summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore5
-rw-r--r--.cvsignore37
-rwxr-xr-xBUILD/build_mccge.sh16
-rw-r--r--BitKeeper/etc/RESYNC_TREE0
-rw-r--r--BitKeeper/etc/collapsed62
-rw-r--r--BitKeeper/etc/config80
-rw-r--r--BitKeeper/etc/gone2344
-rw-r--r--BitKeeper/etc/logging_ok314
-rw-r--r--BitKeeper/etc/notify1
-rw-r--r--BitKeeper/etc/skipkeys7
-rw-r--r--BitKeeper/post-outgoing14
-rwxr-xr-xBitKeeper/triggers/post-commit134
-rwxr-xr-xBitKeeper/triggers/post-commit.innodb.pl22
-rwxr-xr-xBitKeeper/triggers/post-incoming.innodb.pl30
-rwxr-xr-xBitKeeper/triggers/pre-commit22
-rwxr-xr-xBitKeeper/triggers/pre-commit.check-case.pl26
-rwxr-xr-xBitKeeper/triggers/pre-commit.innodb.pl21
-rwxr-xr-xBitKeeper/triggers/pre-delta22
-rwxr-xr-xBitKeeper/triggers/pre-outgoing.crash-protect.pl82
-rwxr-xr-xBitKeeper/triggers/pre-resolve.crash-protect.pl82
-rw-r--r--BitKeeper/triggers/triggers-lib.pl356
-rwxr-xr-xCMakeLists.txt15
-rw-r--r--Makefile.am7
-rwxr-xr-xclient/CMakeLists.txt27
-rw-r--r--client/client_priv.h1
-rw-r--r--client/my_readline.h5
-rw-r--r--client/mysql.cc27
-rw-r--r--client/mysql_upgrade.c22
-rw-r--r--client/mysqladmin.cc5
-rw-r--r--client/mysqlbinlog.cc6
-rw-r--r--client/mysqlcheck.c14
-rw-r--r--client/mysqldump.c206
-rw-r--r--client/mysqlimport.c8
-rw-r--r--client/mysqlshow.c2
-rw-r--r--client/mysqlslap.c2
-rw-r--r--client/mysqltest.cc153
-rw-r--r--client/readline.cc2
-rw-r--r--client/sql_string.h5
-rw-r--r--configure.in38
-rw-r--r--dbug/.cvsignore3
-rwxr-xr-xdbug/CMakeLists.txt1
-rw-r--r--dbug/Makefile.am15
-rw-r--r--dbug/dbug.c872
-rwxr-xr-xdbug/dbug_add_tags.pl4
-rw-r--r--dbug/doinstall.sh15
-rw-r--r--dbug/install.sh64
-rw-r--r--dbug/mklintlib.sh30
-rw-r--r--dbug/qmake.cmd4
-rwxr-xr-xdbug/remove_function_from_trace.pl26
-rwxr-xr-xdbug/tests-t.pl496
-rw-r--r--dbug/tests.c87
-rw-r--r--dbug/user.r54
-rw-r--r--dbug/vargs.h139
-rwxr-xr-xextra/CMakeLists.txt16
-rw-r--r--extra/Makefile.am4
-rw-r--r--extra/comp_err.c2
-rw-r--r--extra/my_print_defaults.c3
-rw-r--r--include/Makefile.am5
-rw-r--r--include/atomic/gcc_builtins.h5
-rw-r--r--include/atomic/nolock.h4
-rw-r--r--include/atomic/rwlock.h4
-rw-r--r--include/atomic/x86-gcc.h4
-rw-r--r--include/config-win.h21
-rw-r--r--include/errmsg.h7
-rw-r--r--include/hash.h34
-rw-r--r--include/help_end.h4
-rw-r--r--include/help_start.h4
-rw-r--r--include/m_ctype.h5
-rw-r--r--include/m_string.h10
-rw-r--r--include/my_aes.h5
-rw-r--r--include/my_atomic.h4
-rw-r--r--include/my_base.h12
-rw-r--r--include/my_bit.h5
-rw-r--r--include/my_dbug.h184
-rw-r--r--include/my_dir.h4
-rw-r--r--include/my_global.h46
-rw-r--r--include/my_handler.h2
-rw-r--r--include/my_libwrap.h4
-rw-r--r--include/my_md5.h5
-rw-r--r--include/my_no_pthread.h8
-rw-r--r--include/my_pthread.h37
-rw-r--r--include/my_sys.h67
-rw-r--r--include/my_uctype.h4
-rw-r--r--include/myisam.h4
-rw-r--r--include/myisampack.h4
-rw-r--r--include/mysql.h136
-rw-r--r--include/mysql.h.pp83
-rw-r--r--include/mysql/plugin.h80
-rw-r--r--include/mysql/plugin.h.pp45
-rw-r--r--include/mysql/service_my_snprintf.h98
-rw-r--r--include/mysql/service_thd_alloc.h128
-rw-r--r--include/mysql/services.h (renamed from server-tools/instance-manager/command.cc)22
-rw-r--r--include/mysql_com.h29
-rw-r--r--include/mysql_embed.h4
-rw-r--r--include/rijndael.h5
-rw-r--r--include/service_versions.h (renamed from server-tools/instance-manager/messages.h)15
-rw-r--r--include/sha1.h5
-rw-r--r--include/sql_common.h4
-rw-r--r--include/sslopt-case.h4
-rw-r--r--include/sslopt-longopts.h4
-rw-r--r--include/sslopt-vars.h4
-rwxr-xr-xlibmysql/CMakeLists.txt28
-rw-r--r--libmysql/Makefile.shared2
-rw-r--r--libmysql/client_settings.h16
-rw-r--r--libmysql/errmsg.c9
-rw-r--r--libmysql/libmysql.c520
-rw-r--r--libmysql/libmysql.def9
-rw-r--r--libmysql/manager.c269
-rw-r--r--libmysqld/CMakeLists.txt10
-rw-r--r--libmysqld/Makefile.am3
-rw-r--r--libmysqld/emb_qcache.cc3
-rw-r--r--libmysqld/examples/CMakeLists.txt3
-rw-r--r--libmysqld/lib_sql.cc90
-rw-r--r--libmysqld/libmysqld.c23
-rw-r--r--libmysqld/libmysqld.def4
-rw-r--r--libservices/CMakeLists.txt (renamed from server-tools/Makefile.am)10
-rw-r--r--libservices/HOWTO100
-rw-r--r--libservices/Makefile.am19
-rw-r--r--libservices/my_snprintf_service.c (renamed from server-tools/instance-manager/angel.h)23
-rw-r--r--libservices/thd_alloc_service.c (renamed from server-tools/instance-manager/IMService.h)23
-rw-r--r--mysql-test/collections/default.experimental4
-rw-r--r--mysql-test/collections/mysql-next-mr.push5
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test4
-rw-r--r--mysql-test/extra/binlog_tests/implicit.test28
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc121
-rw-r--r--mysql-test/include/bug38347.inc21
-rw-r--r--mysql-test/include/default_client.cnf19
-rw-r--r--mysql-test/include/default_my.cnf1
-rw-r--r--mysql-test/include/have_community_features.inc4
-rw-r--r--mysql-test/include/have_nodebug.inc4
-rw-r--r--mysql-test/include/have_profiling.inc4
-rw-r--r--mysql-test/include/have_semisync_plugin.inc22
-rw-r--r--mysql-test/include/have_ssl_communication.inc4
-rw-r--r--mysql-test/include/master-slave.inc2
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc37
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc16
-rw-r--r--mysql-test/include/show_binlog_events.inc29
-rw-r--r--mysql-test/include/show_binlog_events2.inc2
-rw-r--r--mysql-test/include/show_relaylog_events.inc35
-rw-r--r--mysql-test/include/test_fieldsize.inc2
-rw-r--r--mysql-test/include/wait_for_slave_param.inc4
-rw-r--r--mysql-test/include/wait_until_disconnected.inc2
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm20
-rwxr-xr-xmysql-test/lib/t/testMyConfigFactory.t6
-rwxr-xr-xmysql-test/mysql-test-run.pl53
-rw-r--r--mysql-test/r/alter_table.result8
-rw-r--r--mysql-test/r/bench_count_distinct.result2
-rw-r--r--mysql-test/r/bigint.result6
-rw-r--r--mysql-test/r/cast.result2
-rw-r--r--mysql-test/r/compare.result4
-rw-r--r--mysql-test/r/create.result34
-rw-r--r--mysql-test/r/ctype_collate.result30
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result14
-rw-r--r--mysql-test/r/ctype_errors.result32
-rw-r--r--mysql-test/r/ctype_ldml.result38
-rw-r--r--mysql-test/r/ctype_recoding.result4
-rw-r--r--mysql-test/r/ctype_ucs2_def.result2
-rw-r--r--mysql-test/r/ctype_utf8.result210
-rw-r--r--mysql-test/r/date_formats.result64
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result122
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result122
-rw-r--r--mysql-test/r/debug_sync.result2
-rw-r--r--mysql-test/r/delayed.result24
-rw-r--r--mysql-test/r/drop-no_root.result28
-rw-r--r--mysql-test/r/drop.result14
-rw-r--r--mysql-test/r/drop_debug.result21
-rw-r--r--mysql-test/r/errors.result29
-rw-r--r--mysql-test/r/events_1.result40
-rw-r--r--mysql-test/r/events_2.result10
-rw-r--r--mysql-test/r/events_bugs.result32
-rw-r--r--mysql-test/r/events_grant.result42
-rw-r--r--mysql-test/r/explain.result26
-rw-r--r--mysql-test/r/flush_block_commit_notembedded.result4
-rw-r--r--mysql-test/r/fulltext.result8
-rw-r--r--mysql-test/r/func_compress.result14
-rw-r--r--mysql-test/r/func_default.result2
-rw-r--r--mysql-test/r/func_encrypt.result8
-rw-r--r--mysql-test/r/func_encrypt_nossl.result42
-rw-r--r--mysql-test/r/func_gconcat.result64
-rw-r--r--mysql-test/r/func_math.result13
-rw-r--r--mysql-test/r/func_regexp.result2
-rw-r--r--mysql-test/r/func_sapdb.result2
-rw-r--r--mysql-test/r/func_str.result389
-rw-r--r--mysql-test/r/func_test.result2
-rw-r--r--mysql-test/r/func_time.result2
-rw-r--r--mysql-test/r/grant.result759
-rw-r--r--mysql-test/r/grant2.result6
-rw-r--r--mysql-test/r/grant4.result123
-rw-r--r--mysql-test/r/group_min_max.result270
-rw-r--r--mysql-test/r/have_community_features.require2
-rw-r--r--mysql-test/r/have_nodebug.require2
-rw-r--r--mysql-test/r/have_profiling.require2
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/information_schema-big.result93
-rw-r--r--mysql-test/r/information_schema.result292
-rw-r--r--mysql-test/r/information_schema_db.result16
-rw-r--r--mysql-test/r/information_schema_inno.result26
-rw-r--r--mysql-test/r/information_schema_part.result56
-rw-r--r--mysql-test/r/innodb.result2
-rw-r--r--mysql-test/r/innodb_mysql.result20
-rw-r--r--mysql-test/r/insert.result44
-rw-r--r--mysql-test/r/join.result4
-rw-r--r--mysql-test/r/join_optimizer.result37
-rw-r--r--mysql-test/r/join_outer.result12
-rw-r--r--mysql-test/r/key.result8
-rw-r--r--mysql-test/r/loadxml.result75
-rw-r--r--mysql-test/r/locale.result63
-rw-r--r--mysql-test/r/lock_sync.result66
-rw-r--r--mysql-test/r/log_state.result24
-rw-r--r--mysql-test/r/log_state_bug33693.result3
-rw-r--r--mysql-test/r/lowercase_fs_off.result4
-rw-r--r--mysql-test/r/lowercase_table2.result71
-rw-r--r--mysql-test/r/merge.result40
-rw-r--r--mysql-test/r/metadata.result96
-rw-r--r--mysql-test/r/multi_update.result4
-rw-r--r--mysql-test/r/myisam-system.result2
-rw-r--r--mysql-test/r/mysql.result2
-rw-r--r--mysql-test/r/mysql_locale_posix.result72
-rw-r--r--mysql-test/r/mysql_upgrade.result1
-rw-r--r--mysql-test/r/mysqlcheck.result8
-rw-r--r--mysql-test/r/mysqldump.result34
-rw-r--r--mysql-test/r/outfile.resultbin2149 -> 2137 bytes
-rw-r--r--mysql-test/r/partition.result9
-rw-r--r--mysql-test/r/partition_column.result578
-rw-r--r--mysql-test/r/partition_column_prune.result66
-rw-r--r--mysql-test/r/partition_datatype.result8
-rw-r--r--mysql-test/r/partition_error.result13
-rw-r--r--mysql-test/r/partition_hash.result2
-rw-r--r--mysql-test/r/partition_innodb.result35
-rw-r--r--mysql-test/r/partition_list.result11
-rw-r--r--mysql-test/r/partition_mgm_err.result2
-rw-r--r--mysql-test/r/partition_pruning.result348
-rw-r--r--mysql-test/r/partition_range.result93
-rw-r--r--mysql-test/r/partition_truncate.result18
-rw-r--r--mysql-test/r/partition_utf8.result53
-rw-r--r--mysql-test/r/plugin.result9
-rw-r--r--mysql-test/r/profiling.result7
-rw-r--r--mysql-test/r/ps.result171
-rw-r--r--mysql-test/r/ps_1general.result3
-rw-r--r--mysql-test/r/ps_2myisam.result42
-rw-r--r--mysql-test/r/ps_3innodb.result42
-rw-r--r--mysql-test/r/ps_4heap.result42
-rw-r--r--mysql-test/r/ps_5merge.result84
-rw-r--r--mysql-test/r/query_cache.result8
-rw-r--r--mysql-test/r/query_cache_disabled.result14
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result41
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result41
-rw-r--r--mysql-test/r/range.result6
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/show_check.result369
-rw-r--r--mysql-test/r/signal.result2362
-rw-r--r--mysql-test/r/signal_code.result35
-rw-r--r--mysql-test/r/signal_demo1.result270
-rw-r--r--mysql-test/r/signal_demo2.result197
-rw-r--r--mysql-test/r/signal_demo3.result143
-rw-r--r--mysql-test/r/signal_sqlmode.result86
-rw-r--r--mysql-test/r/sp-code.result4
-rw-r--r--mysql-test/r/sp-dynamic.result8
-rw-r--r--mysql-test/r/sp-no-code.result4
-rw-r--r--mysql-test/r/sp-security.result4
-rw-r--r--mysql-test/r/sp-vars.result97
-rw-r--r--mysql-test/r/sp.result90
-rw-r--r--mysql-test/r/sp_notembedded.result2
-rw-r--r--mysql-test/r/sp_trans.result27
-rw-r--r--mysql-test/r/sp_trans_log.result10
-rw-r--r--mysql-test/r/sql_mode.result6
-rw-r--r--mysql-test/r/strict.result54
-rw-r--r--mysql-test/r/subselect.result10
-rw-r--r--mysql-test/r/subselect3.result2
-rw-r--r--mysql-test/r/system_mysql_db.result3
-rw-r--r--mysql-test/r/trigger-compat.result4
-rw-r--r--mysql-test/r/trigger.result41
-rw-r--r--mysql-test/r/trigger_notembedded.result14
-rw-r--r--mysql-test/r/type_binary.result2
-rw-r--r--mysql-test/r/type_bit.result2
-rw-r--r--mysql-test/r/type_date.result22
-rw-r--r--mysql-test/r/type_datetime.result4
-rw-r--r--mysql-test/r/type_decimal.result14
-rw-r--r--mysql-test/r/type_newdecimal.result76
-rw-r--r--mysql-test/r/type_varchar.result20
-rw-r--r--mysql-test/r/variables.result197
-rw-r--r--mysql-test/r/view.result24
-rw-r--r--mysql-test/r/view_grant.result20
-rw-r--r--mysql-test/r/warnings.result4
-rw-r--r--mysql-test/std_data/Index.xml12
-rw-r--r--mysql-test/std_data/loadxml.dat64
-rw-r--r--mysql-test/std_data/loadxml2.dat19
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_implicit_commit.result345
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result10
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result1652
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result852
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result27
-rw-r--r--mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test19
-rw-r--r--mysql-test/suite/binlog/t/binlog_implicit_commit.test63
-rw-r--r--mysql-test/suite/binlog/t/binlog_incident.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed_simulate.test4
-rw-r--r--mysql-test/suite/federated/federated_debug.test2
-rw-r--r--mysql-test/suite/federated/federated_server.result8
-rw-r--r--mysql-test/suite/federated/my.cnf1
-rw-r--r--mysql-test/suite/funcs_1/datadict/basics_mixed1.inc12
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_priv.inc4
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_tables.inc6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result152
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_02.result3
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_07.result16
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_08.result24
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result10
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result8
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_basics_mixed.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_innodb.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_memory.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_myisam.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_ndb.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges.result138
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result44
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result652
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result598
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result594
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result622
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result702
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result702
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result435
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result430
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_ndb.result100
-rw-r--r--mysql-test/suite/funcs_1/r/is_events.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result73
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result34
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges.result98
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result32
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata.result22
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result134
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result96
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result192
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result44
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result48
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result96
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result110
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result36
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_innodb.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result108
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_memory.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result50
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result100
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_ndb.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result22
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result178
-rw-r--r--mysql-test/suite/funcs_1/r/is_views.result18
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result152
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_02.result3
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_07.result16
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_08.result24
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result10
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result8
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result12
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result152
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_02.result3
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_07.result16
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_08.result24
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result10
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result8
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views.result12
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_func_view.result152
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_02.result3
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_07.result16
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_08.result24
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03.result10
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03e.result8
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_views.result12
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result8
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result8
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result75
-rw-r--r--mysql-test/suite/funcs_1/t/is_basics_mixed.test9
-rw-r--r--mysql-test/suite/funcs_1/t/is_columns.test4
-rw-r--r--mysql-test/suite/funcs_1/t/is_user_privileges.test4
-rw-r--r--mysql-test/suite/im/r/im_cmd_line.result47
-rw-r--r--mysql-test/suite/im/r/im_daemon_life_cycle.result26
-rw-r--r--mysql-test/suite/im/r/im_instance_conf.result225
-rw-r--r--mysql-test/suite/im/r/im_life_cycle.result73
-rw-r--r--mysql-test/suite/im/r/im_options.result151
-rw-r--r--mysql-test/suite/im/r/im_utils.result96
-rw-r--r--mysql-test/suite/im/t/disabled.def20
-rw-r--r--mysql-test/suite/im/t/im_check_env.inc26
-rw-r--r--mysql-test/suite/im/t/im_cmd_line.imtest68
-rw-r--r--mysql-test/suite/im/t/im_daemon_life_cycle-im.opt3
-rw-r--r--mysql-test/suite/im/t/im_daemon_life_cycle.imtest100
-rw-r--r--mysql-test/suite/im/t/im_instance_conf-im.opt1
-rw-r--r--mysql-test/suite/im/t/im_instance_conf.imtest244
-rw-r--r--mysql-test/suite/im/t/im_life_cycle-im.opt1
-rw-r--r--mysql-test/suite/im/t/im_life_cycle.imtest205
-rw-r--r--mysql-test/suite/im/t/im_options-im.opt1
-rw-r--r--mysql-test/suite/im/t/im_options.imtest248
-rw-r--r--mysql-test/suite/im/t/im_utils-im.opt1
-rw-r--r--mysql-test/suite/im/t/im_utils.imtest107
-rwxr-xr-xmysql-test/suite/im/t/kill_n_check.sh147
-rwxr-xr-xmysql-test/suite/im/t/log.sh24
-rw-r--r--mysql-test/suite/im/t/utils.sh55
-rwxr-xr-xmysql-test/suite/im/t/wait_for_process.sh114
-rwxr-xr-xmysql-test/suite/im/t/wait_for_socket.sh94
-rw-r--r--mysql-test/suite/large_tests/r/lock_tables_big.result1
-rw-r--r--mysql-test/suite/large_tests/t/lock_tables_big.test32
-rw-r--r--mysql-test/suite/ndb/my.cnf1
-rw-r--r--mysql-test/suite/ndb/r/ndb_bitfield.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_alter.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_basic.result6
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_ddl.result78
-rw-r--r--mysql-test/suite/ndb/r/ndb_gis.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_unique.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi_row.result6
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_range.result6
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore.result6
-rw-r--r--mysql-test/suite/ndb/r/ndb_row_format.result2
-rw-r--r--mysql-test/suite/ndb/r/ndb_single_user.result10
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result42
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_ddl.test101
-rw-r--r--mysql-test/suite/parts/inc/partition_key_32col.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_mgm.inc90
-rw-r--r--mysql-test/suite/parts/inc/partition_syntax.inc4
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_archive.result12
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_memory.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_archive.result12
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_memory.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_archive.result12
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_memory.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result164
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result2
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_innodb.result6
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_myisam.result6
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result2
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc0_archive.test1
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc1_archive.test1
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc2_archive.test1
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test2
-rw-r--r--mysql-test/suite/rpl/my.cnf1
-rw-r--r--mysql-test/suite/rpl/r/rpl_000015.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_host.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_innodb.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_myisam.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result145
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result299
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result132
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_colSize.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result138
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result274
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result440
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id_ignore.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result178
-rw-r--r--mysql-test/suite/rpl/r/rpl_spec_variables.result225
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result148
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_middle_group.result61
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result8
-rw-r--r--mysql-test/suite/rpl/rpl_1slave_base.cnf1
-rw-r--r--mysql-test/suite/rpl/t/disabled.def4
-rw-r--r--mysql-test/suite/rpl/t/rpl000017.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master.test53
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_host.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat.test168
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf17
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test142
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.cnf7
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.test541
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test32
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test585
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.test108
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id_ignore.test114
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test191
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_spec_variables.test306
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_middle_group.test149
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test148
-rw-r--r--mysql-test/suite/rpl_ndb/my.cnf1
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result2
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result18
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result12
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result12
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result246
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result2
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result68
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test373
-rw-r--r--mysql-test/suite/sys_vars/r/auto_commit_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/big_tables_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/flush_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_checksums_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/local_infile_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/low_priority_updates_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/new_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_purge_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_tables_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_bin_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_warnings_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sync_frm_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/timed_mutexes_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/unique_checks_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/t/auto_commit_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/big_tables_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/flush_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_checksums_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/local_infile_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/low_priority_updates_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/new_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_purge_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_bin_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_off_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_warnings_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sync_frm_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/timed_mutexes_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/unique_checks_basic.test2
-rw-r--r--mysql-test/t/alter_table.test15
-rw-r--r--mysql-test/t/create.test53
-rw-r--r--mysql-test/t/ctype_collate.test12
-rw-r--r--mysql-test/t/ctype_cp932_binlog_stm.test6
-rw-r--r--mysql-test/t/ctype_errors.test47
-rw-r--r--mysql-test/t/ctype_ldml.test26
-rw-r--r--mysql-test/t/ctype_utf8.test54
-rw-r--r--mysql-test/t/delayed.test37
-rw-r--r--mysql-test/t/drop-no_root.test85
-rw-r--r--mysql-test/t/drop.test21
-rw-r--r--mysql-test/t/drop_debug.test35
-rw-r--r--mysql-test/t/errors.test35
-rw-r--r--mysql-test/t/explain.test12
-rw-r--r--mysql-test/t/fulltext.test9
-rw-r--r--mysql-test/t/func_gconcat.test32
-rw-r--r--mysql-test/t/func_str.test42
-rw-r--r--mysql-test/t/grant.test352
-rw-r--r--mysql-test/t/grant4.test146
-rw-r--r--mysql-test/t/group_min_max.test125
-rw-r--r--mysql-test/t/information_schema-big.test48
-rw-r--r--mysql-test/t/information_schema.test98
-rw-r--r--mysql-test/t/information_schema_db.test12
-rw-r--r--mysql-test/t/innodb_mysql.test18
-rw-r--r--mysql-test/t/insert.test32
-rw-r--r--mysql-test/t/join_optimizer.test45
-rw-r--r--mysql-test/t/loadxml.test108
-rw-r--r--mysql-test/t/locale.test38
-rw-r--r--mysql-test/t/lock_sync.test118
-rw-r--r--mysql-test/t/log_state.test97
-rw-r--r--mysql-test/t/log_state_bug33693-master.opt1
-rw-r--r--mysql-test/t/log_state_bug33693.test18
-rw-r--r--mysql-test/t/lowercase_table2.test72
-rw-r--r--mysql-test/t/merge.test60
-rw-r--r--mysql-test/t/metadata.test57
-rw-r--r--mysql-test/t/mysql.test5
-rw-r--r--mysql-test/t/mysql_locale_posix.test205
-rw-r--r--mysql-test/t/mysql_upgrade.test7
-rw-r--r--mysql-test/t/mysqladmin.test6
-rw-r--r--mysql-test/t/mysqlbinlog.test29
-rw-r--r--mysql-test/t/mysqlbinlog2.test20
-rw-r--r--mysql-test/t/mysqlcheck.test2
-rw-r--r--mysql-test/t/outfile.test2
-rw-r--r--mysql-test/t/partition.test6
-rw-r--r--mysql-test/t/partition_column.test426
-rw-r--r--mysql-test/t/partition_column_prune.test71
-rw-r--r--mysql-test/t/partition_datatype.test9
-rw-r--r--mysql-test/t/partition_error.test16
-rw-r--r--mysql-test/t/partition_innodb.test45
-rw-r--r--mysql-test/t/partition_list.test2
-rw-r--r--mysql-test/t/partition_mgm_err.test2
-rw-r--r--mysql-test/t/partition_pruning.test39
-rw-r--r--mysql-test/t/partition_range.test72
-rw-r--r--mysql-test/t/partition_truncate.test26
-rw-r--r--mysql-test/t/partition_utf8.test42
-rw-r--r--mysql-test/t/plugin.test6
-rw-r--r--mysql-test/t/profiling.test2
-rw-r--r--mysql-test/t/ps.test204
-rw-r--r--mysql-test/t/query_cache_disabled-master.opt1
-rw-r--r--mysql-test/t/query_cache_disabled.test15
-rw-r--r--mysql-test/t/show_check.test1
-rw-r--r--mysql-test/t/signal.test2685
-rw-r--r--mysql-test/t/signal_code.test57
-rw-r--r--mysql-test/t/signal_demo1.test345
-rw-r--r--mysql-test/t/signal_demo2.test207
-rw-r--r--mysql-test/t/signal_demo3.test159
-rw-r--r--mysql-test/t/signal_sqlmode.test123
-rw-r--r--mysql-test/t/sp-no-code.test12
-rw-r--r--mysql-test/t/sp-vars.test39
-rw-r--r--mysql-test/t/sp.test51
-rw-r--r--mysql-test/t/sp_trans.test38
-rw-r--r--mysql-test/t/sp_trans_log.test3
-rw-r--r--mysql-test/t/sql_mode.test15
-rw-r--r--mysql-test/t/trigger.test28
-rw-r--r--mysql-test/t/type_date.test18
-rw-r--r--mysql-test/t/type_decimal.test10
-rw-r--r--mysql-test/t/type_varchar.test18
-rw-r--r--mysql-test/t/variables+c.test2
-rw-r--r--mysql-test/t/variables.test182
-rw-r--r--mysql-test/t/view_grant.test8
-rwxr-xr-xmysys/CMakeLists.txt4
-rw-r--r--mysys/Makefile.am2
-rw-r--r--mysys/charset-def.c4
-rw-r--r--mysys/charset.c13
-rw-r--r--mysys/default.c45
-rw-r--r--mysys/default_modify.c6
-rw-r--r--mysys/errors.c5
-rw-r--r--mysys/mf_keycaches.c16
-rw-r--r--mysys/my_chsize.c19
-rw-r--r--mysys/my_create.c15
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_dup.c6
-rw-r--r--mysys/my_error.c65
-rw-r--r--mysys/my_file.c1
-rw-r--r--mysys/my_fopen.c49
-rw-r--r--mysys/my_fstream.c17
-rw-r--r--mysys/my_gethwaddr.c100
-rw-r--r--mysys/my_getopt.c33
-rw-r--r--mysys/my_handler_errors.h3
-rw-r--r--mysys/my_init.c2
-rw-r--r--mysys/my_largepage.c2
-rw-r--r--mysys/my_lib.c26
-rw-r--r--mysys/my_lock.c140
-rw-r--r--mysys/my_messnc.c6
-rw-r--r--mysys/my_mmap.c6
-rw-r--r--mysys/my_open.c223
-rw-r--r--mysys/my_pread.c103
-rw-r--r--mysys/my_quick.c22
-rw-r--r--mysys/my_read.c21
-rw-r--r--mysys/my_seek.c38
-rw-r--r--mysys/my_static.c8
-rw-r--r--mysys/my_static.h5
-rw-r--r--mysys/my_sync.c4
-rw-r--r--mysys/my_thr_init.c78
-rw-r--r--mysys/my_wincond.c3
-rw-r--r--mysys/my_winerr.c123
-rw-r--r--mysys/my_winfile.c672
-rw-r--r--mysys/my_winthread.c132
-rw-r--r--mysys/my_write.c39
-rw-r--r--mysys/mysys_priv.h24
-rw-r--r--mysys/thr_lock.c41
-rwxr-xr-xnetware/BUILD/compile-netware-START1
-rw-r--r--plugin/daemon_example/Makefile.am3
-rw-r--r--plugin/semisync/CMakeLists.txt35
-rw-r--r--plugin/semisync/Makefile.am38
-rw-r--r--plugin/semisync/configure.in9
-rw-r--r--plugin/semisync/plug.in3
-rw-r--r--plugin/semisync/semisync.cc30
-rw-r--r--plugin/semisync/semisync.h91
-rw-r--r--plugin/semisync/semisync_master.cc1269
-rw-r--r--plugin/semisync/semisync_master.h363
-rw-r--r--plugin/semisync/semisync_master_plugin.cc394
-rw-r--r--plugin/semisync/semisync_slave.cc138
-rw-r--r--plugin/semisync/semisync_slave.h96
-rw-r--r--plugin/semisync/semisync_slave_plugin.cc226
-rwxr-xr-xregex/CMakeLists.txt2
-rwxr-xr-xscripts/CMakeLists.txt2
-rw-r--r--scripts/mysql_fix_privilege_tables.sh2
-rw-r--r--scripts/mysql_install_db.sh2
-rw-r--r--scripts/mysql_system_tables.sql6
-rw-r--r--scripts/mysql_system_tables_data.sql6
-rw-r--r--scripts/mysql_system_tables_fix.sql20
-rw-r--r--server-tools/CMakeLists.txt33
-rwxr-xr-xserver-tools/instance-manager/CMakeLists.txt38
-rw-r--r--server-tools/instance-manager/IMService.cpp124
-rw-r--r--server-tools/instance-manager/Makefile.am103
-rw-r--r--server-tools/instance-manager/README11
-rw-r--r--server-tools/instance-manager/WindowsService.cpp231
-rw-r--r--server-tools/instance-manager/WindowsService.h56
-rw-r--r--server-tools/instance-manager/angel.cc407
-rw-r--r--server-tools/instance-manager/buffer.cc110
-rw-r--r--server-tools/instance-manager/buffer.h65
-rw-r--r--server-tools/instance-manager/command.h60
-rw-r--r--server-tools/instance-manager/commands.cc1752
-rw-r--r--server-tools/instance-manager/commands.h393
-rw-r--r--server-tools/instance-manager/exit_codes.h40
-rw-r--r--server-tools/instance-manager/guardian.cc496
-rw-r--r--server-tools/instance-manager/guardian.h110
-rw-r--r--server-tools/instance-manager/instance.cc944
-rw-r--r--server-tools/instance-manager/instance.h273
-rw-r--r--server-tools/instance-manager/instance_map.cc649
-rw-r--r--server-tools/instance-manager/instance_map.h102
-rw-r--r--server-tools/instance-manager/instance_options.cc753
-rw-r--r--server-tools/instance-manager/instance_options.h126
-rw-r--r--server-tools/instance-manager/listener.cc337
-rw-r--r--server-tools/instance-manager/listener.h61
-rw-r--r--server-tools/instance-manager/log.cc196
-rw-r--r--server-tools/instance-manager/log.h59
-rw-r--r--server-tools/instance-manager/manager.cc526
-rw-r--r--server-tools/instance-manager/manager.h71
-rw-r--r--server-tools/instance-manager/messages.cc104
-rw-r--r--server-tools/instance-manager/mysql_connection.cc376
-rw-r--r--server-tools/instance-manager/mysql_connection.h74
-rw-r--r--server-tools/instance-manager/mysql_manager_error.h40
-rw-r--r--server-tools/instance-manager/mysqlmanager.cc232
-rw-r--r--server-tools/instance-manager/options.cc558
-rw-r--r--server-tools/instance-manager/options.h108
-rw-r--r--server-tools/instance-manager/parse.cc509
-rw-r--r--server-tools/instance-manager/parse.h212
-rw-r--r--server-tools/instance-manager/parse_output.cc407
-rw-r--r--server-tools/instance-manager/portability.h65
-rw-r--r--server-tools/instance-manager/priv.cc76
-rw-r--r--server-tools/instance-manager/priv.h99
-rw-r--r--server-tools/instance-manager/protocol.cc217
-rw-r--r--server-tools/instance-manager/protocol.h47
-rw-r--r--server-tools/instance-manager/thread_registry.cc419
-rw-r--r--server-tools/instance-manager/thread_registry.h176
-rw-r--r--server-tools/instance-manager/user_management_commands.cc421
-rw-r--r--server-tools/instance-manager/user_management_commands.h167
-rw-r--r--server-tools/instance-manager/user_map.cc395
-rw-r--r--server-tools/instance-manager/user_map.h103
-rw-r--r--sql-common/client.c667
-rwxr-xr-xsql/CMakeLists.txt12
-rw-r--r--sql/Makefile.am8
-rwxr-xr-xsql/add_errmsg4
-rw-r--r--sql/authors.h6
-rw-r--r--sql/client_settings.h6
-rw-r--r--sql/contributors.h5
-rw-r--r--sql/debug_sync.cc8
-rw-r--r--sql/derror.cc61
-rw-r--r--sql/event_data_objects.cc4
-rw-r--r--sql/event_scheduler.cc18
-rw-r--r--sql/events.cc2
-rw-r--r--sql/field.cc200
-rw-r--r--sql/field.h36
-rw-r--r--sql/gstream.h5
-rw-r--r--sql/ha_ndbcluster.cc137
-rw-r--r--sql/ha_ndbcluster.h5
-rw-r--r--sql/ha_ndbcluster_binlog.cc124
-rw-r--r--sql/ha_ndbcluster_binlog.h5
-rw-r--r--sql/ha_ndbcluster_cond.h5
-rw-r--r--sql/ha_ndbcluster_tables.h5
-rw-r--r--sql/ha_partition.cc294
-rw-r--r--sql/ha_partition.h22
-rw-r--r--sql/handler.cc141
-rw-r--r--sql/handler.h23
-rw-r--r--sql/hash_filo.h16
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/item.cc182
-rw-r--r--sql/item.h35
-rw-r--r--sql/item_cmpfunc.h7
-rw-r--r--sql/item_create.cc81
-rw-r--r--sql/item_func.cc52
-rw-r--r--sql/item_func.h4
-rw-r--r--sql/item_geofunc.h4
-rw-r--r--sql/item_row.h5
-rw-r--r--sql/item_strfunc.cc112
-rw-r--r--sql/item_strfunc.h11
-rw-r--r--sql/item_subselect.cc6
-rw-r--r--sql/item_subselect.h5
-rw-r--r--sql/item_sum.cc1249
-rw-r--r--sql/item_sum.h546
-rw-r--r--sql/item_timefunc.cc58
-rw-r--r--sql/item_timefunc.h29
-rw-r--r--sql/item_xmlfunc.h4
-rw-r--r--sql/key.cc21
-rw-r--r--sql/lex.h23
-rw-r--r--sql/lock.cc18
-rw-r--r--sql/log.cc185
-rw-r--r--sql/log.h34
-rw-r--r--sql/log_event.cc160
-rw-r--r--sql/log_event.h57
-rw-r--r--sql/log_event_old.cc44
-rw-r--r--sql/message.h7
-rw-r--r--sql/my_decimal.cc6
-rw-r--r--sql/mysql_priv.h199
-rw-r--r--sql/mysqld.cc407
-rw-r--r--sql/mysqld_suffix.h4
-rw-r--r--sql/net_serv.cc15
-rw-r--r--sql/nt_servc.h5
-rw-r--r--sql/opt_range.cc526
-rw-r--r--sql/opt_range.h17
-rw-r--r--sql/opt_sum.cc10
-rw-r--r--sql/partition_element.h46
-rw-r--r--sql/partition_info.cc1200
-rw-r--r--sql/partition_info.h87
-rw-r--r--sql/procedure.h7
-rw-r--r--sql/protocol.cc449
-rw-r--r--sql/protocol.h46
-rw-r--r--sql/records.cc5
-rw-r--r--sql/records.h79
-rw-r--r--sql/repl_failsafe.cc27
-rw-r--r--sql/repl_failsafe.h4
-rw-r--r--sql/replication.h550
-rw-r--r--sql/rpl_filter.cc12
-rw-r--r--sql/rpl_handler.cc518
-rw-r--r--sql/rpl_handler.h213
-rw-r--r--sql/rpl_injector.h3
-rw-r--r--sql/rpl_mi.cc138
-rw-r--r--sql/rpl_mi.h15
-rw-r--r--sql/rpl_rli.cc22
-rw-r--r--sql/rpl_rli.h25
-rw-r--r--sql/rpl_tblmap.cc14
-rw-r--r--sql/rpl_tblmap.h9
-rw-r--r--sql/scheduler.h5
-rw-r--r--sql/set_var.cc257
-rw-r--r--sql/set_var.h77
-rw-r--r--sql/share/Makefile.am8
-rw-r--r--sql/share/errmsg-cnv.sh61
-rw-r--r--sql/share/errmsg-utf8.txt6262
-rw-r--r--sql/share/errmsg.txt62
-rw-r--r--sql/slave.cc668
-rw-r--r--sql/slave.h13
-rw-r--r--sql/sp.cc40
-rw-r--r--sql/sp_cache.cc11
-rw-r--r--sql/sp_head.cc98
-rw-r--r--sql/sp_pcontext.cc3
-rw-r--r--sql/sp_pcontext.h2
-rw-r--r--sql/sp_rcontext.cc94
-rw-r--r--sql/sp_rcontext.h61
-rw-r--r--sql/sql_acl.cc328
-rw-r--r--sql/sql_acl.h20
-rw-r--r--sql/sql_analyse.h5
-rw-r--r--sql/sql_array.h4
-rw-r--r--sql/sql_base.cc161
-rw-r--r--sql/sql_binlog.cc2
-rw-r--r--sql/sql_cache.cc274
-rw-r--r--sql/sql_cache.h32
-rw-r--r--sql/sql_class.cc560
-rw-r--r--sql/sql_class.h487
-rw-r--r--sql/sql_connect.cc71
-rw-r--r--sql/sql_crypt.h5
-rw-r--r--sql/sql_cursor.cc30
-rw-r--r--sql/sql_db.cc57
-rw-r--r--sql/sql_delete.cc19
-rw-r--r--sql/sql_derived.cc6
-rw-r--r--sql/sql_error.cc786
-rw-r--r--sql/sql_error.h548
-rw-r--r--sql/sql_handler.cc59
-rw-r--r--sql/sql_help.cc6
-rw-r--r--sql/sql_insert.cc96
-rw-r--r--sql/sql_lex.cc68
-rw-r--r--sql/sql_lex.h147
-rw-r--r--sql/sql_list.cc2
-rw-r--r--sql/sql_list.h6
-rw-r--r--sql/sql_load.cc568
-rw-r--r--sql/sql_locale.cc886
-rw-r--r--sql/sql_map.h5
-rw-r--r--sql/sql_parse.cc583
-rw-r--r--sql/sql_partition.cc2028
-rw-r--r--sql/sql_partition.h41
-rw-r--r--sql/sql_plugin.cc177
-rw-r--r--sql/sql_plugin.h18
-rw-r--r--sql/sql_plugin_services.h (renamed from server-tools/instance-manager/parse_output.h)41
-rw-r--r--sql/sql_prepare.cc885
-rw-r--r--sql/sql_prepare.h367
-rw-r--r--sql/sql_profile.cc6
-rw-r--r--sql/sql_profile.h2
-rw-r--r--sql/sql_repl.cc495
-rw-r--r--sql/sql_repl.h4
-rw-r--r--sql/sql_select.cc300
-rw-r--r--sql/sql_select.h22
-rw-r--r--sql/sql_servers.cc37
-rw-r--r--sql/sql_servers.h5
-rw-r--r--sql/sql_show.cc546
-rw-r--r--sql/sql_signal.cc510
-rw-r--r--sql/sql_signal.h152
-rw-r--r--sql/sql_sort.h5
-rw-r--r--sql/sql_string.cc68
-rw-r--r--sql/sql_string.h10
-rw-r--r--sql/sql_table.cc248
-rw-r--r--sql/sql_tablespace.cc4
-rw-r--r--sql/sql_test.cc4
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_trigger.h4
-rw-r--r--sql/sql_udf.cc28
-rw-r--r--sql/sql_udf.h4
-rw-r--r--sql/sql_update.cc10
-rw-r--r--sql/sql_view.cc13
-rw-r--r--sql/sql_view.h4
-rw-r--r--sql/sql_yacc.yy1001
-rw-r--r--sql/structs.h40
-rw-r--r--sql/table.cc110
-rw-r--r--sql/table.h42
-rw-r--r--sql/thr_malloc.cc7
-rw-r--r--sql/time.cc2
-rw-r--r--sql/tzfile.h5
-rw-r--r--sql/tztime.cc29
-rw-r--r--sql/tztime.h4
-rw-r--r--sql/udf_example.c5
-rw-r--r--sql/unireg.cc32
-rw-r--r--sql/unireg.h11
-rw-r--r--storage/archive/Makefile.am15
-rw-r--r--storage/archive/ha_archive.cc14
-rw-r--r--storage/blackhole/CMakeLists.txt3
-rw-r--r--storage/blackhole/ha_blackhole.cc15
-rw-r--r--storage/csv/CMakeLists.txt2
-rw-r--r--storage/csv/ha_tina.cc26
-rw-r--r--storage/csv/ha_tina.h1
-rw-r--r--storage/example/CMakeLists.txt2
-rw-r--r--storage/example/Makefile.am2
-rw-r--r--storage/example/ha_example.cc36
-rw-r--r--storage/federated/ha_federated.cc18
-rwxr-xr-xstorage/heap/CMakeLists.txt2
-rw-r--r--storage/innobase/handler/ha_innodb.cc24
-rw-r--r--storage/innobase/include/handler0alter.h4
-rw-r--r--storage/innobase/include/row0merge.h2
-rw-r--r--storage/innobase/include/row0types.h2
-rw-r--r--storage/innobase/row/row0merge.c12
-rwxr-xr-xstorage/myisam/CMakeLists.txt10
-rw-r--r--storage/myisam/ft_static.c4
-rw-r--r--storage/myisam/mi_dynrec.c7
-rw-r--r--storage/myisam/mi_locking.c8
-rw-r--r--storage/myisam/mi_open.c7
-rwxr-xr-xstorage/myisammrg/CMakeLists.txt2
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/mysql_storage_engine.cmake2
-rw-r--r--storage/ndb/test/run-test/setup.cpp8
-rwxr-xr-xstrings/CMakeLists.txt3
-rw-r--r--strings/conf_to_src.c23
-rw-r--r--strings/ctype-extra.c72
-rw-r--r--strings/ctype-sjis.c4
-rw-r--r--strings/ctype-uca.c169
-rw-r--r--strings/ctype-ucs2.c4
-rw-r--r--strings/ctype-utf8.c2
-rw-r--r--strings/ctype.c20
-rw-r--r--strings/my_vsnprintf.c663
-rw-r--r--strings/strings-not-used.h4
-rw-r--r--support-files/mysql.server.sh178
-rw-r--r--support-files/mysql.spec.sh8
-rwxr-xr-xtests/CMakeLists.txt7
-rw-r--r--tests/mysql_client_test.c822
-rw-r--r--unittest/mysys/Makefile.am2
-rw-r--r--unittest/mysys/my_vsnprintf-t.c155
-rwxr-xr-xvio/CMakeLists.txt2
-rw-r--r--vio/vio_priv.h4
1063 files changed, 62513 insertions, 35363 deletions
diff --git a/.bzrignore b/.bzrignore
index e1e2083e2d2..351417a4353 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1139,6 +1139,7 @@ libmysqld/protocol_cursor.cc
libmysqld/records.cc
libmysqld/repl_failsafe.cc
libmysqld/rpl_filter.cc
+libmysqld/rpl_handler.cc
libmysqld/rpl_injector.cc
libmysqld/rpl_record.cc
libmysqld/rpl_record_old.cc
@@ -3064,4 +3065,8 @@ sql/share/spanish
sql/share/swedish
sql/share/ukrainian
libmysqld/examples/mysqltest.cc
+libmysqld/sql_signal.cc
+libmysqld/rpl_handler.cc
libmysqld/debug_sync.cc
+libmysqld/rpl_handler.cc
+dbug/tests
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index ab83fba3a89..00000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,37 +0,0 @@
-.snprj
-COPYING
-COPYING.LIB
-INSTALL-SOURCE
-INSTALL-SOURCE-GENERIC
-Logs
-MIRRORS
-Makefile
-Makefile.in
-NEW-RPMS
-PUBLIC
-Projects
-TODO
-WIN-LICENSE
-aclocal.m4
-binary
-compile
-confdefs.h
-config.cache
-config.h
-config.log
-config.status
-configure
-configure.in-removed
-conftest.c
-conftest.s1
-conftest.s2
-conftest.subs
-internal-docs
-libtool
-linked_client_sources
-linked_server_sources
-mysql-copyright-120700-194832
-mysql-copyright-120700-221248
-skr
-stamp-h
-tmp
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
index ad3e728453c..3345ac3dcb5 100755
--- a/BUILD/build_mccge.sh
+++ b/BUILD/build_mccge.sh
@@ -556,7 +556,7 @@ parse_package()
package="pro"
;;
extended )
- package=""
+ package="extended"
;;
cge )
package="cge"
@@ -1274,7 +1274,7 @@ set_bsd_configs()
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -O3"
else
- compiler_flags="$compiler_flags -O"
+ compiler_flags="$compiler_flags -O0"
fi
set_cc_and_cxx_for_gcc
}
@@ -1305,7 +1305,7 @@ set_linux_configs()
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -O2"
else
- compiler_flags="$compiler_flags -O"
+ compiler_flags="$compiler_flags -O0"
fi
# configure will set proper compiler flags for gcc on Linux
elif test "x$compiler" = "xicc" ; then
@@ -1375,8 +1375,8 @@ set_solaris_configs()
LDFLAGS="$LDFLAGS -O2"
compiler_flags="$compiler_flags -O2"
else
- LDFLAGS="$LDFLAGS -O"
- compiler_flags="$compiler_flags -O"
+ LDFLAGS="$LDFLAGS -O0"
+ compiler_flags="$compiler_flags -O0"
fi
fi
else
@@ -1407,7 +1407,7 @@ set_solaris_configs()
elif test "x$fast_flag" = "xgeneric" ; then
compiler_flags="$compiler_flags -xO2"
else
- compiler_flags="$compiler_flags -xO"
+ compiler_flags="$compiler_flags -xO0"
fi
else
#Using SPARC cpu with SunStudio (Forte) compiler
@@ -1421,7 +1421,7 @@ set_solaris_configs()
elif test "x$fast_flag" = "xgeneric" ; then
compiler_flags="$compiler_flags -xO2"
else
- compiler_flags="$compiler_flags -xO"
+ compiler_flags="$compiler_flags -xO0"
fi
fi
fi
@@ -1452,7 +1452,7 @@ set_macosx_configs()
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -Os"
else
- compiler_flags="$compiler_flags -O"
+ compiler_flags="$compiler_flags -O0"
fi
set_cc_and_cxx_for_gcc
}
diff --git a/BitKeeper/etc/RESYNC_TREE b/BitKeeper/etc/RESYNC_TREE
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/BitKeeper/etc/RESYNC_TREE
+++ /dev/null
diff --git a/BitKeeper/etc/collapsed b/BitKeeper/etc/collapsed
deleted file mode 100644
index 34584f04c01..00000000000
--- a/BitKeeper/etc/collapsed
+++ /dev/null
@@ -1,62 +0,0 @@
-44d03f27qNdqJmARzBoP3Is_cN5e0w
-44ec850ac2k4y2Omgr92GiWPBAVKGQ
-44edb86b1iE5knJ97MbliK_3lCiAXA
-44f33f3aj5KW5qweQeekY1LU0E9ZCg
-45001f7c3b2hhCXDKfUvzkX9TNe6VA
-45002051rHJfMEXAIMiAZV0clxvKSA
-4513d8e4Af4dQWuk13sArwofRgFDQw
-45143312u0Tz4r0wPXCbUKwdHa2jWA
-45143b90ewOQuTW8-jrB3ZSAQvMRJw
-45184588w9U72A6KX1hUFeAC4shSHA
-45185df8mZbxfp85FbA0VxUXkmDewA
-4519a6c5BVUxEHTf5iJnjZkixMBs8g
-451ab499rgdjXyOnUDqHu-wBDoS-OQ
-451b110a3ZV6MITl93ehXk2wxrbW7g
-45214442pBGT9KuZEGixBH71jTzbOA
-45214a07hVsIGwvwa-WrO-jpeaSwVw
-452a92d0-31-8wSzSfZi165fcGcXPA
-452c6c6dAjuNghfc1ObZ_UQ5SCl85g
-4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
-454a7ef8gdvE_ddMlJyghvOAkKPNOQ
-454bb488ijVLOUK_GFjcoISE0GxPUA
-454bb9a8AwlGRC_wWLS2sNMoRBMRGw
-454c946ciQoR4dfTBZ0RTBmGJKp6lw
-454f6e7eAnfLD9OCbGr5X9KiKvfKcQ
-454f704bJiJy0_Nx2drY9P5kK3uOzg
-454f8960jsVT_kMKJtZ9OCgXoba0xQ
-454fa71cxshxszXJQYa9jbo0-_hAHw
-4550b0ceIcozdgQhWFUTAtWkN196lA
-4554a95d7txO1DuO9G3nAizI3SkFAA
-4554b3722d71SbPiI2Gx-RhbZjmuIQ
-4558b3d73Cxjlb7Wv1oytdSTthxDfw
-4561b2ecZbhuAc0TTDdCdultxUYaMw
-4561bde4qWhz1I8tkItXKex5uniipA
-4562ba016dYH0JzszOqZ8p6psbKfnQ
-45771031yRCoM_ZfONdYchPvVEgLRg
-459a60d8rIxeTuhB3j_QsOwLGdcpng
-459a61c9OS8PzIsdviZJDkybJ1y1uA
-459a70691aYIfU2ohV0a3P5iTLpO2A
-459a7422KF_P7PuU3YQ5qG6ZLEVpiA
-459a74e4nRcXppMSBYeQQ5efDkTADg
-459c03b9N_mqF2XJKK6DwSrIt7e6_g
-459c1965_BQMBzBO8S_gVqjTHYQrmw
-459c2098XoAUsUn8N07IVRDD6CTM-A
-459ea845XenN-uWqEM5LFvUT60tW_A
-45ae6628gqKTsUFfnoNExadETVIkbA
-45af88c9RIIJWPfBxs3o7zekI-ELPQ
-45ba4faf2oqu6eR8fqecR3LfSNcYUg
-45ba5238-NKl80QVXzdGo8hO9M75Xg
-45c0fdfb2mz6NdOIsLenJtf6_ZelTA
-45c38d90tNwOTSaYKHXd3ccLtnytlQ
-45c390d6BbWrwyEi5T5VsWKYxl06Rg
-45c39d31g0iik6UE_oTK5N55ry-ycA
-45d1ffcd-r3v8A7uh92hQaMfQM9UPQ
-45d21437Vg_-i4uOWyvzYWHESXDP6A
-45da6370nnZlAAIieMCrXkxF9toOyQ
-45da6551zUuplwxuqcT2fhRgceC0CQ
-45db0d4bkGtxBk21sZFJgbCV1FcNRg
-45db468b-DKE8kUTV42eYMYmk8_g9g
-45dd21d1rVPnDfvZTNVHLalcjnbsZw
-45ddaf15_Ld7IAEpUUP3FJjJ-oSEFg
-45ddc763DodLG1BqH_wRBJXMbCSB5A
-45ddc8282KnaNGuijqCTphlXV_eeog
diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config
deleted file mode 100644
index 1a027813ff4..00000000000
--- a/BitKeeper/etc/config
+++ /dev/null
@@ -1,80 +0,0 @@
-# This is the BitKeeper configuration for this package.
-#
-# Please take a minute to fill it out carefully, it needs to be accurate.
-#
-# NOTICE: you really do want to fill this out, if something goes wrong
-# with your repository, or if someone changes the logging policy, we
-# send mail to the contact listed here for confirmation.
-#
-# BitKeeper can maintain a log of your change comments (not your source,
-# just the comments) on a centralized server. This is useful as your
-# project grows, it gives people a place to go see what is happening on
-# a per project basis. This is especially useful for distributed developers.
-#
-
-#
-# Name of the project, such as "BitKeeper" or "The GNU C compiler".
-#
-description: MySQL - fast and reliable SQL database
-#
-# Open Logging server. This site is where users go to see the
-# changelog comments for all instances of this repository. This must
-# be logging@openlogging.org for usage under the terms of the BKL,
-# "bk help bkl" will show you the default licensing terms. If this
-# repository is commercial it can be an internal email address or "none"
-# to disable logging.
-#
-logging: none
-#
-# If this field is set, all checkins will appear to be made by this user,
-# in effect making this a single user package. Single user packages are
-# free from the logging constraint. In order for the package to really
-# be free, both the single_user and the single_host field need to be set.
-#
-single_user:
-#
-# If this field is set, all checkins will appear to be made on this host.
-#
-single_host:
-#
-# Contact person for this project. This is whoever is the person that
-# should be contacted with update information or contacted if BitKeeper
-# discovers a problem which requires local intervention. Please make the
-# contact information accurate so we can support you.
-#
-contact: sys@mysql.com
-#
-# It is very important that this email address is filled out and accurate.
-# If someone converts your repository to open logging (which you may not
-# want), we will contact this email address for confirmation that you really
-# did want open logging. If the email address is inaccurate and we get no
-# response from anyone else at your location after 90 days, then open logging
-# will be implicitly approved.
-#
-email: sys@mysql.com
-#
-# Add your street address if you like, it is optional.
-#
-street:
-city:
-state:
-postal:
-country:
-phone:
-cell:
-pager:
-#
-# Business Hours when we can contact you if you left a phone number.
-#
-hours:
-[serg:]checkout:get
-[arjen:]checkout:get
-[kostja:]checkout:get
-[nick:]checkout:get
-[jonas:]checkout:get
-[tomas:]checkout:get
-[guilhem:]checkout:get
-[pekka:]checkout:get
-[msvensson:]checkout:get
-checkout:edit
-eoln:unix
diff --git a/BitKeeper/etc/gone b/BitKeeper/etc/gone
deleted file mode 100644
index 5bf77a89052..00000000000
--- a/BitKeeper/etc/gone
+++ /dev/null
@@ -1,2344 +0,0 @@
-BK|Build-tools/Do-compile-all|19700101030959|00060|f119832ce3aca102
-BK|Docs/Attic/myisam.doc|19700101030959|00502|519bb06ecc870298
-BK|Docs/Flags/island.eps|19700101030959|00181|8cec5a55768bc59e
-BK|Docs/Flags/island.gif|19700101030959|00142|e274d5e96ee0975a
-BK|Docs/Flags/island.txt|19700101030959|00220|301ede0f81c5f3e1
-BK|Docs/Flags/kroatia.eps|19700101030959|00185|f50fcd444e7efceb
-BK|Docs/Flags/kroatia.gif|19700101030959|00146|bea7bbe0316d462d
-BK|Docs/Flags/kroatia.txt|19700101030959|00224|dde7f89f25d616b2
-BK|Docs/Flags/south-africa1.eps|19700101030959|00193|111e4f92f4562e9d
-BK|Docs/Flags/south-africa1.gif|19700101030959|00154|1ea38de5a535f732
-BK|Docs/Flags/south-africa1.txt|19700101030959|00232|87a53fdcd2149c6e
-BK|client/Attic/libmysql.c|19700101030959|00582|72949a7043113807
-BK|client/Attic/net.c|19700101030959|00583|c18042da6fa4e693
-BK|client/mysql-test.c|19700101030959|00560|809ade45d58e28ab
-BK|client/violite.c|19700101030959|00561|afa871b4aab14371
-BK|config.h.in|19700101030959|00050|aecae693cca472c
-BK|extra/Attic/print_defaults.c|19700101030959|01513|362952979aa7b330
-BK|include/Attic/config-win32.h|19700101030959|00116|65db818ec7e8f21b
-BK|include/Attic/m_ctype.h.in|19700101030959|00114|f671e3c2d611ba97
-BK|include/Attic/mysql_com.h.in|19700101030959|00115|85b1ea7ced528c32
-BK|include/my_global.h|19700101030959|00105|f657f708961a4632
-BK|libmysql/acconfig.h|19700101030959|02604|7b620dbd69ea6074
-BK|libmysql/configure.in|19700101030959|02603|c6fc04d4e3d6e291
-BK|libmysql/violite.c|19700101030959|02600|984c09cffe14a11b
-BK|mit-pthreads/config.flags|19700101030959|00594|dcec5296ef811cd6
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__math.h|19700101030959|01011|79d9a37715f2c7fe
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__signal.h|19700101030959|01012|45332b2a56f62580
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__stdio.h|19700101030959|01013|a81562134446c64c
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__stdlib.h|19700101030959|01014|bcbed6d62d1885ae
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__string.h|19700101030959|01015|94a2e4f9574bf1e8
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__time.h|19700101030959|01016|2cde57d8feea7fc8
-BK|mit-pthreads/machdep/i386-sco-3.2v5/__unistd.h|19700101030959|01017|5cc4575b5a74066f
-BK|mit-pthreads/machdep/i386-sco-3.2v5/compat.h|19700101030959|01018|1f7e450a2e18603e
-BK|mit-pthreads/machdep/i386-sco-3.2v5/dirent.h|19700101030959|01019|13608bf11af98f70
-BK|mit-pthreads/machdep/i386-sco-3.2v5/posix/__signal.h|19700101030959|01024|9bb7b240bec88b2d
-BK|mit-pthreads/machdep/i386-sco-3.2v5/socket.h|19700101030959|01020|9f78f7e5a7b4a83f
-BK|mit-pthreads/machdep/i386-sco-3.2v5/syscall.h|19700101030959|01021|d9543a0474656339
-BK|mit-pthreads/machdep/i386-sco-3.2v5/timers.h|19700101030959|01022|d5e694e48990538c
-BK|mit-pthreads/machdep/i386-sco-3.2v5/trash.can|19700101030959|01023|9332039abd82a925
-BK|mit-pthreads/machdep/sco-3.2v5/__math.h|19700101030959|00971|f3855eb411435a06
-BK|mit-pthreads/machdep/sco-3.2v5/__signal.h|19700101030959|00972|3d6f84e96bc1462
-BK|mit-pthreads/machdep/sco-3.2v5/__stdio.h|19700101030959|00973|b991fad3327275e0
-BK|mit-pthreads/machdep/sco-3.2v5/__stdlib.h|19700101030959|00974|6179a0922d90025e
-BK|mit-pthreads/machdep/sco-3.2v5/__string.h|19700101030959|00975|d2cc42eeb5e1666
-BK|mit-pthreads/machdep/sco-3.2v5/__time.h|19700101030959|00976|a9594bab280ced64
-BK|mit-pthreads/machdep/sco-3.2v5/__unistd.h|19700101030959|00977|99e6f1116d1f920
-BK|mit-pthreads/machdep/sco-3.2v5/compat.h|19700101030959|00978|3f150ff6223d49be
-BK|mit-pthreads/machdep/sco-3.2v5/dirent.h|19700101030959|00979|388af3465ad4680f
-BK|mit-pthreads/machdep/sco-3.2v5/posix/__signal.h|19700101030959|00984|5e14827a3b91a6db
-BK|mit-pthreads/machdep/sco-3.2v5/socket.h|19700101030959|00980|1b409f3f1fcbbf7a
-BK|mit-pthreads/machdep/sco-3.2v5/syscall.h|19700101030959|00981|c69bd58eba4d5076
-BK|mit-pthreads/machdep/sco-3.2v5/timers.h|19700101030959|00982|4907a958151368ed
-BK|mit-pthreads/machdep/sco-3.2v5/trash.can|19700101030959|00983|7eecac9fc944ade2
-BK|mit-pthreads/pg++|19700101030959|00597|3beac0502025d766
-BK|mit-pthreads/pgcc|19700101030959|00596|154a03d0c1a0a600
-BK|myisam/Attic/ft_global.h|19700101030959|01673|fe46fb515f1e375
-BK|myisam/common_words|19700101030959|01665|13c10ef32aaa7537
-BK|myisam/ft_search.c|19700101030959|01642|c011cb6e8041bb59
-BK|myisam/mi_test_all|19700101030959|01666|ae7a366c45527b4e
-BK|mysql.proj|19700101030959|00071|3e34edc585d18be8
-BK|mysys/mf_reccache.c|19700101030959|01419|f8191c8485e158fe
-BK|mysys/test_vsnprintf.c|19700101030959|01502|e3d568aca62dc81e
-BK|sql-bench/Results-linux/ATIS-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02361|6a0a837742a861bb
-BK|sql-bench/Results-linux/ATIS-interbase-Linux_2.2.14_5.0_i686|19700101030959|02348|e87091e2a6dce931
-BK|sql-bench/Results-linux/ATIS-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02326|70981cb1dd58d3fb
-BK|sql-bench/Results-linux/ATIS-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02327|67957b2b80839c59
-BK|sql-bench/Results-linux/ATIS-mysql-Linux_2.2.12_20smp_i686|19700101030959|02437|28211fb9f0e6ab0e
-BK|sql-bench/Results-linux/ATIS-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02438|136bdd9fd1a2cd14
-BK|sql-bench/Results-linux/ATIS-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02362|20e8179c6f87930d
-BK|sql-bench/Results-linux/ATIS-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02443|defb62af5958fcac
-BK|sql-bench/Results-linux/Attic/ATIS-mysql-Linux_2.0.33_i586|19700101030959|02381|ef64fcf54c271212
-BK|sql-bench/Results-linux/Attic/ATIS-mysql-Linux_dynamic|19700101030959|02382|ffa77bdc262ac10f
-BK|sql-bench/Results-linux/Attic/ATIS-mysql-Linux_pgcc|19700101030959|02383|e90bc846c037bc40
-BK|sql-bench/Results-linux/Attic/ATIS-mysql-Linux_static|19700101030959|02384|f82ec48b35d970df
-BK|sql-bench/Results-linux/Attic/ATIS-mysql_fast-Linux_2.0.33_i586|19700101030959|02385|91f98358bd93d33
-BK|sql-bench/Results-linux/Attic/ATIS-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02386|7b460696d0bf1072
-BK|sql-bench/Results-linux/Attic/ATIS-mysql_new-Linux_2.0.33_i586|19700101030959|02387|cee42754880a28a2
-BK|sql-bench/Results-linux/Attic/RUN-mysql-Linux_2.0.33_i586|19700101030959|02388|16978dc37b29c312
-BK|sql-bench/Results-linux/Attic/RUN-mysql-Linux_dynamic|19700101030959|02389|bbf0c571b0e7b524
-BK|sql-bench/Results-linux/Attic/RUN-mysql-Linux_pgcc|19700101030959|02390|ba188059ad9609da
-BK|sql-bench/Results-linux/Attic/RUN-mysql-Linux_static|19700101030959|02391|42aef77ab6fdc428
-BK|sql-bench/Results-linux/Attic/RUN-mysql_fast-Linux_2.0.33_i586|19700101030959|02392|5de3839bccd7800d
-BK|sql-bench/Results-linux/Attic/RUN-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02393|621fa27b9d4bd16f
-BK|sql-bench/Results-linux/Attic/RUN-mysql_new-Linux_2.0.33_i586|19700101030959|02394|dd52a2007c1645df
-BK|sql-bench/Results-linux/Attic/big-tables-mysql-Linux_2.0.33_i586|19700101030959|02395|f44520d03e8ce00
-BK|sql-bench/Results-linux/Attic/big-tables-mysql-Linux_dynamic|19700101030959|02396|209fe96b7af30953
-BK|sql-bench/Results-linux/Attic/big-tables-mysql-Linux_pgcc|19700101030959|02397|fc4a80312fcc2195
-BK|sql-bench/Results-linux/Attic/big-tables-mysql-Linux_static|19700101030959|02398|1e79f0a78656a783
-BK|sql-bench/Results-linux/Attic/big-tables-mysql_fast-Linux_2.0.33_i586|19700101030959|02399|55512b5885a90d87
-BK|sql-bench/Results-linux/Attic/big-tables-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02400|6b3250f133c85fe1
-BK|sql-bench/Results-linux/Attic/big-tables-mysql_new-Linux_2.0.33_i586|19700101030959|02401|a69502b3c5c80313
-BK|sql-bench/Results-linux/Attic/connect-mysql-Linux_2.0.33_i586|19700101030959|02402|56370edebf4dca78
-BK|sql-bench/Results-linux/Attic/connect-mysql-Linux_dynamic|19700101030959|02403|48fe1a7c5d808828
-BK|sql-bench/Results-linux/Attic/connect-mysql-Linux_pgcc|19700101030959|02404|4db8805b840040c2
-BK|sql-bench/Results-linux/Attic/connect-mysql-Linux_static|19700101030959|02405|8f0210ab126e2d52
-BK|sql-bench/Results-linux/Attic/connect-mysql_fast-Linux_2.0.33_i586|19700101030959|02406|bea04f29553d0282
-BK|sql-bench/Results-linux/Attic/connect-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02407|7e9bb70fd7b37f42
-BK|sql-bench/Results-linux/Attic/connect-mysql_new-Linux_2.0.33_i586|19700101030959|02408|68bec6f9daa2bef
-BK|sql-bench/Results-linux/Attic/create-mysql-Linux_2.0.33_i586|19700101030959|02409|b17e3ee156e4c5af
-BK|sql-bench/Results-linux/Attic/create-mysql-Linux_dynamic|19700101030959|02410|76f74b46ddaa2195
-BK|sql-bench/Results-linux/Attic/create-mysql-Linux_pgcc|19700101030959|02411|1818558b2313c5c
-BK|sql-bench/Results-linux/Attic/create-mysql-Linux_static|19700101030959|02412|41d31c3aed3bac32
-BK|sql-bench/Results-linux/Attic/create-mysql_fast-Linux_2.0.33_i586|19700101030959|02413|a1097e6149ab2c30
-BK|sql-bench/Results-linux/Attic/create-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02414|f10fc5d8ad18ec87
-BK|sql-bench/Results-linux/Attic/create-mysql_new-Linux_2.0.33_i586|19700101030959|02415|6e325e38cfc0f448
-BK|sql-bench/Results-linux/Attic/insert-mysql-Linux_2.0.33_i586|19700101030959|02416|d8e119a76e9c5299
-BK|sql-bench/Results-linux/Attic/insert-mysql-Linux_dynamic|19700101030959|02417|11d98836dff348d4
-BK|sql-bench/Results-linux/Attic/insert-mysql-Linux_pgcc|19700101030959|02418|a4dc763c821e7320
-BK|sql-bench/Results-linux/Attic/insert-mysql-Linux_static|19700101030959|02419|c30666e4ba4d83e3
-BK|sql-bench/Results-linux/Attic/insert-mysql_fast-Linux_2.0.33_i586|19700101030959|02420|335e3e2e309ed829
-BK|sql-bench/Results-linux/Attic/insert-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02421|9f4d1ef7b3803ea0
-BK|sql-bench/Results-linux/Attic/insert-mysql_new-Linux_2.0.33_i586|19700101030959|02422|ab8faa4054950b
-BK|sql-bench/Results-linux/Attic/select-mysql-Linux_2.0.33_i586|19700101030959|02423|ead2441b87c86a7
-BK|sql-bench/Results-linux/Attic/select-mysql-Linux_dynamic|19700101030959|02424|1a6ecfc73d4c9c7c
-BK|sql-bench/Results-linux/Attic/select-mysql-Linux_pgcc|19700101030959|02425|74dcac67613f7019
-BK|sql-bench/Results-linux/Attic/select-mysql-Linux_static|19700101030959|02426|d05271375e18476f
-BK|sql-bench/Results-linux/Attic/select-mysql_fast-Linux_2.0.33_i586|19700101030959|02427|c4893ae7ccfd6679
-BK|sql-bench/Results-linux/Attic/select-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02428|60fc5c8eaa45e911
-BK|sql-bench/Results-linux/Attic/select-mysql_new-Linux_2.0.33_i586|19700101030959|02429|319f856c6fc2e17e
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql-Linux_2.0.33_i586|19700101030959|02430|70ed9659b64e7687
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql-Linux_dynamic|19700101030959|02431|55691eaf454d6204
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql-Linux_pgcc|19700101030959|02432|799fec80139c693e
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql-Linux_static|19700101030959|02433|a2c543aded6c8f40
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql_fast-Linux_2.0.33_i586|19700101030959|02434|7d98b33fa6d91a87
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql_local_tcp-Linux_2.0.33_i586|19700101030959|02435|28a4840ebd5dd015
-BK|sql-bench/Results-linux/Attic/wisconsin-mysql_new-Linux_2.0.33_i586|19700101030959|02436|e1f17edfbee1f22e
-BK|sql-bench/Results-linux/RUN-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02365|5e446b99518aa0b1
-BK|sql-bench/Results-linux/RUN-interbase-Linux_2.2.14_5.0_i686|19700101030959|02351|9a0d8be7d641fae7
-BK|sql-bench/Results-linux/RUN-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02334|5f0504783180d906
-BK|sql-bench/Results-linux/RUN-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02335|6abba8bd8d9f8b7b
-BK|sql-bench/Results-linux/RUN-mysql-Linux_2.2.12_20smp_i686|19700101030959|02328|da28ced3e0aac09c
-BK|sql-bench/Results-linux/RUN-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02329|f6fa9f46d4a6152
-BK|sql-bench/Results-linux/RUN-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02366|730674f4ac333638
-BK|sql-bench/Results-linux/RUN-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02444|16694c5927b7600c
-BK|sql-bench/Results-linux/alter-table-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02367|e901749edf05bb58
-BK|sql-bench/Results-linux/alter-table-interbase-Linux_2.2.14_5.0_i686|19700101030959|02352|c4e27f25a15b6681
-BK|sql-bench/Results-linux/alter-table-mysql-Linux_2.2.12_20smp_i686|19700101030959|02330|67ae4e91b5f4eabd
-BK|sql-bench/Results-linux/alter-table-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02331|c85eb85ba45dd748
-BK|sql-bench/Results-linux/alter-table-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02368|19c95f9fc4ee458
-BK|sql-bench/Results-linux/alter-table-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02445|b062db76cf6df5d2
-BK|sql-bench/Results-linux/big-tables-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02371|c0c1c5efea0661ad
-BK|sql-bench/Results-linux/big-tables-interbase-Linux_2.2.14_5.0_i686|19700101030959|02353|beba3adfcfd472c0
-BK|sql-bench/Results-linux/big-tables-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02341|cabe523a8f103945
-BK|sql-bench/Results-linux/big-tables-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02342|c682fb7ee1fb3d8
-BK|sql-bench/Results-linux/big-tables-mysql-Linux_2.2.12_20smp_i686|19700101030959|02332|a2dcb74a3c73ac18
-BK|sql-bench/Results-linux/big-tables-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02333|b5f4f4c35225f0f
-BK|sql-bench/Results-linux/big-tables-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02372|69d33d25eda85041
-BK|sql-bench/Results-linux/big-tables-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02446|a9eedd951eab7e8b
-BK|sql-bench/Results-linux/connect-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02373|744f1e38649d21d
-BK|sql-bench/Results-linux/connect-interbase-Linux_2.2.14_5.0_i686|19700101030959|02354|c28534284b9f5657
-BK|sql-bench/Results-linux/connect-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02349|ebdc62367f5fcd43
-BK|sql-bench/Results-linux/connect-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02350|7ed494b7cc7081c9
-BK|sql-bench/Results-linux/connect-mysql-Linux_2.2.12_20smp_i686|19700101030959|02336|beedcd769a903c19
-BK|sql-bench/Results-linux/connect-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02337|74ec2bf5f55b81f
-BK|sql-bench/Results-linux/connect-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02374|55d777517ce8091
-BK|sql-bench/Results-linux/connect-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02447|f6d7665c418d62c6
-BK|sql-bench/Results-linux/create-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02377|d60ca06157cfc9b9
-BK|sql-bench/Results-linux/create-interbase-Linux_2.2.14_5.0_i686|19700101030959|02355|537da98f6c1bc6df
-BK|sql-bench/Results-linux/create-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02356|612a182b889dd778
-BK|sql-bench/Results-linux/create-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02357|b501391eec112dd0
-BK|sql-bench/Results-linux/create-mysql-Linux_2.2.12_20smp_i686|19700101030959|02338|fe23ee50aea195f4
-BK|sql-bench/Results-linux/create-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02339|771b40d3280fe8ad
-BK|sql-bench/Results-linux/create-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02378|35bd48cfe30c16a3
-BK|sql-bench/Results-linux/create-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02448|c46d6c283c0e34ae
-BK|sql-bench/Results-linux/insert-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02379|25161ee7c13036c1
-BK|sql-bench/Results-linux/insert-interbase-Linux_2.2.14_5.0_i686|19700101030959|02358|461a48df25628c0f
-BK|sql-bench/Results-linux/insert-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02363|3260743076dbe95f
-BK|sql-bench/Results-linux/insert-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02364|9de5538694cd87ea
-BK|sql-bench/Results-linux/insert-mysql-Linux_2.2.12_20smp_i686|19700101030959|02340|f120b0ead3836c81
-BK|sql-bench/Results-linux/insert-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02343|17f262f12d2244bc
-BK|sql-bench/Results-linux/insert-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02380|7451b789c29b7dcd
-BK|sql-bench/Results-linux/insert-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02449|3245ba5633a18e8
-BK|sql-bench/Results-linux/select-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02439|816ec12a9152b578
-BK|sql-bench/Results-linux/select-interbase-Linux_2.2.14_5.0_i686|19700101030959|02359|3535cd00c2a9cb5d
-BK|sql-bench/Results-linux/select-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02369|de288cd8c11e1749
-BK|sql-bench/Results-linux/select-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02370|a82e759dbd5d66b
-BK|sql-bench/Results-linux/select-mysql-Linux_2.2.12_20smp_i686|19700101030959|02344|3b64aff0dfddfff4
-BK|sql-bench/Results-linux/select-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02345|9fd9c6e036f988d7
-BK|sql-bench/Results-linux/select-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02440|862a7c0ef1b17f29
-BK|sql-bench/Results-linux/select-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02450|744633c6e13a897f
-BK|sql-bench/Results-linux/wisconsin-interbase-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02441|cb767c1f9abc2ebd
-BK|sql-bench/Results-linux/wisconsin-interbase-Linux_2.2.14_5.0_i686|19700101030959|02360|9404247a2e483b34
-BK|sql-bench/Results-linux/wisconsin-mysql-Linux_2.0.33_i586-cmp-access,mysql|19700101030959|02375|8669562660b2c238
-BK|sql-bench/Results-linux/wisconsin-mysql-Linux_2.0.33_i586-cmp-ms-sql,mysql,sybase|19700101030959|02376|c7cbe3b167655f9c
-BK|sql-bench/Results-linux/wisconsin-mysql-Linux_2.2.12_20smp_i686|19700101030959|02346|d49db545341a732f
-BK|sql-bench/Results-linux/wisconsin-mysql-Linux_2.2.13_SMP_alpha|19700101030959|02347|ad7babd436f26841
-BK|sql-bench/Results-linux/wisconsin-mysql-Linux_2.2.14_5.0_i686-cmp-interbase,mysql|19700101030959|02442|74b238eca114dbbe
-BK|sql-bench/Results-linux/wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha|19700101030959|02451|6ad065fe4c6b4fa9
-BK|sql-bench/Results-win32/ATIS-mysql-win98|19700101030959|02523|cd0705815d3af451
-BK|sql-bench/Results-win32/RUN-mysql-win98|19700101030959|02526|7f09e396772a8665
-BK|sql-bench/Results-win32/alter-table-mysql-win98|19700101030959|02529|e8743982f790462
-BK|sql-bench/Results-win32/big-tables-mysql-win98|19700101030959|02532|99a1882effebbdf2
-BK|sql-bench/Results-win32/connect-mysql-win98|19700101030959|02535|2a11d5e3dfc0bc67
-BK|sql-bench/Results-win32/create-mysql-win98|19700101030959|02538|f66c2cb2909c4792
-BK|sql-bench/Results-win32/insert-mysql-win98|19700101030959|02541|6d6cafc85a6c837
-BK|sql-bench/Results-win32/select-mysql-win98|19700101030959|02544|f370fac2d66a9faf
-BK|sql-bench/Results-win32/wisconsin-mysql-win98|19700101030959|02547|8b3da9c5c5d2365b
-BK|sql-bench/Results/ATIS-mysql-3.21-Linux_2.2.1_i686|19700101030959|02022|660fb76ed6ccfb6f
-BK|sql-bench/Results/ATIS-mysql-Linux_2.2.10_i686|19700101030959|02025|3fa4d167cceff7e8
-BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02312|84ca3b85ff306133
-BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_i686_xeon|19700101030959|02044|3e820c28bf4af63a
-BK|sql-bench/Results/ATIS-mysql-SunOS_5.5.1_sun4u|19700101030959|02031|dfb4c5f6b6db3b49
-BK|sql-bench/Results/ATIS-mysql-SunOS_5.6_sun4m|19700101030959|02032|62028e0375b3b8b
-BK|sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4u|19700101030959|02034|be0d9789776c5ed7
-BK|sql-bench/Results/ATIS-mysql_3.21-Linux_2.0.35_i686|19700101030959|02036|c25425e045ca8dfc
-BK|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02304|cbe120d860296d2f
-BK|sql-bench/Results/ATIS-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02027|a74e7b82d3908fa9
-BK|sql-bench/Results/ATIS-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02313|8c6fc2968f78773
-BK|sql-bench/Results/ATIS-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02163|c2042f9a9657c3c3
-BK|sql-bench/Results/Attic/ATIS-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02176|a8b0d775c0a4691
-BK|sql-bench/Results/Attic/ATIS-mysql-Linux_2.2.12_20smp_i686|19700101030959|02167|1e29b2a67768c48e
-BK|sql-bench/Results/Attic/ATIS-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02177|ad0b2dd9635e2c5
-BK|sql-bench/Results/Attic/ATIS-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02178|f2a315ff3020d8af
-BK|sql-bench/Results/Attic/ATIS-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02179|976d7060e515b99d
-BK|sql-bench/Results/Attic/ATIS-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02180|4eb0a8bb9375c8b4
-BK|sql-bench/Results/Attic/RUN-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02181|b57a8fe3ec3c61fe
-BK|sql-bench/Results/Attic/RUN-mysql-Linux_2.2.12_20smp_i686|19700101030959|02168|151c91b6daab4dde
-BK|sql-bench/Results/Attic/RUN-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02182|29eba7ff708091a9
-BK|sql-bench/Results/Attic/RUN-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02183|5621a2bcc51f0046
-BK|sql-bench/Results/Attic/RUN-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02184|bdd5fe173fc3ce04
-BK|sql-bench/Results/Attic/RUN-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02185|18ad094a4a084f2d
-BK|sql-bench/Results/Attic/alter-table-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02186|5fd6ded14590fbb8
-BK|sql-bench/Results/Attic/alter-table-mysql-Linux_2.2.12_20smp_i686|19700101030959|02169|4d534c0d139e6e84
-BK|sql-bench/Results/Attic/alter-table-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02187|3328a9b65a550c5d
-BK|sql-bench/Results/Attic/alter-table-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02188|ff27c85c97c3ad3
-BK|sql-bench/Results/Attic/alter-table-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02189|4250bb2da83647a2
-BK|sql-bench/Results/Attic/alter-table-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02190|b17e2aaa38b55eb2
-BK|sql-bench/Results/Attic/big-tables-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02191|8f54c66cf5c54c9b
-BK|sql-bench/Results/Attic/big-tables-mysql-Linux_2.2.12_20smp_i686|19700101030959|02170|5769cc71415f47c0
-BK|sql-bench/Results/Attic/big-tables-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02192|f5635f889ac7fd1
-BK|sql-bench/Results/Attic/big-tables-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02193|87bd5cad328f9a56
-BK|sql-bench/Results/Attic/big-tables-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02194|7ab2f4e6f446e8d1
-BK|sql-bench/Results/Attic/big-tables-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02195|f4e8992432a41520
-BK|sql-bench/Results/Attic/connect-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02196|e7d05143faaaed14
-BK|sql-bench/Results/Attic/connect-mysql-Linux_2.2.12_20smp_i686|19700101030959|02171|f729aa3ce165504b
-BK|sql-bench/Results/Attic/connect-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02197|ed24e73925a9a15f
-BK|sql-bench/Results/Attic/connect-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02198|cd44ecbb1bc562df
-BK|sql-bench/Results/Attic/connect-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02199|2e32ec7ed48830b0
-BK|sql-bench/Results/Attic/connect-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02200|54279ceecad4ff75
-BK|sql-bench/Results/Attic/create-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02201|794bb2f5d9848a31
-BK|sql-bench/Results/Attic/create-mysql-Linux_2.2.12_20smp_i686|19700101030959|02172|fac50eb6d476b061
-BK|sql-bench/Results/Attic/create-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02202|567131bf739028de
-BK|sql-bench/Results/Attic/create-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02203|f588adda77591d0e
-BK|sql-bench/Results/Attic/create-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02204|c6cd719f446aef2d
-BK|sql-bench/Results/Attic/create-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02205|447e91cb1cbd0200
-BK|sql-bench/Results/Attic/insert-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02206|3eef949d8497d64a
-BK|sql-bench/Results/Attic/insert-mysql-Linux_2.2.12_20smp_i686|19700101030959|02173|e2b60136e721ee00
-BK|sql-bench/Results/Attic/insert-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02207|34e0e127be9818d5
-BK|sql-bench/Results/Attic/insert-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02208|6c23fbad4756fc5a
-BK|sql-bench/Results/Attic/insert-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02209|256460399ba1a19
-BK|sql-bench/Results/Attic/insert-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02210|64c440c68299737c
-BK|sql-bench/Results/Attic/select-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02211|8945aaf0216c6faa
-BK|sql-bench/Results/Attic/select-mysql-Linux_2.2.12_20smp_i686|19700101030959|02174|f55b5bbb2b146e8f
-BK|sql-bench/Results/Attic/select-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02212|4df8dad5f928896f
-BK|sql-bench/Results/Attic/select-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02213|4f358f071fb9fb64
-BK|sql-bench/Results/Attic/select-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02214|2b25f0443d476a6a
-BK|sql-bench/Results/Attic/select-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02215|72a5128156c0045e
-BK|sql-bench/Results/Attic/wisconsin-mysql-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02216|daca359e12015b98
-BK|sql-bench/Results/Attic/wisconsin-mysql-Linux_2.2.12_20smp_i686|19700101030959|02175|3b972af9467dcd06
-BK|sql-bench/Results/Attic/wisconsin-mysql-Linux_2.2.1_i686-cmp-mysql,pg|19700101030959|02217|16584fde48942aa2
-BK|sql-bench/Results/Attic/wisconsin-mysql_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02218|b4e89cdac0620cba
-BK|sql-bench/Results/Attic/wisconsin-pg-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02219|7d641554f51cf45a
-BK|sql-bench/Results/Attic/wisconsin-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|19700101030959|02220|db31ec971b4c5051
-BK|sql-bench/Results/RUN-mysql-3.21-Linux_2.2.1_i686|19700101030959|02050|f6fdd64859e11de9
-BK|sql-bench/Results/RUN-mysql-Linux_2.2.10_i686|19700101030959|02041|712f52be5d195406
-BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02038|8ee87b26b91c86fe
-BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_i686_xeon|19700101030959|02055|17854e751e1d9d1d
-BK|sql-bench/Results/RUN-mysql-SunOS_5.5.1_sun4u|19700101030959|02058|afbba182428e20df
-BK|sql-bench/Results/RUN-mysql-SunOS_5.6_sun4m|19700101030959|02059|eafc8188345e262b
-BK|sql-bench/Results/RUN-mysql-SunOS_5.7_sun4u|19700101030959|02061|86e1dc0e25a8b8f
-BK|sql-bench/Results/RUN-mysql_3.21-Linux_2.0.35_i686|19700101030959|02064|ea8672d8473435
-BK|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02310|a902e1a967d79c42
-BK|sql-bench/Results/RUN-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02030|413ab3b8a99e61e9
-BK|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02046|a910a9b3fde431e1
-BK|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02165|e0f060fdbf92325e
-BK|sql-bench/Results/alter-table-mysql-3.21-Linux_2.2.1_i686|19700101030959|02073|f6f7ccd7b3c35f97
-BK|sql-bench/Results/alter-table-mysql-Linux_2.2.10_i686|19700101030959|02081|93b78a85b720a186
-BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02314|4ae4b989301df98b
-BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_i686_xeon|19700101030959|02057|64cc4b874cd6fabf
-BK|sql-bench/Results/alter-table-mysql-SunOS_5.5.1_sun4u|19700101030959|02087|9d7e75667fcb29ec
-BK|sql-bench/Results/alter-table-mysql-SunOS_5.6_sun4m|19700101030959|02088|8a1bd6589a189890
-BK|sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4u|19700101030959|02090|ce74c2f623d3bb3
-BK|sql-bench/Results/alter-table-mysql_3.21-Linux_2.0.35_i686|19700101030959|02092|762639f2560976bd
-BK|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02316|1390155aad5b6e86
-BK|sql-bench/Results/alter-table-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02317|9090bebb62ef164b
-BK|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02094|4e02d36dc17ecbfa
-BK|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02233|b8721431b356177
-BK|sql-bench/Results/big-tables-mysql-3.21-Linux_2.2.1_i686|19700101030959|02106|baa649caba113497
-BK|sql-bench/Results/big-tables-mysql-Linux_2.2.10_i686|19700101030959|02109|99daa1c5370d077d
-BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02315|2804ec3c95be436a
-BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_i686_xeon|19700101030959|02074|290c2c3de9d8e6b
-BK|sql-bench/Results/big-tables-mysql-SunOS_5.5.1_sun4u|19700101030959|02115|7d7b6c0bf58b9b79
-BK|sql-bench/Results/big-tables-mysql-SunOS_5.6_sun4m|19700101030959|02116|f351a7f3e1e2257e
-BK|sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4u|19700101030959|02118|ebc379b231312bbe
-BK|sql-bench/Results/big-tables-mysql_3.21-Linux_2.0.35_i686|19700101030959|02120|190e827e569c99a4
-BK|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02318|c5eabcb89ceac698
-BK|sql-bench/Results/big-tables-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02319|856d503725373684
-BK|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02122|a442a8aff47fae20
-BK|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02235|e5a33639e51290fd
-BK|sql-bench/Results/connect-mysql-3.21-Linux_2.2.1_i686|19700101030959|02134|c0c26d4320182d85
-BK|sql-bench/Results/connect-mysql-Linux_2.2.10_i686|19700101030959|02137|c92505d77e19d5ec
-BK|sql-bench/Results/connect-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02084|e7e2959b7387251f
-BK|sql-bench/Results/connect-mysql-Linux_2.2.14_i686_xeon|19700101030959|02071|ea19dc3ec55b3618
-BK|sql-bench/Results/connect-mysql-SunOS_5.5.1_sun4u|19700101030959|02142|a9493110fe62e0b1
-BK|sql-bench/Results/connect-mysql-SunOS_5.6_sun4m|19700101030959|02143|a10e3ddfa26a3e7f
-BK|sql-bench/Results/connect-mysql-SunOS_5.7_sun4u|19700101030959|02145|c67beb9e9d2cf32e
-BK|sql-bench/Results/connect-mysql_3.21-Linux_2.0.35_i686|19700101030959|02146|650abd213e6828c6
-BK|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02320|ce69cc65bc827b5c
-BK|sql-bench/Results/connect-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02066|f801e08429a4f7c6
-BK|sql-bench/Results/connect-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02086|1d95d36fd717990
-BK|sql-bench/Results/connect-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02244|f6ab4d00b0ae09c1
-BK|sql-bench/Results/create-mysql-3.21-Linux_2.2.1_i686|19700101030959|02158|51581b24f45e0f5c
-BK|sql-bench/Results/create-mysql-Linux_2.2.10_i686|19700101030959|02161|9e7822f66df6aa76
-BK|sql-bench/Results/create-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02102|34ded91c5fc25de9
-BK|sql-bench/Results/create-mysql-Linux_2.2.14_i686_xeon|19700101030959|02139|50d15991293030ef
-BK|sql-bench/Results/create-mysql-SunOS_5.5.1_sun4u|19700101030959|02166|bbb5de66fc56de7b
-BK|sql-bench/Results/create-mysql-SunOS_5.6_sun4m|19700101030959|02221|9233114ae6f8c5f
-BK|sql-bench/Results/create-mysql-SunOS_5.7_sun4u|19700101030959|02223|7ee13bfcafeab498
-BK|sql-bench/Results/create-mysql_3.21-Linux_2.0.35_i686|19700101030959|02225|df1b037d17b33587
-BK|sql-bench/Results/create-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02321|e985e71d552ff09e
-BK|sql-bench/Results/create-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02099|483dcf223d5abf81
-BK|sql-bench/Results/create-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02112|a140e5e229a53b7b
-BK|sql-bench/Results/create-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02246|177fd39cc1d298a8
-BK|sql-bench/Results/insert-mysql-3.21-Linux_2.2.1_i686|19700101030959|02239|fd082017c7c57a6
-BK|sql-bench/Results/insert-mysql-Linux_2.2.10_i686|19700101030959|02242|763edf9aec633f51
-BK|sql-bench/Results/insert-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02130|5be3d6f299738a31
-BK|sql-bench/Results/insert-mysql-Linux_2.2.14_i686_xeon|19700101030959|02141|c683ee4b9d214298
-BK|sql-bench/Results/insert-mysql-SunOS_5.5.1_sun4u|19700101030959|02247|8a9ae41f9a79f79
-BK|sql-bench/Results/insert-mysql-SunOS_5.6_sun4m|19700101030959|02248|3402d060ae20e19
-BK|sql-bench/Results/insert-mysql-SunOS_5.7_sun4u|19700101030959|02250|78efa132c6e252b9
-BK|sql-bench/Results/insert-mysql_3.21-Linux_2.0.35_i686|19700101030959|02252|60c0965dff31db07
-BK|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02322|ed252140ff399961
-BK|sql-bench/Results/insert-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02114|29a3b8a1ca8aa9d
-BK|sql-bench/Results/insert-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02148|e65dd14f2ed9abbf
-BK|sql-bench/Results/insert-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02259|b5bf77586c18d2b5
-BK|sql-bench/Results/select-mysql-3.21-Linux_2.2.1_i686|19700101030959|02265|ed3687e713ff0571
-BK|sql-bench/Results/select-mysql-Linux_2.2.10_i686|19700101030959|02268|a2e264d777b787d
-BK|sql-bench/Results/select-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02227|308117295c3bc096
-BK|sql-bench/Results/select-mysql-Linux_2.2.14_i686_xeon|19700101030959|02152|ead3f11b46ac626f
-BK|sql-bench/Results/select-mysql-SunOS_5.5.1_sun4u|19700101030959|02273|c9a1a498a052e268
-BK|sql-bench/Results/select-mysql-SunOS_5.6_sun4m|19700101030959|02274|4da215905bce988d
-BK|sql-bench/Results/select-mysql-SunOS_5.7_sun4u|19700101030959|02276|632c92971c61e34a
-BK|sql-bench/Results/select-mysql_3.21-Linux_2.0.35_i686|19700101030959|02278|5fadbac5f98696a
-BK|sql-bench/Results/select-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02323|e8c0871a668a610d
-BK|sql-bench/Results/select-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02127|963a98ed526e2be4
-BK|sql-bench/Results/select-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02254|f9ab7726ff14ea90
-BK|sql-bench/Results/select-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02261|188d6b5b72d8e0a
-BK|sql-bench/Results/wisconsin-mysql-3.21-Linux_2.2.1_i686|19700101030959|02290|8147dc16a1dc6c47
-BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.10_i686|19700101030959|02288|301a82b12a84922b
-BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02280|d01900af34fb33b8
-BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_i686_xeon|19700101030959|02154|7525b23938631801
-BK|sql-bench/Results/wisconsin-mysql-SunOS_5.5.1_sun4u|19700101030959|02297|379705afa2e12378
-BK|sql-bench/Results/wisconsin-mysql-SunOS_5.6_sun4m|19700101030959|02298|ec61b14072715dc8
-BK|sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4u|19700101030959|02300|f27927f8c64ea8ad
-BK|sql-bench/Results/wisconsin-mysql_3.21-Linux_2.0.35_i686|19700101030959|02302|31703d40ea6b4f66
-BK|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02324|ec075a89dbdbbe6a
-BK|sql-bench/Results/wisconsin-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02325|233d5aa529979990
-BK|sql-bench/Results/wisconsin-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02295|ec361eee4f4128cd
-BK|sql-bench/Results/wisconsin-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02270|ef201ca14f635c57
-BK|sql/Attic/lex_hash.h|19700101030959|01912|14f912771118b50c
-BK|sql/Attic/mini_client.c|19700101030959|01910|9a3778c387d06a81
-BK|sql/Attic/mini_client_errors.c|19700101030959|01909|29edad51a5d0b068
-BK|sql/Attic/mybinlogdump.cc|19700101030959|01908|5dbdd2bde98d6169
-BK|sql/Attic/net_serv.c|19700101030959|01911|52dabcd773a39e10
-BK|sql/ha_hash.h|19700101030959|01902|27e36916116beb3e
-BK|sql/share/czech/errmsg.sys|19700101030959|01828|93104a2bd5c732a
-BK|sql/share/danish/errmsg.sys|19700101030959|01831|3a6d0fb8451a3313
-BK|sql/share/dutch/errmsg.sys|19700101030959|01833|b5aff4d08478bafd
-BK|sql/share/english/errmsg.sys|19700101030959|01834|f29bd4ea5aaf54c8
-BK|sql/share/estonia/errmsg.sys|19700101030959|01836|83b86d7ed4cdd5d0
-BK|sql/share/french/errmsg.sys|19700101030959|01838|9f024dc5e6fe50f5
-BK|sql/share/german/errmsg.sys|19700101030959|01840|1ea60675399c84c
-BK|sql/share/greek/errmsg.sys|19700101030959|01842|fedf585fa73e7cf1
-BK|sql/share/hungarian/errmsg.sys|19700101030959|01845|aff82c16a77fc800
-BK|sql/share/italian/errmsg.sys|19700101030959|01846|c5108ecb850b79a
-BK|sql/share/japanese/errmsg.sys|19700101030959|01848|302478c84697dc00
-BK|sql/share/korean/errmsg.sys|19700101030959|01850|a30e3687ae75a7c9
-BK|sql/share/norwegian-ny/.cvsignore|19700101030959|01855|469064b5190d703d
-BK|sql/share/norwegian/.cvsignore|19700101030959|01853|a91d63182f0b2366
-BK|sql/share/polish/errmsg.sys|19700101030959|01857|126b03af92054f0f
-BK|sql/share/portuguese/errmsg.sys|19700101030959|01859|c0187322f8c9d805
-BK|sql/share/romania/errmsg.sys|19700101030959|01871|e08aa93bae96d25e
-BK|sql/share/romanian/errmsg.sys|19700101030959|01869|9d8282efb437e8cc
-BK|sql/share/romanian/errmsg.txt|19700101030959|01870|2c64fb13a8f104ad
-BK|sql/share/russian/errmsg.sys|19700101030959|01860|72688df0beeabcb3
-BK|sql/share/slovak/errmsg.sys|19700101030959|01862|148510616ae825cf
-BK|sql/share/spanish/errmsg.sys|19700101030959|01865|10c8f32da39070b2
-BK|sql/share/swedish/errmsg.sys|19700101030959|01866|dd772e93db859993
-BK|sql/violite.c|19700101030959|01738|d7b85be615595ace
-BK|strings/Attic/bootstrap-ctype.c|19700101030959|01360|6d2a8cda2d6a35ff
-BK|strings/Attic/ct_init.c|19700101030959|01338|f0948bdd35ceedc3
-BK|strings/Attic/ctype-cp1251.c|19700101030959|01339|cdf74b9168408b3
-BK|strings/Attic/ctype-cp1257.c|19700101030959|01340|732611cbc74aeafc
-BK|strings/Attic/ctype-croat.c|19700101030959|01341|d2d805ee6f10cbcc
-BK|strings/Attic/ctype-danish.c|19700101030959|01342|dc5451066eb272ae
-BK|strings/Attic/ctype-dec8.c|19700101030959|01343|68f257dd2202d0c7
-BK|strings/Attic/ctype-dos.c|19700101030959|01344|f77bd08acf13a8c1
-BK|strings/Attic/ctype-estonia.c|19700101030959|01345|fc8a69424f7cb66b
-BK|strings/Attic/ctype-german1.c|19700101030959|01346|f7830c509bb358f7
-BK|strings/Attic/ctype-greek.c|19700101030959|01347|90acdff1195209ca
-BK|strings/Attic/ctype-hebrew.c|19700101030959|01348|d3b4a000d51e76dc
-BK|strings/Attic/ctype-hp8.c|19700101030959|01349|749e1be0f028d349
-BK|strings/Attic/ctype-hungarian.c|19700101030959|01350|5cf0bf7fa0312637
-BK|strings/Attic/ctype-koi8_ru.c|19700101030959|01351|8ff4188c642c9bd
-BK|strings/Attic/ctype-koi8_ukr.c|19700101030959|01352|a04aa14a6d62335a
-BK|strings/Attic/ctype-latin1.c|19700101030959|01353|cc63880f19c2303e
-BK|strings/Attic/ctype-latin2.c|19700101030959|01354|31895c4b83654342
-BK|strings/Attic/ctype-swe7.c|19700101030959|01355|bb1b012225d7d02c
-BK|strings/Attic/ctype-usa7.c|19700101030959|01356|d19d859dca5675f
-BK|strings/Attic/ctype-win1250.c|19700101030959|01357|1ce7a24255780a1
-BK|strings/Attic/ctype-win1251.c|19700101030959|01358|762607f4fd7d52ad
-BK|strings/Attic/ctype-win1251ukr.c|19700101030959|01359|b5a7cca889bbef58
-BK|strings/Attic/ctype.c.in|19700101030959|01361|8bf48d4bcbc5f675
-BK|strings/Attic/memory.h|19700101030959|01336|450f586e82a26d99
-BK|strings/Attic/ptr_cmp.c|19700101030959|01337|57e682a26e769597
-BK|strings/READ-ME|19700101030959|01362|ed6c5184d4bf6b7c
-BK|support-files/Attic/my-example.cnf.sh|19700101030959|02584|87a7e1f4d24b62a9
-BK|support-files/Attic/my-huge.cfg.sh|19700101030959|02585|589bdcd2d2c4360b
-BK|support-files/Attic/my-large.cfg.sh|19700101030959|02586|842c8e76253c9396
-BK|support-files/Attic/my-medium.cfg.sh|19700101030959|02587|c49880d26ef0648e
-BK|support-files/Attic/my-small.cfg.sh|19700101030959|02588|85023c559a1d96c
-BK|tests/fork3_test.pl|19700101030959|01947|c4a7bffb4f8e813c
-BK|tests/fork_test.pl|19700101030959|01945|3d3535329ed8cd5e
-BK|vio/Vio.cc|19700101030959|00003|60737ce02ab2bc25
-BK|vio/Vio.h|19700101030959|00004|f4416b2949647602
-BK|vio/VioAcceptorFd.cc|19700101030959|00005|a5a08947a31f88de
-BK|vio/VioAcceptorFd.h|19700101030959|00006|7f9c4358477ba9a3
-BK|vio/VioConnectorFd.cc|19700101030959|00007|ddbd7821c43c83a2
-BK|vio/VioConnectorFd.h|19700101030959|00008|58bc11cdc885b951
-BK|vio/VioFd.cc|19700101030959|00009|6e444647affef63b
-BK|vio/VioFd.h|19700101030959|00010|8294293a88c7b4b8
-BK|vio/VioPipe.cc|19700101030959|00011|12cf83b9a2f48f6c
-BK|vio/VioPipe.h|19700101030959|00012|21cebbe61a1da546
-BK|vio/VioSSL.cc|19700101030959|00013|6e85340b11fa42a8
-BK|vio/VioSSL.h|19700101030959|00014|70d367b7ec8cac3e
-BK|vio/VioSSLAcceptorFd.cc|19700101030959|00015|4c828f3688ed74ec
-BK|vio/VioSSLFactoriesFd.cc|19700101030959|00016|89f6bf5073937947
-BK|vio/VioSSLFactoriesFd.h|19700101030959|00017|1d63ae149a63f85
-BK|vio/VioSocket.cc|19700101030959|00018|71c615783f29b5e1
-BK|vio/VioSocket.h|19700101030959|00019|a26d535bd5a1a6
-BK|vio/version.cc|19700101030959|00020|7237acf12bed4a97
-BK|vio/vio-global.h|19700101030959|00021|c261412c01b2f4
-BK|vio/vioelitexx.cc|19700101030959|00022|3eaba70da792a7fc
-BK|vio/violite.h|19700101030959|00023|58d2942a52ea7a83
-BK|vio/viotypes.h|19700101030959|00027|f5a38e7326bd50f3
-BitKeeper/deleted/SCCS/s..del-makefile.w32
-Sinisa@sinisa.nasamreza.org|=6|20010818122920|53462|33f33b0a159dc5d5
-Sinisa@sinisa.nasamreza.org|mysql-test/r/sel000004.result|20020522121240|20995|360af2095c88cb8c
-Sinisa@sinisa.nasamreza.org|mysql-test/r/sel000004.result|20020522133259|25000|4b5fbc60d0d9754f
-Sinisa@sinisa.nasamreza.org|mysql-test/t/sel000004.test|20020522133300|08911|21904fbd1c95cb1
-Sinisa@sinisa.nasamreza.org|mysql-test/t/sel000004.test|20020522133624|23665|445526a8a20de101
-Sinisa@sinisa.nasamreza.org|scripts/mysql_new_fix_privilege_tables.sh|20011226144909|43765|b1664b401375eece
-arjen@co3064164-a.bitbike.com|BitKeeper/etc/logging_ok|20011212060636|33009
-arjen@co3064164-a.bitbike.com|Docs/section.Comparisons.texi|20011108043647|22614|692b647b
-arjen@fred.bitbike.com|scripts/mysql_fix_extensions.sh|20020516001337|12363|f1048a78f4759b4d
-ccarkner@nslinuxw10.bedford.progress.com|mysql-test/r/isolation.result|20010327145543|25059|4da11e109a3d93a9
-ccarkner@nslinuxw10.bedford.progress.com|mysql-test/t/isolation.test|20010327145543|39049|6a39e4138dd4a456
-fs
-holyfoot/hf@mysql.com/deer.(none)|mysql-test/r/bdb_notembedded.result|20061113160642|60022|276fa5181da9a588
-holyfoot/hf@mysql.com/deer.(none)|mysql-test/t/bdb_notembedded.test|20061113160642|06094|6ef2ea4713496614
-jani@a88-113-38-195.elisa-laajakaista.fi|BUILD/SETUP.sh.rej|20070122013357|30052|b0650da46e7c4e54
-jani@a88-113-38-195.elisa-laajakaista.fi|configure.in.rej|20070122013357|43533|4b7ec608b9c90e83
-jani@a88-113-38-195.elisa-laajakaista.fi|include/my_global.h.rej|20070122013357|29911|dc7f1642f6061af
-jani@a88-113-38-195.elisa-laajakaista.fi|include/my_pthread.h.rej|20070122013357|18348|a6b632d992e5df16
-jani@a88-113-38-195.elisa-laajakaista.fi|mysys/thr_alarm.c.rej|20070122013357|21935|c169568388079966
-jani@a88-113-38-195.elisa-laajakaista.fi|sql/mysqld.cc.rej|20070122013357|09337|84aad00c2111bc3
-jani@hynda.mysql.fi|client/mysqlcheck|20010419221207|26716|363e3278166d84ec
-jcole@tetra.bedford.progress.com|BitKeeper/etc/logging_ok|20001004201211|30554
-jimw@mysql.com|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aa
-jimw@mysql.com|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aajimw@mysql.com|mysql-test/t/ndb_autodiscover2.disabled|20050311230559|22363|afa8e5b6e46a3ea1jimw@mysql.com|mysql-test/t/ndb_autodiscover.disabled|20050311230559|58101|dda20d04dddbb06jimw@mysql.com|mysql-test/t/ndb_cache_multi2.disabled|20050311230600|47901|84fed1a78c0d3e6djimw@mysql.com|mysql-test/t/ndb_cache_multi.disabled|20050311230600|18039|9657b6eff7deb27ajimw@mysql.com|mysql-test/t/ndb_multi.disabled|20050311230600|12240|2599367ad06100f6jimw@mysql.com|mysql-test/t/ndb_restore.disabled|20050311230600|30718|3c2453d6164b1a30jimw@mysql.com|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aajimw@mysql.com|mysql-test/t/ndb_autodiscover2.disabled|20050311230559|22363|afa8e5b6e46a3ea1jimw@mysql.com|mysql-test/t/ndb_autodiscover.disabled|20050311230559|58101|dda20d04dddbb06jimw@mysql.com|mysql-test/t/ndb_cache_multi2.disabled|20050311230600|47901|84fed1a78c0d3e6djimw@mysql.com|mysql-test/t/ndb_cache_multi.disabled|20050311230600|18039|9657b6eff7deb27ajimw@mysql.com|mysql-test/t/ndb_multi.disabled|20050311230600|12240|2599367ad06100f6jimw@mysql.com|mysql-test/t/ndb_restore.disabled|20050311230600|30718|3c2453d6164b1a30magnus@neptunus.(none)|ndb/src/client/Makefile|20040414084436|02010|6c2778d2bf4954a2
-jimw@mysql.com|mysql-test/t/ndb_autodiscover.disabled|20050311230559|58101|dda20d04dddbb06
-jimw@mysql.com|mysql-test/t/ndb_autodiscover2.disabled|20050311230559|22363|afa8e5b6e46a3ea1
-jimw@mysql.com|mysql-test/t/ndb_cache_multi.disabled|20050311230600|18039|9657b6eff7deb27a
-jimw@mysql.com|mysql-test/t/ndb_cache_multi2.disabled|20050311230600|47901|84fed1a78c0d3e6d
-jimw@mysql.com|mysql-test/t/ndb_multi.disabled|20050311230600|12240|2599367ad06100f6
-jimw@mysql.com|mysql-test/t/ndb_restore.disabled|20050311230600|30718|3c2453d6164b1a30
-korbit-kernel-2.4.1
-magnus@neptunus.(none)|ndb/src/client/Makefile|20040414084436|02010|6c2778d2bf4954a2
-magnus@neptunus.(none)|ndb/src/client/odbc/Extra.mk|20040414082358|47442|eabbb28986ca817d
-magnus@neptunus.(none)|ndb/src/client/odbc/Makefile|20040414084435|33394|9bc928a18aa88d66
-magnus@neptunus.(none)|ndb/src/client/odbc/NdbOdbc.cpp|20040414082358|49599|aa491b06c9172d11
-magnus@neptunus.(none)|ndb/src/client/odbc/NdbOdbc.def|20040414082358|51708|cd3eed2c4a0121e9
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/CodeGen.cpp|20040414082358|53823|170c83c0765b9160
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/CodeGen.hpp|20040414082358|56074|738f834f80cceba8
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_base.cpp|20040414082358|58196|96f8ceaac8138bfe
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_base.hpp|20040414082358|60340|794baaed32588409
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_column.cpp|20040414082358|62566|5dd0e5c1215bd8bf
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_column.hpp|20040414082358|64739|5d5816d1c496e588
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_comp_op.cpp|20040414082358|01507|6ab02cc3b1e08985
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_comp_op.hpp|20040414082358|03757|37cf1e4cee3a6bf1
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_index.cpp|20040414082358|06374|d1f95c5917afab9
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_index.hpp|20040414082358|08625|12bcb33350fc35c1
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_row.cpp|20040414082358|11036|33f73454f8ddf2d5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_row.hpp|20040414082358|13441|38cb00cc1baa9ee7
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_table.cpp|20040414082358|15724|c25e7cc06414a927
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_create_table.hpp|20040414082358|18032|9648f467f3f0418e
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_data_type.cpp|20040414082358|20759|9e46a7ef85345d4
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_data_type.hpp|20040414082358|23055|5e8928968d3c0107
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl.cpp|20040414082358|25484|c38ee5368efaf688
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl.hpp|20040414082358|27775|75482ddd87b65036
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_column.cpp|20040414082358|32443|c524862773dd9f38
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_column.hpp|20040414082358|33650|c9e534e381b21599
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_constr.cpp|20040414082359|02893|80ae32f83a6c2f00
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_constr.hpp|20040414082359|05185|bca16806c57bc97e
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_row.cpp|20040414082359|07481|ec2fbc3b8ab08a52
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_ddl_row.hpp|20040414082359|09844|c18a43b3770ad25a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete.cpp|20040414082359|12149|feac77b440d04327
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete.hpp|20040414082359|14544|c852ee069a761aab
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_index.cpp|20040414082359|17020|17ed96eca90fe4e7
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_index.hpp|20040414082359|19336|18a9bb119b04636
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_lookup.cpp|20040414082359|23008|1a3728f8c896684
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_lookup.hpp|20040414082359|26530|1be71525ed9ee69
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_scan.cpp|20040414082359|29062|b040ad7670c24eb5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_delete_scan.hpp|20040414082359|31380|b9a11b4ec895d159
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml.cpp|20040414082359|33830|6826ad60f0f566e7
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml.hpp|20040414082359|36167|8fdbf19ad3174ca2
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml_column.cpp|20040414082359|38509|b71ce6186edf1655
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml_column.hpp|20040414082359|40901|a843b3418b30b7a3
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml_row.cpp|20040414082359|43239|17c791507b36cc06
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_dml_row.hpp|20040414082359|46942|33c4cffdd238728d
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_drop_index.cpp|20040414082359|54231|fc5cab67ae58d9f6
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_drop_index.hpp|20040414082359|55474|377c9eb280ec2ee2
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_drop_table.cpp|20040414082359|57899|9637d93efa68996a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_drop_table.hpp|20040414082359|60249|d671379125e4bbbe
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr.cpp|20040414082359|64572|fafd271880c70cf3
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr.hpp|20040414082359|01410|9e8243e99e0ec84
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_column.cpp|20040414082359|03836|4c4fbcd5741cc8cf
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_column.hpp|20040414082359|06355|9c4cbbdf432dc475
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_const.cpp|20040414082359|08702|bdb29dcd94ac5e73
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_const.hpp|20040414082359|12473|9c8789cff376b832
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_conv.cpp|20040414082359|15160|d252fbfe8ef55fff
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_conv.hpp|20040414082359|18741|5cbea39eecb92a43
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_func.cpp|20040414082359|21099|5d3996f062fa3f52
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_func.hpp|20040414082359|23589|22aee1e4f92c49b9
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_op.cpp|20040414082359|25965|e1aaa0244f2efa4
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_op.hpp|20040414082359|28432|4eb8c02dd0602f
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_param.cpp|20040414082359|30810|a5e94ee7c5821611
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_param.hpp|20040414082359|33263|ec441ad8ef21aa2b
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_row.cpp|20040414082400|01179|bc73d8f9c681d418
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_expr_row.hpp|20040414082400|03567|c541c49ea8c0c4f2
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_idx_column.cpp|20040414082400|06012|7d4d074ce5daea0a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_idx_column.hpp|20040414082400|08377|caabaafa34722be7
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_insert.cpp|20040414082400|10799|7d0ef7cc8f657fd5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_insert.hpp|20040414082400|14354|cc96fa9b81169471
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_pred.cpp|20040414082400|16798|56faa755aa42ddfa
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_pred.hpp|20040414082400|19159|eada43753e8b1e6c
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_pred_op.cpp|20040414082400|21533|47d693dde1a6d907
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_pred_op.hpp|20040414082400|23992|b42256983d2bda7b
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query.cpp|20040414082400|26355|4ac293821c9b4602
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query.hpp|20040414082400|28888|f86fbd9a108206c0
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_count.cpp|20040414082400|31247|9fa96a57d2dde660
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_count.hpp|20040414082400|33607|bdbe6e4734abc0c5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_distinct.cpp|20040414082400|37150|3ba18528aa67b9dd
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_distinct.hpp|20040414082400|39517|c12b2b7ff6b2e7b3
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_filter.cpp|20040414082400|41984|a3d067d5d8fb40c
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_filter.hpp|20040414082400|44363|d0a341f2e40f0183
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_group.cpp|20040414082400|46860|4443c844308f9a98
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_group.hpp|20040414082400|49266|ba4691be942c6e2a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_index.cpp|20040414082400|51663|f0312c9e2f22daf6
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_index.hpp|20040414082400|54471|6baaf1abbb704bb1
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_join.cpp|20040414082400|56943|36e07422c67d6838
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_join.hpp|20040414082400|59419|c4d17d18c4e3b4a0
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_lookup.cpp|20040414082400|61998|3d80e3ddbdae531d
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_lookup.hpp|20040414082400|00081|73332533e5196630
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_project.cpp|20040414082400|01373|ebc22f71bb7ec98c
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_project.hpp|20040414082400|03788|2734cdf1f907e0a4
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_range.cpp|20040414082400|06316|62ddafd2d17063cc
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_range.hpp|20040414082400|09865|81546843616efefa
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_repeat.cpp|20040414082400|11154|ce8f2a065897d6e3
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_repeat.hpp|20040414082400|13697|c20e10d0db9ad53c
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_scan.cpp|20040414082400|16320|855e56d6f56de938
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_scan.hpp|20040414082400|20784|b93c277da5b2509b
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_sort.cpp|20040414082400|24684|c08fc07f739de097
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_sort.hpp|20040414082400|25997|84edb5e128eda962
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_sys.cpp|20040414082400|28427|1d6a4a1cec789001
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_query_sys.hpp|20040414082400|31003|f5182823da25f097
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_root.cpp|20040414082400|33423|4c26a01ced583e41
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_root.hpp|20040414082401|01466|de1fd878505d9e26
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_select.cpp|20040414082401|04049|75b2a39f282d8ef5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_select.hpp|20040414082401|06512|f9fadc322d78033a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_set_row.cpp|20040414082401|08991|1bda7e6f86f18aef
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_set_row.hpp|20040414082401|12465|32ac3de384b91229
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_stmt.cpp|20040414082401|13817|c0e9903aa90df90b
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_stmt.hpp|20040414082401|17310|fab11fc487e74d05
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_table.cpp|20040414082401|20990|c46b7a6e2ecf4f61
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_table.hpp|20040414082401|22331|a48d57a0375a6d56
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_table_list.cpp|20040414082402|33460|40948eccedfae7bb
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_table_list.hpp|20040414082402|34739|c1e880e9949d3a
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update.cpp|20040414082402|37093|ed36f4a7a928a91b
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update.hpp|20040414082402|39546|c1de760c7b580b0c
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_index.cpp|20040414082402|42086|a0c6ad33ffbbc00e
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_index.hpp|20040414082402|44472|b57bbe5c8d927df9
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_lookup.cpp|20040414082402|46928|3491782088e97384
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_lookup.hpp|20040414082402|49343|ee335822c3496863
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_scan.cpp|20040414082402|51785|35e5b7d4619b3e09
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Code_update_scan.hpp|20040414082402|54180|287f193ad48fbefd
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/Makefile|20040414084435|20906|420b8378d374f069
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/SimpleGram.ypp|20040414082402|57791|6301cedf92524710
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/SimpleParser.cpp|20040414082402|60351|549f93e2a7fd01b5
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/SimpleParser.hpp|20040414082402|62814|4fdff7ee3839efc4
-magnus@neptunus.(none)|ndb/src/client/odbc/codegen/SimpleScan.lpp|20040414082402|65230|e11862b97fe39faf
-magnus@neptunus.(none)|ndb/src/client/odbc/common/AttrArea.cpp|20040414082402|03357|1570da617a1a6c4b
-magnus@neptunus.(none)|ndb/src/client/odbc/common/AttrArea.hpp|20040414082402|06048|f3d78ccd37af4e6
-magnus@neptunus.(none)|ndb/src/client/odbc/common/CodeTree.cpp|20040414082402|08438|1a4912632b0a61ee
-magnus@neptunus.(none)|ndb/src/client/odbc/common/CodeTree.hpp|20040414082402|10916|dcb603cce390eafa
-magnus@neptunus.(none)|ndb/src/client/odbc/common/ConnArea.cpp|20040414082402|13287|103182cf445f0bc3
-magnus@neptunus.(none)|ndb/src/client/odbc/common/ConnArea.hpp|20040414082402|16782|ffe99deedf7dc1ee
-magnus@neptunus.(none)|ndb/src/client/odbc/common/Ctx.cpp|20040414082402|18121|ce1c13ba8a312eba
-magnus@neptunus.(none)|ndb/src/client/odbc/common/Ctx.hpp|20040414082402|20500|bc88aba55ab71063
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataField.cpp|20040414082402|22982|6bb1fe1cb971c8f9
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataField.hpp|20040414082402|25733|d324898a9a86463d
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataRow.cpp|20040414082402|29367|8764a23cee4f9481
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataRow.hpp|20040414082402|31983|66a65eee1a1b2f23
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataType.cpp|20040414082402|34382|29b8ddd51fdd3a2f
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DataType.hpp|20040414082403|02299|adef26bc1dc940eb
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DescArea.cpp|20040414082403|04653|aab4edd7e336acdd
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DescArea.hpp|20040414082403|07055|20ba9b6484762f0f
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DiagArea.cpp|20040414082403|09406|e3662d8977947e67
-magnus@neptunus.(none)|ndb/src/client/odbc/common/DiagArea.hpp|20040414082403|11824|1c6595b5fac06eb2
-magnus@neptunus.(none)|ndb/src/client/odbc/common/Makefile|20040414084435|27122|8505f6b38fe5c219
-magnus@neptunus.(none)|ndb/src/client/odbc/common/OdbcData.cpp|20040414082403|16621|e557009c1ed1e017
-magnus@neptunus.(none)|ndb/src/client/odbc/common/OdbcData.hpp|20040414082403|19077|2125814c1293c0b3
-magnus@neptunus.(none)|ndb/src/client/odbc/common/ResultArea.cpp|20040414082403|21436|8bcc2a2d9a98b9b0
-magnus@neptunus.(none)|ndb/src/client/odbc/common/ResultArea.hpp|20040414082403|23832|8d4646b94be475d1
-magnus@neptunus.(none)|ndb/src/client/odbc/common/Sqlstate.cpp|20040414082403|26171|b844144af963c22c
-magnus@neptunus.(none)|ndb/src/client/odbc/common/Sqlstate.hpp|20040414082403|29665|60006ee1c27c6e5
-magnus@neptunus.(none)|ndb/src/client/odbc/common/StmtArea.cpp|20040414082403|32310|5c5f8613156e06b2
-magnus@neptunus.(none)|ndb/src/client/odbc/common/StmtArea.hpp|20040414082403|34785|9662e56ae164eb7f
-magnus@neptunus.(none)|ndb/src/client/odbc/common/StmtInfo.cpp|20040414082403|37141|54ee4040e5807214
-magnus@neptunus.(none)|ndb/src/client/odbc/common/StmtInfo.hpp|20040414082403|39465|6698d657391692fc
-magnus@neptunus.(none)|ndb/src/client/odbc/common/common.cpp|20040414082403|41862|4792b9ecddd99482
-magnus@neptunus.(none)|ndb/src/client/odbc/common/common.hpp|20040414082403|45229|25369fa6c80eff53
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictCatalog.cpp|20040414082403|46524|9804b0ff3eac2f8
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictCatalog.hpp|20040414082403|50152|cace2fb2f6bb65e5
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictColumn.cpp|20040414082403|56647|b69d90c53e5b618
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictColumn.hpp|20040414082403|58973|c2da1b7bd0408bd1
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictIndex.cpp|20040414082403|62455|a456d3039e6a39e3
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictIndex.hpp|20040414082403|64865|f53b91a41bb96663
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictSchema.cpp|20040414082403|01679|639403c84a47dfdd
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictSchema.hpp|20040414082403|04043|5aa7dc8ade17e94c
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictSys.cpp|20040414082403|06523|fb89465b10c32bb0
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictSys.hpp|20040414082403|08917|76583ba8aa88fd6f
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictTable.cpp|20040414082403|11346|8f4a9ee5a8038f87
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/DictTable.hpp|20040414082403|13733|cf99a9ac3dd49206
-magnus@neptunus.(none)|ndb/src/client/odbc/dictionary/Makefile|20040414084435|30267|4c1a6148787bdc2f
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/class.fig|20040414082403|16124|c0754ccad74d380a
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/descfield.pl|20040414082403|18935|e0bd59c2824824cc
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/diag.txt|20040414082403|21798|b66a7e227391335f
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/getinfo.pl|20040414082403|24266|2142ecf1567a66f6
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/gettypeinfo.pl|20040414082403|27572|2ea4c0589eac4e73
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/handleattr.pl|20040414082403|31383|b0c2a2901b68342e
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/main.hpp|20040414082404|00011|7b15eb7ffad488a0
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/ndbodbc.html|20040414082404|02501|a2f14fdd978b62cc
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/select.fig|20040414082404|04967|34f5222b5012e1d7
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/systables.pl|20040414082404|07386|1fa2191648bdb629
-magnus@neptunus.(none)|ndb/src/client/odbc/docs/type.txt|20040414082404|10311|feec700c81f5095f
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/Func.data|20040414082404|12860|9e75f15d921063f3
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/Func.pl|20040414082404|16530|aefb901bc3941d32
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/Makefile|20040414084435|24049|80d21270fc3ad931
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLAllocConnect.cpp|20040414082404|18964|246af836b028d810
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLAllocEnv.cpp|20040414082404|21279|eaf36cf2285ec2ac
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLAllocHandle.cpp|20040414082404|23612|c0921921e84d1a10
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp|20040414082404|27069|7d145f6e3640d913
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLAllocStmt.cpp|20040414082404|29405|362331ef456ec879
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLBindCol.cpp|20040414082404|31826|fec3a78088d4951d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLBindParam.cpp|20040414082404|34178|a50b619a23efaab
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLBindParameter.cpp|20040414082404|36965|533b1992496e2775
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLBrowseConnect.cpp|20040414082404|39327|120b61a1ff6edee3
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLBulkOperations.cpp|20040414082404|41701|7a96be04250a388
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLCancel.cpp|20040414082404|45242|27eab683f6fa6ec6
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLCloseCursor.cpp|20040414082404|47634|6cbf193aadaf1058
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLColAttribute.cpp|20040414082404|51528|f2c858b16a9360d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLColAttributes.cpp|20040414082404|53928|d4007908ee1309d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp|20040414082404|56456|39a3020da4c3485b
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLColumns.cpp|20040414082404|58871|1c31107df60bb544
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLConnect.cpp|20040414082404|62974|868e02a519b72743
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLCopyDesc.cpp|20040414082404|64271|286522b25a029761
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDataSources.cpp|20040414082404|01136|12792108aac5b2ca
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDescribeCol.cpp|20040414082404|03611|1d1faafbcd3ecb3c
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDescribeParam.cpp|20040414082404|06014|70b016fa795ed275
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDisconnect.cpp|20040414082404|08470|9fb4c3d7a84db50a
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDriverConnect.cpp|20040414082404|10866|8dad42af7d17a9d9
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLDrivers.cpp|20040414082404|13335|400e7453e70f6e99
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLEndTran.cpp|20040414082404|15741|c37cce04cc303c01
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLError.cpp|20040414082404|18143|593b81885c15187b
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLExecDirect.cpp|20040414082404|20664|5e6274e76315339d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLExecute.cpp|20040414082404|24388|1692a85f8639f71
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLExtendedFetch.cpp|20040414082404|27134|8b9d604580a83cfd
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFetch.cpp|20040414082404|29534|fa1606aa2dd901db
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFetchScroll.cpp|20040414082404|31991|cdb16803511963a1
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLForeignKeys.cpp|20040414082405|00096|4b8a9af2f6bf92cb
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFreeConnect.cpp|20040414082405|02501|92359420501ebc5b
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFreeEnv.cpp|20040414082405|04956|64f1776817464807
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFreeHandle.cpp|20040414082405|07349|2dc029edf912c2d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLFreeStmt.cpp|20040414082405|09791|8f8cb0a43c02a67
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp|20040414082405|13307|b29ff18aeedd8966
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetConnectOption.cpp|20040414082405|15755|3e0bc4e1af95c682
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetCursorName.cpp|20040414082405|19268|8266b920671b6d01
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetData.cpp|20040414082405|21785|3d837348460c219d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetDescField.cpp|20040414082405|24186|62828192a7d1d954
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetDescRec.cpp|20040414082405|26589|f54cc69bcd1238ad
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetDiagField.cpp|20040414082405|29075|673e1ea0f9d5121f
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetDiagRec.cpp|20040414082405|31498|bea0f68f5b940ab8
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp|20040414082405|33972|e742277d8bdf234d
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetFunctions.cpp|20040414082405|36391|72de050fbfb4a9bb
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetInfo.cpp|20040414082405|38935|e4e09d6bedbf02b1
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp|20040414082405|41363|de7dabc8c2acea7
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetStmtOption.cpp|20040414082405|43806|2ff900ebdd167077
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp|20040414082405|46378|333196b07473dff6
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLMoreResults.cpp|20040414082405|48899|483d94cb57379e81
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLNativeSql.cpp|20040414082405|51374|eeae6067f4a85c
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLNumParams.cpp|20040414082405|57810|8921304c3bcf4835
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLNumResultCols.cpp|20040414082405|59136|4d2b6527ffe81059
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLParamData.cpp|20040414082405|62648|163b046513f1e4ae
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLParamOptions.cpp|20040414082405|64040|bdcbccb961fff044
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLPrepare.cpp|20040414082405|00921|1d339fe24888087
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp|20040414082405|03420|5d7b2a0ae08a267
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLProcedureColumns.cpp|20040414082405|05843|c7a0535e9f50ff39
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLProcedures.cpp|20040414082405|08319|c59d025b22e2d1a6
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLPutData.cpp|20040414082405|11934|9dbf69ea9d369dbd
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLRowCount.cpp|20040414082405|14434|d4ac5b273afdb154
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp|20040414082405|16860|c2c520c34c41bd88
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetConnectOption.cpp|20040414082405|19298|dadc980d9f9cad1b
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetCursorName.cpp|20040414082405|21855|ccfc33dd2cf6abeb
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetDescField.cpp|20040414082405|24355|c4db694d1b9e8f77
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetDescRec.cpp|20040414082405|26866|f8dd72467d5012ab
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp|20040414082405|29480|7b50aeae6228c2db
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetParam.cpp|20040414082405|31915|e0dd2d5e8d3ec450
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetPos.cpp|20040414082405|34406|39a3e69960041aa7
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp|20040414082406|03524|6f8250379bb0cac8
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp|20040414082406|06008|e99b7e6025a1ae1f
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSetStmtOption.cpp|20040414082406|10068|87af3125a48c27fa
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLSpecialColumns.cpp|20040414082406|12486|1877b4c368825de5
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLStatistics.cpp|20040414082406|14949|87e0359f237aa66a
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLTablePrivileges.cpp|20040414082406|17508|fa16ea0fffa4edeb
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLTables.cpp|20040414082406|20645|c8b201068baec393
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/SQLTransact.cpp|20040414082406|23280|eb33c2f66ee85738
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/driver.cpp|20040414082406|25724|f8f1eeec35b08f18
-magnus@neptunus.(none)|ndb/src/client/odbc/driver/driver.hpp|20040414082406|29359|f108f4eef34ec8ea
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_comp_op.cpp|20040414082406|31800|eacbd7512b32d68b
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_create_index.cpp|20040414082406|35482|c6b8e670198adfa9
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_create_table.cpp|20040414082406|37927|76904d417bc0a59a
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_delete_index.cpp|20040414082406|40489|1ffe5af6eb160a68
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_delete_lookup.cpp|20040414082406|43115|5d24028ce16b6623
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_delete_scan.cpp|20040414082406|46919|810aa4058f73c941
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_drop_index.cpp|20040414082406|49349|3a3871ec6ee48c28
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_drop_table.cpp|20040414082406|51862|639a2faba4da14f4
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_expr_conv.cpp|20040414082406|54314|b5452bd4fbd7c945
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_expr_func.cpp|20040414082406|56759|c78ab0e67d54f38c
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_expr_op.cpp|20040414082406|59381|5e341b2e63495ba4
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_insert.cpp|20040414082406|61884|71dd4bf2fb913f2e
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_pred_op.cpp|20040414082406|64460|ebe7b65ba81e5185
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_query_index.cpp|20040414082406|01584|4cada676fa178001
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_query_lookup.cpp|20040414082406|05431|79dfe29b088d832
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_query_range.cpp|20040414082406|06819|7c4e148e81a292d6
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_query_scan.cpp|20040414082406|09339|7c66194f7f93346f
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_query_sys.cpp|20040414082406|11968|d66abe07cd519163
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_update_index.cpp|20040414082406|14543|86140a945f790890
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_update_lookup.cpp|20040414082406|17085|b7a7387620cf42ab
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Exec_update_scan.cpp|20040414082406|19743|2285c72106cffe0
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Executor.cpp|20040414082406|22273|ccb54cc8ffe18bae
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Executor.hpp|20040414082406|24762|c94d916ae5af2506
-magnus@neptunus.(none)|ndb/src/client/odbc/executor/Makefile|20040414084435|12419|a08f437558c2d3b4
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/AttrDbc.cpp|20040414082406|27307|24a034fbb22cdb23
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/AttrEnv.cpp|20040414082406|30042|7d74bcba78e149d0
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/AttrRoot.cpp|20040414082406|32507|5def5d7e228eedf0
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/AttrStmt.cpp|20040414082407|00551|5363ba63b35ff8f4
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/DescSpec.cpp|20040414082407|03310|cd50c1c855f1905
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/FuncTab.cpp|20040414082407|05927|e77abea11a532708
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleBase.cpp|20040414082407|08362|2ba63dce2dfec07b
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleBase.hpp|20040414082407|10820|8cf9a1e94d272328
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleDbc.cpp|20040414082407|13361|2a79fea6477b2c63
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleDbc.hpp|20040414082407|15852|9abc692ac6b0abb3
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleDesc.cpp|20040414082407|18335|e77eb1d73d171a98
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleDesc.hpp|20040414082407|20794|553aeb842b3da88e
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleEnv.cpp|20040414082407|23207|6b96fc6b188f252b
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleEnv.hpp|20040414082407|25666|572a7b4af6816f8b
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleRoot.cpp|20040414082407|28085|aa5044f74554fa9c
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleRoot.hpp|20040414082407|30587|2fcfca742c13cfb3
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleStmt.cpp|20040414082407|33024|782f96bda9eaf13c
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/HandleStmt.hpp|20040414082407|35570|6508fc97f3c772e1
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/InfoTab.cpp|20040414082407|38088|f89104b9c6fe7489
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/Makefile|20040414084435|15527|3d8d1529ad26ce76
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/PoolNdb.cpp|20040414082407|40567|793fa032699b7d98
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/PoolNdb.hpp|20040414082407|43172|db9e1a04d2fe705d
-magnus@neptunus.(none)|ndb/src/client/odbc/handles/handles.hpp|20040414082407|45564|bfe0b6a7a95ac142
-magnus@neptunus.(none)|ndb/src/ndbbaseclient/Makefile|20040414084439|01640|4b92d5e5b416dd0
-magnus@neptunus.(none)|ndb/src/ndbbaseclient/ndbbaseclient_dummy.cpp|20040414082426|08918|daee9eb6acbc94
-magnus@neptunus.(none)|ndb/src/ndbclient/Makefile|20040414084438|29978|f993f3afae0d4308
-magnus@neptunus.(none)|ndb/src/ndbclient/ndbclient_dummy.cpp|20040414082426|11587|73154070f5d0bfbf
-magnus@neptunus.(none)|ndb/src/newtonapi/Makefile|20040414084438|17704|bcbd9a7282094cc
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_binding.cpp|20040414082426|14355|dcc4fb57f9ab6cba
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_bulkread.cpp|20040414082426|17142|4ddfe02a93d2ba11
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_config.cpp|20040414082426|19935|38acf2ad3a932420
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_dac.cpp|20040414082426|10457|4615e3d0d8a15bff
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_error.cpp|20040414082426|12319|a58b4a1628a2d4b9
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_init.cpp|20040414082426|15064|80da7e3fa0775346
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_internal.hpp|20040414082426|17987|54884404e30c8823
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_process.cpp|20040414082426|22216|509e54294bc7efd2
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_process.hpp|20040414082426|24005|f0ddefb3b2d6a662
-magnus@neptunus.(none)|ndb/src/newtonapi/dba_schema.cpp|20040414082426|26757|1c3b8399853c108
-magnus@neptunus.(none)|ndb/src/rep/ExtSender.cpp|20040414082426|29555|1851d559cfddae43
-magnus@neptunus.(none)|ndb/src/rep/ExtSender.hpp|20040414082426|32345|10ae62ec85ee6692
-magnus@neptunus.(none)|ndb/src/rep/Makefile|20040414084438|44449|954f853c2d812c2c
-magnus@neptunus.(none)|ndb/src/rep/NodeConnectInfo.hpp|20040414082427|00605|9c4318dd55f3f84
-magnus@neptunus.(none)|ndb/src/rep/README|20040414082427|03407|6939b06d192a6b99
-magnus@neptunus.(none)|ndb/src/rep/RepApiInterpreter.cpp|20040414082427|06188|8ba561cb831ae353
-magnus@neptunus.(none)|ndb/src/rep/RepApiInterpreter.hpp|20040414082427|08968|31be5af2ba72d263
-magnus@neptunus.(none)|ndb/src/rep/RepApiService.cpp|20040414082427|11699|93d4005333167a0f
-magnus@neptunus.(none)|ndb/src/rep/RepApiService.hpp|20040414082432|07265|42f5ffb7e3baa54e
-magnus@neptunus.(none)|ndb/src/rep/RepCommandInterpreter.cpp|20040414082432|10009|f661a8ff312213f8
-magnus@neptunus.(none)|ndb/src/rep/RepCommandInterpreter.hpp|20040414082432|12750|fb6f22895e8c8679
-magnus@neptunus.(none)|ndb/src/rep/RepComponents.cpp|20040414082432|16488|fb067aee8e5a4a1f
-magnus@neptunus.(none)|ndb/src/rep/RepComponents.hpp|20040414082432|19179|9e632beac4f8bbf8
-magnus@neptunus.(none)|ndb/src/rep/RepMain.cpp|20040414082432|21936|de79cb7b6f3acd18
-magnus@neptunus.(none)|ndb/src/rep/Requestor.cpp|20040414082432|24636|c653fa987f84ce43
-magnus@neptunus.(none)|ndb/src/rep/Requestor.hpp|20040414082432|27340|a499054c9a128dbd
-magnus@neptunus.(none)|ndb/src/rep/RequestorSubscriptions.cpp|20040414082432|30099|f0643f7cc9aa9654
-magnus@neptunus.(none)|ndb/src/rep/SignalQueue.cpp|20040414082432|32849|6d32d876acc1a598
-magnus@neptunus.(none)|ndb/src/rep/SignalQueue.hpp|20040414082432|35536|b92204ff36f399d1
-magnus@neptunus.(none)|ndb/src/rep/TODO|20040414082432|38233|187896dd2e5dfd02
-magnus@neptunus.(none)|ndb/src/rep/adapters/AppNDB.cpp|20040414082432|46457|1db5eafacdeda3b7
-magnus@neptunus.(none)|ndb/src/rep/adapters/AppNDB.hpp|20040414082432|49233|2c3081224b4ff75f
-magnus@neptunus.(none)|ndb/src/rep/adapters/ExtAPI.cpp|20040414082432|51989|d98f38669b10ca97
-magnus@neptunus.(none)|ndb/src/rep/adapters/ExtAPI.hpp|20040414082432|54656|32bcb96bcd2d60c
-magnus@neptunus.(none)|ndb/src/rep/adapters/ExtNDB.cpp|20040414082432|57410|38cccb80529c02c6
-magnus@neptunus.(none)|ndb/src/rep/adapters/ExtNDB.hpp|20040414082432|60222|ee245e7e2c707685
-magnus@neptunus.(none)|ndb/src/rep/adapters/Makefile|20040414084438|21912|bcb9d87fd69a7911
-magnus@neptunus.(none)|ndb/src/rep/adapters/TableInfoPs.hpp|20040414082432|62988|56b1f8f75fe7cb1c
-magnus@neptunus.(none)|ndb/src/rep/dbug_hack.cpp|20040414082432|40989|f090906a24103f0
-magnus@neptunus.(none)|ndb/src/rep/rep_version.hpp|20040414082432|43779|82a23fe4dbb13cab
-magnus@neptunus.(none)|ndb/src/rep/repapi/Makefile|20040414084438|41386|25c4b35b84d945b4
-magnus@neptunus.(none)|ndb/src/rep/repapi/repapi.cpp|20040414082432|00155|82b9b00c67cfdcf7
-magnus@neptunus.(none)|ndb/src/rep/repapi/repapi.h|20040414082432|02987|6f8cf6b53a86a5ae
-magnus@neptunus.(none)|ndb/src/rep/state/Channel.cpp|20040414082432|05711|1d5f62245962b839
-magnus@neptunus.(none)|ndb/src/rep/state/Channel.hpp|20040414082432|08527|71c1d63ef4b2cbfe
-magnus@neptunus.(none)|ndb/src/rep/state/Interval.cpp|20040414082432|11324|3d079ca9cc21124d
-magnus@neptunus.(none)|ndb/src/rep/state/Interval.hpp|20040414082432|14048|85aa46fc419bb109
-magnus@neptunus.(none)|ndb/src/rep/state/Makefile|20040414084438|33082|6a9cedaeedcc4650
-magnus@neptunus.(none)|ndb/src/rep/state/RepState.cpp|20040414082432|16760|3d60b0a46e9477c1
-magnus@neptunus.(none)|ndb/src/rep/state/RepState.hpp|20040414082432|19671|94d7c472c8a7367
-magnus@neptunus.(none)|ndb/src/rep/state/RepStateEvent.cpp|20040414082432|22494|f51d7eb7b7aca0b
-magnus@neptunus.(none)|ndb/src/rep/state/RepStateRequests.cpp|20040414082432|25234|393882166df6929
-magnus@neptunus.(none)|ndb/src/rep/state/testInterval/Makefile|20040414084438|35164|e33e587a7947ac36
-magnus@neptunus.(none)|ndb/src/rep/state/testInterval/testInterval.cpp|20040414082432|27995|993f4118f616e80
-magnus@neptunus.(none)|ndb/src/rep/state/testRepState/Makefile|20040414084438|28225|f5a6d9415d7e0977
-magnus@neptunus.(none)|ndb/src/rep/state/testRepState/testRequestor.cpp|20040414082432|30850|4a943fae5be63c79
-magnus@neptunus.(none)|ndb/src/rep/state/testRepState/testRequestor.hpp|20040414082432|33580|583208c83ff5b554
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIBuffer.cpp|20040414082433|01915|6e8c6f38ab63d1d6
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIBuffer.hpp|20040414082433|04667|703e2016a7ec616f
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIContainer.cpp|20040414082433|07490|9c53acd16fc5ac74
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIContainer.hpp|20040414082433|10275|ac28cea9114659fd
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIContainerPS.cpp|20040414082433|13103|116168903a2c617a
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIContainerPS.hpp|20040414082433|15896|9a801ffe939e192e
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIPage.cpp|20040414082433|18724|42fa918fbf36828a
-magnus@neptunus.(none)|ndb/src/rep/storage/GCIPage.hpp|20040414082433|22604|4197e2278326515e
-magnus@neptunus.(none)|ndb/src/rep/storage/LogRecord.hpp|20040414082433|25752|11644fe7c5f5d36
-magnus@neptunus.(none)|ndb/src/rep/storage/Makefile|20040414084438|25055|a955d34726662aba
-magnus@neptunus.(none)|ndb/src/rep/storage/NodeConnectInfo.hpp|20040414082433|28517|35a7682fd9dba464
-magnus@neptunus.(none)|ndb/src/rep/storage/NodeGroup.cpp|20040414082433|31343|adebbefb11cd1670
-magnus@neptunus.(none)|ndb/src/rep/storage/NodeGroup.hpp|20040414082433|34127|3fcddc2da5d10e45
-magnus@neptunus.(none)|ndb/src/rep/storage/NodeGroupInfo.cpp|20040414082433|36945|b1130e3c42777658
-magnus@neptunus.(none)|ndb/src/rep/storage/NodeGroupInfo.hpp|20040414082433|39718|7fd3b74f4b59a503
-magnus@neptunus.(none)|ndb/src/rep/transfer/Makefile|20040414084438|38260|6b43df78ea480db1
-magnus@neptunus.(none)|ndb/src/rep/transfer/TransPS.cpp|20040414082433|43592|7a88ca746987ac10
-magnus@neptunus.(none)|ndb/src/rep/transfer/TransPS.hpp|20040414082433|46546|846b26eaa80632a1
-magnus@neptunus.(none)|ndb/src/rep/transfer/TransSS.cpp|20040414082433|49370|8f12a062b240eecf
-magnus@neptunus.(none)|ndb/src/rep/transfer/TransSS.hpp|20040414082433|52255|7718b5e4ce9a4007
-magnus@neptunus.(none)|ndb/src/rep/transfer/TransSSSubscriptions.cpp|20040414082433|55067|6bc55e474f33e023
-magnus@neptunus.(none)|ndb/tools/ndbnet/Makefile.PL|20040414082442|56473|81be90388548652f
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net.pm|20040414082442|02828|425c84165071d5f6
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Base.pm|20040414082442|11671|50a6f0d38fa1a57c
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Client.pm|20040414082442|14568|45adb527c5cfdaf6
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Command.pm|20040414082442|17582|a20dff1bfd06ea7a
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Config.pm|20040414082442|20612|24456d4beba19604
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Database.pm|20040414082442|23641|cc02e455b02c557
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Env.pm|20040414082442|26624|ffeca4ab253818c3
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Node.pm|20040414082442|29671|276106bf4000fe2b
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/NodeApi.pm|20040414082442|32765|3abf1d7bc947d3d0
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/NodeDb.pm|20040414082443|01346|9e3055381da679ce
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/NodeMgmt.pm|20040414082443|04349|5123fbffcfce73cb
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/Server.pm|20040414082443|07453|70208c964371fd4d
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/ServerINET.pm|20040414082443|10474|fc72d28fedd17795
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Net/ServerUNIX.pm|20040414082443|13573|ad3e25435fceb8d0
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Run.pm|20040414082442|05790|9b414f2b4b76a4da
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Run/Base.pm|20040414082443|16656|dd382c9eec2c38b1
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Run/Database.pm|20040414082443|19701|ec533cd5dd6a54a2
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Run/Env.pm|20040414082443|22716|a343841fae6d0514
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Run/Node.pm|20040414082443|25798|339139ded5fcf795
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util.pm|20040414082442|08694|9be64f1195ec502d
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Base.pm|20040414082443|28821|f39906f304e8a49
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Dir.pm|20040414082443|31912|4cbe8dd8c57149a7
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Event.pm|20040414082443|35023|f445c1c094f57cf
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/File.pm|20040414082443|38178|48da8e977f39bf7
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/IO.pm|20040414082443|41286|6c6a63ce63fe2ee5
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Lock.pm|20040414082443|44445|366e56786358b3d8
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Log.pm|20040414082443|47535|e0da9468a6f9213a
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/Socket.pm|20040414082443|50710|371ccd6c5a818fa0
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/SocketINET.pm|20040414082443|53816|db8a45b1360b69f2
-magnus@neptunus.(none)|ndb/tools/ndbnet/lib/NDB/Util/SocketUNIX.pm|20040414082443|56977|9ffab2ada7f61530
-magnus@neptunus.(none)|ndb/tools/ndbnet/ndbnet.pl|20040414082442|59371|8f8f1b18f0458269
-magnus@neptunus.(none)|ndb/tools/ndbnet/ndbnetd.pl|20040414082442|62363|e44f1cfe7e8bbe14
-magnus@neptunus.(none)|ndb/tools/ndbnet/ndbrun|20040414082442|65454|5db549d7436ac81b
-miguel@hegel.local|zlib/ChangeLog|20020319032513|28917|5d5425fc84737083
-miguel@hegel.local|zlib/Make_vms.com|20020319032513|57151|35050a50ec612bbf
-miguel@hegel.local|zlib/Makefile.riscos|20020319032513|63798|8ab53f195fe429af
-miguel@hegel.local|zlib/adler32.c|20020319032513|04487|f98728c6da1ac164
-miguel@hegel.local|zlib/algorithm.txt|20020319032513|12903|fbc4dda3d31c2005
-miguel@hegel.local|zlib/amiga/Makefile.pup|20020319032513|19225|6a9ee8128d11541f
-miguel@hegel.local|zlib/amiga/Makefile.sas|20020319032513|25562|d7128ac7e0946f0b
-miguel@hegel.local|zlib/compress.c|20020319032513|32512|70bccb304651dba9
-miguel@hegel.local|zlib/contrib/README.contrib|20020319032514|04353|24cb75bee0a061fb
-miguel@hegel.local|zlib/contrib/asm386/gvmat32.asm|20020319032514|12654|31093c1a846dfdc7
-miguel@hegel.local|zlib/contrib/asm386/gvmat32c.c|20020319032514|19182|2a8eba5481c46eab
-miguel@hegel.local|zlib/contrib/asm386/mkgvmt32.bat|20020319032514|25425|422cbe16a6e74695
-miguel@hegel.local|zlib/contrib/asm386/zlibvc.def|20020319032514|31637|605ee23b8a4a6a1a
-miguel@hegel.local|zlib/contrib/asm386/zlibvc.dsp|20020319032514|38372|a1c6749052ce48a
-miguel@hegel.local|zlib/contrib/asm386/zlibvc.dsw|20020319032514|44870|3209982720f131ab
-miguel@hegel.local|zlib/contrib/asm586/match.s|20020319032514|51538|dc1a34b5eb2a7c11
-miguel@hegel.local|zlib/contrib/asm586/readme.586|20020319032514|57815|f60bfeefb27217d
-miguel@hegel.local|zlib/contrib/asm686/match.s|20020319032514|64199|4164951e8e19f116
-miguel@hegel.local|zlib/contrib/asm686/readme.686|20020319032514|04933|15e2bf4653b71f3e
-miguel@hegel.local|zlib/contrib/delphi/zlib.mak|20020319032514|11153|7b97eb8cf290a42
-miguel@hegel.local|zlib/contrib/delphi/zlibdef.pas|20020319032514|18918|658cb04db561e3db
-miguel@hegel.local|zlib/contrib/delphi2/d_zlib.bpr|20020319032514|25335|c267d77cc2e2a2c8
-miguel@hegel.local|zlib/contrib/delphi2/d_zlib.cpp|20020319032514|31641|d6f37620ac7b27fa
-miguel@hegel.local|zlib/contrib/delphi2/readme.txt|20020319032515|03494|65d16837f8579e23
-miguel@hegel.local|zlib/contrib/delphi2/zlib.bpg|20020319032515|09768|93c030edcca1838
-miguel@hegel.local|zlib/contrib/delphi2/zlib.bpr|20020319032515|16113|7a2fa98af2345144
-miguel@hegel.local|zlib/contrib/delphi2/zlib.cpp|20020319032515|22372|4257437d415259e2
-miguel@hegel.local|zlib/contrib/delphi2/zlib.pas|20020319032515|28965|3c94d3f5262cbbdd
-miguel@hegel.local|zlib/contrib/delphi2/zlib32.bpr|20020319032515|35585|41ac53acb8008ff7
-miguel@hegel.local|zlib/contrib/delphi2/zlib32.cpp|20020319032515|41979|3b0f51435e880afe
-miguel@hegel.local|zlib/contrib/iostream/test.cpp|20020319032515|48225|a2ea8d4d7c66cf71
-miguel@hegel.local|zlib/contrib/iostream/zfstream.cpp|20020319032515|55262|dce18d1a5d7096b7
-miguel@hegel.local|zlib/contrib/iostream/zfstream.h|20020319032515|61553|2b4d88acc2d3b714
-miguel@hegel.local|zlib/contrib/iostream2/zstream.h|20020319032515|02537|351f26518ea48196
-miguel@hegel.local|zlib/contrib/iostream2/zstream_test.cpp|20020319032515|08848|63f635d540de8c48
-miguel@hegel.local|zlib/contrib/minizip/ChangeLogUnzip|20020319032515|15183|50464416f4a3768f
-miguel@hegel.local|zlib/contrib/minizip/miniunz.c|20020319032515|21943|6a80009b319b1b9e
-miguel@hegel.local|zlib/contrib/minizip/minizip.c|20020319032515|28588|97181367a7bc47d8
-miguel@hegel.local|zlib/contrib/minizip/readme.txt|20020319032516|00611|7547b986c067c008
-miguel@hegel.local|zlib/contrib/minizip/unzip.c|20020319032516|07891|c66c95e17321206d
-miguel@hegel.local|zlib/contrib/minizip/unzip.def|20020319032516|14456|b4162b8c833ab6c7
-miguel@hegel.local|zlib/contrib/minizip/unzip.h|20020319032516|21001|bac981086af91a30
-miguel@hegel.local|zlib/contrib/minizip/zip.c|20020319032516|27911|e82bf7774e1ece95
-miguel@hegel.local|zlib/contrib/minizip/zip.def|20020319032516|34413|e9bda2081d65c22e
-miguel@hegel.local|zlib/contrib/minizip/zip.h|20020319032516|40925|17fd39ccb4ea294c
-miguel@hegel.local|zlib/contrib/minizip/zlibvc.def|20020319032516|47259|6dc42f99d2d55cad
-miguel@hegel.local|zlib/contrib/minizip/zlibvc.dsp|20020319032516|54044|ec35fd54c9b49987
-miguel@hegel.local|zlib/contrib/minizip/zlibvc.dsw|20020319032516|60515|17f28194a5cd80ea
-miguel@hegel.local|zlib/contrib/untgz/makefile.w32|20020319032516|01267|2c584f05a16db4ba
-miguel@hegel.local|zlib/contrib/untgz/untgz.c|20020319032516|07726|b74e9dde74642756
-miguel@hegel.local|zlib/contrib/visual-basic.txt|20020319032516|14096|cd461e762199bb09
-miguel@hegel.local|zlib/crc32.c|20020319032516|20397|b327da5b8cf9eae8
-miguel@hegel.local|zlib/deflate.c|20020319032516|26978|e22894a54233bc25
-miguel@hegel.local|zlib/deflate.h|20020319032516|33700|3a012bc1f5dfbc74
-miguel@hegel.local|zlib/descrip.mms|20020319032517|08063|7d61d33062ef53ec
-miguel@hegel.local|zlib/example.c|20020319032517|14327|490f57a4a9440dfa
-miguel@hegel.local|zlib/faq|20020319032517|20799|b0d0840d3b9faf07
-miguel@hegel.local|zlib/gzio.c|20020319032517|27098|e02d23e656c19359
-miguel@hegel.local|zlib/index|20020319032517|33542|5443c9f841db4a47
-miguel@hegel.local|zlib/infblock.c|20020319032517|39853|540cc1b743be5f58
-miguel@hegel.local|zlib/infblock.h|20020319032517|46202|4526bc327b4160ab
-miguel@hegel.local|zlib/infcodes.c|20020319032517|52620|dffb42fdf2fb2372
-miguel@hegel.local|zlib/infcodes.h|20020319032517|58960|3a02220a89c9a4fa
-miguel@hegel.local|zlib/inffast.c|20020319032517|65269|bf247ff4aa2bf54b
-miguel@hegel.local|zlib/inffast.h|20020319032517|06651|215e4a4ccfc886fc
-miguel@hegel.local|zlib/inffixed.h|20020319032517|12923|e86ef8e2efe23f77
-miguel@hegel.local|zlib/inflate.c|20020319032517|19311|fb22a3a1ab6fb1a0
-miguel@hegel.local|zlib/inftrees.c|20020319032517|25758|4fcb97357cdbc40
-miguel@hegel.local|zlib/inftrees.h|20020319032517|32227|ffcbe51816466e5c
-miguel@hegel.local|zlib/infutil.c|20020319032518|05244|a9b414f0f4ea0868
-miguel@hegel.local|zlib/infutil.h|20020319032518|12977|13089e09be34788c
-miguel@hegel.local|zlib/maketree.c|20020319032518|19299|7f281aef3547fee
-miguel@hegel.local|zlib/minigzip.c|20020319032518|25601|37f8eacb80c7f8fc
-miguel@hegel.local|zlib/msdos/Makefile.b32|20020319032518|33760|86772037f3344353
-miguel@hegel.local|zlib/msdos/Makefile.bor|20020319032518|40099|7aa9edaac099cdb9
-miguel@hegel.local|zlib/msdos/Makefile.dj2|20020319032518|46371|ca26f5fe96e3e999
-miguel@hegel.local|zlib/msdos/Makefile.emx|20020319032518|52757|64efbf8cedc146b5
-miguel@hegel.local|zlib/msdos/Makefile.msc|20020319032518|59050|1bb69abdddf390f2
-miguel@hegel.local|zlib/msdos/Makefile.tc|20020319032518|65341|2a9dff916115ae77
-miguel@hegel.local|zlib/msdos/Makefile.w32|20020319032518|06083|8d84523c1dcdc0f7
-miguel@hegel.local|zlib/msdos/Makefile.wat|20020319032518|12471|82f8714d825e97e3
-miguel@hegel.local|zlib/msdos/zlib.def|20020319032518|18787|165cd7dcff6ac9f
-miguel@hegel.local|zlib/msdos/zlib.rc|20020319032518|25240|f8a286fa8371ee09
-miguel@hegel.local|zlib/nt/Makefile.emx|20020319032518|31715|7e9fcf6f5ad2e51a
-miguel@hegel.local|zlib/nt/Makefile.gcc|20020319032519|03630|351fa8bd15c704b9
-miguel@hegel.local|zlib/nt/Makefile.nt|20020319032519|09990|ee461a3dd393a061
-miguel@hegel.local|zlib/nt/zlib.dnt|20020319032519|16279|22a0ed3b86ff8c2
-miguel@hegel.local|zlib/os2/Makefile.os2|20020319032519|22554|7a05f2a27812703a
-miguel@hegel.local|zlib/os2/zlib.def|20020319032519|28842|1166a95d83c5f52c
-miguel@hegel.local|zlib/readme|20020319032519|35257|80a41fc822f5f4
-miguel@hegel.local|zlib/trees.c|20020319032519|43770|4fbd4d005e26d38
-miguel@hegel.local|zlib/trees.h|20020319032519|50674|87161133bc2155fd
-miguel@hegel.local|zlib/uncompr.c|20020319032519|57111|82eac43195d1222c
-miguel@hegel.local|zlib/zconf.h|20020319032519|63437|c6b6b636c7e88d90
-miguel@hegel.local|zlib/zlib.3|20020319032519|04298|ec5cb4f64476f6a
-miguel@hegel.local|zlib/zlib.dsp|20020319032519|12016|6eec436fab260061
-miguel@hegel.local|zlib/zlib.html|20020319032519|31060|7a635f4ac95fc56b
-miguel@hegel.local|zlib/zlib.h|20020319032519|20598|fbec7833981c782f
-miguel@hegel.local|zlib/zutil.c|20020319032520|05372|6f0d1763c5deb409
-miguel@hegel.local|zlib/zutil.h|20020319032520|12556|1e431b0173278fb2
-mikef@nslinux.bedford.progress.com|mysql-test/include/have_gemini.inc|20010321203410|40631|42f94f0dfd0f7b18
-mikef@nslinux.bedford.progress.com|mysql-test/r/have_gemini.require|20010321203410|47052|206702c48b2e206b
-monty@donna.mysql.com|innobase/ib_config.h.in|20010217121901|07616|9e57db8504e55b7
-monty@donna.mysql.com|innobase/ib_config.h|20010217121901|04019|7539e26ffc614439
-monty@donna.mysql.com|myisam/mi_debug.c|20000829092809|23459|873a6e7d6ff8297c
-monty@donna.mysql.com|mysql-test/include/have_default_master.inc|20010104005638|23980|a54c86e65a6c4af
-monty@donna.mysql.com|mysql-test/r/have_default_master.require|20010104005638|27332|1465255ffdaf82f
-monty@donna.mysql.com|sql-bench/Results-linux/ATIS-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|34755|45d7837423db243f
-monty@donna.mysql.com|sql-bench/Results-linux/ATIS-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|37262|2274651e29d38b07
-monty@donna.mysql.com|sql-bench/Results-linux/RUN-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|39831|a6ef8229d40b75d1
-monty@donna.mysql.com|sql-bench/Results-linux/RUN-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|42374|65ccbcd7b1c4d7b5
-monty@donna.mysql.com|sql-bench/Results-linux/alter-table-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|44909|de84e4a2fd07f53
-monty@donna.mysql.com|sql-bench/Results-linux/alter-table-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|47422|ee162dd1474ba9d8
-monty@donna.mysql.com|sql-bench/Results-linux/big-tables-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|49948|d11a751a268a4df3
-monty@donna.mysql.com|sql-bench/Results-linux/big-tables-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|52469|c13eca5ec25cd6e1
-monty@donna.mysql.com|sql-bench/Results-linux/connect-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|54998|dfaa50e67eb15556
-monty@donna.mysql.com|sql-bench/Results-linux/connect-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|57532|4015a2bef627d8cd
-monty@donna.mysql.com|sql-bench/Results-linux/create-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|60103|fa19b9a2c7a3c3c
-monty@donna.mysql.com|sql-bench/Results-linux/create-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|62710|21ec8ba1ea3ca4c4
-monty@donna.mysql.com|sql-bench/Results-linux/insert-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|65289|a02aceb3b30de493
-monty@donna.mysql.com|sql-bench/Results-linux/insert-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|02393|7c9baa774fc324e1
-monty@donna.mysql.com|sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|05001|da73eefa16ca9383
-monty@donna.mysql.com|sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|07610|cffd7d282a90113a
-monty@donna.mysql.com|sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|10615|8dcd7271a9137341
-monty@donna.mysql.com|sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|13213|4398328883aa75da
-monty@donna.mysql.com|sql-bench/Results/ATIS-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|14134|cf0d806760eefef2
-monty@donna.mysql.com|sql-bench/Results/ATIS-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|14777|e625af7f600bf930
-monty@donna.mysql.com|sql-bench/Results/RUN-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|15344|d922a0fcc1009130
-monty@donna.mysql.com|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|15933|840503a555e420ec
-monty@donna.mysql.com|sql-bench/Results/alter-table-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|16525|2f516d2c108a9e05
-monty@donna.mysql.com|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|17106|6e532c1936df1737
-monty@donna.mysql.com|sql-bench/Results/big-tables-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|17709|6d8209bf72b663ed
-monty@donna.mysql.com|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|18309|c87333d6fe04433e
-monty@donna.mysql.com|sql-bench/Results/connect-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|18910|7ed15d6fd1a5944c
-monty@donna.mysql.com|sql-bench/Results/connect-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|19522|ab58fffa30dce97e
-monty@donna.mysql.com|sql-bench/Results/create-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|20136|241c337935ae1524
-monty@donna.mysql.com|sql-bench/Results/create-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|20766|4e5a2ab4907748d4
-monty@donna.mysql.com|sql-bench/Results/insert-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|22042|27b7a557c3cb07a
-monty@donna.mysql.com|sql-bench/Results/insert-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|22723|a85a6f0477c13f83
-monty@donna.mysql.com|sql-bench/Results/select-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|23395|8ef771713f89e1
-monty@donna.mysql.com|sql-bench/Results/select-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|24071|4f7795c27eaab86b
-monty@donna.mysql.com|sql-bench/Results/wisconsin-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|24748|6a468dcd3e6f5405
-monty@donna.mysql.com|sql-bench/Results/wisconsin-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|25437|24a02e007a58bf73
-monty@donna.mysql.fi|sql/violite.c|20010523223654|08838|53d4251a69d3c
-monty@hundin.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|32241|dd306b2e583ebde4
-monty@hundin.mysql.fi|sql-bench/Results/ATIS-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|59551|d002b0bc548ff8b3
-monty@hundin.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|35759|11038a44f73070e7
-monty@hundin.mysql.fi|sql-bench/Results/RUN-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|63204|e938a858bd12aa8d
-monty@hundin.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|39143|662b96bc66bc91b6
-monty@hundin.mysql.fi|sql-bench/Results/alter-table-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|01419|14360865bbba479f
-monty@hundin.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|42711|788ad492867b1226
-monty@hundin.mysql.fi|sql-bench/Results/big-tables-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|05113|b6be70bb51013cad
-monty@hundin.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|46284|5316add301edb60
-monty@hundin.mysql.fi|sql-bench/Results/connect-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|08804|1b715c6fd72e913e
-monty@hundin.mysql.fi|sql-bench/Results/create-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|49804|26e09af61f88d8c9
-monty@hundin.mysql.fi|sql-bench/Results/create-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|12309|f3b1d326092bf44
-monty@hundin.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|53328|fd2699adb3190d07
-monty@hundin.mysql.fi|sql-bench/Results/insert-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|15984|a0143553cccb54e2
-monty@hundin.mysql.fi|sql-bench/Results/select-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|56860|b01175ad38fd12b6
-monty@hundin.mysql.fi|sql-bench/Results/select-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|19688|4ffc9cf4be665ea2
-monty@hundin.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|60398|8ba598d217450157
-monty@hundin.mysql.fi|sql-bench/Results/wisconsin-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|23386|1ed1dc6abd24e7e3
-monty@hundin.mysql.fi|support-files/make_mysql_pkg.sh|20010915122456|03682|c616a18bed4b9c2
-monty@narttu.mysql.com|sql-bench/Results/ATIS-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|04677|f761da5546f0d362
-monty@narttu.mysql.com|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|07879|2ac8fe298953d43
-monty@narttu.mysql.com|sql-bench/Results/RUN-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|09727|79ac0482599eace1
-monty@narttu.mysql.com|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171904|13285|a88e954bc8de5460
-monty@narttu.mysql.com|sql-bench/Results/alter-table-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|11725|dfc480becae45236
-monty@narttu.mysql.com|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|13605|ee94f987797ca948
-monty@narttu.mysql.com|sql-bench/Results/big-tables-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|15583|a2a77f37b689cd63
-monty@narttu.mysql.com|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|17580|28b688e2cd4b6bb3
-monty@narttu.mysql.com|sql-bench/Results/connect-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|19531|7dd5ac726f86cf0b
-monty@narttu.mysql.com|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|21574|1cf5d5f0d70a3fa0
-monty@narttu.mysql.com|sql-bench/Results/create-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|23516|441a6aefd381e319
-monty@narttu.mysql.com|sql-bench/Results/create-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|25516|fc207468e871ff69
-monty@narttu.mysql.com|sql-bench/Results/insert-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|27509|d12a7edef05d7185
-monty@narttu.mysql.com|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|29606|975e26cac59161fa
-monty@narttu.mysql.com|sql-bench/Results/select-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|33684|ddcf36cdf3f72e8c
-monty@narttu.mysql.com|sql-bench/Results/select-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|35818|34a39fbcb58d8945
-monty@narttu.mysql.com|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|37931|2db07249379f36
-monty@narttu.mysql.com|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|40155|8101a5823c17e58a
-monty@narttu.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.2.13_SMP_alpha|20001014001004|08145|21ddf9425cbdd58
-monty@narttu.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|06287|d275df58a04737c8
-monty@narttu.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.2.13_SMP_alpha|20001014001004|13092|583091e05a25fb6
-monty@narttu.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|21374|d4766c7f8e70d7a2
-monty@narttu.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.2.13_SMP_alpha|20001014001004|15829|6c20c9ef46f82241
-monty@narttu.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|25875|155a83b53c0e9d6
-monty@narttu.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.2.13_SMP_alpha|20001014001004|18602|e8cc899bb933532f
-monty@narttu.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|30548|f1127add9307098b
-monty@narttu.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.2.13_SMP_alpha|20001014001004|21372|84df7c6446e51e26
-monty@narttu.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|00237|45d2cdf9bea9cc37
-monty@narttu.mysql.fi|sql-bench/Results/create-mysql-Linux_2.2.13_SMP_alpha|20001014001004|23947|2c9af91e9771f618
-monty@narttu.mysql.fi|sql-bench/Results/create-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|04134|d46860c29c5d51ee
-monty@narttu.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.2.13_SMP_alpha|20001014001004|26814|688809eb8ea77b3d
-monty@narttu.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|07880|e1771e0a164bc310
-monty@narttu.mysql.fi|sql-bench/Results/select-mysql-Linux_2.2.13_SMP_alpha|20001014001004|29737|db59425a7f4aa93f
-monty@narttu.mysql.fi|sql-bench/Results/select-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|11605|ee2a063d66a183d
-monty@narttu.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.2.13_SMP_alpha|20001014001004|32465|fc410754151d622c
-monty@narttu.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|15116|b7552710d35202b6
-monty@work.mysql.com|fs/fsck.mysql|20010411110350|07619|87170d4358b50d60
-monty@work.mysql.com|libmysqld/README|20010411110351|24268|434e9cae5fa9a4c4
-monty@work.mysql.com|libmysqld/WHITEPAPER|20010411110351|28263|da1226799debcf3f
-mwagner@cash.mwagner.org|Docs/include.de.texi|20020223092123|06028|112aac21b3489888
-mwagner@evoq.home.mwagner.org|Docs/Books/algor.eps|20001231203219|20480|481984607c98d715
-mwagner@evoq.home.mwagner.org|Docs/Books/dbi.eps|20001231203219|30594|6ad58f9457e2a564
-mwagner@evoq.home.mwagner.org|Docs/Books/dubois.eps|20001231203219|33725|aa3d9c08bbcc149b
-mwagner@evoq.home.mwagner.org|Docs/Books/ecomm.eps|20001231203220|02445|58ae914b5d5ea49
-mwagner@evoq.home.mwagner.org|Docs/Books/in_21.eps|20001231203220|05743|83a7604251d68ebd
-mwagner@evoq.home.mwagner.org|Docs/Books/manual.eps|20001231203220|09365|2a7145f88960c7ec
-mwagner@evoq.home.mwagner.org|Docs/Books/msql.eps|20001231203220|12487|ffe7d62847663250
-mwagner@evoq.home.mwagner.org|Docs/Books/prof.eps|20001231203220|15779|dc69b039543a57d7
-mwagner@evoq.home.mwagner.org|Docs/Books/pthreads.eps|20001231203220|18899|d60ad51891ef4c49
-mwagner@evoq.home.mwagner.org|Docs/Books/realmen.eps|20001231203220|22075|1ceb4839e835dad4
-mwagner@evoq.home.mwagner.org|Docs/Books/sql-99.eps|20001231203220|25230|cec4ae16fee4c640
-mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b9394876
-mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b93948768
-mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.tst|20001013104933|54568|2e626fa07144d2c8
-mwagner@evoq.home.mwagner.org|mysql-test/mybin/start-mysqld|20001016055648|54840|9c8f21a7ab97793a
-mwagner@evoq.home.mwagner.org|mysql-test/mybin/stop-mysqld|20001016055653|20710|89a1194045f05d1c
-mwagner@evoq.home.mwagner.org|mysql-test/mybin/translate-tests|20001018130217|00206|3869c1fdf0a5ea1a
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.22/README|20001009213643|04628|2bddc2706d0834d0
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/README|20001009213643|10190|f9fd36f3c3711305
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000004.result|20001017133900|06471|1f8d1265be521c17
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000005.result|20001017133900|07980|d5410bb765199cc5
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000006.result|20001017133900|09337|d38004d1acfc11a5
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000007.result|20001017133900|10672|df455e49f9727c4f
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000008.result|20001017133900|11918|67a459ff62c84d6a
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000009.result|20001017133900|13159|e042b35ab131fb3
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000010.result|20001017133900|14408|eee5b9631a1e0066
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000011.result|20001017133900|15675|6907fe356973ed25
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000012.result|20001017133900|16957|be18991fc28954c2
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000013.result|20001017133900|18248|513389e06c96af73
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000014.result|20001017133900|19568|fc8de0ec89d9e35
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000015.result|20001017133900|20900|cadbc52051d47bac
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000016.result|20001017133900|22246|6177851869bd5b07
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000017.result|20001017133900|25454|84ebf147850ff31c
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000018.result|20001017133900|26863|562ac9094cf53aba
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000019.result|20001017133900|28330|2870fe1c4998d929
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000020.result|20001017133900|29810|faa670294ef5fa91
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000021.result|20001017133900|31269|8f0ce4ec26e0c21d
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000022.result|20001017133900|32814|34828a43753ee767
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000023.result|20001017133900|34366|13e112d77573bf17
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000024.result|20001017133900|35938|b10d449624f48d07
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000025.result|20001017133900|37670|f31e08fcca805f35
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000026.result|20001017133900|39253|854fa951666b7982
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000027.result|20001017133900|40901|cfd73fe738f27da
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000028.result|20001017133900|42576|13ff5add6ac24908
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000029.result|20001017133900|44275|c6d071781808aa26
-mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/sel000030.result|20001017133900|46003|98d496948e15064d
-mwagner@evoq.home.mwagner.org|mysql-test/share/README|20001009213643|10987|6cd25db633f30de5
-mwagner@evoq.home.mwagner.org|mysql-test/std_data/README|20001009213643|12759|c5aaceda4c2b1a8
-mwagner@evoq.home.mwagner.org|mysql-test/t/3.22/README|20001009213643|13611|b8e00a1b57b91f69
-mwagner@evoq.home.mwagner.org|mysql-test/var/lib/README|20001009213643|15351|3b652c0f321e1940
-mwagner@evoq.home.mwagner.org|mysql-test/var/log/README|20001009213643|16203|df5481fdbe6e5b6e
-mwagner@evoq.home.mwagner.org|mysql-test/var/run/README|20001009213643|17062|acb305e4c2ed5990
-mwagner@evoq.home.mwagner.org|mysql-test/var/tmp/README|20001009213643|17904|b32d866bfd50e72e
-mwagner@evoq.home.mwagner.org|mysql-test/xml/README|20001013051440|12362|877d76bcd19f7193
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000001.xml|20001013051507|22498|f0eb64c0346366db
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000002.xml|20001013074610|25702|8cd06da5293a7147
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000003.xml|20001013074610|26659|1a622b8d30d7ade8
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000004.xml|20001017133600|56955|515488ef221523d9
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000005.xml|20001017133618|09973|a6344e46ba572dc3
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000006.xml|20001017133623|51441|8ad8f44f49b21246
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000007.xml|20001017133625|48163|bfcb6d85276be7e8
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000008.xml|20001017133627|18273|1d6082f0905c51b6
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000009.xml|20001017133629|19814|8677613dc624cb0c
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000010.xml|20001017133713|64368|9b98c9cce8fac145
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000011.xml|20001017133713|00331|432156d127cbd22f
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000012.xml|20001017133713|01909|a410d08dc4cfee11
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000013.xml|20001017133713|03416|2717cbfbe5730174
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000014.xml|20001017133713|05036|bcf55df6a036bd8f
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000015.xml|20001017133749|30814|b72689a8f9b21372
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000016.xml|20001017133713|07087|32f1ef2e3d214be0
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000017.xml|20001017133713|08762|81423597605ff77f
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000018.xml|20001017133713|10435|82e2e7bde83f56d8
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000019.xml|20001017133713|12133|c0f0b05e481b90e7
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000020.xml|20001017133713|13843|8849bbf91a4fd5ec
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000021.xml|20001017133713|15460|2763b87c1549ba87
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000022.xml|20001017133713|17202|da2083ef423ae39a
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000023.xml|20001017133713|20719|11993b379b9838be
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000024.xml|20001017133713|22352|dd067aa28220fa4c
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000025.xml|20001017133713|24071|3e766aa1e43b303
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000026.xml|20001017133713|25860|15145e496417646f
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000027.xml|20001017133713|27519|95e7de3e9934b570
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000028.xml|20001017133713|29282|c72bfec6600949b
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000029.xml|20001017133713|31058|3aba1eb23ef86c9e
-mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000030.xml|20001017133600|63205|c2b25781eefaee9
-mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/README|20001013051514|26509|cd4bb681e5a0cd10
-mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/mysqltest.xsl|20001013051514|27425|1b8f6ec4f1b5f634
-mwagner@work.mysql.com|mysql-test/r/3.23/sel000001.result|20001010091454|28284|383913ae4505ec86
-mwagner@work.mysql.com|mysql-test/r/3.23/sel000002.result|20001010091454|29230|d1787e6fd5dbc1cc
-mysql-test/t/reserved_win_names-master.opt
-ndb/src/client/Makefile
-nick@nick.leippe.com|mysql-test/r/rpl_empty_master_crash.result|20020531235552|47718|615f521be2132141
-nick@nick.leippe.com|mysql-test/t/rpl_empty_master_crash.test|20020531235552|52328|99464e737639ccc6
-reggie@mdk10.(none)|BitKeeper/deleted/.del-reserved_win_names-master.opt~e56da049a7ce9a5b|20050523193219|41081
-reggie@mdk10.(none)|mysql-test/t/reserved_win_names-master.opt|20050520210356|14878|e56da049a7ce9a5b
-sasha@mysql.sashanet.com|BitKeeper/etc/logging_ok|20000801000905|12967|5b7d847a2158554
-sasha@mysql.sashanet.com|build-tags|20011125054855|05181|7afb7e785b80f97
-sasha@mysql.sashanet.com|build-tags|20011201050944|25384|b6f6fff142121618
-sasha@mysql.sashanet.com|libmysql_r/acconfig.h|20001128060846|51084|65f1202b3b5c345f
-sasha@mysql.sashanet.com|mysql-test/README.gcov|20001012045950|28177|5a6da067a30780ce
-sasha@mysql.sashanet.com|mysql-test/README.gcov|20001214012355|41825|2de7575ca81155e5
-sasha@mysql.sashanet.com|mysql-test/README|20001010001022|12739|108667adaeabe3f5
-sasha@mysql.sashanet.com|mysql-test/r/3.23/alt000001.result|20001122072330|24729|393103dbf15f35c9
-sasha@mysql.sashanet.com|mysql-test/r/3.23/ins000001.result|20001018175743|49824|f45c599efdf8352b
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.a.result|20001118063528|39426|2987b17db06808c3
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.b.result|20001118063528|44057|62e1fa91167cacc3
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000002.result|20001118063528|46039|109f5ceed1e0d64
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000003.result|20001118063528|48148|68d6ee00beaa011
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.a.result|20001118063528|50132|3415f066cb91c460
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.b.result|20001118063528|52094|352b35351551485
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000005.result|20001118063528|54071|a50962bc2340ab9a
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000006.result|20001118063528|56081|5653051e8ce6b4aa
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000007.result|20001121063807|21606|e0c3b6134e0884da
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000008.result|20001121063807|23636|c5cfee19ca5a7da9
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000009.result|20001121063807|25633|ed8042446ab97926
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000010.result|20001122072330|29430|3228109b8965b0f8
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000011.result|20001125024912|48851|c29dce30aa97f265
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.result|20001126062901|05938|35d6596da7b90fc5
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.status.result|20001126062901|09395|bbbd650b5beea32f
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.result|20001202171150|03876|ac5024e6cf6daac6
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.status.result|20001202171150|06069|6bee190c298cc9fd
-sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000003.result|20001011230020|64653|d7b657b1e3a286a7
-sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000100.res|20001205131218|23520|84ed46856cb3a69f
-sasha@mysql.sashanet.com|mysql-test/r/3.23/shw000001.result|20001121234128|16652|8b20b03d8319b9a5
-sasha@mysql.sashanet.com|mysql-test/r/binlog-backup-restore.result|20010424233926|16010|605de78abda64d27
-sasha@mysql.sashanet.com|mysql-test/r/df_crash.result|20010406010433|59989|4a3dbee64843953d
-sasha@mysql.sashanet.com|mysql-test/r/identity.result|20010910233028|16331|e41453a364242503
-sasha@mysql.sashanet.com|mysql-test/r/mrg000002.result|20001212152450|11492|745be0854aaaaf5e
-sasha@mysql.sashanet.com|mysql-test/r/slave-running.result|20001208141122|24303|f73e49462cf59e1f
-sasha@mysql.sashanet.com|mysql-test/r/slave-stopped.result|20001208141122|28916|25c134b1a4f1993a
-sasha@mysql.sashanet.com|mysql-test/std_data/m.MRG|20001212152450|17736|3f5632c37af00f18
-sasha@mysql.sashanet.com|mysql-test/std_data/m.frm|20001212152450|13897|e351dfe0b6824c0c
-sasha@mysql.sashanet.com|mysql-test/std_data/select-key.master|20001009234916|07315|e6b83af25df0ce5
-sasha@mysql.sashanet.com|mysql-test/std_data/simple-select.master|20001009234916|08299|6f3eb98812926caf
-sasha@mysql.sashanet.com|mysql-test/t/3.23/alt000001.test|20001122072330|31588|633aed61c4bad94c
-sasha@mysql.sashanet.com|mysql-test/t/3.23/sel000004.test|20001103140433|32471|daf9ad4a1a31cd3c
-sasha@mysql.sashanet.com|mysql-test/t/3.23/sel000005.test|20001103140433|36002|982fde89a4d6d886
-sasha@mysql.sashanet.com|mysql-test/t/3.23/select-key.test|20001009234859|21197|5d785cef5c02c070
-sasha@mysql.sashanet.com|mysql-test/t/3.23/shw000001.test|20001121234128|21322|770d96a2c1c65b20
-sasha@mysql.sashanet.com|mysql-test/t/3.23/simple-select.test|20001009234859|26291|71f98293e1dc65
-sasha@mysql.sashanet.com|mysql-test/t/binlog-backup-restore.test|20010424233926|25316|d5b0b9bd83738a9f
-sasha@mysql.sashanet.com|mysql-test/t/df_crash.test|20010406010433|65180|4c365178fe437f6
-sasha@mysql.sashanet.com|mysql-test/t/fulltext_join.test|20010730234357|20865|e347c8f04405c916
-sasha@mysql.sashanet.com|mysql-test/t/identity.test|20010910233028|36116|326f469b59105404
-sasha@mysql.sashanet.com|mysql-test/t/include/master-slave.inc|20001118030458|01636|556fd038c3a3d54
-sasha@mysql.sashanet.com|mysql-test/t/mrg000002.test|20001212152450|20137|16b3a176adc0f311
-sasha@mysql.sashanet.com|mysql-test/t/rpl000018-master.sh|20010127223331|13256|bc8072e13b26b005
-sasha@mysql.sashanet.com|sounds/compilation_finished.au.gz|20010814034002|63992|70bd14095a918139
-sasha@mysql.sashanet.com|vio/test-ssl|20010828000105|24508|ed0a50364f2a51d7
-sasha@work.mysql.com|BitKeeper/etc/logging_ok|20001214015456|29919|32b6551b8288c2fa
-serg@serg.mysql.com|mysql-test/r/3.23/mrg000001.dummy.result|20001206231604|05053|bf7e6d609f22b897
-serg@serg.mysql.com|mysql-test/r/3.23/mrg000001.result|20001206231609|46662|db2ef2e717ab8332
-serg@serg.mysql.com|mysql-test/r/ft0000001.a.result|20001211130756|05199|3d17aff15fa5a9f1
-serg@serg.mysql.com|mysql-test/r/ft0000001.b.result|20001211130756|10153|505c4c00a0bddfc4
-serg@serg.mysql.com|mysql-test/r/ft0000001.c.result|20001211130756|14950|1040289a75243a92
-serg@serg.mysql.com|mysql-test/r/ft0000001.d.result|20001211130756|19773|7c549555fbc7663e
-serg@serg.mysql.com|mysql-test/r/ft0000001.e.result|20001212121413|40468|c58d30fd7fe86f4f
-serg@serg.mysql.com|mysql-test/r/ft0000002.a.result|20001212120058|27306|a89b4db1db19f944
-serg@serg.mysql.com|mysql-test/r/ft0000002.b.result|20001212120058|34425|5de41ce15ae1cedb
-serg@serg.mysql.com|mysql-test/r/ft0000002.c.result|20001212120059|07173|cd66b90918a87531
-serg@serg.mysql.com|mysql-test/t/3.23/mrg000001.test|20001206231615|27540|e0327f9d1e6cb4e
-serg@serg.mysql.com|mysql-test/t/sel000006.test|20001211130730|19922|291cc6c8d85e51df
-serg@serg.mysql.com|mysql-test/t/sel000007.test|20001211130730|24336|f431e4f4739a24c3
-serg@serg.mysql.com|mysql-test/t/sel000008.test|20001211130730|28581|b338ef585cadf7ae
-serg@serg.mysql.com|mysql-test/t/sel000009.test|20001211130730|33139|a455c38f5c942cd1
-serg@serg.mysql.com|mysql-test/t/sel000010.test|20001211130731|03554|ca07085ae92255f1
-serg@serg.mysql.com|mysql-test/t/sel000011.test|20001211130731|08373|c2a971726c9d18d6
-serg@serg.mysql.com|mysql-test/t/sel000012.test|20001211130731|13215|ae64bff363c42e92
-serg@serg.mysql.com|mysql-test/t/sel000013.test|20001211130731|18090|ce8aa504ba4f74ba
-serg@serg.mysql.com|mysql-test/t/sel000014.test|20001211130731|22977|74cb8c70f1d73fcc
-serg@serg.mysql.com|mysql-test/t/sel000015.test|20001211130731|27841|7442bf9cbc96fe07
-serg@serg.mysql.com|mysql-test/t/sel000016.test|20001211130731|32739|f495235f14c47ec
-serg@serg.mysql.com|mysql-test/t/sel000017.test|20001211130731|37659|7c39f2b45a6aa780
-serg@serg.mysql.com|mysql-test/t/sel000018.test|20001211130731|42584|16207f3ad74de75e
-serg@serg.mysql.com|mysql-test/t/sel000019.test|20001211130731|47552|8fd63c8dc6be8dbc
-serg@serg.mysql.com|mysql-test/t/sel000020.test|20001211130731|52532|c5758ad18a6dff1e
-serg@serg.mysql.com|mysql-test/t/sel000021.test|20001211130731|57561|94dd47de2872264a
-serg@serg.mysql.com|mysql-test/t/sel000022.test|20001211130731|62553|6e3e5435e66875e9
-serg@serg.mysql.com|mysql-test/t/sel000023.test|20001211130731|02042|7bdfcfaa278f837d
-serg@serg.mysql.com|mysql-test/t/sel000024.test|20001211130731|07099|849f47e6cbdc4fe3
-serg@serg.mysql.com|mysql-test/t/sel000025.test|20001211130731|12136|65b32b4b67e4c77
-serg@serg.mysql.com|mysql-test/t/sel000026.test|20001211130731|17211|d8aa2d614f23b1
-serg@serg.mysql.com|mysql-test/t/sel000027.test|20001211130731|23677|ab44bb57a580de9
-serg@serg.mysql.com|mysql-test/t/sel000028.test|20001211130731|28317|db9bfc0a808fb629
-serg@serg.mysql.com|mysql-test/t/sel000029.test|20001211130731|32917|6aae34dbb3ee86d9
-serg@serg.mysql.com|mysql-test/t/sel000030.test|20001211130732|03110|a29683eac3e7b706
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_sjis.result|20050107081527|04225|2ec1fd4929b5638e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ucs2.result|20050107081527|11825|f3ac4ae77651d4f4
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ujis.result|20050107081528|17309|2c37b350cc1614b7
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_utf8.result|20050107081528|57925|2916262ef0a8467c
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_sjis.result|20050107081528|32479|2d7cc0bab6a08fb7
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ucs2.result|20050107081529|38657|a904397e286b018d
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ujis.result|20050107081529|63265|a3e5fab4dda3f63
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_utf8.result|20050107081529|19050|8f33e213f34b75c4
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_sjis.result|20050107081530|05840|92bcb5996a61c9bc
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ucs2.result|20050107081530|27322|9f3eb425f5a8a94e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ujis.result|20050107081530|48971|ccce22a3ed33edb
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_utf8.result|20050107081530|04766|6be23c27e03aaef
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_sjis.result|20050107081530|26438|e16736c277401654
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ucs2.result|20050107081531|13914|845b174a4e12fdf5
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ujis.result|20050107081531|35726|ea4382cfe092a050
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_utf8.result|20050107081531|58104|b90186d893390496
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_sjis.result|20050107081531|14644|d35a81ed738ce5ba
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ucs2.result|20050107081532|01516|94fe34e7cf948cf4
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ujis.result|20050107081532|23036|4d5552d56ab27619
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_utf8.result|20050107081532|44748|374e13cc2ae5b0fa
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_sjis.result|20050107081532|00620|eee512b72025128e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ucs2.result|20050107081532|22012|c0187e924a3b5cdc
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ujis.result|20050107081533|09019|e8763bd889fa5d1
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_utf8.result|20050107081533|30411|b9afcd7fdbca71bf
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_sjis.result|20050107081533|52491|68150e74f7d83182
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ucs2.result|20050107081533|08926|50375a296eea1a4c
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ujis.result|20050107081533|30516|26c8e1122bdac1f1
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_utf8.result|20050107081534|17587|577e655491905344
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_sjis.result|20050107081534|39290|67147bffbcee5282
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ucs2.result|20050107081534|61019|2a3faa20c3360cfb
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ujis.result|20050107081534|17136|5e7b2c0407b9eae
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_utf8.result|20050107081535|04220|62fa831c2b8a02e9
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_sjis.result|20050107081535|25969|abfcff6cbdae1925
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ucs2.result|20050107081535|47754|be297a9ec05c0e0a
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ujis.result|20050107081535|03623|f42e09a2a6736f23
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_utf8.result|20050107081535|24952|8fc889df4669cd6
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_sjis.result|20050107081536|12369|396a43a5ac83bda3
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ucs2.result|20050107081536|34440|f112f6b3a020dcb5
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ujis.result|20050107081536|56149|dab3a2b2f5e31eb5
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_utf8.result|20050107081536|12246|6661d21d7c485970
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_sjis.result|20050107081536|33732|c4d6b2814e85710f
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ucs2.result|20050107081537|20829|ebc1bcd92b01ba3
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ujis.result|20050107081537|42728|c88e3ddf34290212
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_utf8.result|20050107081537|64357|702b2e408597f5ef
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_sjis.result|20050107081537|20201|ab84fe078f8c50e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ucs2.result|20050107081538|07211|f79c430972fe4242
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ujis.result|20050107081538|28829|92e66a0d987080ab
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_utf8.result|20050107081538|50725|f3e1ec3c827572ef
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_sjis.result|20050107081538|07207|497ea317a9779e08
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ucs2.result|20050107081538|29018|dff13e955936a635
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ujis.result|20050107081539|16190|5aaf14c5cc0eb3d7
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_utf8.result|20050107081539|38032|e62cf43214334eaf
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_sjis.result|20050107081539|59851|f5cd5bb0720f1388
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ucs2.result|20050107081539|16013|397f3c3ecc929da
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ujis.result|20050107081540|05016|a0746377dc240841
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_utf8.result|20050107081540|26599|65816e1c9ea27fbc
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_sjis.result|20050107081540|48453|be23445a258c2efb
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ucs2.result|20050107081540|04446|10797352d768da53
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ujis.result|20050107081540|26224|75165c42c9da07e8
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_utf8.result|20050107081541|13606|36ad2d19941abede
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_sjis.result|20050107081541|35572|2b3b542ec89a8440
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ucs2.result|20050107081541|57615|cab66782e2d918b7
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ujis.result|20050107081541|13734|5e405409e03dca3
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_utf8.result|20050107081542|00849|5f64c2575080fb2e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_sjis.result|20050107081542|22464|194a85125571489c
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_ujis.result|20050107081542|44552|1d31f04dc3869387
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_sjis.result|20050107081542|00673|76b3f6fab7cce305
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ucs2.result|20050107081542|22178|40a5c69f7fb9ad70
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ujis.result|20050107081543|09299|ab8af1803ff6de87
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_utf8.result|20050107081543|31103|34a42201cf18603f
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_sjis.result|20050107081543|53242|2fd638c1bbea9de
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ucs2.result|20050107081543|09440|bcae1663ff14df06
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ujis.result|20050107081543|31543|69792ccfb7d3b59b
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_utf8.result|20050107081544|19023|30e4181e77154299
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_sjis.result|20050107081544|40814|84b8e7d33c6cc088
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ucs2.result|20050107081544|62694|20e50c73803406e0
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ujis.result|20050107081544|18674|2bd13ccf7478f32b
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_utf8.result|20050107081545|06019|b26626fbc0c8fa25
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_sjis.result|20050107081545|47717|a6cb9a00a34d9280
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ucs2.result|20050107081545|03933|6f310a21c6a3ad7f
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ujis.result|20050107081545|25719|419271caa26c24cd
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_utf8.result|20050107081546|12990|e1cd2ebd6c0208ea
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_sjis.result|20050107081546|34719|d23e6090f98e8fbc
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ucs2.result|20050107081546|56850|f2fe2a72c482aa49
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ujis.result|20050107081546|13304|1e865c1ccf400e23
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_utf8.result|20050107081547|00440|8b2e0fffb1bc5cd4
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_sjis.result|20050107081547|22111|60535594c5605694
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ucs2.result|20050107081547|44100|71c3558952cbc6ad
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ujis.result|20050107081547|00264|f0e2860f90982398
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_utf8.result|20050107081547|21895|eeef381fbf2d9c95
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_sjis.result|20050107081548|09502|b652bee325136852
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ucs2.result|20050107081548|31516|8a8aa66dad072fed
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ujis.result|20050107081548|53490|8add4d2433058e8e
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_utf8.result|20050107081548|09693|cdeb3a8f901a6efb
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_sjis.result|20050107081549|05596|fee80f00e654153
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ucs2.result|20050107081549|28016|238f41941bf1cde2
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ujis.result|20050107081549|50377|1d6072226dc693ac
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_utf8.result|20050107081549|06796|2dba8103bf4ad46d
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_sjis.result|20050107081549|28652|8a103fbcece5bf25
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ucs2.result|20050107081550|15970|ac4cba762dc14e28
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ujis.result|20050107081550|37865|4df912345aac10f1
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_utf8.result|20050107081550|60045|79cba16887bf3b1f
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_union_ujis.result|20050107081550|16675|f0d464252c220c15
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_sjis.result|20050107081551|03970|13dc7639ad1ec6e5
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ucs2.result|20050107081551|25688|8fc9b1f31d32a21f
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ujis.result|20050107081551|47775|93f6c8b3f5622aff
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_utf8.result|20050107081551|04259|24a758ee1768afcc
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_sjis.result|20050107081551|26138|cb97323da2f50869
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ucs2.result|20050107081552|13450|b3dad356facc16be
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ujis.result|20050107081552|35250|4e3045c764bfa364
-shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_utf8.result|20050107081552|57088|143422da49ad0cdb
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_sjis.dat|20050107081552|13191|3b811e51d64f83c7
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ucs2.dat|20050107083211|03894|85975a083dfb7a54
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ujis.dat|20050107081605|05898|699c7c58964df90
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_utf8.dat|20050107081606|12116|74d43073bf069bc7
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis.dat|20050107081606|52743|9e8273f37d55fc4
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis2.dat|20050107083212|14086|38a382ad2316ccf0
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis3.dat|20050107081608|13836|8661d7801d6d35c
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ucs2.dat|20050107081608|54705|269e953196baf762
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ujis.dat|20050107081608|29492|e5d30a2aadd8062a
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_utf8.dat|20050107081609|35613|db4e6eadc27ec29e
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ucs2.dat|20050107081609|10803|4fbb36024a7d47d0
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ujis.dat|20050107081610|17128|bedeb2aa4cf2103d
-shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_utf8.dat|20050107081610|58355|6f46c105f00e6da7
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_sjis.test|20050107081610|33134|f7c41740399a114a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ucs2.test|20050107081611|40070|8aded01010aa4027
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ujis.test|20050107081611|04428|ddd8a1d2c2b10744
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_utf8.test|20050107081611|26011|749a0e3b6ba599d2
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_sjis.test|20050107081612|13318|38dc8c4a77af62a4
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ucs2.test|20050107081612|35063|fe5674c6b12d2b1
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ujis.test|20050107081612|57379|e901fbd29981385b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_utf8.test|20050107081612|13800|36ef1b7b55dc4a1b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_sjis.test|20050107081613|01245|daf9bbe53b34f1a8
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ucs2.test|20050107081613|22978|ea01c4415d5ef4a4
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ujis.test|20050107081613|45096|ca893d3a1c4a5fab
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_utf8.test|20050107081613|01406|9d3ffec1489a799b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_sjis.test|20050107081613|23086|a7fbf85ce0fc9591
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ucs2.test|20050107081614|10458|84828e6663159064
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ujis.test|20050107081614|32393|a64465e0725243
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_utf8.test|20050107081614|54260|8f344fb86504b604
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_sjis.test|20050107081614|10489|40a1631cffd46fe
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ucs2.test|20050107081614|32422|8f034f1fb0ae644b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ujis.test|20050107081615|20478|bbdb04d1a483939b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_utf8.test|20050107081615|42908|1f4418fddb751c58
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_sjis.test|20050107081615|64880|448ff3eaff962456
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ucs2.test|20050107081615|21081|b2bafda9e7a3f226
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ujis.test|20050107081616|08589|1477760d458bb313
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_utf8.test|20050107081616|30689|a1d12ccab39f74f3
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_sjis.test|20050107081616|53230|9b863b7e4728f82a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ucs2.test|20050107081617|23149|f05f1cbbe3740670
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ujis.test|20050107081618|10643|ac136bedb31cf9a8
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_utf8.test|20050107081618|46561|43460e3947ac3d24
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_sjis.test|20050107081618|02948|b32f23f3f588ea9a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ucs2.test|20050107081618|24774|783e8b896271e49e
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ujis.test|20050107081619|12298|3f9c8c41cd92faa3
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_utf8.test|20050107081619|37128|e4ab71ff1f780509
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_sjis.test|20050107081619|59453|25fc516136ca9159
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ucs2.test|20050107081619|15956|673e221671a2770d
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ujis.test|20050107081620|03773|75c1239ff59d928a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_utf8.test|20050107081620|26260|ed912ad48a1893a8
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_sjis.test|20050107081620|49077|59a36a82ee570052
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ucs2.test|20050107081620|05668|7d8665f03f26863d
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ujis.test|20050107081620|27737|ecdf5e86cbda74cb
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_utf8.test|20050107081621|15489|b98f58e8a4a65e7b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_sjis.test|20050107081621|41478|91fcd07aaac68648
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ucs2.test|20050107081621|63674|65929b80d0271c86
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ujis.test|20050107081621|20110|2a5ce575491289f4
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_utf8.test|20050107081622|07679|932150eea8460d1
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_sjis.test|20050107081622|30138|22fc722d29faeb92
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ucs2.test|20050107081622|52718|81dcde6618d6a22d
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ujis.test|20050107081622|09451|d5be7e1b3b4fb88b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_utf8.test|20050107081622|31964|cfd3ea368b652b5b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_sjis.test|20050107081623|19721|1db71ef08ca802d0
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ucs2.test|20050107081623|42415|55eee7f0b2b984cd
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ujis.test|20050107081623|64766|4136ccd8cd83eee5
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_utf8.test|20050107081623|21529|556e575385ee58f
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_sjis.test|20050107081624|09362|ac12c88e8477d736
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ucs2.test|20050107081624|31699|e6e0cc4752262b9f
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ujis.test|20050107081624|54042|afa7eadd28fa536e
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_utf8.test|20050107081624|10934|307d85c4cd318e62
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_sjis.test|20050107081624|33252|29972178e7d58d93
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ucs2.test|20050107081625|21025|b722d1ed662e03c8
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ujis.test|20050107081625|44023|c1feeadebdfc0ff9
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_utf8.test|20050107081625|01097|2f3347de2a42b9d6
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_sjis.test|20050107081625|23224|fb954f6d4b2a20ac
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ucs2.test|20050107081626|11079|998157355fe96143
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ujis.test|20050107081626|33500|aab63ba3302196a2
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_utf8.test|20050107081626|55883|8193f90a6ed58d36
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_sjis.test|20050107081626|12674|2f1450a52f147fec
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_ujis.test|20050107081627|00495|7b0eb3ca59abb12
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_sjis.test|20050107081627|23008|a74ce2aca0e5ac66
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ucs2.test|20050107081627|45674|71b7010127493fb
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ujis.test|20050107081627|02501|cfe2af6b3db381c0
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_utf8.test|20050107081627|24683|57e905b35703072
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_sjis.test|20050107081628|12962|f40219e9e488fc23
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ucs2.test|20050107081628|35555|2c0e7ad52ec9ca65
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ujis.test|20050107081628|57942|c353d85f4e92f5df
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_utf8.test|20050107081628|14597|e2588c2a3dcf63a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_sjis.test|20050107081629|02304|14af84f068332d50
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ucs2.test|20050107081629|24565|729a8377aa8100e4
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ujis.test|20050107081629|47409|a839209fac19b930
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_utf8.test|20050107081629|04400|ada246cab13f1811
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_sjis.test|20050107081629|26583|9ae895ba98c4d31
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ucs2.test|20050107081630|14467|cc7b3b62ee6dae28
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ujis.test|20050107081630|37003|9c869c17899db4c7
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_utf8.test|20050107081630|59835|a8ed7c9ff559c38d
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_sjis.test|20050107081630|16798|82a8f174f2ac5988
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ucs2.test|20050107081631|04558|1f90bdf68ed4d6d0
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ujis.test|20050107081631|26878|1804ccc6518b5d9
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_utf8.test|20050107081631|49568|74375ee1105781bd
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_sjis.test|20050107081631|06299|b1151637493de45
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ucs2.test|20050107081632|27924|3364d51b3168f562
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ujis.test|20050107081632|50639|721b5841964bf8e6
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_utf8.test|20050107081632|07426|37222d28b4cfe7c8
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_sjis.test|20050107081632|29631|c92ff81669eb652
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ucs2.test|20050107084021|10337|4b920d28fc9dc5aa
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ujis.test|20050107083216|33062|3f51b47de1fb0c17
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_utf8.test|20050107081637|15503|fe599c9515084385
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_sjis.test|20050107081638|08555|305285c02185f498
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ucs2.test|20050107081638|36441|ddc58f642ca61418
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ujis.test|20050107081638|64337|2cc53c02a5cc4879
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_utf8.test|20050107081638|26081|55bb4e11bc747e5d
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_sjis.test|20050107081639|19046|ec18bf7845064d09
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ucs2.test|20050107081639|46660|583edc63a51fd799
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ujis.test|20050107081639|06910|87aad3c53be879fd
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_utf8.test|20050107081639|29347|b35fcc89b5fa47c3
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_union_ujis.test|20050107081640|17665|1eb842f74190b3c1
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_sjis.test|20050107081640|40239|d21d19721f975c74
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ucs2.test|20050107081640|62869|3dad27b824548037
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ujis.test|20050107081640|19575|5c3da888e148065b
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_utf8.test|20050107081641|07967|bc3adabdd5ac865
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_sjis.test|20050107081641|30584|e2886fcc8b23152f
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ucs2.test|20050107081641|53233|b3c07768684ddfdb
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ujis.test|20050107081641|10027|9e123ef3c645b66a
-shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_utf8.test|20050107081641|32217|59fb529f60d9d8bc
-tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.eps|20020228162345|64529|31ade79a89683616
-tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.gif|20020228162348|36945|364ca7338682f71
-tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.txt|20020228162350|33044|e155c53c10374ff
-tim@cane.mysql.fi|mysql-test/r/delete.result|20001221095802|20463|e866a6678e29f186
-tim@cane.mysql.fi|mysql-test/t/delete.test|20001221095802|36821|389410e29f2cebe5
-tim@threads.polyesthetic.msg|bdb/btree/btree_auto.c|20010305004134|12592|a683156a176761f
-tim@threads.polyesthetic.msg|bdb/build_vxworks/db_int.h|20010305004134|18702|40ba51edce41403f
-tim@threads.polyesthetic.msg|bdb/build_win32/db_archive.dsp|20010305004134|25535|e3da826e91bb086
-tim@threads.polyesthetic.msg|bdb/build_win32/db_checkpoint.dsp|20010305004134|26943|8071af22db95b1db
-tim@threads.polyesthetic.msg|bdb/build_win32/db_deadlock.dsp|20010305004134|28374|befd45d29eaeb672
-tim@threads.polyesthetic.msg|bdb/build_win32/db_dll.dsp|20010305004134|29137|4e9dda53c84511b6
-tim@threads.polyesthetic.msg|bdb/build_win32/db_dump.dsp|20010305004134|29985|e07d2a82708b61
-tim@threads.polyesthetic.msg|bdb/build_win32/db_int.h|20010305004134|30736|9ee5645850a336a0
-tim@threads.polyesthetic.msg|bdb/build_win32/db_java.dsp|20010305004134|31520|e3941d5a9810b360
-tim@threads.polyesthetic.msg|bdb/build_win32/db_load.dsp|20010305004134|32237|e83a2af8e24a715d
-tim@threads.polyesthetic.msg|bdb/build_win32/db_printlog.dsp|20010305004134|32975|163f6e1073a5f396
-tim@threads.polyesthetic.msg|bdb/build_win32/db_recover.dsp|20010305004134|34274|835c32ab73359256
-tim@threads.polyesthetic.msg|bdb/build_win32/db_stat.dsp|20010305004135|00560|f77417f5d9984986
-tim@threads.polyesthetic.msg|bdb/build_win32/db_static.dsp|20010305004135|01425|78ea414467defc70
-tim@threads.polyesthetic.msg|bdb/build_win32/db_tcl.dsp|20010305004135|02285|5ad951d774e41520
-tim@threads.polyesthetic.msg|bdb/build_win32/db_upgrade.dsp|20010305004135|03711|90fd250190af4984
-tim@threads.polyesthetic.msg|bdb/build_win32/db_verify.dsp|20010305004135|04464|e9a4938542f86cea
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_access.dsp|20010305004135|07926|8dd6017efffae14e
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_btrec.dsp|20010305004135|08710|c87137287d8d67dc
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_env.dsp|20010305004135|09533|1732d5e41efda77
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_lock.dsp|20010305004135|10303|286d2566e786dde
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_mpool.dsp|20010305004135|11076|9eb937bc70c1573
-tim@threads.polyesthetic.msg|bdb/build_win32/ex_tpcb.dsp|20010305004135|11838|644b38dae8b38152
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_access.dsp|20010305004135|12614|31e87b6228470681
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_btrec.dsp|20010305004135|13384|61b563f4ac1f73eb
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_env.dsp|20010305004135|14159|b0bf2649a4c797ac
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_lock.dsp|20010305004135|14943|257abf03544f6270
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_mpool.dsp|20010305004135|15715|d17a5d09f09f5217
-tim@threads.polyesthetic.msg|bdb/build_win32/excxx_tpcb.dsp|20010305004135|16510|159c727e2c15105e
-tim@threads.polyesthetic.msg|bdb/build_win32/include.tcl|20010305004135|17284|f8bffb5e2510f229
-tim@threads.polyesthetic.msg|bdb/build_win32/libdb.rc|20010305004135|20964|906f4936ec6a8398
-tim@threads.polyesthetic.msg|bdb/db/crdel_auto.c|20010305004136|27298|ee4146a08fd175c1
-tim@threads.polyesthetic.msg|bdb/db/db_auto.c|20010305004136|32432|3186e950cc321ae7
-tim@threads.polyesthetic.msg|bdb/dist/build/chk.define|20010305004137|15254|aa9a626e58631003
-tim@threads.polyesthetic.msg|bdb/dist/build/chk.def|20010305004137|13920|bb65b471d09f7c58
-tim@threads.polyesthetic.msg|bdb/dist/build/chk.offt|20010305004137|16371|25759c9294db634e
-tim@threads.polyesthetic.msg|bdb/dist/build/chk.srcfiles|20010305004137|18056|ae884700cd110cbf
-tim@threads.polyesthetic.msg|bdb/dist/build/chk.tags|20010305004137|19101|7a5b14d33d4078cc
-tim@threads.polyesthetic.msg|bdb/dist/config.guess|20010305004136|14678|ead1d91caeaa748c
-tim@threads.polyesthetic.msg|bdb/dist/config.hin|20010305004136|15955|fdecb7a06fa137a7
-tim@threads.polyesthetic.msg|bdb/dist/config.sub|20010305004136|16944|17e9990a298261a
-tim@threads.polyesthetic.msg|bdb/dist/install-sh|20010305004136|21695|1858c24340b72628
-tim@threads.polyesthetic.msg|bdb/dist/template/db_server_proc|20010305004137|21042|2e8b49d42aefab55
-tim@threads.polyesthetic.msg|bdb/dist/template/gen_client_ret|20010305004137|22087|786a5e65119b3991
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_btree|20010305004137|23131|65d6b0b2f5b7a6d2
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_crdel|20010305004137|24191|58795c0c5232f80d
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_db|20010305004137|25141|52c5797539878fca
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_hash|20010305004137|26120|dcbdd106ae17b865
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_log|20010305004137|27185|3fe6d62c43bc553a
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_qam|20010305004137|28066|6eecf6833de0af98
-tim@threads.polyesthetic.msg|bdb/dist/template/rec_txn|20010305004137|29072|1ff22b797deb0e1b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/c_index.html|20010305004143|28133|1a854fa55012906
-tim@threads.polyesthetic.msg|bdb/docs/api_c/c_pindex.html|20010305004145|05766|697acebf58a8db4
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_close.html|20010305004144|26254|fda0b4dfa946f44e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_create.html|20010305004143|29368|a87157ea60c82ee2
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_cursor.html|20010305004144|27133|7431dd96ed3492c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_del.html|20010305004144|11427|e8bffcf9be371317
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_err.html|20010305004143|33003|3696088bd85eeda3
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_fd.html|20010305004144|28004|15a01776b340a959
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get.html|20010305004144|29265|7e0018b93ee31eba
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get_byteswapped.html|20010305004144|30478|bcab4145183a7be2
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get_type.html|20010305004144|31538|d66aa1642a4d20e2
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_join.html|20010305004144|32446|a58c2d81ecfea5b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_key_range.html|20010305004144|33389|1060761b1e359d85
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_lsn.html|20010305004143|34135|5edb9bce1118feae
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_open.html|20010305004144|34314|59dfa6e5198c382e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_put.html|20010305004144|35267|ea78709ffb6cd7e8
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_remove.html|20010305004144|36184|668fa1d67a4f6941
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_rename.html|20010305004144|37128|36796ad9e106c3f0
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_append_recno.html|20010305004144|38070|bdf0130e642f74fa
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_compare.html|20010305004144|39551|e55a311bb0be93a8
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_minkey.html|20010305004144|40498|e2d52ba2d0174432
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_prefix.html|20010305004144|41420|d6e443a7e47c9b3a
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_cachesize.html|20010305004144|02131|47a3c8ca486eb013
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_dup_compare.html|20010305004144|03068|a833bfc727a794e7
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errcall.html|20010305004144|04030|faf92be4ee8bc634
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errfile.html|20010305004144|00766|f07d3c57bb3c8fbd
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errpfx.html|20010305004144|05859|756b9b73dd28b8d9
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_feedback.html|20010305004144|06786|90d495e78318a332
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_flags.html|20010305004144|07758|4cd3700ae4387d22
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_ffactor.html|20010305004144|08766|41352ddf74ccc338
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_hash.html|20010305004144|09702|73f14897664d9d08
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_nelem.html|20010305004144|10635|bd8371e033b15c8f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_lorder.html|20010305004144|11587|e24ae76325374653
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_malloc.html|20010305004144|01594|3581879fef5af695
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_pagesize.html|20010305004144|12535|9644fa0f538cde17
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_paniccall.html|20010305004144|02405|ac7f63325b4499ce
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_q_extentsize.html|20010305004144|13496|f2fe41a5d8c46658
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_delim.html|20010305004144|14446|e0a7face764111b9
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_len.html|20010305004144|15420|f30d68257bd60e1e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_pad.html|20010305004144|16373|8a1de721eb6fc53f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_source.html|20010305004144|17353|6d12ac12652acc31
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_realloc.html|20010305004144|03204|a9be244baf966892
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_stat.html|20010305004144|18351|578f6f99f8e247ff
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_sync.html|20010305004144|19394|7a067029b6e1496b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_upgrade.html|20010305004144|20363|5e6210d6f09a0c3e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/db_verify.html|20010305004144|21372|cf80f5ba845eac2e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_close.html|20010305004144|22419|a3ad4ea563bafc42
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_count.html|20010305004144|23385|c3cd00c48b4babf5
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_del.html|20010305004144|24335|2685f75d28e4ad99
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_dup.html|20010305004144|25301|3bdf8b0a687b43f3
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_get.html|20010305004144|26284|4bf7579a92c35195
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_put.html|20010305004144|27355|a2c4a52329376657
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbm.html|20010305004144|04019|ebf1d8e329b06bba
-tim@threads.polyesthetic.msg|bdb/docs/api_c/dbt.html|20010305004144|04896|ae7a81c9c5f574f6
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_close.html|20010305004144|28399|a8e722cbb66c9d7b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_create.html|20010305004144|05736|3e73dd35fe5dcc8
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_open.html|20010305004144|29421|e4c9706220a4cd9b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_remove.html|20010305004144|31547|a71d5e1ca41324a7
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_cachesize.html|20010305004144|32567|f4c341d3f2c09469
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_data_dir.html|20010305004144|33569|437cec65e441c60
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errcall.html|20010305004145|00341|ba09eec1ba15f15f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errfile.html|20010305004144|06564|3b6b0822f29fc3d4
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errpfx.html|20010305004145|01527|806c8c438d0ee36c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_feedback.html|20010305004145|02860|87a78f97ba545aba
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_flags.html|20010305004145|03778|b2a1f3c8498e6d95
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_bsize.html|20010305004145|04625|1eb03c137a42e80f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_dir.html|20010305004145|05444|26be310214a2ff8f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_max.html|20010305004145|06288|319c24b5245b0685
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_conflicts.html|20010305004145|07137|58d9f7179bc864a3
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_detect.html|20010305004145|07983|d9ed73495defdc19
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max.html|20010305004145|08849|a2dc11fa8b2f1c9
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_lockers.html|20010305004145|24923|f22d5d4640436efe
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_locks.html|20010305004145|09704|1baf2d63a6fb418d
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_objects.html|20010305004145|25791|1a428bbee06cb5cc
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_mp_mmapsize.html|20010305004145|26668|21f27997f00accfe
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_mutexlocks.html|20010305004145|27540|85bbd53b877cafe1
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_pageyield.html|20010305004145|28418|8aa4a6cb2f18cad7
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_paniccall.html|20010305004144|07360|97a1d58189199453
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_panicstate.html|20010305004145|29311|43228366ca64363c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_rec_init.html|20010305004145|30192|bf7da051ef6689ba
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_region_init.html|20010305004145|31081|2ca19f76ee1ae790
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_server.html|20010305004145|31969|c13b793b525d504b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_shm_key.html|20010305004145|32880|cf5aaa6a995cbf55
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tas_spins.html|20010305004145|33848|91c7091deca3d97f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tmp_dir.html|20010305004145|34771|b563e87af5431824
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_max.html|20010305004145|35672|71a739e46faf33a9
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_recover.html|20010305004145|36580|8dd351545b444a24
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_timestamp.html|20010305004145|37492|ddb77d7dfb531085
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_verbose.html|20010305004145|38421|344f5119536cae0
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_strerror.html|20010305004145|39331|7f090bf26bdd4dc
-tim@threads.polyesthetic.msg|bdb/docs/api_c/env_version.html|20010305004145|40251|9bf7f99fefacc2bf
-tim@threads.polyesthetic.msg|bdb/docs/api_c/hsearch.html|20010305004144|08165|a8b76d897a8216d8
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_detect.html|20010305004145|41159|8fe406dce10e0bb
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_get.html|20010305004145|42084|63399d204f1885fa
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_id.html|20010305004145|43025|c9ee776f928a38f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_put.html|20010305004145|44022|f5bc2f52e55f16e1
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_stat.html|20010305004145|44954|d9a98bb949070b
-tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_vec.html|20010305004145|45892|cc79e33b82b7a275
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_archive.html|20010305004145|46850|490428ce45f9f918
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_compare.html|20010305004145|47782|4f12fdf04d30ab94
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_file.html|20010305004145|48705|574444b46b801f9c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_flush.html|20010305004145|49632|bb8bc4fc43c9f63d
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_get.html|20010305004145|50583|24cdf17ba55cbecf
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_put.html|20010305004145|51546|11a1bec49bb90419
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_register.html|20010305004145|52499|5381c1fad82d6527
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_stat.html|20010305004145|53440|36b87b19ee2c5bba
-tim@threads.polyesthetic.msg|bdb/docs/api_c/log_unregister.html|20010305004145|54401|45b8f9d3f8eb3d80
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fclose.html|20010305004145|55335|b52c7d599d83c26
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fget.html|20010305004145|56294|460714b5c2e3e1c5
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fopen.html|20010305004145|57267|d032a963a0103472
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fput.html|20010305004145|58291|4a7aace7db01ee15
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fset.html|20010305004145|59241|ecb97931b222568d
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fsync.html|20010305004145|60192|a95ab802bb28646f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_register.html|20010305004145|61165|8b9dff9b5043da58
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_stat.html|20010305004145|62160|55a9521fe04b03bd
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_sync.html|20010305004145|63168|b387035a94c20c50
-tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_trickle.html|20010305004145|64180|8b1adf1404d7a5f
-tim@threads.polyesthetic.msg|bdb/docs/api_c/pindex.src|20010305004143|31726|d1ecd116c42e0e23
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_close.html|20010305004144|08984|8981d16589844161
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_dirfree.html|20010305004144|09784|d59f36547c7b5384
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_dirlist.html|20010305004144|10606|24e75ccc86809023
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_exists.html|20010305004144|12261|23f077e82ca8f827
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_free.html|20010305004144|13076|ed61d2dfea9e069e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_fsync.html|20010305004144|13884|f59339ff63d95e7d
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_ioinfo.html|20010305004144|14713|80365bb8c66ae84c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_malloc.html|20010305004144|15535|5579a0604e14e1e7
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_map.html|20010305004144|16369|d90bbc8462ef43a6
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_open.html|20010305004144|17474|8c812591efc8abe6
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_read.html|20010305004144|18372|c8f6ece1ed408bf8
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_realloc.html|20010305004144|19375|e8e78e57c005c7c4
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_rename.html|20010305004144|20199|3f8c7b6674cda105
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_seek.html|20010305004144|21048|fdf1b31d3f6c7473
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_sleep.html|20010305004144|21928|4b962c8b82989d8c
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_unlink.html|20010305004144|22800|c42b13fd26f2e90
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_unmap.html|20010305004144|23658|d85790692f3b536e
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_write.html|20010305004144|24518|63567be42d586fde
-tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_yield.html|20010305004144|25375|ca5e359bcbeca7fd
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_abort.html|20010305004145|65162|a53425dd70214619
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_begin.html|20010305004145|00608|557b34fd3e7363
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_checkpoint.html|20010305004145|01607|4a1704dbfcaad5dc
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_commit.html|20010305004145|02592|8950b5e11c8b0778
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_id.html|20010305004144|04952|1e71088a7e8f6678
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_prepare.html|20010305004145|03605|19f84203db4e6608
-tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_stat.html|20010305004145|04637|f57a656bfbac12bf
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/cxx_index.html|20010305004145|07331|a0bc165de8a0554c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/cxx_pindex.html|20010305004147|08181|9ff6b69b56f988dd
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_class.html|20010305004145|08391|3129ff8c53721fe8
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_close.html|20010305004145|28189|cc570e65ac7d22f
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_cursor.html|20010305004145|29241|4f0225f98f4a11c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_del.html|20010305004145|31220|43fa05f2dfa86dbc
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_err.html|20010305004145|10496|77022bd5af575696
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_fd.html|20010305004145|33050|99ec316575f80428
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get.html|20010305004145|34357|3b6e6005f3f17f2a
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get_byteswapped.html|20010305004146|00979|a44d5d57d050b466
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get_type.html|20010305004146|01846|398668783c4070db
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_join.html|20010305004146|02717|9c4819679501ad6e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_key_range.html|20010305004146|03630|d79b373af096cb7
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_open.html|20010305004146|04518|ab95c48ac26ad3f7
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_put.html|20010305004146|05435|2792034e8c83c56
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_remove.html|20010305004146|06326|8c537fc5e326293b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_rename.html|20010305004146|07200|9c0a820e864220b3
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_append_recno.html|20010305004146|08075|a158b1fdba756ce
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_compare.html|20010305004146|08946|d888d1ebe056bc6b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_minkey.html|20010305004146|09837|d6181e52342005c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_prefix.html|20010305004146|11627|ecd8f927371a5dbd
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_cachesize.html|20010305004146|12541|3befdbaf98d5a04e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_dup_compare.html|20010305004146|13472|91f36955a213e0f4
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errcall.html|20010305004146|10727|28a7a1fa2b3b73ee
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errfile.html|20010305004145|11465|f6eddb9ab7ef07d0
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errpfx.html|20010305004146|14381|1f26e7b0bb5a067f
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_feedback.html|20010305004146|15263|a08620d86f05ec8c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_flags.html|20010305004146|16174|1146625feeb3bb0b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_ffactor.html|20010305004146|17155|a67084c644c38114
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_hash.html|20010305004146|18078|afe952f65389d93b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_nelem.html|20010305004146|19017|1829bc583d9c7554
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_lorder.html|20010305004146|19980|a46750a29588268c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_malloc.html|20010305004145|12423|b0aa5802da5bef4d
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_pagesize.html|20010305004146|20914|b8d544ec3e102c6c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_paniccall.html|20010305004145|13411|6bc911c9d64e9237
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_q_extentsize.html|20010305004146|21826|b17e340a68ede3ac
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_delim.html|20010305004146|22753|81d9df93c3511df3
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_len.html|20010305004146|23672|e09bb30e40208dfb
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_pad.html|20010305004146|24627|f2e0c2c2c3806a97
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_source.html|20010305004146|25550|46998978715ccc1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_realloc.html|20010305004145|14370|64d967a58c328957
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_stat.html|20010305004146|26537|3473827de856d680
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_sync.html|20010305004146|27538|dadf1f745e44faa7
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_upgrade.html|20010305004146|28493|c6231eb2f9989284
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_verify.html|20010305004146|29479|14db455da528229d
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_class.html|20010305004145|15353|2a31b398c37d674b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_close.html|20010305004146|30462|2adba79b482ee157
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_count.html|20010305004146|31395|bc025b8894450525
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_del.html|20010305004146|32671|424fc0ebb3b4c5cf
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_dup.html|20010305004146|33708|75df863b4bc13aaa
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_get.html|20010305004146|34739|36e2dbe65e3442e3
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_put.html|20010305004146|35761|11e6aa2492dd1032
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbenv_class.html|20010305004145|16297|5ab8aaf8a531f76b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbt_class.html|20010305004145|17281|fb91648586c1aa77
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_close.html|20010305004146|36778|5cc705b97b86972c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_open.html|20010305004146|37756|66ac1ae7fa67ca4a
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_remove.html|20010305004146|38809|5efece7ecdfc4df7
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_cachesize.html|20010305004146|39807|b82ed49a47415fec
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_data_dir.html|20010305004146|40779|9176f081597e4f27
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errcall.html|20010305004146|41745|bae25b45b0196773
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errfile.html|20010305004145|18322|f9543c9e65ed6a1d
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_error_stream.html|20010305004145|19317|a4101c1d68559fa2
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errpfx.html|20010305004146|42728|d26da4bab9538234
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_feedback.html|20010305004146|43755|1d5bd8dfe2d8034e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_flags.html|20010305004146|44734|8136e8e1ae16dc02
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_bsize.html|20010305004146|45706|7fd917bea6b163bf
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_dir.html|20010305004146|46674|c08aac264e7faa97
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_max.html|20010305004146|47638|4f7ba5f02c66c0de
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_conflicts.html|20010305004146|48615|5bba88df4cc6dfba
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_detect.html|20010305004146|49591|13e53300b722cf1e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max.html|20010305004146|50580|52ac3c4ca2876de
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_lockers.html|20010305004146|52578|ebb61fd669c2eefb
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_locks.html|20010305004146|51576|bbde4ffbcc607f61
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_objects.html|20010305004146|53572|c47424e4d13d5327
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_mp_mmapsize.html|20010305004146|54573|c21e3f9c5a29b0ab
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_mutexlocks.html|20010305004146|55575|f73e7ffdd2d8d62f
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_pageyield.html|20010305004146|56583|db4e5bdf71e171c0
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_paniccall.html|20010305004145|20292|2080056f15faa516
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_panicstate.html|20010305004146|57577|ad2d38e398cafd31
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_rec_init.html|20010305004146|58586|77916e00d1361c7b
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_region_init.html|20010305004146|59589|2d70678382bbbf9a
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_server.html|20010305004146|60631|bb74806839e8eb58
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_shm_key.html|20010305004146|62685|65b2c2f848ddf31e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tas_spins.html|20010305004146|64671|a107049f4776b358
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tmp_dir.html|20010305004146|00169|6c815da1fad27537
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_max.html|20010305004146|01212|910d1c17dd000729
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_recover.html|20010305004146|02235|cdf13797131b2d97
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_timestamp.html|20010305004146|03286|6396a1145f8e41c1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_verbose.html|20010305004146|04365|e804a65368b5cdc1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_strerror.html|20010305004146|05414|7e1cbfbd096ca
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_version.html|20010305004146|06444|1cff25c44cbea934
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/except_class.html|20010305004145|21277|59839667e43592e
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/get_errno.html|20010305004145|22249|e1a57c1c5f1d2695
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_class.html|20010305004145|23233|ed88ab78cccbef8d
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_detect.html|20010305004146|07495|bb50519c431233ed
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_get.html|20010305004146|61648|527d63a8526f336c
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_id.html|20010305004146|08539|b3c7995efbe12c16
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_put.html|20010305004146|09587|9eb85a1c9e88621
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_stat.html|20010305004146|10635|2112ceb0894b34d8
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_vec.html|20010305004146|11739|c55deaa5173a3323
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_archive.html|20010305004146|12836|d47f39e6dad7ee50
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_compare.html|20010305004146|13902|3225b4c32016c9b1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_file.html|20010305004146|14965|9a724b41d84e0c31
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_flush.html|20010305004146|16027|3976f77e905f35eb
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_get.html|20010305004146|17104|aee6162219c71617
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_put.html|20010305004146|18207|66077da9630fa8c2
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_register.html|20010305004146|19292|55470e0d79382beb
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_stat.html|20010305004146|20379|dc2d4ffe7950fc09
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_unregister.html|20010305004146|21535|8fa1fe691751d6ad
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lsn_class.html|20010305004145|24210|34809f73e15540ad
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fclose.html|20010305004146|22608|cc4a5776ac69d660
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fget.html|20010305004146|23710|bfe74f8c299c2995
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fopen.html|20010305004146|24842|abfef0a4db99c8e1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fput.html|20010305004146|26004|7ee8cda6287dee81
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fset.html|20010305004146|27124|e52fa0488faa893
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fsync.html|20010305004146|28227|76d47da7c5dc8932
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_register.html|20010305004146|29358|cba6f572fe27c7a
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_stat.html|20010305004146|31867|d370717a78971be1
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_sync.html|20010305004146|33235|253961279934d3c8
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_trickle.html|20010305004146|34409|c9df8540b9ebc898
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/mempfile_class.html|20010305004145|25191|672b4aa787b4aeca
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/pindex.src|20010305004145|09392|d65361c4acfcef06
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_abort.html|20010305004147|01091|81177bcb2e5f4502
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_begin.html|20010305004147|02053|3a2d1488ec9d8655
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_checkpoint.html|20010305004147|02999|173930473e76d008
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_class.html|20010305004145|26179|5e57abe095aceca9
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_commit.html|20010305004147|03924|65afb8caf9c470ae
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_id.html|20010305004147|04873|162661f4c2dc09d6
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_prepare.html|20010305004147|05797|818b4163518bace5
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_stat.html|20010305004147|06751|e8e25f86f8541696
-tim@threads.polyesthetic.msg|bdb/docs/api_cxx/what.html|20010305004145|27185|a64f42c697273c44
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_class.html|20010305004147|09609|b957a4d2b77acb1e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_close.html|20010305004147|24101|21595167f4fdbe88
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_cursor.html|20010305004147|25020|2181d652bd1c1ff
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_del.html|20010305004147|25922|f4f15b362b114506
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_fd.html|20010305004147|26830|1f70020c37023baa
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get.html|20010305004147|27733|87b8316c55b24739
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get_byteswapped.html|20010305004147|28706|edbc66a9d5491a1
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get_type.html|20010305004147|29592|4cfb6f09cbe0b8ae
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_join.html|20010305004147|30506|a3a6dead9cae65f9
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_key_range.html|20010305004147|31461|8834de5873a6acb5
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_open.html|20010305004147|32409|bfc13736b96ac509
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_put.html|20010305004147|33389|c476abe5599f21cf
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_remove.html|20010305004147|34343|49d3b8c7e5a5b000
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_rename.html|20010305004147|35341|19b20feaa815bc27
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_append_recno.html|20010305004147|36282|d28bf857803b93a2
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_compare.html|20010305004147|37206|e972f964d042b35e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_minkey.html|20010305004147|38144|c7e1f184bdca25fa
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_prefix.html|20010305004147|39088|a3269aad23e6dbc
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_cachesize.html|20010305004147|40035|22d172a2d29f276b
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_dup_compare.html|20010305004147|40992|3dabd840a1d9e5f3
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_errcall.html|20010305004147|41930|4e4743f5b4277199
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_errpfx.html|20010305004147|42881|c446da51277796df
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_feedback.html|20010305004147|45141|69b4c07b3dbe383
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_flags.html|20010305004147|46212|b6b9d271bd42a94e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_ffactor.html|20010305004147|47226|edcc10024104d57e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_hash.html|20010305004147|48174|c6eb825c706a9548
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_nelem.html|20010305004147|49144|fc6f22a4c285fcef
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_lorder.html|20010305004147|50103|f64cbdd62bbbdd7c
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_pagesize.html|20010305004147|51079|d899ea90b20b7b31
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_q_extentsize.html|20010305004147|52035|6ac26239fc538cb
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_delim.html|20010305004147|53019|78fcf2d750fb26ef
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_len.html|20010305004147|53997|8448826ea78c630e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_pad.html|20010305004147|54985|2729c192747ac7af
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_source.html|20010305004147|55969|b29827dbf47537d1
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_stat.html|20010305004147|57008|bc253f0883e9c82b
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_sync.html|20010305004147|58064|42391f7d5f200b90
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_upgrade.html|20010305004147|59076|782fa4cc6c633990
-tim@threads.polyesthetic.msg|bdb/docs/api_java/db_verify.html|20010305004147|60082|20873ab17f6ed922
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_class.html|20010305004147|11473|8ee03c40ae0dbcb8
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_close.html|20010305004147|61116|e3bf1f36bc0e8e7e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_count.html|20010305004147|62108|9c239575f4550756
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_del.html|20010305004147|63111|6ec2b8a4b8dde996
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_dup.html|20010305004147|64103|aa141014c4d7f9b0
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_get.html|20010305004147|65144|e66e387b83681e73
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_put.html|20010305004147|00700|da0f0fa974385abd
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbenv_class.html|20010305004147|12326|92c7a4a6c22090c7
-tim@threads.polyesthetic.msg|bdb/docs/api_java/dbt_class.html|20010305004147|13192|f6b04ff142e332f8
-tim@threads.polyesthetic.msg|bdb/docs/api_java/deadlock_class.html|20010305004147|14282|b587b2d8c9e5d0b0
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_close.html|20010305004147|01809|c4e2ec77d7d14d4f
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_open.html|20010305004147|02873|2df0f0ef544da715
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_remove.html|20010305004147|04039|e92277e3dfd9bba1
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_cachesize.html|20010305004147|05132|f3700cd19856f14e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_data_dir.html|20010305004147|06162|b7b3f35e96804650
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_errcall.html|20010305004147|07189|4e206d08cbb39ab7
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_error_stream.html|20010305004147|15677|a738119910b452b8
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_errpfx.html|20010305004147|08227|a3b9a09670f6912
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_feedback.html|20010305004147|09255|9748745e65f070d5
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_flags.html|20010305004147|10283|690847bb5e205c21
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_bsize.html|20010305004147|11335|6c67beed877df84c
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_dir.html|20010305004147|12366|484cad2123994e14
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_max.html|20010305004147|13429|c9f705492162e175
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_conflicts.html|20010305004147|14497|8951eb975a90918b
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_detect.html|20010305004147|15549|9fc15a1a95b0dfa1
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max.html|20010305004147|16607|12b6e34ac5a53281
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_lockers.html|20010305004147|18755|7896265ea77829b3
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_locks.html|20010305004147|17677|f0114205b169de39
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_objects.html|20010305004147|19812|d1ed194631ffeb2a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_mp_mmapsize.html|20010305004147|20894|b7dea9108fa65dfa
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_mutexlocks.html|20010305004147|21961|aad8e4a059075bb6
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_pageyield.html|20010305004147|23054|774b3da0306a6767
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_panicstate.html|20010305004147|24142|72846d9a97cb80bb
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_rec_init.html|20010305004147|25237|1fdb2c5fc3b6407
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_region_init.html|20010305004147|26379|30534afa94cbf54e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_server.html|20010305004147|27545|d901cdab9698605d
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_shm_key.html|20010305004147|28699|8c576698882f0edc
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tas_spins.html|20010305004147|30425|2f9963827fbcb3f
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tmp_dir.html|20010305004147|32251|f23e4f614f6d975a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_max.html|20010305004147|33999|70f356b8b67782fe
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_recover.html|20010305004148|00983|40280da113fc9d2b
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_timestamp.html|20010305004148|02804|457eeb135f1f8bc0
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_verbose.html|20010305004148|03690|9dcda0399c8256e7
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_strerror.html|20010305004148|04588|fceebaa94cf9aafd
-tim@threads.polyesthetic.msg|bdb/docs/api_java/env_version.html|20010305004148|05599|854d26806930cab6
-tim@threads.polyesthetic.msg|bdb/docs/api_java/except_class.html|20010305004147|16978|195c00e4a7cbe648
-tim@threads.polyesthetic.msg|bdb/docs/api_java/get_errno.html|20010305004147|17836|89a89f8efe3a9360
-tim@threads.polyesthetic.msg|bdb/docs/api_java/java_index.html|20010305004147|18736|8ecfcef4a702011d
-tim@threads.polyesthetic.msg|bdb/docs/api_java/java_pindex.html|20010305004148|35859|f8bc0811d8eda8e9
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_class.html|20010305004147|19738|880aa614d1469304
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_detect.html|20010305004148|06490|14d4e7c7dca0dad7
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_get.html|20010305004148|07401|fd52de261831f9b5
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_id.html|20010305004148|08326|737cf8d8dc74084e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_put.html|20010305004148|09226|5af89e4cbf29c694
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_stat.html|20010305004148|10140|71b81d8567befc43
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_vec.html|20010305004148|11077|df5eb838fdbe1eab
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_archive.html|20010305004148|11996|b4a9483dbb5a2b58
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_compare.html|20010305004148|12947|756622b42572ecb
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_file.html|20010305004148|13857|74a49bae2532199a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_flush.html|20010305004148|14794|1691d6a3c8cc284e
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_get.html|20010305004148|15736|5fbbbd4baa60e052
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_put.html|20010305004148|16729|ad7e9f382abde491
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_register.html|20010305004148|17668|c68fc6fb22dd594a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_stat.html|20010305004148|18608|d186a08662046aba
-tim@threads.polyesthetic.msg|bdb/docs/api_java/log_unregister.html|20010305004148|19590|eee284e0da176d0a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/lsn_class.html|20010305004147|20619|b1458208b6c81016
-tim@threads.polyesthetic.msg|bdb/docs/api_java/mem_class.html|20010305004147|21486|2e5052b5b2bea584
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fclose.html|20010305004148|20518|d08f0c134361f802
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fget.html|20010305004148|21431|ca84dee01997eb89
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fopen.html|20010305004148|22355|f7cf58725aa1c406
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fput.html|20010305004148|23268|6ba75e517a259703
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fset.html|20010305004148|24178|5c5371a93b83275
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fsync.html|20010305004148|25118|e767b233fe7730a2
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_register.html|20010305004148|26052|8331390a1c66fefd
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_stat.html|20010305004148|27008|4628462474db62b4
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_sync.html|20010305004148|27969|5b401daadc7261eb
-tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_trickle.html|20010305004148|28912|4d5c4e83a4a5c638
-tim@threads.polyesthetic.msg|bdb/docs/api_java/pindex.src|20010305004147|10521|de828917f041d27b
-tim@threads.polyesthetic.msg|bdb/docs/api_java/runrec_class.html|20010305004147|22358|49c5cb3efe0c201
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_abort.html|20010305004148|29858|ec9a3517748bfa3
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_begin.html|20010305004148|30859|553bf78bd7fc3e0a
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_checkpoint.html|20010305004148|31832|2565ac892d04b63d
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_class.html|20010305004147|23221|c7bb2a3393ca9488
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_commit.html|20010305004148|32812|c265042f3340baa1
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_id.html|20010305004148|01920|798720b73cc9391
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_prepare.html|20010305004148|33784|510a245c80e715c
-tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_stat.html|20010305004148|34772|9a6ef8c262f218f9
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_close.html|20010305004148|38213|f40794b17e0fe443
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_count.html|20010305004148|40010|4812f3756a75437
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_cursor.html|20010305004148|40924|e035b3c11a91c5d6
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_del.html|20010305004148|41829|400c7a72fb10d6f4
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get.html|20010305004148|42753|127bd361ee695c71
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get_join.html|20010305004148|43762|1c737805c2c49cf9
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get_type.html|20010305004148|44686|7202f3ca793e6ec3
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_is_byteswapped.html|20010305004148|45596|8fb9e2c58051c769
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_join.html|20010305004148|46525|cb3eb61ed17a1f8
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_open.html|20010305004148|47486|f588cc9bc694cbf0
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_put.html|20010305004148|48549|380c7caeced55512
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_remove.html|20010305004148|50431|3b2be4b0b1b3dc98
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_rename.html|20010305004148|49486|909bc643d5455b54
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_stat.html|20010305004148|51363|3bb57be2de907fd2
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_sync.html|20010305004148|52310|3b615ca64d934602
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_close.html|20010305004148|53244|ef431e58d72accc3
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_del.html|20010305004148|54185|7e94f9f01e7e4453
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_dup.html|20010305004148|55139|325121689412d70b
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_get.html|20010305004148|56098|5bbb80cf51aff594
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_put.html|20010305004148|57122|290ecb1275d4270
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_close.html|20010305004148|58109|bf191b2673a2b19e
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_open.html|20010305004148|59088|39b63925d45a637e
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_remove.html|20010305004148|60117|9090900413ff0280
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/pindex.src|20010305004148|39123|f8754fff24f2cb24
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/tcl_index.html|20010305004148|61088|443e6b9a10ef4139
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/tcl_pindex.html|20010305004148|00553|259f0e062eee63c7
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn.html|20010305004148|62085|8e345950e6029230
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn_abort.html|20010305004148|63068|8cc23b6ef6f457d2
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn_commit.html|20010305004148|64051|25150b20b84cd519
-tim@threads.polyesthetic.msg|bdb/docs/api_tcl/version.html|20010305004148|65038|eeb51f4de1bbfe8e
-tim@threads.polyesthetic.msg|bdb/docs/images/api.gif|20010305004148|02578|dec2d4fe5f39dffe
-tim@threads.polyesthetic.msg|bdb/docs/images/next.gif|20010305004148|03600|ddab96466674135b
-tim@threads.polyesthetic.msg|bdb/docs/images/prev.gif|20010305004148|04639|9448d24755d708a0
-tim@threads.polyesthetic.msg|bdb/docs/images/ps.gif|20010305004148|05648|f6b1b372cb2cda4c
-tim@threads.polyesthetic.msg|bdb/docs/images/ref.gif|20010305004148|06650|add30c753dc1972d
-tim@threads.polyesthetic.msg|bdb/docs/images/sleepycat.gif|20010305004148|07668|ea63aaaa508ef096
-tim@threads.polyesthetic.msg|bdb/docs/index.html|20010305004143|26935|450dd5db21a9bb64
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/close.html|20010305004148|10227|ed6f7427edc0431
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/count.html|20010305004148|11236|8fd8daf2e2cbd7c7
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/curclose.html|20010305004148|12231|8b6b8442fc8382f7
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/curdel.html|20010305004148|13236|39bf0a8cba99c064
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/curdup.html|20010305004148|14243|5c855e1f5b99d990
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/curget.html|20010305004148|15271|d7dd42affcd54073
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/curput.html|20010305004148|16324|c7e4fa0a68170c3d
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/cursor.html|20010305004148|17350|6dbcdb3b7d552f58
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/delete.html|20010305004148|18364|9195664374690b24
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/error.html|20010305004148|19390|45ac854e68196844
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/get.html|20010305004148|20425|96c9c9a01c32d16
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/join.html|20010305004148|22331|acc16686a78a732
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/open.html|20010305004148|23468|c9a7e23579a5e93a
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/opensub.html|20010305004148|24500|81c79cce793fb343
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/ops.html|20010305004148|25566|9b24db9ba4f45724
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/partial.html|20010305004148|26629|db4a970c839b3051
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/put.html|20010305004148|28752|8e18b0af61eb7f0f
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/stability.html|20010305004148|30129|a92faac934d69cef
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/stat.html|20010305004148|32050|fafc0f88571d9395
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/sync.html|20010305004148|33751|381722c07c9d8825
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/upgrade.html|20010305004149|00532|c7499736f03c1a1c
-tim@threads.polyesthetic.msg|bdb/docs/ref/am/verify.html|20010305004149|01382|badaeba91bda50e1
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_compare.html|20010305004149|18156|c1e847e651704c89
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_minkey.html|20010305004149|19013|b4708e561be92b83
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_prefix.html|20010305004149|19903|4e7602aa68d50fe1
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_recnum.html|20010305004149|20770|f081f10254e86e75
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/byteorder.html|20010305004149|21617|999a22f727e2dae0
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/cachesize.html|20010305004149|22486|99dcd466dc881093
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/dup.html|20010305004149|23371|523731632fca7343
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/extentsize.html|20010305004149|24263|fdcfb5572974545c
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_ffactor.html|20010305004149|25120|5eb87b7ce99f3362
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_hash.html|20010305004149|25978|3a0174586fbcfcdf
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_nelem.html|20010305004149|26871|979995db477052ad
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/intro.html|20010305004149|27745|dd1647202258ee28
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/logrec.html|20010305004149|28646|5edeb34d63936e2
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/malloc.html|20010305004149|29537|cb0e6d7e9448d93e
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/pagesize.html|20010305004149|30437|eb4800704ae1131b
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/re_source.html|20010305004149|31346|b000d11ca4a0f9a
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/recno.html|20010305004149|32283|c2ae722138309e95
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/renumber.html|20010305004149|33199|b7df79bf32240b5c
-tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/select.html|20010305004149|34120|57b1c99f6a8ea93f
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/apis.html|20010305004149|36488|a84570e410b11a6a
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/bigpic.gif|20010305004149|41251|fe43e7415b3bbdb0
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/bigpic.html|20010305004149|37519|ab5254bc99af0d5c
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/progmodel.html|20010305004149|38491|caa422dc155b6370
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/script.html|20010305004149|39400|6796fd0a63161a0c
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/smallpic.gif|20010305004149|42169|fdf77055d7e711
-tim@threads.polyesthetic.msg|bdb/docs/ref/arch/utilities.html|20010305004149|40326|54d7014fab332c7a
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/aix.html|20010305004149|44137|e8ae448bdb85fa22
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/conf.html|20010305004149|45053|d0378c69618b790b
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/flags.html|20010305004149|46003|a739404f90eb8c3d
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/freebsd.html|20010305004149|46918|8ed2a42e1668004c
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/hpux.html|20010305004149|47818|d34942564699608
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/install.html|20010305004149|48752|660222dd1feffc4
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/intro.html|20010305004149|49652|f261022c26987d7f
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/irix.html|20010305004149|50564|95833aedc3a82f0
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/linux.html|20010305004149|51464|f9f2d09dc6df75e
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/notes.html|20010305004149|52391|97e9b52853db15ea
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/osf1.html|20010305004149|53358|9d4ebabfe3af8970
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/qnx.html|20010305004149|54263|6d2849a8e8038dc9
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/sco.html|20010305004149|55174|e25f6271a1b753d0
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/shlib.html|20010305004149|56099|7168ed40f2e1155d
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/solaris.html|20010305004149|57063|3a85fb541538d0d7
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/sunos.html|20010305004149|58008|fc41965e9d95985c
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/test.html|20010305004149|58940|b2c2f275a0c3e783
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/ultrix.html|20010305004149|59865|a1dd780edcde11f6
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/faq.html|20010305004149|61835|cdb7646d3d2e6374
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/intro.html|20010305004149|62808|2eed15d25078711
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/notes.html|20010305004149|63758|7e53a042c5c4d350
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/faq.html|20010305004149|65331|34704a907168cea7
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/intro.html|20010305004149|00770|2975a07b53b12046
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/notes.html|20010305004149|01764|4058bf968f287f7
-tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/test.html|20010305004149|02729|84090b57cb7f0cf8
-tim@threads.polyesthetic.msg|bdb/docs/ref/cam/intro.html|20010305004149|04558|4c497b1a18c4c7f5
-tim@threads.polyesthetic.msg|bdb/docs/ref/debug/common.html|20010305004149|07598|607061232e2532df
-tim@threads.polyesthetic.msg|bdb/docs/ref/debug/compile.html|20010305004149|08609|12785e3091b78bfd
-tim@threads.polyesthetic.msg|bdb/docs/ref/debug/intro.html|20010305004149|06616|57ef29f26341ea
-tim@threads.polyesthetic.msg|bdb/docs/ref/debug/printlog.html|20010305004149|09591|9fa9894f839fad95
-tim@threads.polyesthetic.msg|bdb/docs/ref/debug/runtime.html|20010305004149|10629|d50f2fea4a8e58c
-tim@threads.polyesthetic.msg|bdb/docs/ref/distrib/layout.html|20010305004149|12589|5aeb292fbd987cf8
-tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/format.html|20010305004149|13995|9fa10ca3c7ae6751
-tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/text.html|20010305004149|14998|88b57a73860b423
-tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/utility.html|20010305004149|15969|8fc100fdb58adb3c
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/create.html|20010305004149|17402|9f454cb1910df0b8
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/error.html|20010305004149|18447|acbbdb848c9fe70f
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/intro.html|20010305004149|19435|96dd1090729e06b
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/naming.html|20010305004149|20447|1f041789686cc8a0
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/open.html|20010305004149|21520|37a6e67d520d6c00
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/region.html|20010305004149|22506|cc94139c8daa7f6a
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/remote.html|20010305004149|23518|52a3a79fdff8f7bd
-tim@threads.polyesthetic.msg|bdb/docs/ref/env/security.html|20010305004149|24507|e455f95aee7f5cd2
-tim@threads.polyesthetic.msg|bdb/docs/ref/install/file.html|20010305004150|21159|d4ba2317db7c064b
-tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.s5.be.txt|20010305004150|22805|cf7d25e758432ab6
-tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.s5.le.txt|20010305004150|23615|528ef76418c8b45c
-tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.txt|20010305004150|21985|3894a46ea11ce25a
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/data.html|20010305004149|26092|33fbf7496c58cf63
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/dbis.html|20010305004149|28303|e672b7615d70be2c
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/dbisnot.html|20010305004149|29466|5ce7aed7ce41c9e6
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/distrib.html|20010305004149|30742|84b56709310017f2
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/need.html|20010305004149|31743|43950806e35d71f
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/products.html|20010305004149|32785|f37221772a3b589d
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/terrain.html|20010305004149|33850|b396d6447a59435f
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/what.html|20010305004150|00539|dd70b9e6e085725d
-tim@threads.polyesthetic.msg|bdb/docs/ref/intro/where.html|20010305004150|01442|6cb9ec27f19ecbbb
-tim@threads.polyesthetic.msg|bdb/docs/ref/java/compat.html|20010305004150|25581|b39d173789bbf70d
-tim@threads.polyesthetic.msg|bdb/docs/ref/java/conf.html|20010305004150|26401|ef560bcf13a71cd5
-tim@threads.polyesthetic.msg|bdb/docs/ref/java/faq.html|20010305004150|27218|7ca2474ba1f6676f
-tim@threads.polyesthetic.msg|bdb/docs/ref/java/program.html|20010305004150|28026|e9bbc08bccf5d396
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/am_conv.html|20010305004150|30986|3bab32d969f21b77
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/cam_conv.html|20010305004150|31862|63844ff6fa95f0c
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/config.html|20010305004150|32692|a593ea4c87467ddd
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/dead.html|20010305004150|33535|f5c7debd9ba739bb
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/intro.html|20010305004150|34434|e1e07e71f3198be
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/max.html|20010305004150|35299|f0fb32ebc251f636
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/nondb.html|20010305004150|36156|863fe076a46378d7
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/notxn.html|20010305004150|37003|beec805d9f05e2bc
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/page.html|20010305004150|37863|d56876b2565cbee
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/stdmode.html|20010305004150|38797|4048a052ea129ca3
-tim@threads.polyesthetic.msg|bdb/docs/ref/lock/twopl.html|20010305004150|39650|b3f3aee667bc381d
-tim@threads.polyesthetic.msg|bdb/docs/ref/log/config.html|20010305004150|41449|aedc53caf49c51c9
-tim@threads.polyesthetic.msg|bdb/docs/ref/log/intro.html|20010305004150|42339|31e7055d83ca8757
-tim@threads.polyesthetic.msg|bdb/docs/ref/log/limits.html|20010305004150|43198|26fac1e32387b7c9
-tim@threads.polyesthetic.msg|bdb/docs/ref/mp/config.html|20010305004150|46018|771c2c91fc0b6b17
-tim@threads.polyesthetic.msg|bdb/docs/ref/mp/intro.html|20010305004150|45138|34937731cafcf1b1
-tim@threads.polyesthetic.msg|bdb/docs/ref/perl/intro.html|20010305004150|47570|ce7e794e619e1e1d
-tim@threads.polyesthetic.msg|bdb/docs/ref/pindex.src|20010305004149|02223|7d74723f9fd25801
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/appsignals.html|20010305004150|48930|3ab63bf9399d7ead
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/byteorder.html|20010305004150|49835|f7fa52b53e4c8838
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/compatible.html|20010305004150|50729|237b98e6a6d7ed35
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/copy.html|20010305004150|51641|bcf5ff9656fafcd3
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/dbsizes.html|20010305004150|52571|d70da530573b9b38
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/diskspace.html|20010305004150|53502|959508f155721ee8
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/environ.html|20010305004150|54494|dc4a48aa531bd399
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/errorret.html|20010305004150|55412|23491397d7e704e9
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/extending.html|20010305004150|56407|6a86a40872d6b8bc
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/mt.html|20010305004150|57429|552ab570b657fc0e
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/namespace.html|20010305004150|58394|182f8f762343bdc1
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/recimp.html|20010305004150|60288|bbdb0feb7d467a80
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/runtime.html|20010305004150|61233|6853fdbfe15df788
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/scope.html|20010305004150|59326|2987f97781410bc1
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/solaris.txt|20010305004150|63135|8b6bb29de0d58ffe
-tim@threads.polyesthetic.msg|bdb/docs/ref/program/version.html|20010305004150|62172|d266e819d1531df8
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/bdb_usenix.html|20010305004150|00758|bad2247b4f8c582b
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/bdb_usenix.ps|20010305004150|02162|9851f6cdeff17481
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/embedded.html|20010305004150|03865|d25b9719d24df88c
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/hash_usenix.ps|20010305004150|05408|11cad226b0aa012b
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/libtp_usenix.ps|20010305004150|08667|73329b041f7e8c41
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/refs.html|20010305004150|64422|30490b237ba9b61
-tim@threads.polyesthetic.msg|bdb/docs/ref/refs/witold.html|20010305004150|65330|ad6c866cf48734b5
-tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/client.html|20010305004150|12568|824178f8626e45b7
-tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/intro.html|20010305004150|13549|ad16bc20623e1192
-tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/server.html|20010305004150|14510|79f560205494295
-tim@threads.polyesthetic.msg|bdb/docs/ref/sendmail/intro.html|20010305004150|16532|ecac45d7e2bcf51c
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/close.html|20010305004150|18046|1fe3a82f28e7ed32
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/del.html|20010305004150|19030|514a1bd568ed4c1d
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/errors.html|20010305004150|19994|be11ff6410e1db2c
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/example.txt|20010305004150|28042|9ff88f22565208bf
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/get.html|20010305004150|20970|211de230d6a6cbc5
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/handles.html|20010305004150|21935|18a14f4a50e7bad0
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/intro.html|20010305004150|22878|7544c4688623a54c
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/keydata.html|20010305004150|23810|530b1581aeba63ca
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/open.html|20010305004150|24776|5d6eb5c3df68eeee
-tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/put.html|20010305004150|25774|bdd2629c212af471
-tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/error.html|20010305004151|21581|37b817c57777b460
-tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/faq.html|20010305004151|22367|f8433900f7f85400
-tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/intro.html|20010305004151|20749|d66c6c398e2ace0b
-tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/program.html|20010305004151|23138|2f5bf497ae226ed5
-tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/using.html|20010305004151|23908|28856d8c72d0660b
-tim@threads.polyesthetic.msg|bdb/docs/ref/test/faq.html|20010305004151|38444|f95038006d18229
-tim@threads.polyesthetic.msg|bdb/docs/ref/test/run.html|20010305004151|39305|63c0398e7e2a29e2
-tim@threads.polyesthetic.msg|bdb/docs/ref/toc.html|20010305004148|08788|ab1fa294d5ef4b69
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/admin.html|20010305004151|41323|cf867ed0b00cccef
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/app.html|20010305004151|42111|6dc3c82982164fa8
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/archival.html|20010305004151|42978|7631314d840be181
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/checkpoint.html|20010305004151|43948|29e077c954369ed
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/cursor.html|20010305004151|44775|824b2f28c9e8d610
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/data_open.html|20010305004151|45592|413c1d8aba9d8018
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/deadlock.html|20010305004151|46421|34914b9dc6b01703
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/env_open.html|20010305004151|47233|c8d61102658c3bbf
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/filesys.html|20010305004151|48077|ebee24f726f99bf6
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/inc.html|20010305004151|48911|5ea32b4e2a2107b3
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/intro.html|20010305004151|49773|22096cea9fe159ac
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/logfile.html|20010305004151|50590|1c3002fcb6581e8c
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/put.html|20010305004151|51420|8cc785aeecff8535
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/read.html|20010305004151|52265|fc8b056380e09887
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/reclimit.html|20010305004151|53098|5f54174bf6026bd5
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/recovery.html|20010305004151|53956|6e3a0c07b997c3b2
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/term.html|20010305004151|54819|d6f3fa4fc5a630ec
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/throughput.html|20010305004151|55655|8a7d5a958df7f91a
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/transapp.txt|20010305004151|57368|337576ea2aae23b0
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/why.html|20010305004151|56525|c941c1a56a0adbaf
-tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/writetest.txt|20010305004151|58289|4de1fc39894cd760
-tim@threads.polyesthetic.msg|bdb/docs/ref/txn/config.html|20010305004151|59874|c7337cb30f9bf66
-tim@threads.polyesthetic.msg|bdb/docs/ref/txn/intro.html|20010305004151|60722|85fabd5518fb26be
-tim@threads.polyesthetic.msg|bdb/docs/ref/txn/limits.html|20010305004151|61583|3004b7a93dab148b
-tim@threads.polyesthetic.msg|bdb/docs/ref/txn/nested.html|20010305004151|62443|6860bbf2f29aa93b
-tim@threads.polyesthetic.msg|bdb/docs/ref/txn/other.html|20010305004151|63311|4991722636b3a46d
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/convert.html|20010305004151|00512|d7f18eb34c1b6ae
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/disk.html|20010305004151|01410|94dc4e6e3668e613
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/intro.html|20010305004151|02261|8bfd3804a2da1598
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/system.html|20010305004151|03146|eae0256a127c3c89
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/toc.html|20010305004151|04069|670791f294a61494
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/close.html|20010305004151|05457|c79c866b393785cc
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/cxx.html|20010305004151|06323|7f3bfc9bba854d48
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/db.html|20010305004151|07207|e7d63f4bb8e989e8
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/db_cxx.html|20010305004151|08078|5c17d6a360205140
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbenv.html|20010305004151|08972|f9863847dc1ed617
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbenv_cxx.html|20010305004151|09872|7f4fd0ebace36d8e
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbinfo.html|20010305004151|10780|7529af7145c0680a
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/disk.html|20010305004151|11685|eb79d1157ef44d3c
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/eacces.html|20010305004151|12569|f0299373d8b2f65c
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/eagain.html|20010305004151|13462|920800d8eb450f79
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/envopen.html|20010305004151|14369|5e768fd180f471e4
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/func.html|20010305004151|15332|c06e5bc63ddf7a64
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/intro.html|20010305004151|16219|7ecd16967b0bc868
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/java.html|20010305004151|17120|300acccbb633e335
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/join.html|20010305004151|18031|ec21d874caa0654
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/jump_set.html|20010305004151|18936|718c098a91db9dba
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_detect.html|20010305004151|19846|fb307b10156762ca
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_notheld.html|20010305004151|20761|ed6853b6daa5531b
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_put.html|20010305004151|21664|fd9ed0b04b465af
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_stat.html|20010305004151|22568|c49716e693ce225b
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/log_register.html|20010305004151|23513|399320e965adf598
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/log_stat.html|20010305004151|24428|20b5898ba061557d
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/memp_stat.html|20010305004151|25363|79e1141c63f7357
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/open.html|20010305004151|27357|8b1e2a969e97069a
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/rmw.html|20010305004151|28431|992b0143d13a3ec0
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/stat.html|20010305004151|29377|775d75e3ba02d15c
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/toc.html|20010305004151|30301|16e7d8e76496cbc9
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_begin.html|20010305004151|31307|53512180de5fec80
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_commit.html|20010305004151|32241|e1debf9ea769426c
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_stat.html|20010305004151|33181|516f1870c6127351
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/value_set.html|20010305004151|34118|f0b0c770a81b90b6
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/xa.html|20010305004152|00602|1af042e462ab829
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/btstat.html|20010305004152|37584|40a76aef8b25a948
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/config.html|20010305004152|38401|d2ace28f39ab0f8d
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/disk.html|20010305004152|39192|2abdaf9059265ba9
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/dup.html|20010305004152|40004|911018877c118b45
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/env.html|20010305004152|40827|381e366a9c9c9a37
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/intro.html|20010305004152|41719|64592a50b1c634d6
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/log_register.html|20010305004152|42524|7177eeb2fc099317
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/logalloc.html|20010305004152|43372|30563c544b8ddd54
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/memp_register.html|20010305004152|44171|7d92464a1029d53e
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/put.html|20010305004152|44997|961a1a689be6ce
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_feedback.html|20010305004152|45815|6d7de50be92a5488
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_paniccall.html|20010305004152|46636|8f9741244fb6e9f6
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_tx_recover.html|20010305004152|47442|ada65907ba98eee8
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/sysmem.html|20010305004152|48282|3d088eb0ef1b27e0
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/tcl.html|20010305004152|49096|f5c85b09c33bda4
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/tmp.html|20010305004152|50733|ef3450f6fa89f2dc
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/toc.html|20010305004152|49908|af1a24798980ad1
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/txn_check.html|20010305004152|51549|2405b25bc92cc476
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/callback.html|20010305004152|53656|64a2b2b85cc253c1
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/db_dump.html|20010305004152|54477|7d1cac3358c0482e
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/disk.html|20010305004152|55280|61799ebebe78ebb2
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/handle.html|20010305004152|56086|bb8a73b74d4399ae
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/incomplete.html|20010305004152|56914|af86a649a878a124
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/intro.html|20010305004152|57734|984a9f7dd07e0c14
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/mutexlock.html|20010305004152|58567|972b710c5bdba67c
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/notfound.html|20010305004152|59393|dc91c094aba92838
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/renumber.html|20010305004152|60219|d6cd798434da81aa
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/set_flags.html|20010305004152|61061|213809ca8d7802d0
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/toc.html|20010305004152|61902|9c94c533ada43c1a
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/tx_recover.html|20010305004152|62754|132a354cde7a8286
-tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade/process.html|20010305004151|64704|78f9ca966a587234
-tim@threads.polyesthetic.msg|bdb/docs/ref/xa/config.html|20010305004152|64479|3f3f449c305e66b4
-tim@threads.polyesthetic.msg|bdb/docs/ref/xa/faq.html|20010305004152|65373|7aa890c7b70f1293
-tim@threads.polyesthetic.msg|bdb/docs/ref/xa/intro.html|20010305004152|00728|8ac020ffb869e9a8
-tim@threads.polyesthetic.msg|bdb/docs/sleepycat/contact.html|20010305004152|04402|55b4da3d7bf7655b
-tim@threads.polyesthetic.msg|bdb/docs/sleepycat/legal.html|20010305004152|02616|7388af4c578cacf6
-tim@threads.polyesthetic.msg|bdb/docs/sleepycat/license.html|20010305004152|03483|9371001bbf0ba2dd
-tim@threads.polyesthetic.msg|bdb/docs/utility/berkeley_db_svc.html|20010305004152|06576|91fe012778882ce4
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_archive.html|20010305004152|07446|ab2c66e01b3e3626
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_checkpoint.html|20010305004152|08309|c040e4424edcc451
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_deadlock.html|20010305004152|09191|f23f99911c3e5784
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_dump.html|20010305004152|10062|5de7ade427f20332
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_load.html|20010305004152|10976|981095940db0197
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_printlog.html|20010305004152|11895|fcc4075ad0232842
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_recover.html|20010305004152|12771|1b63f2acdc0b0af7
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_stat.html|20010305004152|13652|9582c327964e1f9
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_upgrade.html|20010305004152|14532|6444f26a93f77ea
-tim@threads.polyesthetic.msg|bdb/docs/utility/db_verify.html|20010305004152|15424|4fee9bfa2f9ab41a
-tim@threads.polyesthetic.msg|bdb/docs/utility/index.html|20010305004152|05717|66c82ee036c1b369
-tim@threads.polyesthetic.msg|bdb/hash/hash_auto.c|20010305004137|61459|d17c6a6ed4f181d1
-tim@threads.polyesthetic.msg|bdb/include/btree_auto.h|20010305004137|17274|84d4451c78faf67e
-tim@threads.polyesthetic.msg|bdb/include/btree_ext.h|20010305004137|18246|5d53d710f170c6b6
-tim@threads.polyesthetic.msg|bdb/include/clib_ext.h|20010305004137|19207|ed9d9f7965f0e1d3
-tim@threads.polyesthetic.msg|bdb/include/common_ext.h|20010305004137|20146|35c8aab64ee3b8fd
-tim@threads.polyesthetic.msg|bdb/include/crdel_auto.h|20010305004137|21088|1b8255da47550ece
-tim@threads.polyesthetic.msg|bdb/include/db_auto.h|20010305004137|26350|994ddc84db334345
-tim@threads.polyesthetic.msg|bdb/include/db_ext.h|20010305004137|29469|a1e210bbd0de0a48
-tim@threads.polyesthetic.msg|bdb/include/db_server.h|20010305004137|34247|61a33aa05bf368a7
-tim@threads.polyesthetic.msg|bdb/include/env_ext.h|20010305004138|05832|33a5fdef1aeecefd
-tim@threads.polyesthetic.msg|bdb/include/gen_client_ext.h|20010305004138|06647|5c621cacb18b38
-tim@threads.polyesthetic.msg|bdb/include/gen_server_ext.h|20010305004138|07539|fd7bcfe6bbca8bcb
-tim@threads.polyesthetic.msg|bdb/include/hash_auto.h|20010305004138|09216|1b79cdd426d7ef25
-tim@threads.polyesthetic.msg|bdb/include/hash_ext.h|20010305004138|10079|5b31ff8413481606
-tim@threads.polyesthetic.msg|bdb/include/lock_ext.h|20010305004138|11814|ccd0785bb206933f
-tim@threads.polyesthetic.msg|bdb/include/log_auto.h|20010305004138|13513|8d52dd0884d03051
-tim@threads.polyesthetic.msg|bdb/include/log_ext.h|20010305004138|14339|2988f11d4545c76b
-tim@threads.polyesthetic.msg|bdb/include/mp_ext.h|20010305004138|17070|a528b772d42d6455
-tim@threads.polyesthetic.msg|bdb/include/mutex_ext.h|20010305004138|19006|f20f47ddc346598b
-tim@threads.polyesthetic.msg|bdb/include/os_ext.h|20010305004138|20730|a1771032b4d2d53b
-tim@threads.polyesthetic.msg|bdb/include/qam_auto.h|20010305004138|24568|96f6c045fd0d6cab
-tim@threads.polyesthetic.msg|bdb/include/qam_ext.h|20010305004138|25430|9993db1fb3428b6d
-tim@threads.polyesthetic.msg|bdb/include/rpc_client_ext.h|20010305004138|28220|85436ca9b5691338
-tim@threads.polyesthetic.msg|bdb/include/rpc_server_ext.h|20010305004138|29091|952741fb85de2b80
-tim@threads.polyesthetic.msg|bdb/include/tcl_ext.h|20010305004138|31857|6759d22aa2ff5f39
-tim@threads.polyesthetic.msg|bdb/include/txn_auto.h|20010305004138|33645|e3f49e94fd291c45
-tim@threads.polyesthetic.msg|bdb/include/txn_ext.h|20010305004138|34549|9db24c14f204890c
-tim@threads.polyesthetic.msg|bdb/include/xa_ext.h|20010305004138|36449|50918e5ef9f095b6
-tim@threads.polyesthetic.msg|bdb/java/src/com/sleepycat/db/DbConstants.java|20010305004138|56622|15fa87eda6b72302
-tim@threads.polyesthetic.msg|bdb/log/log_auto.c|20010305004137|49459|fe8c0369965f7151
-tim@threads.polyesthetic.msg|bdb/qam/qam_auto.c|20010305004141|31764|361954d3f149feb0
-tim@threads.polyesthetic.msg|bdb/rpc_client/db_server_clnt.c|20010305004141|41933|b548b860f765c597
-tim@threads.polyesthetic.msg|bdb/rpc_client/gen_client.c|20010305004141|43060|ad86f092d0996a68
-tim@threads.polyesthetic.msg|bdb/rpc_server/db_server.x|20010305004141|47705|811aeb6b630fe7aa
-tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_proc.sed|20010305004141|49906|1a9af8e5b051acbd
-tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_svc.c|20010305004141|50897|35804eb82b953f49
-tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_xdr.c|20010305004141|53794|336ef020b4a22c05
-tim@threads.polyesthetic.msg|bdb/rpc_server/gen_db_server.c|20010305004141|54931|d5602f9bd5c930e
-tim@threads.polyesthetic.msg|bdb/test/include.tcl|20010305004141|34016|20fc297b040cbe2
-tim@threads.polyesthetic.msg|bdb/test/logtrack.list|20010305004142|05743|7f4f1382b37d98e5
-tim@threads.polyesthetic.msg|bdb/txn/txn_auto.c|20010305004143|19863|6eb282f016f606d9
-tonu@x3.internalnet|include/vio.h|20010520213124|42404|c62fd2b86c03da7d
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
deleted file mode 100644
index 416ab8dbbde..00000000000
--- a/BitKeeper/etc/logging_ok
+++ /dev/null
@@ -1,314 +0,0 @@
-Administrador@light.
-Administrator@co3064164-a.
-Administrator@co3064164-a.rochd1.qld.optushome.com.au
-Administrator@fred.
-Administrator@w2k.
-Greg@greg-laptop.
-Miguel@light.local
-Sinisa@sinisa.nasamreza.org
-WAX@sergbook.mysql.com
-acurtis@ltantony.rdg.cyberkinetica.homeunix.net
-acurtis@pcgem.rdg.cyberkinetica.com
-acurtis@xiphis.org
-administrador@light.hegel.local
-ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
-akishkin@work.mysql.com
-anjuta@arthur.local
-antony@ltantony.dsl-verizon.net
-antony@ltantony.mysql.com
-antony@ltantony.rdg.cyberkinetica.com
-antony@ltantony.rdg.cyberkinetica.homeunix.net
-antony@ltantony.xiphis.org
-arjen@bitbike.com
-arjen@co3064164-a.bitbike.com
-arjen@fred.bitbike.com
-arjen@george.bitbike.com
-autotest@mc01.ndb.mysql.com
-bar@bar.intranet.mysql.r18.ru
-bar@bar.mysql.r18.ru
-bar@bar.udmsearch.izhnet.ru
-bar@deer.(none)
-bar@eagle.intranet.mysql.r18.ru
-bar@gw.udmsearch.izhnet.ru
-bar@mysql.com
-bar@noter.intranet.mysql.r18.ru
-bell@51.0.168.192.in-addr.arpa
-bell@52.0.168.192.in-addr.arpa
-bell@book.sanja.is.com.ua
-bell@laptop.sanja.is.com.ua
-bell@sanja.is.com.ua
-bk@admin.bk
-bk@mysql.r18.ru
-brian@avenger.(none)
-brian@brian-akers-computer.local
-brian@private-client-ip-101.oz.net
-brian@zim.(none)
-carsten@tsort.bitbybit.dk
-cps@silver_beast.(none)
-davida@isil.mysql.com
-dean@mysql.com
-dellis@goetia.(none)
-dlenev@brandersnatch.localdomain
-dlenev@build.mysql.com
-dlenev@jabberwock.localdomain
-dlenev@mysql.com
-ejonore@mc03.ndb.mysql.com
-elliot@mysql.com
-evgen@moonbone.(none)
-evgen@moonbone.local
-gbichot@bk-internal.mysql.com
-gbichot@production.mysql.com
-gbichot@quadita2.mysql.com
-gbichot@quadxeon.mysql.com
-geert@kriem.kemuri.org
-georg@beethoven.local
-georg@beethoven.site
-georg@lmy002.wdf.sap.corp
-gerberb@ou800.zenez.com
-gluh@eagle.intranet.mysql.r18.ru
-gluh@gluh.(none)
-gluh@gluh.mysql.r18.ru
-gluh@mysql.com
-gordon@zero.local.lan
-greg@gcw.ath.cx
-greg@mysql.com
-guilhem@mysql.com
-gweir@build.mysql.com
-gweir@work.mysql.com
-harrison@mysql.com
-harry@corona.lordblink.com
-hartmut@mysql.com
-heikki@donna.mysql.fi
-heikki@hundin.mysql.fi
-heikki@rescue.
-heikki@work.mysql.com
-hf@bison.(none)
-hf@bisonxp.(none)
-hf@deer.(none)
-hf@deer.mysql.r18.ru
-hf@genie.(none)
-holyfoot@mysql.com
-igor@hundin.mysql.fi
-igor@igor-inspiron.creware.com
-igor@linux.local
-igor@rurik.mysql.com
-ingo@mysql.com
-jan@hundin.mysql.fi
-jani@a193-229-222-105.elisa-laajakaista.fi
-jani@a193-229-222-2.elisa-laajakaista.fi
-jani@a80-186-24-72.elisa-laajakaista.fi
-jani@a80-186-41-201.elisa-laajakaista.fi
-jani@a80-186-8-224.elisa-laajakaista.fi
-jani@dsl-jkl1657.dial.inet.fi
-jani@dsl-kpogw4gb5.dial.inet.fi
-jani@hynda.(none)
-jani@hynda.mysql.fi
-jani@ibmlab.site
-jani@janikt.pp.saunalahti.fi
-jani@linux.local
-jani@rhols221.adsl.netsonic.fi
-jani@rhols221.arenanet.fi
-jani@ua126d19.elisa.omakaista.fi
-jani@ua141d10.elisa.omakaista.fi
-jani@ua167d18.elisa.omakaista.fi
-jani@ua72d24.elisa.omakaista.fi
-jcole@abel.spaceapes.com
-jcole@main.burghcom.com
-jcole@mugatu.jcole.us
-jcole@mugatu.spaceapes.com
-jcole@sarvik.tfr.cafe.ee
-jcole@tetra.spaceapes.com
-jimw@mysql.com
-joerg@mysql.com
-joerg@trift-lap.fambruehe
-jon@gigan.
-jonas@mysql.com
-joreland@bk-internal.mysql.com
-joreland@mysql.com
-jorge@linux.jorge.mysql.com
-jplindst@t41.(none)
-kaa@polly.local
-kaj@work.mysql.com
-kent@mysql.com
-konstantin@mysql.com
-kosipov@production.mysql.com
-kostja@oak.local
-lars@mysql.com
-lenz@kallisto.mysql.com
-lenz@mysql.com
-magnus@msdesk.mysql.com
-magnus@neptunus.(none)
-magnus@shellback.(none)
-marko@hundin.mysql.fi
-marty@flipper.bredbandsbolaget.se
-marty@linux.site
-marty@shark.
-mats@mysql.com
-matt@booty.(none)
-matt@mysql.com
-matthias@three.local.lan
-miguel@hegel.(none)
-miguel@hegel.br
-miguel@hegel.local
-miguel@hegel.txg
-miguel@hegel.txg.br
-miguel@light.
-miguel@light.local
-miguel@sartre.local
-mikael@mc04.(none)
-mikael@orca.ndb.mysql.com
-mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
-mikron@mikael-ronstr-ms-dator.local
-mleich@mysql.com
-mmatthew@markslaptop.
-monty@bitch.mysql.fi
-monty@butch.
-monty@donna.mysql.fi
-monty@hundin.mysql.fi
-monty@mashka.(none)
-monty@mashka.mysql.fi
-monty@mishka.local
-monty@mishka.mysql.fi
-monty@mysql.com
-monty@narttu.
-monty@narttu.mysql.fi
-monty@rescue.
-monty@tik.
-monty@tik.mysql.fi
-monty@tramp.mysql.fi
-monty@work.mysql.com
-mronstrom@build.mysql.com
-mronstrom@mysql.com
-mskold@bk-internal.mysql.com
-mskold@mysql.com
-msvensson@build.mysql.com
-msvensson@neptunus.(none)
-msvensson@neptunus.homeip.net
-mwagner@cash.mwagner.org
-mwagner@evoq.mwagner.org
-mwagner@here.mwagner.org
-mwagner@mysql.com
-mwagner@ultrafly.mysql.com
-mwagner@work.mysql.com
-mydev@mysql.com
-mysql@home.(none)
-mysql@mc04.(none)
-mysqldev@bk-internal.mysql.com
-mysqldev@build.mysql2.com
-mysqldev@melody.local
-mysqldev@mysql.com
-mysqldev@o2k.irixworld.net
-ndbdev@dl145b.mysql.com
-ndbdev@dl145c.mysql.com
-ndbdev@eel.hemma.oreland.se
-ndbdev@ndbmaster.mysql.com
-ndbdev@shark.
-nick@mysql.com
-nick@nick.leippe.com
-obarnir@mysql.com
-papa@gbichot.local
-patg@krsna.
-patg@krsna.patg.net
-patg@patrick-galbraiths-computer.local
-patg@patrick.local
-patg@pc248.lfp.kcls.org
-patg@radha.local
-paul@central.snake.net
-paul@frost.snake.net
-paul@ice.local
-paul@ice.snake.net
-paul@kite-hub.kitebird.com
-paul@snake-hub.snake.net
-paul@teton.kitebird.com
-pekka@mysql.com
-pem@mysql.com
-pem@per-erik-martins-dator.local
-peter@linux.local
-peter@mysql.com
-peterg@mysql.com
-petr@mysql.com
-pgulutzan@linux.local
-pmartin@build.mysql2.com
-psergey@psergey-rh8.(none)
-psergey@psergey.(none)
-ram@deer.(none)
-ram@gw.mysql.r18.ru
-ram@gw.udmsearch.izhnet.ru
-ram@mysql.r18.ru
-ram@ram-book.(none)
-ram@ram.(none)
-ramil@mysql.com
-ranger@regul.home.lan
-rburnett@bk-internal.mysql.com
-rburnett@build.mysql.com
-reggie@bob.(none)
-reggie@mdk10.(none)
-reggie@monster.
-root@home.(none)
-root@mc04.(none)
-root@x3.internalnet
-salle@banica.(none)
-salle@geopard.(none)
-salle@geopard.online.bg
-salle@vafla.home
-salle@vafla.online.bg
-sasha@mysql.sashanet.com
-schwenke@lmy003.wdf.sap.corp
-schwenke@lmy003.xl.local
-serg@build.mysql.com
-serg@build.mysql2.com
-serg@mysql.com
-serg@serg.mylan
-serg@serg.mysql.com
-serg@sergbook.mylan
-serg@sergbook.mysql.com
-sergefp@mysql.com
-shuichi@mysql.com
-sinisa@rhols221.adsl.netsonic.fi
-stewart@mysql.com
-svoj@mysql.com
-tfr@beta.frontier86.ee
-tfr@indrek.tfr.cafe.ee
-tfr@sarvik.tfr.cafe.ee
-tim@bitch.mysql.fi
-tim@black.box
-tim@hundin.mysql.fi
-tim@sand.box
-tim@siva.hindu.god
-tim@threads.polyesthetic.msg
-tim@white.box
-tim@work.mysql.com
-timour@mysql.com
-tom@basil-firewall.home.com
-tomas@mc05.(none)
-tomas@poseidon.(none)
-tomas@poseidon.bredbandsbolaget.se
-tomas@poseidon.elisa-laajakaista.fi
-tomas@poseidon.ndb.mysql.com
-tonu@hundin.mysql.fi
-tonu@volk.internalnet
-tonu@x153.internalnet
-tonu@x3.internalnet
-tsmith@build.mysql.com
-tulin@build.mysql.com
-tulin@dl145b.mysql.com
-tulin@dl145c.mysql.com
-tulin@mysql.com
-ulli@morbus.(none)
-venu@hundin.mysql.fi
-venu@myvenu.com
-venu@work.mysql.com
-vtkachenko@intelp4d.mysql.com
-vtkachenko@mail.mysql.com
-vva@eagle.mysql.r18.ru
-vva@genie.(none)
-vva@mysql.r18.ru
-walrus@kishkin.ru
-walrus@mysql.com
-wax@kishkin.ru
-wax@mysql.com
-worm@altair.is.lan
-zak@balfor.local
-zak@linux.local
-zak@mysql.com
-zgreant@mysql.com
diff --git a/BitKeeper/etc/notify b/BitKeeper/etc/notify
deleted file mode 100644
index c38234e7826..00000000000
--- a/BitKeeper/etc/notify
+++ /dev/null
@@ -1 +0,0 @@
-dev@mysql.com
diff --git a/BitKeeper/etc/skipkeys b/BitKeeper/etc/skipkeys
deleted file mode 100644
index 36b38ab1c21..00000000000
--- a/BitKeeper/etc/skipkeys
+++ /dev/null
@@ -1,7 +0,0 @@
-BK|scripts/safe_mysqld.sh|19700101030959|01930|d0a3cc73fd1b0d8d tim@localhost.polyesthetic.msg|scripts/safe_mysqld.sh|20000802235627|38519
-bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe arjen@co3064164-a.bitbike.com|BitKeeper/etc/logging_ok|20011212060636|33009
-bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe jcole@tetra.bedford.progress.com|BitKeeper/etc/logging_ok|20001004201211|30554
-bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe sasha@work.mysql.com|BitKeeper/etc/logging_ok|20000802223223|24242
-bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe tim@localhost.polyesthetic.msg|BitKeeper/etc/logging_ok|20000802235640|27343
-bk@work.mysql.com|ChangeSet|20000731191004|44203|eae70093a6122e66+ sasha@work.mysql.com|ChangeSet|20000802223249|54774
-bk@work.mysql.com|ChangeSet|20000731191004|44203|eae70093a6122e66+ tim@localhost.polyesthetic.msg|ChangeSet|20000802235645|56533
diff --git a/BitKeeper/post-outgoing b/BitKeeper/post-outgoing
deleted file mode 100644
index 5b16dec6c15..00000000000
--- a/BitKeeper/post-outgoing
+++ /dev/null
@@ -1,14 +0,0 @@
- #!/bin/sh
-
- shift
- REPO=`bk gethost`:`pwd`
- TO=dev@mysql.com
- if [ -f BitKeeper/etc/pushed -a "$BK_OUTGOING" = OK ]
- then (
- echo ${USER}@"$@"
- echo ""
- bk changes - < BitKeeper/etc/pushed
- ) | mail -s "Outgoing from $REPO" $TO
- else
- echo ${USER}@"$@"| mail -s "Outgoing from $REPO = $BK_OUTGOING" $TO
- fi
diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit
deleted file mode 100755
index c3a61ed2dde..00000000000
--- a/BitKeeper/triggers/post-commit
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-
-#shift
-if [ -n "$BK_USER" ]
-then
- COMMITTER=$BK_USER
-else
- COMMITTER=$USER
-fi
-FROM=$COMMITTER@mysql.com
-COMMITS=commits@lists.mysql.com
-DOCS=docs-commit@mysql.com
-LIMIT=10000
-VERSION="5.1"
-BKROOT=`bk root`
-
-if [ -x /usr/sbin/sendmail ]; then
- SENDMAIL=/usr/sbin/sendmail
-else
- SENDMAIL=sendmail
-fi
-
-if [ "$REAL_EMAIL" = "" ]
-then
- echo "Warning: you must set REAL_EMAIL in your profile"
-else
- FROM=$REAL_EMAIL
-fi
-
-BK_STATUS=$BK_STATUS$BK_COMMIT
-
-if [ "$BK_STATUS" = OK ]
-then
-
-HAS_ACTUAL_CHANGES=`bk cset -r+ -d | grep -v "^#"`
-if [ "$HAS_ACTUAL_CHANGES" = "" ]
-then
- echo ChangeSet had no real changes, not sending emails
- exit
-fi
-
-IS_MERGE=`bk changes -r+ -k -m`
-if [ "$IS_MERGE" = "" ]
-then
- echo Merge changeset, not sending mails
- exit
-fi
-
-CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
-CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet`
-#
-# composing subject lines of commit mails.
-# if a fix targets to a WL and there is a bug referred
-# then X-Bug mail header will contain the first found bug's number
-#
-BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | \
- sed -ne 's/[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/BUG#\1/
- s/.*BUG#\([0-9][0-9]*\)/\1/p'`
-WL=`bk -R prs -r+ -h -d':C:' ChangeSet | \
- sed -ne 's/[Ww][Ll] *# *\([0-9][0-9]*\).*$/WL#\1/
- s/.*\(WL#[0-9][0-9]*\)/ \1/p'`
-if [ "$BUG" = "" ]
-then
-# TO=dev-public@mysql.com
- BS=""
- BH=""
-else
-# TO=dev-bugs@mysql.com
- BS=" BUG#$BUG"
-# need newline here
- BH="X-Bug: $BUG
-"
-fi
-
-#++
-# commits@ or dev-private@ mail
-#--
-
-LIST="commits"
-TO="commits@lists.mysql.com"
-if [ -f .tree-is-private ]
-then
- LIST="dev-private"
- TO="dev-private@mysql.com"
-fi
-
- echo "Notifying $LIST list at $TO"
- (
- cat <<EOF
-List-ID: <bk.mysql-$VERSION>
-From: $FROM
-To: $TO
-Subject: bk commit into $VERSION tree ($CHANGESET)$BS
-X-CSetKey: <$CSETKEY>
-$BH
-Below is the list of changes that have just been committed into a local
-$VERSION repository of $COMMITTER. When $COMMITTER does a push these changes
-will be propagated to the main repository and, within 24 hours after the
-push, to the public repository.
-For information on how to access the public repository
-see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
-
-EOF
- bk changes -v -r+
- bk rset -r+ -ah | bk gnupatch -h -dup -T
- ) | bk sed -e ${LIMIT}q > $BKROOT/BitKeeper/tmp/commits.txt
-
-$SENDMAIL -t < $BKROOT/BitKeeper/tmp/commits.txt
-
-#++
-# docs-commit@ mail
-# Picks up anything under the Docs subdirectory (relevant for docs team).
-#--
- bk changes -v -r+ | grep -q " Docs/"
- if [ $? -eq 0 ]
- then
- echo "Notifying docs list at $DOCS"
- (
- cat <<EOF
-List-ID: <bk.mysql-$VERSION>
-From: $FROM
-To: $DOCS
-Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
-
-EOF
- bk changes -v -r+
- bk rset -r+ -ah | bk gnupatch -h -dup -T
- ) > $BKROOT/BitKeeper/tmp/docs.txt
- $SENDMAIL -t < $BKROOT/BitKeeper/tmp/docs.txt
- fi
-
-else
- echo "commit failed because '$BK_STATUS', you may need to re-clone..."
-fi
diff --git a/BitKeeper/triggers/post-commit.innodb.pl b/BitKeeper/triggers/post-commit.innodb.pl
deleted file mode 100755
index 44d98b04838..00000000000
--- a/BitKeeper/triggers/post-commit.innodb.pl
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-use FindBin;
-require "$FindBin::Bin/triggers-lib.pl";
-
-# Don't run unless commit was successful
-check_status() || exit 0;
-
-my $cset = latest_cset();
-
-# Read most recent ChangeSet's changed files. Send merge changes along, since
-# they'll need to be incorporated in InnoDB's source tree eventually.
-my $changes = innodb_get_changes('cset', $cset, 'yes')
- or exit 0;
-
-innodb_send_changes_email($cset, $changes)
- or exit 1;
-
-exit 0;
diff --git a/BitKeeper/triggers/post-incoming.innodb.pl b/BitKeeper/triggers/post-incoming.innodb.pl
deleted file mode 100755
index 4b100d88037..00000000000
--- a/BitKeeper/triggers/post-incoming.innodb.pl
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-use FindBin;
-require "$FindBin::Bin/triggers-lib.pl";
-
-# Don't run unless push/pull was successful
-check_status() or exit 0;
-
-# Don't run if push/pull is in local clones
-exit 0 if repository_type() eq 'local';
-
-# For each pushed ChangeSet, check it for InnoDB files and send
-# diff of entire ChangeSet to InnoDB developers if such changes
-# exist.
-
-my $error = 0;
-
-foreach my $cset (read_bk_csetlist())
-{
- my $changes = innodb_get_changes('cset', $cset, 'yes')
- or next;
-
- innodb_send_changes_email($cset, $changes)
- or $error = 1;
-}
-
-exit ($error == 0 ? 0 : 1);
diff --git a/BitKeeper/triggers/pre-commit b/BitKeeper/triggers/pre-commit
deleted file mode 100755
index f4664ccf1fe..00000000000
--- a/BitKeeper/triggers/pre-commit
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ]
-then
- echo "Error: you cannot commit as 'Administrator' or 'mysqldev' user."
- echo "as a workaround set BK_USER to your nickname"
- echo "e.g.: export BK_USER='bar'"
- echo ""
- echo "Checkin FAILED!"
- echo "Set BK_USER and retry."
- exit 1
-fi
-
-if [ "$REAL_EMAIL" = "" ]
-then
- echo "Error: you must set REAL_EMAIL in your profile"
- echo "e.g.: export REAL_EMAIL='Joe Dow <joe@foo.bar>'"
- echo ""
- echo "Commit FAILED!"
- echo "Set REAL_EMAIL and retry."
- exit 1
-fi
diff --git a/BitKeeper/triggers/pre-commit.check-case.pl b/BitKeeper/triggers/pre-commit.check-case.pl
deleted file mode 100755
index 4f68f8619e5..00000000000
--- a/BitKeeper/triggers/pre-commit.check-case.pl
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/perl
-my $status = 0;
-
-my $pending = $ENV{'BK_PENDING'};
-exit 0 unless -f $pending;
-
-open FI, "<", $pending || exit 0;
-while(<FI>) {
- my ($file, $stuff) = split /\|/, $_, 2;
- next unless -f $file;
- $file =~ s/^(.*)\/([^\/]*)$/$2/;
- my $path = $1;
- opendir DIR, $path;
- my @files = sort map { lc } readdir DIR;
- closedir DIR;
- my %count = ();
- $count{$_}++ for @files;
- @files = grep { $count{$_} > 1 } keys %count;
- if(@files > 0) {
- print "$path/$file: duplicate file names: " . (join " ", @files) . "\n";
- $status = 1;
- }
-}
-close FI;
-
-exit $status;
diff --git a/BitKeeper/triggers/pre-commit.innodb.pl b/BitKeeper/triggers/pre-commit.innodb.pl
deleted file mode 100755
index 6e2b65113b0..00000000000
--- a/BitKeeper/triggers/pre-commit.innodb.pl
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-use FindBin;
-require "$FindBin::Bin/triggers-lib.pl";
-
-die "$0: Script error: \$BK_PENDING is not set in pre-commit trigger\n"
- unless defined $ENV{BK_PENDING};
-
-# Read changed files from $BK_PENDING directly. Do not bother user about
-# merge changes; they don't have any choice, the merge must be done.
-my $changes = innodb_get_changes('file', $ENV{BK_PENDING}, undef)
- or exit 0;
-
-innodb_inform_and_query_user($changes)
- or exit 1; # Abort commit
-
-# OK, continue with commit
-exit 0;
diff --git a/BitKeeper/triggers/pre-delta b/BitKeeper/triggers/pre-delta
deleted file mode 100755
index cd861703bb5..00000000000
--- a/BitKeeper/triggers/pre-delta
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ]
-then
- echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user."
- echo "as a workaround set BK_USER to your nickname"
- echo "e.g.: export BK_USER='bar'"
- echo ""
- echo "Checkin FAILED!"
- echo "Set BK_USER and retry."
- exit 1
-fi
-
-if [ `tail -c1 $BK_FILE` ]
-then
- echo "File $BK_FILE does not end with a new-line character!"
- echo ""
- echo "Checkin FAILED!"
- echo "Fix the problem and retry."
- exit 1
-fi
-
diff --git a/BitKeeper/triggers/pre-outgoing.crash-protect.pl b/BitKeeper/triggers/pre-outgoing.crash-protect.pl
deleted file mode 100755
index b83e356e3f8..00000000000
--- a/BitKeeper/triggers/pre-outgoing.crash-protect.pl
+++ /dev/null
@@ -1,82 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-my $event= $ENV{BK_EVENT};
-unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
- $event eq 'resolve') {
- exit 0;
-}
-
-my @bad_csets=
- ( 'monty@mysql.com|ChangeSet|20060418090255|16983',
- 'monty@mysql.com|ChangeSet|20060418090458|02628',
- 'monty@mysql.com|ChangeSet|20060419084236|49576',
- 'monty@mysql.com|ChangeSet|20060503164655|51444',
- 'monty@mysql.com|ChangeSet|20060503225814|60133',
- 'monty@mysql.com|ChangeSet|20060504033006|54878',
- 'monty@mysql.com|ChangeSet|20060504130520|48660',
- 'monty@mysql.com|ChangeSet|20060504164102|03511',
- 'monty@mysql.com|ChangeSet|20060504193112|04109',
- 'monty@mysql.com|ChangeSet|20060505015314|02799',
- 'monty@mysql.com|ChangeSet|20060505084007|16704',
- 'monty@mysql.com|ChangeSet|20060505104008|16695',
- 'monty@mysql.com|ChangeSet|20060505171041|13924',
- 'monty@mysql.com|ChangeSet|20060508121933|13866',
- 'monty@mysql.com|ChangeSet|20060508160902|15029',
- 'monty@mysql.com|ChangeSet|20060509145448|38636',
- 'monty@mysql.com|ChangeSet|20060509224111|40037',
- 'monty@mysql.com|ChangeSet|20060510090758|40678',
- 'monty@mysql.com|ChangeSet|20060515164104|46760',
- 'monty@mysql.com|ChangeSet|20060530114549|35852',
- 'monty@mysql.com|ChangeSet|20060605032828|23579',
- 'monty@mysql.com|ChangeSet|20060605033011|10641',
- 'monty@mysql.com|ChangeSet|20060605060652|09843',
- 'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
- 'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
- 'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
- 'jmiller@mysql.com|ChangeSet|20060531210831|36442',
- 'jmiller@mysql.com|ChangeSet|20060602151941|36118',
- 'jmiller@mysql.com|ChangeSet|20060602152136|27762',
- 'jmiller@mysql.com|ChangeSet|20060605121748|12864',
- 'jmiller@mysql.com|ChangeSet|20060605160304|14798',
- 'jimw@mysql.com|ChangeSet|20060605210201|14667',
- 'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
- 'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
- 'stewart@mysql.com|ChangeSet|20060525073521|11169',
- 'stewart@mysql.com|ChangeSet|20060605154220|12975',
- 'stewart@mysql.com|ChangeSet|20060606040001|15337',
- 'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
- );
-
-# Read the list of changesets.
-my $csetlist = $ENV{BK_CSETLIST};
-if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
- die "Failed to open list of incoming changesets '$csetlist': $!.\n";
-}
-my @csets = <FH>;
-close FH;
-
-# Reject any attempt to push/pull a bad changeset.
-for my $cs (@csets) {
- # Do this the raw way, don't want to be bitten by different EOL conventions
- # on server and client (Unix/Windows/Mac).
- $cs =~ s/\x0d?\x0a?$//s;
- if(grep($_ eq $cs, @bad_csets)) {
- print <<END;
-BAD CHANGESET DETECTED! $event REJECTED!
-
-The changeset with key '$cs' was detected in the attempted push or pull.
-This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
-Pushing or pulling this changeset would result in corruption of the new tree,
-and therefore the operation has been rejected.
-
-Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
-questions regarding this.
-END
- exit 1;
- }
-}
-
-exit 0;
diff --git a/BitKeeper/triggers/pre-resolve.crash-protect.pl b/BitKeeper/triggers/pre-resolve.crash-protect.pl
deleted file mode 100755
index b83e356e3f8..00000000000
--- a/BitKeeper/triggers/pre-resolve.crash-protect.pl
+++ /dev/null
@@ -1,82 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-my $event= $ENV{BK_EVENT};
-unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
- $event eq 'resolve') {
- exit 0;
-}
-
-my @bad_csets=
- ( 'monty@mysql.com|ChangeSet|20060418090255|16983',
- 'monty@mysql.com|ChangeSet|20060418090458|02628',
- 'monty@mysql.com|ChangeSet|20060419084236|49576',
- 'monty@mysql.com|ChangeSet|20060503164655|51444',
- 'monty@mysql.com|ChangeSet|20060503225814|60133',
- 'monty@mysql.com|ChangeSet|20060504033006|54878',
- 'monty@mysql.com|ChangeSet|20060504130520|48660',
- 'monty@mysql.com|ChangeSet|20060504164102|03511',
- 'monty@mysql.com|ChangeSet|20060504193112|04109',
- 'monty@mysql.com|ChangeSet|20060505015314|02799',
- 'monty@mysql.com|ChangeSet|20060505084007|16704',
- 'monty@mysql.com|ChangeSet|20060505104008|16695',
- 'monty@mysql.com|ChangeSet|20060505171041|13924',
- 'monty@mysql.com|ChangeSet|20060508121933|13866',
- 'monty@mysql.com|ChangeSet|20060508160902|15029',
- 'monty@mysql.com|ChangeSet|20060509145448|38636',
- 'monty@mysql.com|ChangeSet|20060509224111|40037',
- 'monty@mysql.com|ChangeSet|20060510090758|40678',
- 'monty@mysql.com|ChangeSet|20060515164104|46760',
- 'monty@mysql.com|ChangeSet|20060530114549|35852',
- 'monty@mysql.com|ChangeSet|20060605032828|23579',
- 'monty@mysql.com|ChangeSet|20060605033011|10641',
- 'monty@mysql.com|ChangeSet|20060605060652|09843',
- 'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
- 'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
- 'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
- 'jmiller@mysql.com|ChangeSet|20060531210831|36442',
- 'jmiller@mysql.com|ChangeSet|20060602151941|36118',
- 'jmiller@mysql.com|ChangeSet|20060602152136|27762',
- 'jmiller@mysql.com|ChangeSet|20060605121748|12864',
- 'jmiller@mysql.com|ChangeSet|20060605160304|14798',
- 'jimw@mysql.com|ChangeSet|20060605210201|14667',
- 'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
- 'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
- 'stewart@mysql.com|ChangeSet|20060525073521|11169',
- 'stewart@mysql.com|ChangeSet|20060605154220|12975',
- 'stewart@mysql.com|ChangeSet|20060606040001|15337',
- 'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
- );
-
-# Read the list of changesets.
-my $csetlist = $ENV{BK_CSETLIST};
-if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
- die "Failed to open list of incoming changesets '$csetlist': $!.\n";
-}
-my @csets = <FH>;
-close FH;
-
-# Reject any attempt to push/pull a bad changeset.
-for my $cs (@csets) {
- # Do this the raw way, don't want to be bitten by different EOL conventions
- # on server and client (Unix/Windows/Mac).
- $cs =~ s/\x0d?\x0a?$//s;
- if(grep($_ eq $cs, @bad_csets)) {
- print <<END;
-BAD CHANGESET DETECTED! $event REJECTED!
-
-The changeset with key '$cs' was detected in the attempted push or pull.
-This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
-Pushing or pulling this changeset would result in corruption of the new tree,
-and therefore the operation has been rejected.
-
-Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
-questions regarding this.
-END
- exit 1;
- }
-}
-
-exit 0;
diff --git a/BitKeeper/triggers/triggers-lib.pl b/BitKeeper/triggers/triggers-lib.pl
deleted file mode 100644
index 65a334ba926..00000000000
--- a/BitKeeper/triggers/triggers-lib.pl
+++ /dev/null
@@ -1,356 +0,0 @@
-# To use this convenience library in a trigger, simply require it at
-# at the top of the script. For example:
-#
-# #! /usr/bin/perl
-#
-# use FindBin;
-# require "$FindBin::Bin/triggers-lib.pl";
-#
-# FindBin is needed, because sometimes a trigger is called from the
-# RESYNC directory, and the trigger dir is ../BitKeeper/triggers
-
-use strict;
-use warnings;
-
-use Carp;
-use FindBin;
-
-
-my $mysql_version = "5.1";
-
-# These addresses must be kept current in all MySQL versions.
-# See the wiki page InnoDBandOracle.
-#my @innodb_to_email = ('dev_innodb_ww@oracle.com');
-#my @innodb_cc_email = ('dev-innodb@mysql.com');
-# FIXME: Keep this for testing; remove it once it's been used for a
-# week or two.
-my @innodb_to_email = ('tim@mysql.com');
-my @innodb_cc_email = ();
-
-# This is for MySQL >= 5.1. Regex which defines the InnoDB files
-# which should generally not be touched by MySQL developers.
-my $innodb_files_description = <<EOF;
- storage/innobase/*
- mysql-test/t/innodb* (except mysql-test/t/innodb_mysql*)
- mysql-test/r/innodb* (except mysql-test/r/innodb_mysql*)
-EOF
-my $innodb_files_regex = qr{
- ^
- (
- # Case 1: innobase/*
- storage/innobase/
- |
- # Case 2: mysql-test/[tr]/innodb* (except innodb_mysql*)
- mysql-test/(t|r)/SCCS/s.innodb
- # The mysql-test/[tr]/innodb_mysql* are OK to edit
- (?!_mysql)
- )
-}x;
-
-
-# See 'bk help log', and the format of, e.g., $BK_PENDING.
-# Important: this already contains the terminating newline!
-my $file_rev_dspec = ':SFILE:|:REV:\n';
-
-my $bktmp = "$FindBin::Bin/../tmp";
-
-my $sendmail;
-foreach ('/usr/sbin/sendmail', 'sendmail') {
- $sendmail = $_;
- last if -x $sendmail;
-}
-my $from = $ENV{REAL_EMAIL} || $ENV{USER} . '@mysql.com';
-
-
-# close_or_warn
-# $fh file handle to be closed
-# $description description of the file handle
-# RETURN Return value of close($fh)
-#
-# Print a nice warning message if close() isn't successful. See
-# perldoc perlvar and perldoc -f close for details.
-
-sub close_or_warn (*$)
-{
- my ($fh, $description) = @_;
-
- my $status = close $fh;
- if (not $status) {
- warn "$0: error on close of '$description': ",
- ($! ? "$!" : "exit status " . ($? >> 8)), "\n";
- }
-
- return $status;
-}
-
-
-# check_status
-# $warn If true, warn about bad status
-# RETURN TRUE, if $BK_STATUS is "OK"; FALSE otherwise
-#
-# Also checks the undocumented $BK_COMMIT env variable
-
-sub check_status
-{
- my ($warn) = @_;
-
- my $status = (grep { defined $_ }
- $ENV{BK_STATUS}, $ENV{BK_COMMIT}, '<undef>')[0];
-
- unless ($status eq 'OK')
- {
- warn "Bad BK_STATUS '$status'\n" if $warn;
- return undef;
- }
-
- return 1;
-}
-
-
-# repository_location
-#
-# RETURN ('HOST', 'ROOT') for the repository being modified
-
-sub repository_location
-{
- if ($ENV{BK_SIDE} eq 'client') {
- return ($ENV{BK_HOST}, $ENV{BK_ROOT});
- } else {
- return ($ENV{BKD_HOST}, $ENV{BKD_ROOT});
- }
-}
-
-
-# repository_type
-# RETURN:
-# 'main' for repo on bk-internal with post-incoming.bugdb trigger
-# 'team' for repo on bk-internal with post-incoming.queuepush.pl trigger
-# 'local' otherwise
-#
-# This definition may need to be modified if the host name or triggers change.
-
-sub repository_type
-{
- my ($host, $root) = repository_location();
-
- return 'local'
- unless uc($host) eq 'BK-INTERNAL.MYSQL.COM'
- and -e "$root/BitKeeper/triggers/post-incoming.queuepush.pl";
-
- return 'main' if -e "$root/BitKeeper/triggers/post-incoming.bugdb";
-
- return 'team';
-}
-
-
-# latest_cset
-# RETURN Key for most recent ChangeSet
-
-sub latest_cset {
- chomp(my $retval = `bk changes -r+ -k`);
- return $retval;
-}
-
-
-# read_bk_csetlist
-# RETURN list of cset keys from $BK_CSETLIST file
-sub read_bk_csetlist
-{
- die "$0: script error: \$BK_CSETLIST not set\n"
- unless defined $ENV{BK_CSETLIST};
-
- open CSETS, '<', $ENV{BK_CSETLIST}
- or die "$0: can't read \$BK_CSETLIST='$ENV{BK_CSETLIST}': $!\n";
- chomp(my @csets = <CSETS>);
- close_or_warn(CSETS, "\$BK_CSETLIST='$ENV{BK_CSETLIST}'");
-
- return @csets;
-}
-
-
-# innodb_get_changes
-# $type 'file' or 'cset'
-# $value file name (e.g., $BK_PENDING) or ChangeSet key
-# $want_merge_changes flag; if false, merge changes will be ignored
-# RETURN A string describing the InnoDB changes, or undef if no changes
-#
-# The return value does *not* include ChangeSet comments, only per-file
-# comments.
-
-sub innodb_get_changes
-{
- my ($type, $value, $want_merge_changes) = @_;
-
- if ($type eq 'file')
- {
- open CHANGES, '<', $value
- or die "$0: can't read '$value': $!\n";
- }
- elsif ($type eq 'cset')
- {
- open CHANGES, '-|', "bk changes -r'$value' -v -d'$file_rev_dspec'"
- or die "$0: can't exec 'bk changes': $!\n";
- }
- else
- {
- croak "$0: script error: invalid type '$type'";
- }
-
- my @changes = grep { /$innodb_files_regex/ } <CHANGES>;
-
- close_or_warn(CHANGES, "($type, '$value')");
-
- return undef unless @changes;
-
-
- # Set up a pipeline of 'bk log' commands to weed out unwanted deltas. We
- # never want deltas which contain no actual changes. We may not want deltas
- # which are merges.
-
- my @filters;
-
- # This tests if :LI: (lines inserted) or :LD: (lines deleted) is
- # non-zero. That is, did this delta change the file contents?
- push @filters,
- "bk log -d'"
- . "\$if(:LI: -gt 0){$file_rev_dspec}"
- . "\$if(:LI: -eq 0){\$if(:LD: -gt 0){$file_rev_dspec}}"
- . "' -";
-
- push @filters, "bk log -d'\$unless(:MERGE:){$file_rev_dspec}' -"
- unless $want_merge_changes;
-
- my $tmpname = "$bktmp/ibchanges.txt";
- my $pipeline = join(' | ', @filters) . " > $tmpname";
- open TMP, '|-', $pipeline
- or die "$0: can't exec [[$pipeline]]: $!\n";
-
- print TMP @changes;
- close_or_warn(TMP, "| $pipeline");
-
- # Use bk log to describe the changes
- open LOG, "bk log - < $tmpname |"
- or die "$0: can't exec 'bk log - < $tmpname': $!\n";
- my @log = <LOG>;
- close_or_warn(LOG, "bk log - < $tmpname |");
-
- unlink $tmpname;
-
- return undef unless @log;
-
- return join('', @log);
-}
-
-
-# Ask user if they really want to commit.
-# RETURN TRUE = YES, commit; FALSE = NO, do not commit
-
-sub innodb_inform_and_query_user
-{
- my ($description) = @_;
-
- my $tmpname = "$bktmp/ibquery.txt";
-
- open MESSAGE, "> $tmpname"
- or die "$0: can't write message to '$tmpname': $!";
-
- print MESSAGE <<EOF;
-This ChangeSet modifies some files which should normally be changed by
-InnoDB developers only. In general, MySQL developers should not change:
-
-$innodb_files_description
-The following InnoDB files were modified:
-=========================================================
-$description
-=========================================================
-
-If you understand this, you may Commit these changes. The changes
-will be sent to the InnoDB developers at @{[join ', ', @innodb_to_email]},
-CC @{[join ', ', @innodb_cc_email]}.
-EOF
-
- close_or_warn(MESSAGE, "$tmpname");
-
- my $status = system('bk', 'prompt', '-w',
- '-yCommit these changes', '-nDo not Commit', "-f$tmpname");
-
- unlink $tmpname;
-
- return ($status == 0 ? 1 : undef);
-}
-
-
-# innodb_send_changes_email
-# $cset The ChangeSet key
-# $description A (maybe brief) description of the changes
-# RETURN TRUE = Success, e-mail sent; FALSE = Failure
-#
-# Sends a complete diff of changes in $cset by e-mail.
-
-sub innodb_send_changes_email
-{
- my ($cset, $description) = @_;
-
- # FIXME: Much of this is duplicated in the 'post-commit' Bourne shell
- # trigger
-
- my $cset_short = `bk changes -r'$cset' -d':P:::I:'`;
- my $cset_key = `bk changes -r'$cset' -d':KEY:'`;
-
- my ($host, $bk_root) = repository_location();
- my $type = repository_type();
- (my $treename = $bk_root) =~ s,^.*/,,;
-
- print "Nofifying InnoDB developers at ",
- (join ', ', @innodb_to_email, @innodb_cc_email), "\n";
-
- open SENDMAIL, '|-', "$sendmail -t"
- or die "Can't exec '$sendmail -t': $!\n";
-
- my @headers;
- push @headers, "List-ID: <bk.innodb-$mysql_version>";
- push @headers, "From: $from";
- push @headers, "To: " . (join ', ', @innodb_to_email);
- push @headers, "Cc: " . (join ', ', @innodb_cc_email) if @innodb_cc_email;
- push @headers,
- "Subject: InnoDB changes in $type $mysql_version tree ($cset_short)";
- push @headers, "X-CSetKey: <$cset_key>";
-
- print SENDMAIL map { "$_\n" } @headers, '';
-
- if ($type eq 'main')
- {
- print SENDMAIL <<EOF;
-Changes pushed to $treename by $ENV{USER} affect the following
-files. These changes are in a $mysql_version main tree. They
-will be available publicly within 24 hours.
-EOF
- }
- elsif ($type eq 'team')
- {
- print SENDMAIL <<EOF;
-Changes added to $treename by $ENV{USER} affect the
-following files. These changes are in a $mysql_version team tree.
-EOF
- }
- else
- {
- print SENDMAIL <<EOF;
-A local commit by $ENV{USER} affects the following files. These
-changes are in a clone of a $mysql_version tree.
-EOF
- }
- print SENDMAIL "\n";
- print SENDMAIL qx(bk changes -r'$cset');
- print SENDMAIL "$description";
- print SENDMAIL "The complete ChangeSet diffs follow.\n\n";
- print SENDMAIL qx(bk rset -r'$cset' -ah | bk gnupatch -h -dup -T);
-
- close_or_warn(SENDMAIL, "$sendmail -t")
- or return undef;
-
- return 1;
-}
-
-
-1;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ab5a56476c..6e53ff30159 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,13 @@ ADD_DEFINITIONS(-DSHAREDIR="share")
# Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
+# Do not use SAFEMALLOC for Windows builds, as Debug CRT has the same functionality
+# Neither SAFE_MUTEX works on Windows and it has been explicitely undefined in
+# my_pthread.h
+IF(NOT WIN32)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+ENDIF(NOT WIN32)
SET(localstatedir "C:\\mysql\\data")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
@@ -55,9 +62,6 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-medium.cnf.sh
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
-
-ADD_DEFINITIONS(-D__NT__)
-
IF(CYBOZU)
ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
@@ -287,6 +291,10 @@ FOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
ADD_SUBDIRECTORY(${DIR})
ENDFOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
+# Add subdirectories for semisync plugin
+IF(NOT WITHOUT_DYNAMIC_PLUGINS)
+ ADD_SUBDIRECTORY(plugin/semisync)
+ENDIF(NOT WITHOUT_DYNAMIC_PLUGINS)
# FIXME "debug" only needed if build type is "Debug", but
# CMAKE_BUILD_TYPE is not set during configure time.
@@ -303,6 +311,7 @@ ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(libmysql)
+ADD_SUBDIRECTORY(libservices)
ADD_SUBDIRECTORY(tests)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
diff --git a/Makefile.am b/Makefile.am
index 7e9614fb1e5..36be3d0f7e7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common scripts \
- @pstack_dir@ \
+ @pstack_dir@ libservices \
@sql_union_dirs@ unittest \
@sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
@@ -32,7 +32,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
DIST_SUBDIRS = . include Docs zlib \
cmd-line-utils sql-common scripts \
- pstack \
+ pstack libservices \
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \
netware libmysqld \
@@ -98,7 +98,8 @@ test-pr:
test-ns:
cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
+ @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed ; \
+ @PERL@ ./mysql-test-run.pl $(force) $(mem) --suite=funcs_1
test-binlog-statement:
cd mysql-test ; \
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index e96437d40d0..28e4c354a69 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -14,13 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-# We use the "mysqlclient_notls" library here just as safety, in case
-# any of the clients here would go beyond the client API and access the
-# Thread Local Storage directly.
-
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include
@@ -30,27 +23,27 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/strings)
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
-TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql mysqlclient)
ADD_EXECUTABLE(mysqltest mysqltest.cc)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
+TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex dbug)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
-TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c ../mysys/mf_getdate.c)
-TARGET_LINK_LIBRARIES(mysqldump mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
ADD_EXECUTABLE(mysqlimport mysqlimport.c)
-TARGET_LINK_LIBRARIES(mysqlimport mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c)
-TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
ADD_EXECUTABLE(mysqlshow mysqlshow.c)
-TARGET_LINK_LIBRARIES(mysqlshow mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
../mysys/mf_tempdir.c
@@ -59,14 +52,14 @@ ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
../mysys/my_bitmap.c
../mysys/my_vle.c
../mysys/base64.c)
-TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
-TARGET_LINK_LIBRARIES(mysqladmin mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib wsock32 dbug)
+TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib dbug)
ADD_EXECUTABLE(echo echo.c)
diff --git a/client/client_priv.h b/client/client_priv.h
index 06145232995..e99d34ffa97 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -80,5 +80,6 @@ enum options_client
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
+ OPT_INIT_COMMAND,
OPT_MAX_CLIENT_OPTION
};
diff --git a/client/my_readline.h b/client/my_readline.h
index 62ad19bece9..08cff565819 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -1,3 +1,6 @@
+#ifndef CLIENT_MY_READLINE_INCLUDED
+#define CLIENT_MY_READLINE_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -31,3 +34,5 @@ extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
extern void batch_readline_end(LINE_BUFFER *buffer);
+
+#endif /* CLIENT_MY_READLINE_INCLUDED */
diff --git a/client/mysql.cc b/client/mysql.cc
index 9d078153a33..548feb5a1c7 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -141,7 +141,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
vertical=0, line_numbers=1, column_names=1,opt_html=0,
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
- default_charset_used= 0, opt_secure_auth= 0,
+ opt_secure_auth= 0,
default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0,
ignore_spaces= 0;
@@ -155,7 +155,8 @@ static char * opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE;
static char *current_host,*current_db,*current_user=0,*opt_password=0,
*current_prompt=0, *delimiter_str= 0,
- *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
+ *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME,
+ *opt_init_command= 0;
static char *histfile;
static char *histfile_tmp;
static String glob_buffer,old_buffer;
@@ -1398,6 +1399,10 @@ static struct my_option my_long_options[] =
{"ignore-spaces", 'i', "Ignore space after function names.",
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
+ {"init-command", OPT_INIT_COMMAND,
+ "SQL Command to execute when connecting to MySQL server. Will automatically be re-executed when reconnecting.",
+ (uchar**) &opt_init_command, (uchar**) &opt_init_command, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -1590,9 +1595,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
charsets_dir = mysql_charsets_dir;
break;
- case OPT_DEFAULT_CHARSET:
- default_charset_used= 1;
- break;
case OPT_DELIMITER:
if (argument == disabled_my_option)
{
@@ -1797,10 +1799,6 @@ static int get_options(int argc, char **argv)
connect_flag= 0; /* Not in interactive mode */
}
- if (strcmp(default_charset, charset_info->csname) &&
- !(charset_info= get_charset_by_csname(default_charset,
- MY_CS_PRIMARY, MYF(MY_WME))))
- exit(1);
if (argc > 1)
{
usage(0);
@@ -2928,7 +2926,6 @@ com_charset(String *buffer __attribute__((unused)), char *line)
charset_info= new_cs;
mysql_set_character_set(&mysql, charset_info->csname);
default_charset= (char *)charset_info->csname;
- default_charset_used= 1;
put_info("Charset changed", INFO_INFO);
}
else put_info("Charset is not found", INFO_INFO);
@@ -4217,6 +4214,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_close(&mysql);
}
mysql_init(&mysql);
+ if (opt_init_command)
+ mysql_options(&mysql, MYSQL_INIT_COMMAND, opt_init_command);
if (opt_connect_timeout)
{
uint timeout=opt_connect_timeout;
@@ -4250,8 +4249,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
select_limit,max_join_size);
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
}
- if (default_charset_used)
- mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
+
+ mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
+
if (!mysql_real_connect(&mysql, host, user, password,
database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_STATEMENTS))
@@ -4266,6 +4266,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
}
return -1; // Retryable
}
+
+ charset_info= mysql.charset;
+
connected=1;
#ifndef EMBEDDED_LIBRARY
mysql.reconnect= debug_info_flag; // We want to know if this happens
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 52c3636219d..05eb80e5455 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -34,7 +34,8 @@
static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN];
-static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag;
+static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag,
+ opt_systables_only;
static uint my_end_arg= 0;
static char *opt_user= (char*)"root";
@@ -121,6 +122,10 @@ static struct my_option my_long_options[]=
#include <sslopt-longopts.h>
{"tmpdir", 't', "Directory for temporary files",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"upgrade-system-tables", 's', "Only upgrade the system tables "
+ "do not try to upgrade the data.",
+ (uchar**)&opt_systables_only, (uchar**)&opt_systables_only, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Display more output about the process",
@@ -838,8 +843,15 @@ int main(int argc, char **argv)
/* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
- /* Find mysqlcheck */
- find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
+ if (!opt_systables_only)
+ {
+ /* Find mysqlcheck */
+ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
+ }
+ else
+ {
+ printf("The --upgrade-system-tables option was used, databases won't be touched.\n");
+ }
/*
Read the mysql_upgrade_info file to check if mysql_upgrade
@@ -856,8 +868,8 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
- if (run_mysqlcheck_fixnames() ||
- run_mysqlcheck_upgrade() ||
+ if ((!opt_systables_only &&
+ (run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade())) ||
run_sql_fix_privilege_tables())
{
/*
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 2b93c149523..a3eee14e0d1 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -30,7 +30,7 @@
#define MAX_TRUNC_LENGTH 3
char *host= NULL, *user= 0, *opt_password= 0,
- *default_charset= NULL;
+ *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH];
char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN];
ulonglong last_values[MAX_MYSQL_VAR];
@@ -348,8 +348,7 @@ int main(int argc,char *argv[])
if (shared_memory_base_name)
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
- if (default_charset)
- mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
+ mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
error_flags= (myf)(opt_nobeep ? 0 : ME_BELL);
if (sql_connect(&mysql, option_wait))
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index f55dc75df5d..f87f5b92f10 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1358,7 +1358,6 @@ static int parse_args(int *argc, char*** argv)
int ho_error;
result_file = stdout;
- load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (debug_info_flag)
@@ -1926,7 +1925,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
return ERROR_STOP;
}
#endif
- if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
+ if (init_io_cache(file, my_fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
{
error("Failed to init IO cache.");
@@ -2015,8 +2014,9 @@ int main(int argc, char** argv)
my_init_time(); // for time functions
+ load_defaults("my", load_default_groups, &argc, &argv);
+ defaults_argv= argv;
parse_args(&argc, (char***)&argv);
- defaults_argv=argv;
if (!argc)
{
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 1533e602639..1affea1d189 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -369,12 +369,15 @@ static int get_options(int *argc, char ***argv)
If there's no --default-character-set option given with
--fix-table-name or --fix-db-name set the default character set to "utf8".
*/
- if (!default_charset && (opt_fix_db_names || opt_fix_table_names))
+ if (!default_charset)
{
- default_charset= (char*) "utf8";
+ if (opt_fix_db_names || opt_fix_table_names)
+ default_charset= (char*) "utf8";
+ else
+ default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
}
- if (default_charset && !get_charset_by_csname(default_charset, MY_CS_PRIMARY,
- MYF(MY_WME)))
+ if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) &&
+ !get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME)))
{
printf("Unsupported character set: %s\n", default_charset);
return 1;
@@ -798,8 +801,7 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
- if (default_charset)
- mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
+ mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
{
diff --git a/client/mysqldump.c b/client/mysqldump.c
index e9e3124b9cb..aa81a0e98bf 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -861,9 +861,9 @@ static int get_options(int *argc, char ***argv)
load_defaults("my",load_default_groups,argc,argv);
defaults_argv= *argv;
- if (hash_init(&ignore_table, charset_info, 16, 0, 0,
- (hash_get_key) get_table_key,
- (hash_free_key) free_table_ent, 0))
+ if (my_hash_init(&ignore_table, charset_info, 16, 0, 0,
+ (my_hash_get_key) get_table_key,
+ (my_hash_free_key) free_table_ent, 0))
return(EX_EOM);
/* Don't copy internal log tables */
if (my_hash_insert(&ignore_table,
@@ -1273,120 +1273,68 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
}
/**
- Rewrite CREATE TRIGGER statement, enclosing DEFINER clause in
- version-specific comment.
+ Rewrite statement, enclosing DEFINER clause in version-specific comment.
- This function parses the CREATE TRIGGER statement and encloses
- DEFINER-clause in version-specific comment:
- input query: CREATE DEFINER=a@b TRIGGER ...
- rewritten query: CREATE * / / *!50017 DEFINER=a@b * / / *!50003 TRIGGER ...
-
- @note This function will go away when WL#3995 is implemented.
-
- @param[in] trigger_def_str CREATE TRIGGER statement string.
- @param[in] trigger_def_length length of the trigger_def_str.
-
- @return pointer to the new allocated query string.
-*/
-
-static char *cover_definer_clause_in_trigger(const char *trigger_def_str,
- uint trigger_def_length)
-{
- char *query_str= NULL;
- char *definer_begin= my_case_str(trigger_def_str, trigger_def_length,
- C_STRING_WITH_LEN(" DEFINER"));
- char *definer_end;
-
- if (!definer_begin)
- return NULL;
-
- definer_end= my_case_str(definer_begin, strlen(definer_begin),
- C_STRING_WITH_LEN(" TRIGGER"));
-
- if (definer_end)
- {
- char *query_str_tail;
-
- /*
- Allocate memory for new query string: original string
- from SHOW statement and version-specific comments.
- */
- query_str= alloc_query_str(trigger_def_length + 23);
-
- query_str_tail= strnmov(query_str,
- trigger_def_str,
- definer_begin - trigger_def_str);
-
- query_str_tail= strmov(query_str_tail,
- "*/ /*!50017");
-
- query_str_tail= strnmov(query_str_tail,
- definer_begin,
- definer_end - definer_begin);
-
- query_str_tail= strxmov(query_str_tail,
- "*/ /*!50003",
- definer_end,
- NullS);
- }
-
- return query_str;
-}
-
-/**
- Rewrite CREATE FUNCTION or CREATE PROCEDURE statement, enclosing DEFINER
- clause in version-specific comment.
-
- This function parses the CREATE FUNCTION | PROCEDURE statement and
- encloses DEFINER-clause in version-specific comment:
+ This function parses any CREATE statement and encloses DEFINER-clause in
+ version-specific comment:
input query: CREATE DEFINER=a@b FUNCTION ...
rewritten query: CREATE * / / *!50020 DEFINER=a@b * / / *!50003 FUNCTION ...
@note This function will go away when WL#3995 is implemented.
- @param[in] def_str CREATE FUNCTION|PROCEDURE statement string.
- @param[in] def_str_length length of the def_str.
+ @param[in] stmt_str CREATE statement string.
+ @param[in] stmt_length Length of the stmt_str.
+ @param[in] definer_version_str Minimal MySQL version number when
+ DEFINER clause is supported in the
+ given statement.
+ @param[in] definer_version_length Length of definer_version_str.
+ @param[in] stmt_version_str Minimal MySQL version number when the
+ given statement is supported.
+ @param[in] stmt_version_length Length of stmt_version_str.
+ @param[in] keyword_str Keyword to look for after CREATE.
+ @param[in] keyword_length Length of keyword_str.
@return pointer to the new allocated query string.
*/
-static char *cover_definer_clause_in_sp(const char *def_str,
- uint def_str_length)
+static char *cover_definer_clause(const char *stmt_str,
+ uint stmt_length,
+ const char *definer_version_str,
+ uint definer_version_length,
+ const char *stmt_version_str,
+ uint stmt_version_length,
+ const char *keyword_str,
+ uint keyword_length)
{
- char *query_str= NULL;
- char *definer_begin= my_case_str(def_str, def_str_length,
+ char *definer_begin= my_case_str(stmt_str, stmt_length,
C_STRING_WITH_LEN(" DEFINER"));
- char *definer_end;
+ char *definer_end= NULL;
+
+ char *query_str= NULL;
+ char *query_ptr;
if (!definer_begin)
return NULL;
definer_end= my_case_str(definer_begin, strlen(definer_begin),
- C_STRING_WITH_LEN(" PROCEDURE"));
+ keyword_str, keyword_length);
if (!definer_end)
- {
- definer_end= my_case_str(definer_begin, strlen(definer_begin),
- C_STRING_WITH_LEN(" FUNCTION"));
- }
+ return NULL;
- if (definer_end)
- {
- char *query_str_tail;
+ /*
+ Allocate memory for new query string: original string
+ from SHOW statement and version-specific comments.
+ */
+ query_str= alloc_query_str(stmt_length + 23);
- /*
- Allocate memory for new query string: original string
- from SHOW statement and version-specific comments.
- */
- query_str= alloc_query_str(def_str_length + 23);
-
- query_str_tail= strnmov(query_str, def_str, definer_begin - def_str);
- query_str_tail= strmov(query_str_tail, "*/ /*!50020");
- query_str_tail= strnmov(query_str_tail, definer_begin,
- definer_end - definer_begin);
- query_str_tail= strxmov(query_str_tail, "*/ /*!50003",
- definer_end, NullS);
- }
+ query_ptr= strnmov(query_str, stmt_str, definer_begin - stmt_str);
+ query_ptr= strnmov(query_ptr, C_STRING_WITH_LEN("*/ /*!"));
+ query_ptr= strnmov(query_ptr, definer_version_str, definer_version_length);
+ query_ptr= strnmov(query_ptr, definer_begin, definer_end - definer_begin);
+ query_ptr= strnmov(query_ptr, C_STRING_WITH_LEN("*/ /*!"));
+ query_ptr= strnmov(query_ptr, stmt_version_str, stmt_version_length);
+ query_ptr= strxmov(query_ptr, definer_end, NullS);
return query_str;
}
@@ -1419,8 +1367,8 @@ static void free_resources()
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
- if (hash_inited(&ignore_table))
- hash_free(&ignore_table);
+ if (my_hash_inited(&ignore_table))
+ my_hash_free(&ignore_table);
if (extended_insert)
dynstr_free(&extended_row);
if (insert_pat_inited)
@@ -1922,6 +1870,8 @@ static uint dump_events_for_db(char *db)
*/
if (strlen(row[3]) != 0)
{
+ char *query_str;
+
if (opt_drop)
fprintf(sql_file, "/*!50106 DROP EVENT IF EXISTS %s */%s\n",
event_name, delimiter);
@@ -1948,31 +1898,36 @@ static uint dump_events_for_db(char *db)
row[4], /* character_set_results */
row[5]); /* collation_connection */
}
- else
- {
- /*
- mysqldump is being run against the server, that does not
- provide character set information in SHOW CREATE
- statements.
+ else
+ {
+ /*
+ mysqldump is being run against the server, that does not
+ provide character set information in SHOW CREATE
+ statements.
- NOTE: the dump may be incorrect, since character set
- information is required in order to restore event properly.
- */
+ NOTE: the dump may be incorrect, since character set
+ information is required in order to restore event properly.
+ */
- fprintf(sql_file,
- "--\n"
- "-- WARNING: old server version. "
- "The following dump may be incomplete.\n"
- "--\n");
- }
+ fprintf(sql_file,
+ "--\n"
+ "-- WARNING: old server version. "
+ "The following dump may be incomplete.\n"
+ "--\n");
+ }
switch_sql_mode(sql_file, delimiter, row[1]);
switch_time_zone(sql_file, delimiter, row[2]);
+ query_str= cover_definer_clause(row[3], strlen(row[3]),
+ C_STRING_WITH_LEN("50117"),
+ C_STRING_WITH_LEN("50106"),
+ C_STRING_WITH_LEN(" EVENT"));
+
fprintf(sql_file,
"/*!50106 %s */ %s\n",
- (const char *) row[3],
+ (const char *) (query_str != NULL ? query_str : row[3]),
(const char *) delimiter);
restore_time_zone(sql_file, delimiter);
@@ -2127,7 +2082,16 @@ static uint dump_routines_for_db(char *db)
fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
routine_type[i], routine_name);
- query_str= cover_definer_clause_in_sp(row[2], strlen(row[2]));
+ query_str= cover_definer_clause(row[2], strlen(row[2]),
+ C_STRING_WITH_LEN("50020"),
+ C_STRING_WITH_LEN("50003"),
+ C_STRING_WITH_LEN(" FUNCTION"));
+
+ if (!query_str)
+ query_str= cover_definer_clause(row[2], strlen(row[2]),
+ C_STRING_WITH_LEN("50020"),
+ C_STRING_WITH_LEN("50003"),
+ C_STRING_WITH_LEN(" PROCEDURE"));
if (mysql_num_fields(routine_res) >= 6)
{
@@ -2806,8 +2770,10 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
while ((row= mysql_fetch_row(show_create_trigger_rs)))
{
- char *query_str= cover_definer_clause_in_trigger(row[2], strlen(row[2]));
-
+ char *query_str= cover_definer_clause(row[2], strlen(row[2]),
+ C_STRING_WITH_LEN("50017"),
+ C_STRING_WITH_LEN("50003"),
+ C_STRING_WITH_LEN(" TRIGGER"));
if (switch_db_collation(sql_file, db_name, ";",
db_cl_name, row[5], &db_cl_altered))
@@ -3316,7 +3282,7 @@ static void dump_table(char *table, char *db)
{
if (length)
{
- if (!IS_NUM_FIELD(field))
+ if (!(field->flags & NUM_FLAG))
{
/*
"length * 2 + 2" is OK for both HEX and non-HEX modes:
@@ -3384,7 +3350,7 @@ static void dump_table(char *table, char *db)
}
if (row[i])
{
- if (!IS_NUM_FIELD(field))
+ if (!(field->flags & NUM_FLAG))
{
if (opt_xml)
{
@@ -3992,7 +3958,7 @@ static int init_dumping(char *database, int init_func(char*))
my_bool include_table(const uchar *hash_key, size_t len)
{
- return !hash_search(&ignore_table, hash_key, len);
+ return ! my_hash_search(&ignore_table, hash_key, len);
}
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index ef38d760e5d..5b8ec95c06d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -55,11 +55,10 @@ static char *opt_password=0, *current_user=0,
*current_host=0, *current_db=0, *fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0,
*escaped=0, *opt_columns=0,
- *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
+ *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
static longlong opt_ignore_lines= -1;
-static CHARSET_INFO *charset_info= &my_charset_latin1;
#include <sslopt-vars.h>
#ifdef HAVE_SMEM
@@ -282,10 +281,6 @@ static int get_options(int *argc, char ***argv)
fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n");
return(1);
}
- if (strcmp(default_charset, charset_info->csname) &&
- !(charset_info= get_charset_by_csname(default_charset,
- MY_CS_PRIMARY, MYF(MY_WME))))
- exit(1);
if (*argc < 2)
{
usage();
@@ -440,6 +435,7 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+ mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,
0)))
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 15f791ca8fb..206b86d07cf 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -32,7 +32,7 @@ static my_bool tty_password= 0, opt_table_type= 0;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static uint my_end_arg= 0;
static uint opt_verbose=0;
-static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
+static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 5983b911866..f13b5099766 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1204,7 +1204,7 @@ get_options(int *argc,char ***argv)
if (opt_csv_str[0] == '-')
{
- csv_file= fileno(stdout);
+ csv_file= my_fileno(stdout);
}
else
{
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index e0cdec42a60..04a3526139e 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -115,6 +115,8 @@ static uint my_end_arg= 0;
/* Number of lines of the result to include in failure report */
static uint opt_tail_lines= 0;
+static uint opt_connect_timeout= 0;
+
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
static uint delimiter_length= 1;
@@ -260,8 +262,7 @@ enum enum_commands {
Q_SEND, Q_REAP,
Q_DIRTY_CLOSE, Q_REPLACE, Q_REPLACE_COLUMN,
Q_PING, Q_EVAL,
- Q_RPL_PROBE, Q_ENABLE_RPL_PARSE,
- Q_DISABLE_RPL_PARSE, Q_EVAL_RESULT,
+ Q_EVAL_RESULT,
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
Q_WAIT_FOR_SLAVE_TO_STOP,
@@ -283,7 +284,7 @@ enum enum_commands {
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
- Q_MOVE_FILE,
+ Q_MOVE_FILE, Q_SEND_EVAL,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -320,9 +321,6 @@ const char *command_names[]=
"replace_column",
"ping",
"eval",
- "rpl_probe",
- "enable_rpl_parse",
- "disable_rpl_parse",
"eval_result",
/* Enable/disable that the _query_ is logged to result file */
"enable_query_log",
@@ -381,6 +379,7 @@ const char *command_names[]=
"send_shutdown",
"shutdown_server",
"move_file",
+ "send_eval",
0
};
@@ -662,14 +661,6 @@ public:
LogFile log_file;
LogFile progress_file;
-
-/* Disable functions that only exist in MySQL 4.0 */
-#if MYSQL_VERSION_ID < 40000
-void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
-void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
-int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; }
-my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
-#endif
void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
int len);
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val);
@@ -1138,7 +1129,7 @@ void free_used_memory()
close_connections();
close_files();
- hash_free(&var_hash);
+ my_hash_free(&var_hash);
for (i= 0 ; i < q_lines.elements ; i++)
{
@@ -1171,7 +1162,6 @@ void free_used_memory()
mysql_server_end();
/* Don't use DBUG after mysql_server_end() */
- DBUG_VIOLATION_HELPER_LEAVE;
return;
}
@@ -2001,8 +1991,8 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
if (length >= MAX_VAR_NAME_LENGTH)
die("Too long variable name: %s", save_var_name);
- if (!(v = (VAR*) hash_search(&var_hash, (const uchar*) save_var_name,
- length)))
+ if (!(v = (VAR*) my_hash_search(&var_hash, (const uchar*) save_var_name,
+ length)))
{
char buff[MAX_VAR_NAME_LENGTH+1];
strmake(buff, save_var_name, length);
@@ -2033,7 +2023,7 @@ err:
VAR *var_obtain(const char *name, int len)
{
VAR* v;
- if ((v = (VAR*)hash_search(&var_hash, (const uchar *) name, len)))
+ if ((v = (VAR*)my_hash_search(&var_hash, (const uchar *) name, len)))
return v;
v = var_init(0, name, len, "", 0);
my_hash_insert(&var_hash, (uchar*)v);
@@ -2967,6 +2957,7 @@ void do_move_file(struct st_command *command)
void do_chmod_file(struct st_command *command)
{
long mode= 0;
+ int err_code;
static DYNAMIC_STRING ds_mode;
static DYNAMIC_STRING ds_file;
const struct command_arg chmod_file_args[] = {
@@ -2986,7 +2977,10 @@ void do_chmod_file(struct st_command *command)
die("You must write a 4 digit octal number for mode");
DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
- handle_command_error(command, chmod(ds_file.str, mode));
+ err_code= chmod(ds_file.str, mode);
+ if (err_code < 0)
+ err_code= 1;
+ handle_command_error(command, err_code);
dynstr_free(&ds_mode);
dynstr_free(&ds_file);
DBUG_VOID_RETURN;
@@ -3847,12 +3841,8 @@ int do_save_master_pos()
MYSQL_ROW row;
MYSQL *mysql = &cur_con->mysql;
const char *query;
- int rpl_parse;
DBUG_ENTER("do_save_master_pos");
- rpl_parse = mysql_rpl_parse_enabled(mysql);
- mysql_disable_rpl_parse(mysql);
-
#ifdef HAVE_NDB_BINLOG
/*
Wait for ndb binlog to be up-to-date with all changes
@@ -4002,10 +3992,6 @@ int do_save_master_pos()
strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
master_pos.pos = strtoul(row[1], (char**) 0, 10);
mysql_free_result(res);
-
- if (rpl_parse)
- mysql_enable_rpl_parse(mysql);
-
DBUG_RETURN(0);
}
@@ -4068,29 +4054,6 @@ void do_let(struct st_command *command)
}
-int do_rpl_probe(struct st_command *command __attribute__((unused)))
-{
- DBUG_ENTER("do_rpl_probe");
- if (mysql_rpl_probe(&cur_con->mysql))
- die("Failed in mysql_rpl_probe(): '%s'", mysql_error(&cur_con->mysql));
- DBUG_RETURN(0);
-}
-
-
-int do_enable_rpl_parse(struct st_command *command __attribute__((unused)))
-{
- mysql_enable_rpl_parse(&cur_con->mysql);
- return 0;
-}
-
-
-int do_disable_rpl_parse(struct st_command *command __attribute__((unused)))
-{
- mysql_disable_rpl_parse(&cur_con->mysql);
- return 0;
-}
-
-
/*
Sleep the number of specified seconds
@@ -5021,6 +4984,11 @@ void do_connect(struct st_command *command)
#endif
if (!mysql_init(&con_slot->mysql))
die("Failed on mysql_init()");
+
+ if (opt_connect_timeout)
+ mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+ (void *) &opt_connect_timeout);
+
if (opt_compress || con_compress)
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
@@ -5810,6 +5778,11 @@ static struct my_option my_long_options[] =
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"connect_timeout", OPT_CONNECT_TIMEOUT,
+ "Number of seconds before connection timeout.",
+ (uchar**) &opt_connect_timeout,
+ (uchar**) &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
+ 120, 0, 3600 * 12, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -6548,8 +6521,6 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
if (!disable_result_log)
{
- ulonglong UNINIT_VAR(affected_rows); /* Ok to be undef if 'disable_info' is set */
-
if (res)
{
MYSQL_FIELD *fields= mysql_fetch_fields(res);
@@ -6566,10 +6537,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
/*
Need to call mysql_affected_rows() before the "new"
- query to find the warnings
+ query to find the warnings.
*/
if (!disable_info)
- affected_rows= mysql_affected_rows(mysql);
+ append_info(ds, mysql_affected_rows(mysql), mysql_info(mysql));
/*
Add all warnings to the result. We can't do this if we are in
@@ -6584,9 +6555,6 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
dynstr_append_mem(ds, ds_warnings->str, ds_warnings->length);
}
}
-
- if (!disable_info)
- append_info(ds, affected_rows, mysql_info(mysql));
}
if (res)
@@ -6960,40 +6928,34 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
}
/*
- Need to grab affected rows information before getting
- warnings here
+ Fetch info before fetching warnings, since it will be reset
+ otherwise.
*/
- {
- ulonglong UNINIT_VAR(affected_rows);
- if (!disable_info)
- affected_rows= mysql_affected_rows(mysql);
+ if (!disable_info)
+ append_info(ds, mysql_stmt_affected_rows(stmt), mysql_info(mysql));
- if (!disable_warnings)
- {
- /* Get the warnings from execute */
+ if (!disable_warnings)
+ {
+ /* Get the warnings from execute */
- /* Append warnings to ds - if there are any */
- if (append_warnings(&ds_execute_warnings, mysql) ||
- ds_execute_warnings.length ||
- ds_prepare_warnings.length ||
- ds_warnings->length)
- {
- dynstr_append_mem(ds, "Warnings:\n", 10);
- if (ds_warnings->length)
- dynstr_append_mem(ds, ds_warnings->str,
- ds_warnings->length);
- if (ds_prepare_warnings.length)
- dynstr_append_mem(ds, ds_prepare_warnings.str,
- ds_prepare_warnings.length);
- if (ds_execute_warnings.length)
- dynstr_append_mem(ds, ds_execute_warnings.str,
- ds_execute_warnings.length);
- }
+ /* Append warnings to ds - if there are any */
+ if (append_warnings(&ds_execute_warnings, mysql) ||
+ ds_execute_warnings.length ||
+ ds_prepare_warnings.length ||
+ ds_warnings->length)
+ {
+ dynstr_append_mem(ds, "Warnings:\n", 10);
+ if (ds_warnings->length)
+ dynstr_append_mem(ds, ds_warnings->str,
+ ds_warnings->length);
+ if (ds_prepare_warnings.length)
+ dynstr_append_mem(ds, ds_prepare_warnings.str,
+ ds_prepare_warnings.length);
+ if (ds_execute_warnings.length)
+ dynstr_append_mem(ds, ds_execute_warnings.str,
+ ds_execute_warnings.length);
}
-
- if (!disable_info)
- append_info(ds, affected_rows, mysql_info(mysql));
}
}
@@ -7043,6 +7005,10 @@ int util_query(MYSQL* org_mysql, const char* query){
if (!(mysql= mysql_init(mysql)))
die("Failed in mysql_init()");
+ if (opt_connect_timeout)
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+ (void *) &opt_connect_timeout);
+
/* enable local infile, in non-binary builds often disabled by default */
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
@@ -7091,7 +7057,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
/*
Evaluate query if this is an eval command
*/
- if (command->type == Q_EVAL)
+ if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
{
init_dynamic_string(&eval_query, "", command->query_len+256, 1024);
do_eval(&eval_query, command->query, command->end, FALSE);
@@ -7638,8 +7604,8 @@ int main(int argc, char **argv)
my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024);
- if (hash_init(&var_hash, charset_info,
- 1024, 0, 0, get_var_key, var_free, MYF(0)))
+ if (my_hash_init(&var_hash, charset_info,
+ 1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
@@ -7702,6 +7668,9 @@ int main(int argc, char **argv)
st_connection *con= connections;
if (!( mysql_init(&con->mysql)))
die("Failed in mysql_init()");
+ if (opt_connect_timeout)
+ mysql_options(&con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+ (void *) &opt_connect_timeout);
if (opt_compress)
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
@@ -7806,9 +7775,6 @@ int main(int argc, char **argv)
case Q_DISCONNECT:
case Q_DIRTY_CLOSE:
do_close_connection(command); break;
- case Q_RPL_PROBE: do_rpl_probe(command); break;
- case Q_ENABLE_RPL_PARSE: do_enable_rpl_parse(command); break;
- case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(command); break;
case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break;
@@ -7915,6 +7881,7 @@ int main(int argc, char **argv)
break;
}
case Q_SEND:
+ case Q_SEND_EVAL:
if (!*command->first_argument)
{
/*
diff --git a/client/readline.cc b/client/readline.cc
index b32cb71b0de..73ce7c3b8c7 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -33,7 +33,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
if (!(line_buff=(LINE_BUFFER*)
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;
- if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size))
+ if (init_line_buffer(line_buff,my_fileno(file),IO_SIZE,max_size))
{
my_free(line_buff,MYF(0));
return 0;
diff --git a/client/sql_string.h b/client/sql_string.h
index da19c1ccfe5..0e6d6da4476 100644
--- a/client/sql_string.h
+++ b/client/sql_string.h
@@ -1,3 +1,6 @@
+#ifndef CLIENT_SQL_STRING_INCLUDED
+#define CLIENT_SQL_STRING_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -353,3 +356,5 @@ public:
return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length);
}
};
+
+#endif /* CLIENT_SQL_STRING_INCLUDED */
diff --git a/configure.in b/configure.in
index 4f6fd815d72..bc34dc0f07b 100644
--- a/configure.in
+++ b/configure.in
@@ -623,24 +623,6 @@ then
fi
fi
-AC_MSG_CHECKING(whether features provided by the user community should be included.)
-AC_ARG_ENABLE(community-features,
- AC_HELP_STRING(
- [--disable-community-features],
- [Disable additional features provided by the user community.]),
- [ ENABLE_COMMUNITY_FEATURES=$enableval ],
- [ ENABLE_COMMUNITY_FEATURES=yes ]
- )
-
-if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
-then
- AC_DEFINE([COMMUNITY_SERVER], [1],
- [Whether features provided by the user community should be included])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
AC_ARG_WITH(server-suffix,
[ --with-server-suffix Append value to the version string.],
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
@@ -706,21 +688,14 @@ fi
# Add query profiler
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
AC_ARG_ENABLE(profiling,
- AS_HELP_STRING([--enable-profiling], [Build a version with query profiling code (req. community-features)]),
+ AS_HELP_STRING([--enable-profiling], [Enable profiling of query lifetime.]),
[ ENABLED_PROFILING=$enableval ],
- [ ENABLED_PROFILING=$ENABLE_COMMUNITY_FEATURES ])
+ [ ENABLED_PROFILING=no ])
+AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled])
if test "$ENABLED_PROFILING" = "yes"
then
- if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
- then
- AC_DEFINE([ENABLED_PROFILING], [1],
- [If SHOW PROFILE should be enabled])
- AC_MSG_RESULT([yes])
- else
- ENABLED_PROFILING="no"
- AC_MSG_RESULT([no, overridden by community-features disabled])
- fi
+ AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
@@ -2054,10 +2029,11 @@ AC_SUBST(MAKE_SHELL)
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
-paths.h semaphore.h)
+paths.h semaphore.h langinfo.h)
# Already-done: strcasecmp
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
+AC_CHECK_FUNCS(nl_langinfo)
AC_STAT_MACROS_BROKEN
MYSQL_SIGNAL_CHECK
@@ -2951,7 +2927,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
man/Makefile BUILD/Makefile vio/Makefile dnl
libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
sql/Makefile sql/share/Makefile dnl
- sql/sql_builtin.cc sql-common/Makefile dnl
+ sql/sql_builtin.cc sql-common/Makefile libservices/Makefile dnl
dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
diff --git a/dbug/.cvsignore b/dbug/.cvsignore
deleted file mode 100644
index e9955884756..00000000000
--- a/dbug/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.deps
-Makefile
-Makefile.in
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 8b27f79dcf4..fabb592dccc 100755
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -18,7 +18,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/dbug)
SET(DBUG_SOURCES dbug.c factorial.c sanity.c)
IF(NOT SOURCE_SUBLIBS)
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(dbug ${DBUG_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/dbug/Makefile.am b/dbug/Makefile.am
index 872ebdb7902..4091858a1af 100644
--- a/dbug/Makefile.am
+++ b/dbug/Makefile.am
@@ -23,19 +23,20 @@ libdbug_a_SOURCES = dbug.c sanity.c
EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \
user.r monty.doc dbug_add_tags.pl \
my_main.c main.c factorial.c dbug_analyze.c \
- CMakeLists.txt
+ CMakeLists.txt tests.c tests-t.pl
NROFF_INC = example1.r example2.r example3.r main.r \
factorial.r output1.r output2.r output3.r \
output4.r output5.r
-CLEANFILES = $(NROFF_INC) user.t user.ps
+CLEANFILES = $(NROFF_INC) user.t user.ps tests-t
# Must be linked with libs that are not compiled yet
-noinst_PROGRAMS = factorial dbug_analyze
+noinst_PROGRAMS = factorial dbug_analyze tests
factorial_SOURCES = my_main.c factorial.c
+tests_SOURCES = tests.c
dbug_analyze_SOURCES = dbug_analyze.c
-all: user.t user.ps
+all: user.t user.ps tests-t
user.t: user.r $(NROFF_INC)
-nroff -mm user.r > $@
@@ -61,5 +62,7 @@ output5.r: factorial
@RM@ -f $@
@SED@ -e 's!\\!\\\\!g' $< > $@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+# a hack to have executable in builddir, not in srcdir
+tests-t: tests-t.pl
+ cp -f $(srcdir)/tests-t.pl ./tests-t
+
diff --git a/dbug/dbug.c b/dbug/dbug.c
index baf080f5e27..0a0c56170fa 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -57,29 +57,48 @@
* seismo!bpa!sjuvax!bbanerje
*
* Michael Widenius:
- * DBUG_DUMP - To dump a block of memory.
- * PUSH_FLAG "O" - To be used insted of "o" if we
- * want flushing after each write
- * PUSH_FLAG "A" - as 'O', but we will append to the out file instead
- * of creating a new one.
- * Check of malloc on entry/exit (option "S")
- *
- * DBUG_EXECUTE_IF
- * incremental mode (-#+t:-d,info ...)
- * DBUG_SET, _db_explain_
- * thread-local settings
+ * DBUG_DUMP - To dump a block of memory.
+ * PUSH_FLAG "O" - To be used insted of "o" if we
+ * want flushing after each write
+ * PUSH_FLAG "A" - as 'O', but we will append to the out file instead
+ * of creating a new one.
+ * Check of malloc on entry/exit (option "S")
+ *
+ * Sergei Golubchik:
+ * DBUG_EXECUTE_IF
+ * incremental mode (-#+t:-d,info ...)
+ * DBUG_SET, _db_explain_
+ * thread-local settings
+ * negative lists (-#-d,info => everything but "info")
+ *
+ * function/ syntax
+ * (the logic is - think of a call stack as of a path.
+ * "function" means only this function, "function/" means the hierarchy.
+ * in the future, filters like function1/function2 could be supported.
+ * following this logic glob(7) wildcards are supported.)
*
*/
+/*
+ We can't have SAFE_MUTEX defined here as this will cause recursion
+ in pthread_mutex_lock
+*/
+#undef SAFE_MUTEX
#include <my_global.h>
#include <m_string.h>
#include <errno.h>
+
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#else
+#define fnmatch(A,B,C) strcmp(A,B)
+#endif
+
#if defined(MSDOS) || defined(__WIN__)
#include <process.h>
#endif
-
#ifndef DBUG_OFF
@@ -95,21 +114,24 @@
* The following flags are used to determine which
* capabilities the user has enabled with the settings
* push macro.
+ *
+ * TRACE_ON is also used in _db_stack_frame_->level
+ * (until we add flags to _db_stack_frame_, increasing it by 4 bytes)
*/
-#define TRACE_ON 000001 /* Trace enabled */
-#define DEBUG_ON 000002 /* Debug enabled */
-#define FILE_ON 000004 /* File name print enabled */
-#define LINE_ON 000010 /* Line number print enabled */
-#define DEPTH_ON 000020 /* Function nest level print enabled */
-#define PROCESS_ON 000040 /* Process name print enabled */
-#define NUMBER_ON 000100 /* Number each line of output */
-#define PROFILE_ON 000200 /* Print out profiling code */
-#define PID_ON 000400 /* Identify each line with process id */
-#define TIMESTAMP_ON 001000 /* timestamp every line of output */
-#define SANITY_CHECK_ON 002000 /* Check safemalloc on DBUG_ENTER */
-#define FLUSH_ON_WRITE 004000 /* Flush on every write */
-#define OPEN_APPEND 010000 /* Open for append */
+#define DEBUG_ON (1 << 1) /* Debug enabled */
+#define FILE_ON (1 << 2) /* File name print enabled */
+#define LINE_ON (1 << 3) /* Line number print enabled */
+#define DEPTH_ON (1 << 4) /* Function nest level print enabled */
+#define PROCESS_ON (1 << 5) /* Process name print enabled */
+#define NUMBER_ON (1 << 6) /* Number each line of output */
+#define PROFILE_ON (1 << 7) /* Print out profiling code */
+#define PID_ON (1 << 8) /* Identify each line with process id */
+#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */
+#define SANITY_CHECK_ON (1 << 10) /* Check safemalloc on DBUG_ENTER */
+#define FLUSH_ON_WRITE (1 << 11) /* Flush on every write */
+#define OPEN_APPEND (1 << 12) /* Open for append */
+#define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/
#define TRACING (cs->stack->flags & TRACE_ON)
#define DEBUGGING (cs->stack->flags & DEBUG_ON)
@@ -119,11 +141,7 @@
* Typedefs to make things more obvious.
*/
-#ifndef __WIN__
-typedef int BOOLEAN;
-#else
-#define BOOLEAN BOOL
-#endif
+#define BOOLEAN my_bool
/*
* Make it easy to change storage classes if necessary.
@@ -139,7 +157,7 @@ typedef int BOOLEAN;
* (G?) which allowed the user to specify this.
*
* If the automatic variables get allocated on the stack in
- * reverse order from their declarations, then define AUTOS_REVERSE.
+ * reverse order from their declarations, then define AUTOS_REVERSE to 1.
* This is used by the code that keeps track of stack usage. For
* forward allocation, the difference in the dbug frame pointers
* represents stack used by the callee function. For reverse allocation,
@@ -154,6 +172,8 @@ typedef int BOOLEAN;
#ifdef M_I386 /* predefined by xenix 386 compiler */
#define AUTOS_REVERSE 1
+#else
+#define AUTOS_REVERSE 0
#endif
/*
@@ -164,7 +184,11 @@ typedef int BOOLEAN;
static void perror(); /* Fake system/library error print routine */
#endif
+#ifdef SAFEMALLOC
IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */
+#else
+#define _sanity(X,Y) (1)
+#endif
/*
* The user may specify a list of functions to trace or
@@ -174,9 +198,18 @@ IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */
struct link {
struct link *next_link; /* Pointer to the next link */
- char str[1]; /* Pointer to link's contents */
+ char flags;
+ char str[1]; /* Pointer to link's contents */
};
+/* flags for struct link and return flags of InList */
+#define SUBDIR 1 /* this MUST be 1 */
+#define INCLUDE 2
+#define EXCLUDE 4
+/* this is not a struct link flag, but only a return flags of InList */
+#define MATCHED 65536
+#define NOT_MATCHED 0
+
/*
* Debugging settings can be pushed or popped off of a
* stack which is implemented as a linked list. Note
@@ -188,18 +221,18 @@ struct link {
*/
struct settings {
- int flags; /* Current settings flags */
- int maxdepth; /* Current maximum trace depth */
- uint delay; /* Delay after each output line */
- int sub_level; /* Sub this from code_state->level */
- FILE *out_file; /* Current output stream */
- FILE *prof_file; /* Current profiling stream */
- char name[FN_REFLEN]; /* Name of output file */
- struct link *functions; /* List of functions */
- struct link *p_functions; /* List of profiled functions */
- struct link *keywords; /* List of debug keywords */
- struct link *processes; /* List of process names */
- struct settings *next; /* Next settings in the list */
+ uint flags; /* Current settings flags */
+ uint maxdepth; /* Current maximum trace depth */
+ uint delay; /* Delay after each output line */
+ uint sub_level; /* Sub this from code_state->level */
+ FILE *out_file; /* Current output stream */
+ FILE *prof_file; /* Current profiling stream */
+ char name[FN_REFLEN]; /* Name of output file */
+ struct link *functions; /* List of functions */
+ struct link *p_functions; /* List of profiled functions */
+ struct link *keywords; /* List of debug keywords */
+ struct link *processes; /* List of process names */
+ struct settings *next; /* Next settings in the list */
};
#define is_shared(S, V) ((S)->next && (S)->next->V == (S)->V)
@@ -212,18 +245,19 @@ struct settings {
static BOOLEAN init_done= FALSE; /* Set to TRUE when initialization done */
static struct settings init_settings;
static const char *db_process= 0;/* Pointer to process name; argv[0] */
+my_bool _dbug_on_= TRUE; /* FALSE if no debugging at all */
typedef struct _db_code_state_ {
const char *process; /* Pointer to process name; usually argv[0] */
- const char *func; /* Name of current user function */
- const char *file; /* Name of current user file */
- char **framep; /* Pointer to current frame */
- struct settings *stack; /* debugging settings */
- const char *jmpfunc; /* Remember current function for setjmp */
- const char *jmpfile; /* Remember current file for setjmp */
- int lineno; /* Current debugger output line number */
- int level; /* Current function nesting level */
- int jmplevel; /* Remember nesting level at setjmp() */
+ const char *func; /* Name of current user function */
+ const char *file; /* Name of current user file */
+ struct _db_stack_frame_ *framep; /* Pointer to current frame */
+ struct settings *stack; /* debugging settings */
+ const char *jmpfunc; /* Remember current function for setjmp */
+ const char *jmpfile; /* Remember current file for setjmp */
+ int lineno; /* Current debugger output line number */
+ uint level; /* Current function nesting level */
+ int jmplevel; /* Remember nesting level at setjmp() */
/*
* The following variables are used to hold the state information
@@ -244,12 +278,16 @@ typedef struct _db_code_state_ {
The test below is so we could call functions with DBUG_ENTER before
my_thread_init().
*/
-#define get_code_state_or_return if (!cs && !((cs=code_state()))) return
+#define get_code_state_if_not_set_or_return if (!cs && !((cs=code_state()))) return
+#define get_code_state_or_return if (!((cs=code_state()))) return
/* Handling lists */
-static struct link *ListAdd(struct link *, const char *, const char *);
-static struct link *ListDel(struct link *, const char *, const char *);
+#define ListAdd(A,B,C) ListAddDel(A,B,C,INCLUDE)
+#define ListDel(A,B,C) ListAddDel(A,B,C,EXCLUDE)
+static struct link *ListAddDel(struct link *, const char *, const char *, int);
static struct link *ListCopy(struct link *);
+static int InList(struct link *linkp,const char *cp);
+static uint ListFlags(struct link *linkp);
static void FreeList(struct link *linkp);
/* OpenClose debug output stream */
@@ -260,10 +298,18 @@ static void PushState(CODE_STATE *cs);
/* Free memory associated with debug state. */
static void FreeState (CODE_STATE *cs, struct settings *state, int free_state);
/* Test for tracing enabled */
-static BOOLEAN DoTrace(CODE_STATE *cs);
+static int DoTrace(CODE_STATE *cs);
+/*
+ return values of DoTrace.
+ Can also be used as bitmask: ret & DO_TRACE
+*/
+#define DO_TRACE 1
+#define DONT_TRACE 2
+#define ENABLE_TRACE 3
+#define DISABLE_TRACE 4
/* Test to see if file is writable */
-#if !(!defined(HAVE_ACCESS) || defined(MSDOS))
+#if defined(HAVE_ACCESS) && !defined(MSDOS)
static BOOLEAN Writable(const char *pathname);
/* Change file owner and group */
static void ChangeOwner(CODE_STATE *cs, char *pathname);
@@ -275,10 +321,10 @@ static void DoPrefix(CODE_STATE *cs, uint line);
static char *DbugMalloc(size_t size);
static const char *BaseName(const char *pathname);
static void Indent(CODE_STATE *cs, int indent);
-static BOOLEAN InList(struct link *linkp,const char *cp);
-static void dbug_flush(CODE_STATE *);
+static void DbugFlush(CODE_STATE *);
static void DbugExit(const char *why);
static const char *DbugStrTok(const char *s);
+static void DbugVfprintf(FILE *stream, const char* format, va_list args);
#ifndef THREAD
/* Open profile output stream */
@@ -293,7 +339,7 @@ static unsigned long Clock(void);
* Miscellaneous printf format strings.
*/
-#define ERR_MISSING_RETURN "%s: missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"%s\"\n"
+#define ERR_MISSING_RETURN "missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"%s\"\n"
#define ERR_OPEN "%s: can't open debug output stream \"%s\": "
#define ERR_CLOSE "%s: can't close debug file: "
#define ERR_ABORT "%s: debugger aborting because %s\n"
@@ -322,34 +368,39 @@ static unsigned long Clock(void);
#ifdef THREAD
#include <my_pthread.h>
-pthread_mutex_t THR_LOCK_dbug;
+static pthread_mutex_t THR_LOCK_dbug;
static CODE_STATE *code_state(void)
{
- CODE_STATE *cs=0;
- struct st_my_thread_var *tmp;
+ CODE_STATE *cs, **cs_ptr;
+
+ /*
+ _dbug_on_ is reset if we don't plan to use any debug commands at all and
+ we want to run on maximum speed
+ */
+ if (!_dbug_on_)
+ return 0;
if (!init_done)
{
+ init_done=TRUE;
pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST);
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
- init_done=TRUE;
}
- if ((tmp=my_thread_var))
+ if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug()))
+ return 0; /* Thread not initialised */
+ if (!(cs= *cs_ptr))
{
- if (!(cs=(CODE_STATE *) tmp->dbug))
- {
- cs=(CODE_STATE*) DbugMalloc(sizeof(*cs));
- bzero((uchar*) cs,sizeof(*cs));
- cs->process= db_process ? db_process : "dbug";
- cs->func="?func";
- cs->file="?file";
- cs->stack=&init_settings;
- tmp->dbug= (void*) cs;
- }
+ cs=(CODE_STATE*) DbugMalloc(sizeof(*cs));
+ bzero((uchar*) cs,sizeof(*cs));
+ cs->process= db_process ? db_process : "dbug";
+ cs->func="?func";
+ cs->file="?file";
+ cs->stack=&init_settings;
+ *cs_ptr= cs;
}
return cs;
}
@@ -403,20 +454,19 @@ static CODE_STATE *code_state(void)
void _db_process_(const char *name)
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
if (!db_process)
db_process= name;
-
+
get_code_state_or_return;
cs->process= name;
}
-
/*
* FUNCTION
*
- * DbugParse parse control string and set current debugger setting
+ * DbugParse parse control string and set current debugger settings
*
* DESCRIPTION
*
@@ -438,15 +488,17 @@ void _db_process_(const char *name)
*
* For convenience, any leading "-#" is stripped off.
*
+ * RETURN
+ * 1 - a list of functions ("f" flag) was possibly changed
+ * 0 - a list of functions was not changed
*/
-static void DbugParse(CODE_STATE *cs, const char *control)
+int DbugParse(CODE_STATE *cs, const char *control)
{
const char *end;
- int rel=0;
+ int rel, f_used=0;
struct settings *stack;
- get_code_state_or_return;
stack= cs->stack;
if (control[0] == '-' && control[1] == '#')
@@ -455,6 +507,7 @@ static void DbugParse(CODE_STATE *cs, const char *control)
rel= control[0] == '+' || control[0] == '-';
if ((!rel || (!stack->out_file && !stack->next)))
{
+ FreeState(cs, stack, 0);
stack->flags= 0;
stack->delay= 0;
stack->maxdepth= 0;
@@ -497,7 +550,6 @@ static void DbugParse(CODE_STATE *cs, const char *control)
{
int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0;
if (sign) control++;
- if (!rel) sign=0;
c= *control++;
if (*control == ',') control++;
/* XXX when adding new cases here, don't forget _db_explain_ ! */
@@ -526,6 +578,7 @@ static void DbugParse(CODE_STATE *cs, const char *control)
stack->delay= atoi(control);
break;
case 'f':
+ f_used= 1;
if (sign < 0 && control == end)
{
if (!is_shared(stack,functions))
@@ -664,8 +717,111 @@ static void DbugParse(CODE_STATE *cs, const char *control)
control=end+1;
end= DbugStrTok(control);
}
+ return !rel || f_used;
}
+#define framep_trace_flag(cs, frp) (frp ? \
+ frp->level & TRACE_ON : \
+ (ListFlags(cs->stack->functions) & INCLUDE) ? \
+ 0 : (uint)TRACE_ON)
+
+void FixTraceFlags_helper(CODE_STATE *cs, const char *func,
+ struct _db_stack_frame_ *framep)
+{
+ if (framep->prev)
+ FixTraceFlags_helper(cs, framep->func, framep->prev);
+
+ cs->func= func;
+ cs->level= framep->level & ~TRACE_ON;
+ framep->level= cs->level | framep_trace_flag(cs, framep->prev);
+ /*
+ we don't set cs->framep correctly, even though DoTrace uses it.
+ It's ok, because cs->framep may only affect DO_TRACE/DONT_TRACE return
+ values, but we ignore them here anyway
+ */
+ switch(DoTrace(cs)) {
+ case ENABLE_TRACE:
+ framep->level|= TRACE_ON;
+ break;
+ case DISABLE_TRACE:
+ framep->level&= ~TRACE_ON;
+ break;
+ }
+}
+
+#define fflags(cs) cs->stack->out_file ? ListFlags(cs->stack->functions) : TRACE_ON;
+
+void FixTraceFlags(uint old_fflags, CODE_STATE *cs)
+{
+ const char *func;
+ uint new_fflags, traceon, level;
+ struct _db_stack_frame_ *framep;
+
+ /*
+ first (a.k.a. safety) check:
+ if we haven't started tracing yet, no call stack at all - we're safe.
+ */
+ framep=cs->framep;
+ if (framep == 0)
+ return;
+
+ /*
+ Ok, the tracing has started, call stack isn't empty.
+
+ second check: does the new list have a SUBDIR rule ?
+ */
+ new_fflags=fflags(cs);
+ if (new_fflags & SUBDIR)
+ goto yuck;
+
+ /*
+ Ok, new list doesn't use SUBDIR.
+
+ third check: we do NOT need to re-scan if
+ neither old nor new lists used SUBDIR flag and if a default behavior
+ (whether an unlisted function is traced) hasn't changed.
+ Default behavior depends on whether there're INCLUDE elements in the list.
+ */
+ if (!(old_fflags & SUBDIR) && !((new_fflags^old_fflags) & INCLUDE))
+ return;
+
+ /*
+ Ok, old list may've used SUBDIR, or defaults could've changed.
+
+ fourth check: are we inside a currently active SUBDIR rule ?
+ go up the call stack, if TRACE_ON flag ever changes its value - we are.
+ */
+ for (traceon=framep->level; framep; framep=framep->prev)
+ if ((traceon ^ framep->level) & TRACE_ON)
+ goto yuck;
+
+ /*
+ Ok, TRACE_ON flag doesn't change in the call stack.
+
+ fifth check: but is the top-most value equal to a default one ?
+ */
+ if (((traceon & TRACE_ON) != 0) == ((new_fflags & INCLUDE) == 0))
+ return;
+
+yuck:
+ /*
+ Yuck! function list was changed, and one of the currently active rules
+ was possibly affected. For example, a tracing could've been enabled or
+ disabled for a function somewhere up the call stack.
+ To react correctly, we must go up the call stack all the way to
+ the top and re-match rules to set TRACE_ON bit correctly.
+
+ We must traverse the stack forwards, not backwards.
+ That's what a recursive helper is doing.
+ It'll destroy two CODE_STATE fields, save them now.
+ */
+ func= cs->func;
+ level= cs->level;
+ FixTraceFlags_helper(cs, func, cs->framep);
+ /* now we only need to restore CODE_STATE fields, and we're done */
+ cs->func= func;
+ cs->level= level;
+}
/*
* FUNCTION
@@ -683,19 +839,21 @@ static void DbugParse(CODE_STATE *cs, const char *control)
* parses the control string, and sets up a current debug
* settings. Pushes a new debug settings if the current is
* set to the initial debugger settings.
+ *
*/
-void _db_set_(CODE_STATE *cs, const char *control)
+void _db_set_(const char *control)
{
+ CODE_STATE *cs;
+ uint old_fflags;
get_code_state_or_return;
-
+ old_fflags=fflags(cs);
if (cs->stack == &init_settings)
PushState(cs);
-
- DbugParse(cs, control);
+ if (DbugParse(cs, control))
+ FixTraceFlags(old_fflags, cs);
}
-
/*
* FUNCTION
*
@@ -716,10 +874,25 @@ void _db_set_(CODE_STATE *cs, const char *control)
void _db_push_(const char *control)
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
+ uint old_fflags;
get_code_state_or_return;
+ old_fflags=fflags(cs);
PushState(cs);
- DbugParse(cs, control);
+ if (DbugParse(cs, control))
+ FixTraceFlags(old_fflags, cs);
+}
+
+
+/**
+ Returns TRUE if session-local settings have been set.
+*/
+
+int _db_is_pushed_()
+{
+ CODE_STATE *cs= NULL;
+ get_code_state_or_return FALSE;
+ return (cs->stack != &init_settings);
}
/*
@@ -765,15 +938,18 @@ void _db_set_init_(const char *control)
void _db_pop_()
{
struct settings *discard;
- CODE_STATE *cs=0;
+ uint old_fflags;
+ CODE_STATE *cs;
get_code_state_or_return;
discard= cs->stack;
- if (discard->next != NULL)
+ if (discard != &init_settings)
{
+ old_fflags=fflags(cs);
cs->stack= discard->next;
FreeState(cs, discard, 1);
+ FixTraceFlags(old_fflags, cs);
}
}
@@ -798,11 +974,16 @@ void _db_pop_()
buf=strnmov(buf, (S), len+1); \
if (buf >= end) goto overflow; \
} while (0)
-#define list_to_buf(l) do { \
+#define list_to_buf(l, f) do { \
struct link *listp=(l); \
while (listp) \
{ \
- str_to_buf(listp->str); \
+ if (listp->flags & (f)) \
+ { \
+ str_to_buf(listp->str); \
+ if (listp->flags & SUBDIR) \
+ char_to_buf('/'); \
+ } \
listp=listp->next_link; \
} \
} while (0)
@@ -842,9 +1023,18 @@ void _db_pop_()
#define op_list_to_buf(C, val, cond) do { \
if ((cond)) \
{ \
+ int f=ListFlags(val); \
colon_to_buf; \
char_to_buf((C)); \
- list_to_buf(val); \
+ if (f & INCLUDE) \
+ list_to_buf(val, INCLUDE); \
+ if (f & EXCLUDE) \
+ { \
+ colon_to_buf; \
+ char_to_buf('-'); \
+ char_to_buf((C)); \
+ list_to_buf(val, EXCLUDE); \
+ } \
} \
} while (0)
#define op_bool_to_buf(C, cond) do { \
@@ -859,7 +1049,7 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
{
char *start=buf, *end=buf+len-4;
- get_code_state_or_return *buf=0;
+ get_code_state_if_not_set_or_return *buf=0;
op_list_to_buf('d', cs->stack->keywords, DEBUGGING);
op_int_to_buf ('D', cs->stack->delay, 0);
@@ -927,15 +1117,11 @@ int _db_explain_init_(char *buf, size_t len)
*
* SYNOPSIS
*
- * VOID _db_enter_(_func_, _file_, _line_,
- * _sfunc_, _sfile_, _slevel_, _sframep_)
+ * VOID _db_enter_(_func_, _file_, _line_, _stack_frame_)
* char *_func_; points to current function name
* char *_file_; points to current file name
* int _line_; called from source line number
- * char **_sfunc_; save previous _func_
- * char **_sfile_; save previous _file_
- * int *_slevel_; save previous nesting level
- * char ***_sframep_; save previous frame pointer
+ * struct _db_stack_frame_ allocated on the caller's stack
*
* DESCRIPTION
*
@@ -959,55 +1145,66 @@ int _db_explain_init_(char *buf, size_t len)
*/
void _db_enter_(const char *_func_, const char *_file_,
- uint _line_, const char **_sfunc_, const char **_sfile_,
- uint *_slevel_, char ***_sframep_ __attribute__((unused)))
+ uint _line_, struct _db_stack_frame_ *_stack_frame_)
{
- int save_errno=errno;
- CODE_STATE *cs=0;
- get_code_state_or_return;
+ int save_errno;
+ CODE_STATE *cs;
+ if (!((cs=code_state())))
+ {
+ _stack_frame_->level= 0; /* Set to avoid valgrind warnings if dbug is enabled later */
+ _stack_frame_->prev= 0;
+ return;
+ }
+ save_errno= errno;
- *_sfunc_= cs->func;
- *_sfile_= cs->file;
+ _stack_frame_->func= cs->func;
+ _stack_frame_->file= cs->file;
cs->func= _func_;
cs->file= _file_;
- *_slevel_= ++cs->level;
+ _stack_frame_->prev= cs->framep;
+ _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep);
+ cs->framep= _stack_frame_;
#ifndef THREAD
- *_sframep_= cs->framep;
- cs->framep= (char **) _sframep_;
if (DoProfile(cs))
{
long stackused;
- if (*cs->framep == NULL)
+ if (cs->framep->prev == NULL)
stackused= 0;
else
{
- stackused= ((long)(*cs->framep)) - ((long)(cs->framep));
+ stackused= (char*)(cs->framep->prev) - (char*)(cs->framep);
stackused= stackused > 0 ? stackused : -stackused;
}
(void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func);
-#ifdef AUTOS_REVERSE
- (void) fprintf(cs->stack->prof_file, PROF_SFMT, cs->framep, stackused, *_sfunc_);
-#else
(void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused,
- cs->func);
-#endif
+ AUTOS_REVERSE ? _stack_frame_->func : cs->func);
(void) fflush(cs->stack->prof_file);
}
#endif
- if (DoTrace(cs))
- {
- if (!cs->locked)
- pthread_mutex_lock(&THR_LOCK_dbug);
- DoPrefix(cs, _line_);
- Indent(cs, cs->level);
- (void) fprintf(cs->stack->out_file, ">%s\n", cs->func);
- dbug_flush(cs); /* This does a unlock */
- }
-#ifdef SAFEMALLOC
- if (cs->stack->flags & SANITY_CHECK_ON)
- if (_sanity(_file_,_line_)) /* Check of safemalloc */
+ switch (DoTrace(cs)) {
+ case ENABLE_TRACE:
+ cs->framep->level|= TRACE_ON;
+ if (!TRACING) break;
+ /* fall through */
+ case DO_TRACE:
+ if ((cs->stack->flags & SANITY_CHECK_ON) && _sanity(_file_,_line_))
cs->stack->flags &= ~SANITY_CHECK_ON;
-#endif
+ if (TRACING)
+ {
+ if (!cs->locked)
+ pthread_mutex_lock(&THR_LOCK_dbug);
+ DoPrefix(cs, _line_);
+ Indent(cs, cs->level);
+ (void) fprintf(cs->stack->out_file, ">%s\n", cs->func);
+ DbugFlush(cs); /* This does a unlock */
+ }
+ break;
+ case DISABLE_TRACE:
+ cs->framep->level&= ~TRACE_ON;
+ /* fall through */
+ case DONT_TRACE:
+ break;
+ }
errno=save_errno;
}
@@ -1018,11 +1215,9 @@ void _db_enter_(const char *_func_, const char *_file_,
*
* SYNOPSIS
*
- * VOID _db_return_(_line_, _sfunc_, _sfile_, _slevel_)
+ * VOID _db_return_(_line_, _stack_frame_)
* int _line_; current source line number
- * char **_sfunc_; where previous _func_ is to be retrieved
- * char **_sfile_; where previous _file_ is to be retrieved
- * int *_slevel_; where previous level was stashed
+ * struct _db_stack_frame_ allocated on the caller's stack
*
* DESCRIPTION
*
@@ -1033,52 +1228,47 @@ void _db_enter_(const char *_func_, const char *_file_,
*
*/
-/* helper macro */
-void _db_return_(uint _line_, const char **_sfunc_,
- const char **_sfile_, uint *_slevel_)
+void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
{
int save_errno=errno;
- CODE_STATE *cs=0;
+ uint _slevel_= _stack_frame_->level & ~TRACE_ON;
+ CODE_STATE *cs;
get_code_state_or_return;
- if (cs->level != (int) *_slevel_)
+ if (cs->framep != _stack_frame_)
{
- if (!cs->locked)
- pthread_mutex_lock(&THR_LOCK_dbug);
- (void) fprintf(cs->stack->out_file, ERR_MISSING_RETURN, cs->process,
- cs->func);
- dbug_flush(cs);
+ char buf[512];
+ my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
+ DbugExit(buf);
}
- else
- {
-#ifdef SAFEMALLOC
- if (cs->stack->flags & SANITY_CHECK_ON)
- {
- if (_sanity(*_sfile_,_line_))
- cs->stack->flags &= ~SANITY_CHECK_ON;
- }
-#endif
#ifndef THREAD
- if (DoProfile(cs))
- (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
+ if (DoProfile(cs))
+ (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
#endif
- if (DoTrace(cs))
+ if (DoTrace(cs) & DO_TRACE)
+ {
+ if ((cs->stack->flags & SANITY_CHECK_ON) &&
+ _sanity(_stack_frame_->file,_line_))
+ cs->stack->flags &= ~SANITY_CHECK_ON;
+ if (TRACING)
{
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
DoPrefix(cs, _line_);
Indent(cs, cs->level);
(void) fprintf(cs->stack->out_file, "<%s\n", cs->func);
- dbug_flush(cs);
+ DbugFlush(cs);
}
}
- cs->level= *_slevel_-1;
- cs->func= *_sfunc_;
- cs->file= *_sfile_;
-#ifndef THREAD
+ /*
+ Check to not set level < 0. This can happen if DBUG was disabled when
+ function was entered and enabled in function.
+ */
+ cs->level= _slevel_ != 0 ? _slevel_ - 1 : 0;
+ cs->func= _stack_frame_->func;
+ cs->file= _stack_frame_->file;
if (cs->framep != NULL)
- cs->framep= (char **) *cs->framep;
-#endif
+ cs->framep= cs->framep->prev;
errno=save_errno;
}
@@ -1105,7 +1295,7 @@ void _db_return_(uint _line_, const char **_sfunc_,
void _db_pargs_(uint _line_, const char *keyword)
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
cs->u_line= _line_;
cs->u_keyword= keyword;
@@ -1141,13 +1331,12 @@ void _db_pargs_(uint _line_, const char *keyword)
void _db_doprnt_(const char *format,...)
{
va_list args;
-
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
va_start(args,format);
- if (_db_keyword_(cs, cs->u_keyword))
+ if (_db_keyword_(cs, cs->u_keyword, 0))
{
int save_errno=errno;
if (!cs->locked)
@@ -1158,14 +1347,25 @@ void _db_doprnt_(const char *format,...)
else
(void) fprintf(cs->stack->out_file, "%s: ", cs->func);
(void) fprintf(cs->stack->out_file, "%s: ", cs->u_keyword);
- (void) vfprintf(cs->stack->out_file, format, args);
- (void) fputc('\n',cs->stack->out_file);
- dbug_flush(cs);
+ DbugVfprintf(cs->stack->out_file, format, args);
+ DbugFlush(cs);
errno=save_errno;
}
va_end(args);
}
+/*
+ * vfprintf clone with consistent, platform independent output for
+ * problematic formats like %p, %zd and %lld.
+ */
+static void DbugVfprintf(FILE *stream, const char* format, va_list args)
+{
+ char cvtbuf[1024];
+ size_t len;
+ len = my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args);
+ (void) fprintf(stream, "%s\n", cvtbuf);
+}
+
/*
* FUNCTION
@@ -1182,19 +1382,17 @@ void _db_doprnt_(const char *format,...)
*
* DESCRIPTION
* Dump N characters in a binary array.
- * Is used to examine corrputed memory or arrays.
+ * Is used to examine corrupted memory or arrays.
*/
void _db_dump_(uint _line_, const char *keyword,
const unsigned char *memory, size_t length)
{
int pos;
- char dbuff[90];
-
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
- if (_db_keyword_(cs, keyword))
+ if (_db_keyword_(cs, keyword, 0))
{
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
@@ -1208,9 +1406,8 @@ void _db_dump_(uint _line_, const char *keyword,
{
fprintf(cs->stack->out_file, "%s: ", cs->func);
}
- sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%ld)\n",
+ (void) fprintf(cs->stack->out_file, "%s: Memory: 0x%lx Bytes: (%ld)\n",
keyword, (ulong) memory, (long) length);
- (void) fputs(dbuff,cs->stack->out_file);
pos=0;
while (length-- > 0)
@@ -1226,7 +1423,7 @@ void _db_dump_(uint _line_, const char *keyword,
fputc(' ',cs->stack->out_file);
}
(void) fputc('\n',cs->stack->out_file);
- dbug_flush(cs);
+ DbugFlush(cs);
}
}
@@ -1234,93 +1431,75 @@ void _db_dump_(uint _line_, const char *keyword,
/*
* FUNCTION
*
- * ListAdd add to the list modifiers from debug control string
- *
- * SYNOPSIS
- *
- * static struct link *ListAdd(listp, ctlp, end)
- * struct link *listp;
- * char *ctlp;
- * char *end;
+ * ListAddDel modify the list according to debug control string
*
* DESCRIPTION
*
* Given pointer to a comma separated list of strings in "cltp",
- * parses the list, and adds it to listp, returning a pointer
- * to the new list
- *
- * Note that since each link is added at the head of the list,
- * the final list will be in "reverse order", which is not
- * significant for our usage here.
- *
- */
-
-static struct link *ListAdd(struct link *head,
- const char *ctlp, const char *end)
-{
- const char *start;
- struct link *new_malloc;
- int len;
-
- while (ctlp < end)
- {
- start= ctlp;
- while (ctlp < end && *ctlp != ',')
- ctlp++;
- len=ctlp-start;
- new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len);
- memcpy(new_malloc->str, start, len);
- new_malloc->str[len]=0;
- new_malloc->next_link= head;
- head= new_malloc;
- ctlp++;
- }
- return head;
-}
-
-/*
- * FUNCTION
+ * parses the list, and modifies "listp", returning a pointer
+ * to the new list.
*
- * ListDel remove from the list modifiers in debug control string
+ * The mode of operation is defined by "todo" parameter.
*
- * SYNOPSIS
- *
- * static struct link *ListDel(listp, ctlp, end)
- * struct link *listp;
- * char *ctlp;
- * char *end;
- *
- * DESCRIPTION
- *
- * Given pointer to a comma separated list of strings in "cltp",
- * parses the list, and removes these strings from the listp,
- * returning a pointer to the new list.
+ * If it is INCLUDE, elements (strings from "cltp") are added to the
+ * list, they will have INCLUDE flag set. If the list already contains
+ * the string in question, new element is not added, but a flag of
+ * the existing element is adjusted (INCLUDE bit is set, EXCLUDE bit
+ * is removed).
*
+ * If it is EXCLUDE, elements are added to the list with the EXCLUDE
+ * flag set. If the list already contains the string in question,
+ * it is removed, new element is not added.
*/
-static struct link *ListDel(struct link *head,
- const char *ctlp, const char *end)
+static struct link *ListAddDel(struct link *head, const char *ctlp,
+ const char *end, int todo)
{
const char *start;
struct link **cur;
- int len;
+ size_t len;
+ int subdir;
- while (ctlp < end)
+ ctlp--;
+next:
+ while (++ctlp < end)
{
start= ctlp;
+ subdir=0;
while (ctlp < end && *ctlp != ',')
ctlp++;
len=ctlp-start;
- cur=&head;
- do
+ if (start[len-1] == '/')
+ {
+ len--;
+ subdir=SUBDIR;
+ }
+ if (len == 0) continue;
+ for (cur=&head; *cur; cur=&((*cur)->next_link))
{
- while (*cur && !strncmp((*cur)->str, start, len))
+ if (!strncmp((*cur)->str, start, len))
{
- struct link *delme=*cur;
- *cur=(*cur)->next_link;
- free((void*) delme);
+ if ((*cur)->flags & todo) /* same action ? */
+ (*cur)->flags|= subdir; /* just merge the SUBDIR flag */
+ else if (todo == EXCLUDE)
+ {
+ struct link *delme=*cur;
+ *cur=(*cur)->next_link;
+ free((void*) delme);
+ }
+ else
+ {
+ (*cur)->flags&=~(EXCLUDE & SUBDIR);
+ (*cur)->flags|=INCLUDE | subdir;
+ }
+ goto next;
}
- } while (*cur && *(cur=&((*cur)->next_link)));
+ }
+ *cur= (struct link *) DbugMalloc(sizeof(struct link)+len);
+ memcpy((*cur)->str, start, len);
+ (*cur)->str[len]=0;
+ (*cur)->flags=todo | subdir;
+ (*cur)->next_link=0;
}
return head;
}
@@ -1352,7 +1531,7 @@ static struct link *ListCopy(struct link *orig)
{
struct link *new_malloc;
struct link *head;
- int len;
+ size_t len;
head= NULL;
while (orig != NULL)
@@ -1361,6 +1540,7 @@ static struct link *ListCopy(struct link *orig)
new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len);
memcpy(new_malloc->str, orig->str, len);
new_malloc->str[len]= 0;
+ new_malloc->flags=orig->flags;
new_malloc->next_link= head;
head= new_malloc;
orig= orig->next_link;
@@ -1373,47 +1553,52 @@ static struct link *ListCopy(struct link *orig)
*
* InList test a given string for member of a given list
*
- * SYNOPSIS
- *
- * static BOOLEAN InList(linkp, cp)
- * struct link *linkp;
- * char *cp;
- *
* DESCRIPTION
*
* Tests the string pointed to by "cp" to determine if it is in
* the list pointed to by "linkp". Linkp points to the first
- * link in the list. If linkp is NULL then the string is treated
- * as if it is in the list (I.E all strings are in the null list).
+ * link in the list. If linkp is NULL or contains only EXCLUDE
+ * elements then the string is treated as if it is in the list.
* This may seem rather strange at first but leads to the desired
* operation if no list is given. The net effect is that all
* strings will be accepted when there is no list, and when there
* is a list, only those strings in the list will be accepted.
*
+ * RETURN
+ * combination of SUBDIR, INCLUDE, EXCLUDE, MATCHED flags
+ *
*/
-static BOOLEAN InList(struct link *linkp, const char *cp)
+static int InList(struct link *linkp, const char *cp)
{
- REGISTER struct link *scan;
- REGISTER BOOLEAN result;
+ int result;
- if (linkp == NULL)
- result= TRUE;
- else
+ for (result=MATCHED; linkp != NULL; linkp= linkp->next_link)
{
- result= FALSE;
- for (scan= linkp; scan != NULL; scan= scan->next_link)
- {
- if (!strcmp(scan->str, cp))
- {
- result= TRUE;
- break;
- }
- }
+ if (!fnmatch(linkp->str, cp, 0))
+ return linkp->flags;
+ if (!(linkp->flags & EXCLUDE))
+ result=NOT_MATCHED;
+ if (linkp->flags & SUBDIR)
+ result|=SUBDIR;
}
return result;
}
+/*
+ * FUNCTION
+ *
+ * ListFlags returns aggregated list flags (ORed over all elements)
+ *
+ */
+
+static uint ListFlags(struct link *linkp)
+{
+ uint f;
+ for (f=0; linkp != NULL; linkp= linkp->next_link)
+ f|= linkp->flags;
+ return f;
+}
/*
* FUNCTION
@@ -1440,8 +1625,8 @@ static void PushState(CODE_STATE *cs)
struct settings *new_malloc;
new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings));
+ bzero(new_malloc, sizeof(*new_malloc));
new_malloc->next= cs->stack;
- new_malloc->out_file= NULL;
cs->stack= new_malloc;
}
@@ -1472,11 +1657,17 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state)
FreeList(state->processes);
if (!is_shared(state, p_functions))
FreeList(state->p_functions);
+
if (!is_shared(state, out_file))
DBUGCloseFile(cs, state->out_file);
- (void) fflush(cs->stack->out_file);
- if (state->prof_file)
+ else
+ (void) fflush(state->out_file);
+
+ if (!is_shared(state, prof_file))
DBUGCloseFile(cs, state->prof_file);
+ else
+ (void) fflush(state->prof_file);
+
if (free_state)
free((void*) state);
}
@@ -1503,8 +1694,12 @@ void _db_end_()
{
struct settings *discard;
static struct settings tmp;
- CODE_STATE *cs=0;
-
+ CODE_STATE *cs;
+ /*
+ Set _dbug_on_ to be able to do full reset even when DEBUGGER_OFF was
+ called after dbug was initialized
+ */
+ _dbug_on_= 1;
get_code_state_or_return;
while ((discard= cs->stack))
@@ -1538,25 +1733,30 @@ void _db_end_()
*
* DoTrace check to see if tracing is current enabled
*
- * SYNOPSIS
- *
- * static BOOLEAN DoTrace(stack)
- *
* DESCRIPTION
*
- * Checks to see if tracing is enabled based on whether the
- * user has specified tracing, the maximum trace depth has
- * not yet been reached, the current function is selected,
- * and the current process is selected. Returns TRUE if
- * tracing is enabled, FALSE otherwise.
+ * Checks to see if dbug in this function is enabled based on
+ * whether the maximum trace depth has been reached, the current
+ * function is selected, and the current process is selected.
*
*/
-static BOOLEAN DoTrace(CODE_STATE *cs)
+static int DoTrace(CODE_STATE *cs)
{
- return (TRACING && cs->level <= cs->stack->maxdepth &&
- InList(cs->stack->functions, cs->func) &&
- InList(cs->stack->processes, cs->process));
+ if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) &&
+ InList(cs->stack->processes, cs->process) & (MATCHED|INCLUDE))
+ switch(InList(cs->stack->functions, cs->func)) {
+ case INCLUDE|SUBDIR: return ENABLE_TRACE;
+ case INCLUDE: return DO_TRACE;
+ case MATCHED|SUBDIR:
+ case NOT_MATCHED|SUBDIR:
+ case MATCHED: return framep_trace_flag(cs, cs->framep) ?
+ DO_TRACE : DONT_TRACE;
+ case EXCLUDE:
+ case NOT_MATCHED: return DONT_TRACE;
+ case EXCLUDE|SUBDIR: return DISABLE_TRACE;
+ }
+ return DONT_TRACE;
}
@@ -1584,62 +1784,27 @@ static BOOLEAN DoProfile(CODE_STATE *cs)
{
return PROFILING &&
cs->level <= cs->stack->maxdepth &&
- InList(cs->stack->p_functions, cs->func) &&
- InList(cs->stack->processes, cs->process);
+ InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) &&
+ InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED);
}
#endif
FILE *_db_fp_(void)
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return NULL;
return cs->stack->out_file;
}
-
-/*
- * FUNCTION
- *
- * _db_strict_keyword_ test keyword for member of keyword list
- *
- * SYNOPSIS
- *
- * BOOLEAN _db_strict_keyword_(keyword)
- * char *keyword;
- *
- * DESCRIPTION
- *
- * Similar to _db_keyword_, but keyword is NOT accepted if keyword list
- * is empty. Used in DBUG_EXECUTE_IF() - for actions that must not be
- * executed by default.
- *
- * Returns TRUE if keyword accepted, FALSE otherwise.
- *
- */
-
-BOOLEAN _db_strict_keyword_(const char *keyword)
-{
- CODE_STATE *cs=0;
- get_code_state_or_return FALSE;
- if (!DEBUGGING || cs->stack->keywords == NULL)
- return FALSE;
- return _db_keyword_(cs, keyword);
-}
-
/*
* FUNCTION
*
* _db_keyword_ test keyword for member of keyword list
*
- * SYNOPSIS
- *
- * BOOLEAN _db_keyword_(keyword)
- * char *keyword;
- *
* DESCRIPTION
*
* Test a keyword to determine if it is in the currently active
- * keyword list. As with the function list, a keyword is accepted
+ * keyword list. If strict=0, a keyword is accepted
* if the list is null, otherwise it must match one of the list
* members. When debugging is not on, no keywords are accepted.
* After the maximum trace level is exceeded, no keywords are
@@ -1651,15 +1816,13 @@ BOOLEAN _db_strict_keyword_(const char *keyword)
*
*/
-BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword)
+BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict)
{
- get_code_state_or_return FALSE;
+ get_code_state_if_not_set_or_return FALSE;
+ strict=strict ? INCLUDE : INCLUDE|MATCHED;
- return (DEBUGGING &&
- (!TRACING || cs->level <= cs->stack->maxdepth) &&
- InList(cs->stack->functions, cs->func) &&
- InList(cs->stack->keywords, keyword) &&
- InList(cs->stack->processes, cs->process));
+ return DEBUGGING && DoTrace(cs) & DO_TRACE &&
+ InList(cs->stack->keywords, keyword) & strict;
}
/*
@@ -1827,7 +1990,7 @@ static void DBUGOpenFile(CODE_STATE *cs,
{
if (end)
{
- int len=end-name;
+ size_t len=end-name;
memcpy(cs->stack->name, name, len);
cs->stack->name[len]=0;
}
@@ -1950,12 +2113,12 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
{
- if (fp != stderr && fp != stdout && fclose(fp) == EOF)
+ if (fp && fp != stderr && fp != stdout && fclose(fp) == EOF)
{
pthread_mutex_lock(&THR_LOCK_dbug);
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
perror("");
- dbug_flush(cs);
+ DbugFlush(cs);
}
}
@@ -1984,7 +2147,7 @@ static void DbugExit(const char *why)
CODE_STATE *cs=code_state();
(void) fprintf(stderr, ERR_ABORT, cs ? cs->process : "(null)", why);
(void) fflush(stderr);
- exit(1);
+ DBUG_ABORT();
}
@@ -2172,7 +2335,7 @@ static void ChangeOwner(CODE_STATE *cs, char *pathname)
EXPORT void _db_setjmp_()
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
cs->jmplevel= cs->level;
@@ -2199,7 +2362,7 @@ EXPORT void _db_setjmp_()
EXPORT void _db_longjmp_()
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
cs->level= cs->jmplevel;
@@ -2250,11 +2413,9 @@ char *s;
/* This is because some systems (MSDOS!!) dosn't flush fileheader */
/* and dbug-file isn't readable after a system crash !! */
-static void dbug_flush(CODE_STATE *cs)
+static void DbugFlush(CODE_STATE *cs)
{
-#ifndef THREAD
if (cs->stack->flags & FLUSH_ON_WRITE)
-#endif
{
(void) fflush(cs->stack->out_file);
if (cs->stack->delay)
@@ -2262,12 +2423,22 @@ static void dbug_flush(CODE_STATE *cs)
}
if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug);
-} /* dbug_flush */
+} /* DbugFlush */
+
+
+/* For debugging */
+
+void _db_flush_()
+{
+ CODE_STATE *cs;
+ get_code_state_or_return;
+ (void) fflush(cs->stack->out_file);
+}
void _db_lock_file_()
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked=1;
@@ -2275,12 +2446,19 @@ void _db_lock_file_()
void _db_unlock_file_()
{
- CODE_STATE *cs=0;
+ CODE_STATE *cs;
get_code_state_or_return;
cs->locked=0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
+const char* _db_get_func_(void)
+{
+ CODE_STATE *cs;
+ get_code_state_or_return NULL;
+ return cs->func;
+}
+
/*
* Here we need the definitions of the clock routine. Add your
* own for whatever system that you have.
diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl
index 141a2ed85f1..3e51a54c707 100755
--- a/dbug/dbug_add_tags.pl
+++ b/dbug/dbug_add_tags.pl
@@ -7,7 +7,7 @@ $ctags="exctags -x -f - --c-types=f -u";
sub get_tag {
local $.; local $_=<TAGS>;
($symbol, $line)= /^(.*\S)\s+function\s+(\d+)/;
- $symbol=$1 if /\s(\S+)\s*\(/;
+ $symbol=$1 if /[\s*]([^\s*]+)\s*\(/;
$line=1e50 unless $line;
}
@@ -51,7 +51,7 @@ while($src=shift)
$skip=!$semicolon;
$semicolon= /;\s*$/;
print && next if $skip ||
- (/^\s+\w+((::\w+)?|<\w+>)\s+\**\w+/ && !/^\s*return/);
+ (/^\s+\w+((::\w+)?|<\w+>)\s+\**\w+/ && !/^\s*return\b/);
last if /DBUG_ENTER/;
print "$tab DBUG_ENTER(\"$symbol\");\n";
print "\n" unless $_ eq "\n";
diff --git a/dbug/doinstall.sh b/dbug/doinstall.sh
deleted file mode 100644
index 707f193c761..00000000000
--- a/dbug/doinstall.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-
-# Warning - first line left blank for sh/csh/ksh compatibility. Do not
-# remove it. fnf@Unisoft
-
-# doinstall.sh --- figure out environment and do recursive make with
-# appropriate pathnames. Works under SV or BSD.
-
-if [ -r /usr/include/search.h ]
-then
- # System V
- $* LLIB=/usr/lib
-else
- # 4.2 BSD
- $* LLIB=/usr/lib/lint
-fi
diff --git a/dbug/install.sh b/dbug/install.sh
deleted file mode 100644
index 7226e01b1cf..00000000000
--- a/dbug/install.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-
-# WARNING -- first line intentionally left blank for sh/csh/ksh
-# compatibility. Do not remove it! FNF, UniSoft Systems.
-#
-# Usage is:
-# install <from> <to>
-#
-# The file <to> is replaced with the file <from>, after first
-# moving <to> to a backup file. The backup file name is created
-# by prepending the filename (after removing any leading pathname
-# components) with "OLD".
-#
-# This script is currently not real robust in the face of signals
-# or permission problems. It also does not do (by intention) all
-# the things that the System V or BSD install scripts try to do
-#
-
-if [ $# -ne 2 ]
-then
- echo "usage: $0 <from> <to>"
- exit 1
-fi
-
-# Now extract the dirname and basename components. Unfortunately, BSD does
-# not have dirname, so we do it the hard way.
-
-fd=`expr $1'/' : '\(/\)[^/]*/$' \| $1'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \| .`
-ff=`basename $1`
-td=`expr $2'/' : '\(/\)[^/]*/$' \| $2'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \| .`
-tf=`basename $2`
-
-# Now test to make sure that they are not the same files.
-
-if [ $fd/$ff = $td/$tf ]
-then
- echo "install: input and output are same files"
- exit 2
-fi
-
-# Save a copy of the "to" file as a backup.
-
-if test -f $td/$tf
-then
- if test -f $td/OLD$tf
- then
- rm -f $td/OLD$tf
- fi
- mv $td/$tf $td/OLD$tf
- if [ $? != 0 ]
- then
- exit 3
- fi
-fi
-
-# Now do the copy and return appropriate status
-
-cp $fd/$ff $td/$tf
-if [ $? != 0 ]
-then
- exit 4
-else
- exit 0
-fi
-
diff --git a/dbug/mklintlib.sh b/dbug/mklintlib.sh
deleted file mode 100644
index 6963016f334..00000000000
--- a/dbug/mklintlib.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Warning - first line left blank for sh/csh/ksh compatibility. Do not
-# remove it. fnf@Unisoft
-
-# mklintlib --- make a lint library, under either System V or 4.2 BSD
-#
-# usage: mklintlib <infile> <outfile>
-#
-
-if test $# -ne 2
-then
- echo "usage: mklintlib <infile> <outfile>"
- exit 1
-fi
-
-if grep SIGTSTP /usr/include/signal.h >/dev/null
-then # BSD
- if test -r /usr/include/whoami.h # 4.1
- then
- /lib/cpp -C -Dlint $1 >hlint
- (/usr/lib/lint/lint1 <hlint >$2) 2>&1 | grep -v warning
- else # 4.2
- lint -Cxxxx $1
- mv llib-lxxxx.ln $2
- fi
-else # USG
- cc -E -C -Dlint $1 | /usr/lib/lint1 -vx -Hhlint >$2
- rm -f hlint
-fi
-exit 0 # don't kill make
diff --git a/dbug/qmake.cmd b/dbug/qmake.cmd
deleted file mode 100644
index ebd4432f7fc..00000000000
--- a/dbug/qmake.cmd
+++ /dev/null
@@ -1,4 +0,0 @@
-CL -I\my\include -AL -Gsm2 -FPi -DDBUG_OFF *.c
-rm \my\lib\dbug.lib
-lib.exe \my\lib\dbug dbug.obj sanity.obj;
-link /NOD /STACK:8000 main factoria,factoria,,DBUG+STRINGS+LLIBCEP+DOSCALLS;
diff --git a/dbug/remove_function_from_trace.pl b/dbug/remove_function_from_trace.pl
new file mode 100755
index 00000000000..1da9e25f9ba
--- /dev/null
+++ b/dbug/remove_function_from_trace.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+
+die <<EEE unless @ARGV;
+Usage: $0 func1 [func2 [ ...] ]
+
+This filter (stdin->stdout) removes lines from dbug trace that were generated
+by specified functions and all functions down the call stack. Produces the
+same effect as if the original source had DBUG_PUSH(""); right after
+DBUG_ENTER() and DBUG_POP(); right before DBUG_RETURN in every such a function.
+EEE
+
+$re=join('|', @ARGV);
+$skip='';
+
+while(<STDIN>) {
+ print unless $skip;
+ next unless /^(?:.*: )*((?:\| )*)([<>])($re)\n/o;
+ if ($2 eq '>') {
+ $skip=$1.$3 unless $skip;
+ next;
+ }
+ next if $skip ne $1.$3;
+ $skip='';
+ print;
+}
diff --git a/dbug/tests-t.pl b/dbug/tests-t.pl
new file mode 100755
index 00000000000..de9ed6f6ab9
--- /dev/null
+++ b/dbug/tests-t.pl
@@ -0,0 +1,496 @@
+#!/usr/bin/env perl
+
+#
+# A driver program to test DBUG features - runs tests (shell commands)
+# from the end of file to invoke tests.c, which does the real dbug work.
+#
+
+use Test::More;
+
+$exe=$0;
+
+die unless $exe =~ s/(tests)-t(\.exe)?$/$1$2 /;
+
+# load tests
+@tests=();
+while (<DATA>) {
+ if (/^% \.\/tests /) {
+ push @tests, [ $' ]
+ } elsif (/^#/) {
+ next;
+ } else {
+ push @{$tests[$#tests]}, $_
+ }
+}
+
+plan skip_all => "because dbug is disabled" if system $exe;
+
+plan tests => scalar(@tests);
+
+for (@tests) {
+ $t=$exe . shift @$_;
+ chomp($t);
+ open F, '-|', $t or die "open($t|): $!";
+ local $";
+ $out=join($", <F>); close(F);
+ # special cases are handled here:
+ $out =~ s/Memory: 0x[0-9A-Fa-f]+/Memory: 0x####/g if $t =~ /dump/;
+ # compare ("\n" at the beginning makes better output in case of errors)
+ is("\n$out","\n@$_", $t);
+}
+
+__DATA__
+% ./tests -#d
+func2: info: s=ok
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+main: explain: dbug explained: d
+func2: info: s=ok
+% ./tests d,ret3
+=> evaluate: OFF
+=> evaluate_if: OFF
+#
+## Testing negative lists
+#
+% ./tests d:-d,ret3
+func2: info: s=ko
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+main: explain: dbug explained: d:-d,ret3
+func2: info: s=ko
+% ./tests t:-d,ret3
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+% ./tests t:d,info:-d,ret3
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ko
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| | info: s=ko
+| <func2
+<main
+% ./tests t:d,info:-d,ret3:-f,func2
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| | >func3
+| | <func3
+<main
+% ./tests t:d,info:-d,ret3:-f,func2 d,evaluate
+=> evaluate: ON
+=> evaluate_if: OFF
+% ./tests t:d,info:-d,ret3:-f,func2 d,evaluate_if
+=> evaluate: OFF
+=> evaluate_if: ON
+% ./tests t:d:-d,ret3:-f,func2 d,evaluate_if
+=> evaluate: OFF
+=> evaluate_if: ON
+% ./tests t:d:-d,ret3:-f,func2
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+| explain: dbug explained: d:-d,ret3:f:-f,func2:t
+| | >func3
+| | <func3
+<main
+#
+## Adding incremental settings to the brew
+#
+% ./tests t:d:-d,ret3:-f,func2 +d,evaluate_if
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+=> evaluate: OFF
+=> evaluate_if: ON
+| | >func3
+| | <func3
+<main
+#
+## DBUG_DUMP
+#
+% ./tests t:d:-d,ret3:f:-f,func2 +d,dump
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+| dump: Memory: 0x#### Bytes: (27)
+64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
+74
+=> evaluate: OFF
+=> evaluate_if: OFF
+| | >func3
+| | <func3
+<main
+% ./tests t:d:-d,ret3:f:-f,func2 +d,dump
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+| dump: Memory: 0x#### Bytes: (27)
+64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
+74
+=> evaluate: OFF
+=> evaluate_if: OFF
+| | >func3
+| | <func3
+<main
+% ./tests t:d:-d,ret3:f:-f,func2:+d,dump
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+| dump: Memory: 0x#### Bytes: (27)
+64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
+74
+=> evaluate: OFF
+=> evaluate_if: OFF
+| | >func3
+| | <func3
+<main
+% ./tests t:d:-d,ret3:f:-f,func2 +d,dump,explain
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+| dump: Memory: 0x#### Bytes: (35)
+64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
+66 2C 66 75 6E 63 32 3A 74
+=> evaluate: OFF
+=> evaluate_if: OFF
+| explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:t
+| | >func3
+| | <func3
+<main
+% ./tests t:d:-d,ret3:f:-f,func2 +d,dump,explain:P
+dbug: >main
+dbug-tests: | >func1
+dbug-tests: | | | >func3
+dbug-tests: | | | <func3
+dbug-tests: | <func1
+dbug-tests: | dump: Memory: 0x#### Bytes: (37)
+64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
+66 2C 66 75 6E 63 32 3A 50 3A 74
+=> evaluate: OFF
+=> evaluate_if: OFF
+dbug-tests: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:P:t
+dbug-tests: | | >func3
+dbug-tests: | | <func3
+dbug-tests: <main
+% ./tests t:d:-d,ret3:f:-f,func2 +d,dump,explain:P:F
+dbug: tests.c: >main
+dbug-tests: tests.c: | >func1
+dbug-tests: tests.c: | | | >func3
+dbug-tests: tests.c: | | | <func3
+dbug-tests: tests.c: | <func1
+dbug-tests: tests.c: | dump: Memory: 0x#### Bytes: (39)
+64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
+66 2C 66 75 6E 63 32 3A 46 3A 50 3A 74
+=> evaluate: OFF
+=> evaluate_if: OFF
+dbug-tests: tests.c: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:F:P:t
+dbug-tests: tests.c: | | >func3
+dbug-tests: tests.c: | | <func3
+dbug-tests: tests.c: <main
+#
+## DBUG_EXPLAIN, DBUG_PUSH, DBUG_POP, DBUG_SET
+#
+% ./tests t:d:-d,ret3:f:-f,func2
+>main
+| >func1
+| | | >func3
+| | | <func3
+| <func1
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+| explain: dbug explained: d:-d,ret3:f:-f,func2:t
+| | >func3
+| | <func3
+<main
+% ./tests t:d:-d,ret3
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ko
+| | <func2
+| <func1
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+| explain: dbug explained: d:-d,ret3:t
+| >func2
+| | >func3
+| | <func3
+| | info: s=ko
+| <func2
+<main
+% ./tests d,info:-d,ret3:d,push
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| | info: s=ko
+| <func2
+<main
+% ./tests d,info:-d,ret3:d,push,explain
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+| explain: dbug explained: d,info,push,explain:-d,ret3:t
+| >func2
+| | >func3
+| | <func3
+| | info: s=ko
+| <func2
+<main
+% ./tests d,info:-d,ret3:d,explain
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+main: explain: dbug explained: d,info,explain:-d,ret3
+func2: info: s=ko
+% ./tests d,info:-d,ret3:d,explain,pop
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+% ./tests d,info:-d,ret3:d,explain t:d,pop
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+main: explain: dbug explained: d,info,explain:-d,ret3
+func2: info: s=ko
+% ./tests d,info:-d,ret3:d,explain,pop +t
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ko
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+main: explain: dbug explained: d,info,explain,pop:-d,ret3
+func2: info: s=ko
+% ./tests d,info:-d,ret3:d,explain,set
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+ tests.c: main: explain: dbug explained: d,info,explain,set:-d,ret3:F
+ tests.c: func2: info: s=ko
+% ./tests d,info:-d,ret3:d,explain,set:t
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ko
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+ tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t
+ tests.c: | >func2
+ tests.c: | | >func3
+ tests.c: | | <func3
+ tests.c: | | info: s=ko
+ tests.c: | <func2
+ tests.c: <main
+% ./tests t d,info:-d,ret3:d,explain,set:t
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ko
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+ tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t
+ tests.c: | >func2
+ tests.c: | | >func3
+ tests.c: | | <func3
+ tests.c: | | info: s=ko
+ tests.c: | <func2
+ tests.c: <main
+% ./tests t d,info:-d,ret3:d,explain,set,pop
+func2: info: s=ko
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+% ./tests t:f,func2
+| | >func2
+| | <func2
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| <func2
+#
+## Testing SUBDIR rules
+#
+% ./tests t:-f,func2/:d
+>main
+| >func1
+| <func1
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+| explain: dbug explained: d:f:-f,func2/:t
+<main
+% ./tests t:f,func1/:d
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | | info: s=ok
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+% ./tests t:f,main/:d,pop
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | <func2
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+% ./tests f,main/:d,push
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+#
+## Testing FixTraceFlags() - when we need to traverse the call stack
+# (these tests fail with FixTraceFlags() disabled)
+#
+# delete the INCLUDE rule up the stack
+% ./tests t:f,func1/ --push1=t:f,func3/
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | <func2
+=> push1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| | >func3
+| | <func3
+# delete the EXCLUDE rule up the stack
+% ./tests t:-f,func1/ --push1=t
+>main
+=> push1
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+# add the INCLUDE rule up the stack
+% ./tests t:f,func3 --push1=t:f,main/
+| | | >func3
+| | | <func3
+=> push1
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+# add the EXCLUDE rule up the stack
+% ./tests t --push1=t:-f,main/
+>main
+| >func1
+| | >func2
+| | | >func3
+| | | <func3
+| | <func2
+=> push1
+=> evaluate: OFF
+=> evaluate_if: OFF
+# change the defaults
+% ./tests t:f,func3 --push1=t
+| | | >func3
+| | | <func3
+=> push1
+| <func1
+=> evaluate: OFF
+=> evaluate_if: OFF
+| >func2
+| | >func3
+| | <func3
+| <func2
+<main
+# repeated keyword
+% ./tests d:-d,info,info
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+main: explain: dbug explained: d:-d,info
+% ./tests d:-d,info/,info
+=> execute
+=> evaluate: ON
+=> evaluate_if: OFF
+main: explain: dbug explained: d:-d,info/
diff --git a/dbug/tests.c b/dbug/tests.c
new file mode 100644
index 00000000000..d76266d34a3
--- /dev/null
+++ b/dbug/tests.c
@@ -0,0 +1,87 @@
+/*
+ A program to test DBUG features. Used by tests-t.pl
+*/
+
+char *push1=0;
+
+#include <my_global.h> /* This includes dbug.h */
+#include <my_pthread.h>
+#include <string.h>
+
+const char *func3()
+{
+ DBUG_ENTER("func3");
+ DBUG_RETURN(DBUG_EVALUATE("ret3", "ok", "ko"));
+}
+
+void func2()
+{
+ const char *s;
+ DBUG_ENTER("func2");
+ s=func3();
+ DBUG_PRINT("info", ("s=%s", s));
+ DBUG_VOID_RETURN;
+}
+
+int func1()
+{
+ DBUG_ENTER("func1");
+ func2();
+ if (push1)
+ {
+ DBUG_PUSH(push1);
+ fprintf(DBUG_FILE, "=> push1\n");
+ }
+ DBUG_RETURN(10);
+}
+
+int main (int argc, char *argv[])
+{
+ int i;
+#ifdef DBUG_OFF
+ return 1;
+#endif
+ if (argc == 1)
+ return 0;
+
+#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
+ pthread_init(); /* Must be called before DBUG_ENTER */
+#endif
+#ifdef THREAD
+ my_thread_global_init();
+#endif
+ dup2(1, 2);
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp(argv[i], "--push1=", 8) == 0)
+ push1=argv[i]+8;
+ else
+ DBUG_PUSH (argv[i]);
+ }
+ {
+ DBUG_ENTER ("main");
+ DBUG_PROCESS ("dbug-tests");
+ func1();
+ DBUG_EXECUTE_IF("dump",
+ {
+ char s[1000];
+ DBUG_EXPLAIN(s, sizeof(s)-1);
+ DBUG_DUMP("dump", (uchar*)s, strlen(s));
+ });
+ DBUG_EXECUTE_IF("push", DBUG_PUSH("+t"); );
+ DBUG_EXECUTE("execute", fprintf(DBUG_FILE, "=> execute\n"); );
+ DBUG_EXECUTE_IF("set", DBUG_SET("+F"); );
+ fprintf(DBUG_FILE, "=> evaluate: %s\n",
+ DBUG_EVALUATE("evaluate", "ON", "OFF"));
+ fprintf(DBUG_FILE, "=> evaluate_if: %s\n",
+ DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
+ DBUG_EXECUTE_IF("pop", DBUG_POP(); );
+ {
+ char s[1000] __attribute__((unused));
+ DBUG_EXPLAIN(s, sizeof(s)-1);
+ DBUG_PRINT("explain", ("dbug explained: %s", s));
+ }
+ func2();
+ DBUG_RETURN (0);
+ }
+}
diff --git a/dbug/user.r b/dbug/user.r
index ef67ef7a7cf..847ad80b30f 100644
--- a/dbug/user.r
+++ b/dbug/user.r
@@ -512,7 +512,7 @@ possible since all code preceding the first call to
.B DBUG_PUSH
is
essentially invisible to
-.B dbug
+.I dbug
(this can be worked around by
inserting a temporary
.B DBUG_PUSH(argv[1])
@@ -708,7 +708,7 @@ EX:\ \fCDBUG_PROCESS\ (argv[0]);\fR
.SP 1
.LI DBUG_PUSH\
Sets a new debugger state by pushing the current
-.B dbug
+.I dbug
state onto an internal stack and setting up the new state using the
debug control string passed as the macro argument. The most common
usage is to set the state specified by a debug control string
@@ -769,14 +769,14 @@ the 'd' flag. Used to conditionally execute "dangerous" actions, e.g
to crash the program testing how recovery works, or to introduce an
artificial delay checking for race conditions.
.SP 1
-EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ abort\ ());\fR
+EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR
.SP 1
.LI DBUG_EVALUATE\
The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in
the expression context. The first argument is the debug keyword that is used to
choose whether the second (keyword is enabled) or the third (keyword is not
enabled) argument is evaluated. When
-.B dbug
+.I dbug
is compiled off, the third argument is evaluated.
.SP 1
EX:\fC
@@ -796,7 +796,7 @@ EX:\fC
.br
if (prepare_transaction () ||
.br
- DBUG_EVALUATE ("crashme", (abort (), 0), 0) ||
+ DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) ||
.br
commit_transaction () )\fR
.SP 1
@@ -875,6 +875,12 @@ library. So there will be no need to disable asserts separately with NDEBUG.
.SP 1
EX:\ \fCDBUG_ASSERT(\ a\ >\ 0\ );\fR
.SP 1
+.LI DBUG_ABORT\
+This macro could be used instead of abort(). It flushes DBUG_FILE stream
+to ensure that no
+.I dbug
+output is lost and then calls abort().
+.SP 1
.LI DBUG_EXPLAIN\
Generates control string corresponding to the current debug state.
The macro takes two arguments - a buffer to store the result string
@@ -910,17 +916,17 @@ via the
.B DBUG_PUSH
or
.B DBUG_SET
-macros. Control string consists of colon separate flags. Colons
+macros. Control string consists of colon separated flags. Colons
that are part of ':\\', ':/', or '::' are not considered flag
separators. A flag may take an argument or a list of arguments.
If a control string starts from a '+' sign it works
.I incrementally,
-that is, it can modify existing state without overriding it. In such a
-string every flag may be preceded by a '+' or '-' to enable or disable
-a corresponding option in the debugger state. This section summarizes
-the currently available debugger options and the flag characters which
-enable or disable them. Argument lists enclosed in '[' and ']' are
-optional.
+that is, it can modify existing state without overriding it. Every
+flag may be preceded by a '+' or '-' to enable or disable a
+corresponding option in the debugger state or to add or remove
+arguments to the list. This section summarizes the currently available
+debugger options and the flag characters which enable or disable them.
+Argument lists enclosed in '[' and ']' are optional.
.SP 2
.BL 22
.LI a[,file]
@@ -936,6 +942,9 @@ a complete log file in case of crashes. This mode is implicit in
multi-threaded environment.
.LI d[,keywords]
Enable output from macros with specified keywords.
+Every keyword can be a
+.I glob(7)
+pattern.
An empty list of keywords implies that all keywords are selected.
.LI D[,time]
Delay for specified time after each output line, to let output drain.
@@ -943,7 +952,19 @@ Time is given in tenths of a second (value of 10 is one second).
Default is zero.
.LI f[,functions]
Limit debugger actions to the specified list of functions.
+Every function can be a
+.I glob(7)
+pattern.
An empty list of functions implies that all functions are selected.
+Every function in the list may optionally be followed by a '/' -
+this will implicitly select all the functions down the call stack.
+.SP 1
+EX: \fCf,func1,func2/:-f,func3,func4/\fR
+.SP 1
+This would enable debugger in functions 'func1()', 'func2()' and all
+functions called from it (directly or indirectly). But not in
+functions 'func3()' or 'func4()' and all functions called from
+it.
.LI F
Mark each debugger output line with the name of the source file
containing the macro causing the output.
@@ -952,6 +973,9 @@ Mark each debugger output line with the PID (or thread ID) of the
current process.
.LI g,[functions]
Enable profiling for the specified list of functions.
+Every function can be a
+.I glob(7)
+pattern.
An empty list of functions enables profiling for all functions.
See
.B PROFILING\ WITH\ DBUG
@@ -970,7 +994,11 @@ Like 'a[,file]' but overwrite old file, do not append.
.LI O[,file]
Like 'A[,file]' but overwrite old file, do not append.
.LI p[,processes]
-Limit debugger actions to the specified processes. An empty list
+Limit debugger actions to the specified processes.
+Every name can be a
+.I glob(7)
+pattern.
+An empty list
implies all processes. This is useful for processes which run child
processes. Note that each debugger output line can be marked with the
name of the current process via the 'P' flag. The process name must
diff --git a/dbug/vargs.h b/dbug/vargs.h
deleted file mode 100644
index 4609c8301bb..00000000000
--- a/dbug/vargs.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/******************************************************************************
- * *
- * N O T I C E *
- * *
- * Copyright Abandoned, 1987, Fred Fish *
- * *
- * *
- * This previously copyrighted work has been placed into the public *
- * domain by the author and may be freely used for any purpose, *
- * private or commercial. *
- * *
- * Because of the number of inquiries I was receiving about the use *
- * of this product in commercially developed works I have decided to *
- * simply make it public domain to further its unrestricted use. I *
- * specifically would be most happy to see this material become a *
- * part of the standard Unix distributions by AT&T and the Berkeley *
- * Computer Science Research Group, and a standard part of the GNU *
- * system from the Free Software Foundation. *
- * *
- * I would appreciate it, as a courtesy, if this notice is left in *
- * all copies and derivative works. Thank you. *
- * *
- * The author makes no warranty of any kind with respect to this *
- * product and explicitly disclaims any implied warranties of mer- *
- * chantability or fitness for any particular purpose. *
- * *
- ******************************************************************************
- */
-
-
-/*
- * FILE
- *
- * vargs.h include file for environments without varargs.h
- *
- * SCCS
- *
- * @(#)vargs.h 1.2 5/8/88
- *
- * SYNOPSIS
- *
- * #include "vargs.h"
- *
- * DESCRIPTION
- *
- * This file implements a varargs macro set for use in those
- * environments where there is no system supplied varargs. This
- * generally works because systems which don't supply a varargs
- * package are precisely those which don't strictly need a varargs
- * package. Using this one then allows us to minimize source
- * code changes. So in some sense, this is a "portable" varargs
- * since it is only used for convenience, when it is not strictly
- * needed.
- *
- */
-
-/*
- * These macros allow us to rebuild an argument list on the stack
- * given only a va_list. We can use these to fake a function like
- * vfprintf, which gets a fixed number of arguments, the last of
- * which is a va_list, by rebuilding a stack and calling the variable
- * argument form fprintf. Of course this only works when vfprintf
- * is not available in the host environment, and thus is not available
- * for fprintf to call (which would give us an infinite loop).
- *
- * Note that ARGS_TYPE is a long, which lets us get several bytes
- * at a time while also preventing lots of "possible pointer alignment
- * problem" messages from lint. The messages are valid, because this
- * IS nonportable, but then we should only be using it in very
- * nonrestrictive environments, and using the real varargs where it
- * really counts.
- *
- */
-
-#define ARG0 a0
-#define ARG1 a1
-#define ARG2 a2
-#define ARG3 a3
-#define ARG4 a4
-#define ARG5 a5
-#define ARG6 a6
-#define ARG7 a7
-#define ARG8 a8
-#define ARG9 a9
-
-#define ARGS_TYPE long
-#define ARGS_LIST ARG0,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8,ARG9
-#define ARGS_DCL auto ARGS_TYPE ARGS_LIST
-
-/*
- * A pointer of type "va_list" points to a section of memory
- * containing an array of variable sized arguments of unknown
- * number. This pointer is initialized by the va_start
- * macro to point to the first byte of the first argument.
- * We can then use it to walk through the argument list by
- * incrementing it by the size of the argument being referenced.
- */
-
-typedef char *va_list;
-
-/*
- * The first variable argument overlays va_alist, which is
- * nothing more than a "handle" which allows us to get the
- * address of the first argument on the stack. Note that
- * by definition, the va_dcl macro includes the terminating
- * semicolon, which makes use of va_dcl in the source code
- * appear to be missing a semicolon.
- */
-
-#define va_dcl ARGS_TYPE va_alist;
-
-/*
- * The va_start macro takes a variable of type "va_list" and
- * initializes it. In our case, it initializes a local variable
- * of type "pointer to char" to point to the first argument on
- * the stack.
- */
-
-#define va_start(list) list = (char *) &va_alist
-
-/*
- * The va_end macro is a null operation for our use.
- */
-
-#define va_end(list)
-
-/*
- * The va_arg macro is the tricky one. This one takes
- * a va_list as the first argument, and a type as the second
- * argument, and returns a value of the appropriate type
- * while advancing the va_list to the following argument.
- * For our case, we first increment the va_list arg by the
- * size of the type being recovered, cast the result to
- * a pointer of the appropriate type, and then dereference
- * that pointer as an array to get the previous arg (which
- * is the one we wanted.
- */
-
-#define va_arg(list,type) ((type *) (list += sizeof (type)))[-1]
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index cec0db6a4ae..b67fdfa601f 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -14,13 +14,11 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_EXECUTABLE(comp_err comp_err.c)
-TARGET_LINK_LIBRARIES(comp_err debug dbug mysys strings zlib wsock32)
+TARGET_LINK_LIBRARIES(comp_err dbug mysys strings zlib)
GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
@@ -31,24 +29,24 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
--header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h
--name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
--state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h
- --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt
- DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt)
+ --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
+ DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt)
ADD_CUSTOM_TARGET(GenError
ALL
DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_error.h)
ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
-TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock32)
+TARGET_LINK_LIBRARIES(my_print_defaults strings mysys dbug taocrypt)
ADD_EXECUTABLE(perror perror.c)
-TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
+TARGET_LINK_LIBRARIES(perror strings mysys dbug)
ADD_EXECUTABLE(resolveip resolveip.c)
-TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)
+TARGET_LINK_LIBRARIES(resolveip strings mysys dbug)
ADD_EXECUTABLE(replace replace.c)
-TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
+TARGET_LINK_LIBRARIES(replace strings mysys dbug)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 75422c4ee11..1552a5836ed 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -30,7 +30,7 @@ DIST_SUBDIRS = yassl
# NOTE Built files should depend on their sources to avoid
# the built files being rebuilt in source dist
$(top_builddir)/include/mysqld_error.h: comp_err.c \
- $(top_srcdir)/sql/share/errmsg.txt
+ $(top_srcdir)/sql/share/errmsg-utf8.txt
$(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT)
$(top_builddir)/extra/comp_err$(EXEEXT) \
--charset=$(top_srcdir)/sql/share/charsets \
@@ -38,7 +38,7 @@ $(top_builddir)/include/mysqld_error.h: comp_err.c \
--header_file=$(top_builddir)/include/mysqld_error.h \
--name_file=$(top_builddir)/include/mysqld_ername.h \
--state_file=$(top_builddir)/include/sql_state.h \
- --in_file=$(top_srcdir)/sql/share/errmsg.txt
+ --in_file=$(top_srcdir)/sql/share/errmsg-utf8.txt
$(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 9326444ade9..69665cbe452 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -39,7 +39,7 @@ static char *OUTFILE= (char*) "errmsg.sys";
static char *HEADERFILE= (char*) "mysqld_error.h";
static char *NAMEFILE= (char*) "mysqld_ername.h";
static char *STATEFILE= (char*) "sql_state.h";
-static char *TXTFILE= (char*) "../sql/share/errmsg.txt";
+static char *TXTFILE= (char*) "../sql/share/errmsg-utf8.txt";
static char *DATADIRECTORY= (char*) "../sql/share/";
#ifndef DBUG_OFF
static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index 06f7e51c380..42a5cbd6877 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -192,7 +192,8 @@ int main(int argc, char **argv)
}
for (argument= arguments+1 ; *argument ; argument++)
- puts(*argument);
+ if (*argument != args_separator) /* skip arguments separator */
+ puts(*argument);
my_free((char*) load_default_groups,MYF(0));
free_defaults(arguments);
diff --git a/include/Makefile.am b/include/Makefile.am
index dd6f53f7ca2..0a7a35bd6fa 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -21,7 +21,8 @@ HEADERS_GEN_MAKE = my_config.h
HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
my_list.h my_alloc.h typelib.h mysql/plugin.h
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
- my_xml.h mysql_embed.h \
+ my_xml.h mysql_embed.h mysql/services.h \
+ mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
my_pthread.h my_no_pthread.h \
decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
@@ -36,7 +37,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
- my_handler.h my_time.h \
+ my_handler.h my_time.h service_versions.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
atomic/solaris.h \
diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h
index 509701b30a5..01ebc38707e 100644
--- a/include/atomic/gcc_builtins.h
+++ b/include/atomic/gcc_builtins.h
@@ -1,3 +1,6 @@
+#ifndef ATOMIC_GCC_BUILTINS_INCLUDED
+#define ATOMIC_GCC_BUILTINS_INCLUDED
+
/* Copyright (C) 2008 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -31,3 +34,5 @@
#define make_atomic_store_body(S) \
(void) __sync_lock_test_and_set(a, v);
#endif
+
+#endif /* ATOMIC_GCC_BUILTINS_INCLUDED */
diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h
index 0e6c8089b84..d7d87167ade 100644
--- a/include/atomic/nolock.h
+++ b/include/atomic/nolock.h
@@ -1,3 +1,6 @@
+#ifndef ATOMIC_NOLOCK_INCLUDED
+#define ATOMIC_NOLOCK_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -59,3 +62,4 @@ typedef struct { } my_atomic_rwlock_t;
#endif
+#endif /* ATOMIC_NOLOCK_INCLUDED */
diff --git a/include/atomic/rwlock.h b/include/atomic/rwlock.h
index 18b77e93d80..0ff4d16c545 100644
--- a/include/atomic/rwlock.h
+++ b/include/atomic/rwlock.h
@@ -1,3 +1,6 @@
+#ifndef ATOMIC_RWLOCK_INCLUDED
+#define ATOMIC_RWLOCK_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -46,3 +49,4 @@ typedef struct {pthread_rwlock_t rw;} my_atomic_rwlock_t;
#define make_atomic_load_body(S) ret= *a;
#define make_atomic_store_body(S) *a= v;
+#endif /* ATOMIC_RWLOCK_INCLUDED */
diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h
index 726c98213fb..c3029f9c1b4 100644
--- a/include/atomic/x86-gcc.h
+++ b/include/atomic/x86-gcc.h
@@ -1,3 +1,6 @@
+#ifndef ATOMIC_X86_GCC_INCLUDED
+#define ATOMIC_X86_GCC_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -56,3 +59,4 @@
asm volatile ("; xchg %0, %1;" : "+m" (*a) : "r" (v))
#endif
+#endif /* ATOMIC_X86_GCC_INCLUDED */
diff --git a/include/config-win.h b/include/config-win.h
index af4915440b1..364c4f92134 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -1,3 +1,6 @@
+#ifndef CONFIG_WIN_INCLUDED
+#define CONFIG_WIN_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -27,6 +30,9 @@
#include <fcntl.h>
#include <io.h>
#include <malloc.h>
+#include <sys/stat.h>
+#include <process.h> /* getpid()*/
+
#define HAVE_SMEM 1
@@ -65,7 +71,6 @@
#endif
/* File and lock constants */
-#define O_SHARE 0x1000 /* Open file in sharing mode */
#ifdef __BORLANDC__
#define F_RDLCK LK_NBLCK /* read lock */
#define F_WRLCK LK_NBRLCK /* write lock */
@@ -175,7 +180,7 @@ typedef uint rf_SetTimer;
#define SIZEOF_CHARP 4
#endif
#define HAVE_BROKEN_NETINET_INCLUDES
-#ifdef __NT__
+#ifdef _WIN32
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
#endif
@@ -288,11 +293,6 @@ inline ulonglong double2ulonglong(double d)
#define strcasecmp stricmp
#define strncasecmp strnicmp
-#ifndef __NT__
-#undef FILE_SHARE_DELETE
-#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */
-#endif
-
#ifdef NOT_USED
#define HAVE_SNPRINTF /* Gave link error */
#define _snprintf snprintf
@@ -336,13 +336,13 @@ inline ulonglong double2ulonglong(double d)
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
-#define OS_FILE_LIMIT 2048
+#define OS_FILE_LIMIT UINT_MAX /* No limit*/
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
/* The following is only used for statistics, so it should be good enough */
-#ifdef __NT__ /* This should also work on Win98 but .. */
+#ifdef _WIN32
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
#endif
@@ -356,7 +356,6 @@ inline ulonglong double2ulonglong(double d)
#define HAVE_OPENSSL 1
#define HAVE_YASSL 1
-#define COMMUNITY_SERVER 1
#define ENABLED_PROFILING 1
/*
@@ -410,3 +409,5 @@ inline ulonglong double2ulonglong(double d)
#define HAVE_UCA_COLLATIONS 1
#define HAVE_BOOL 1
+
+#endif /* CONFIG_WIN_INCLUDED */
diff --git a/include/errmsg.h b/include/errmsg.h
index a6d8c770de8..c55c94af169 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -1,3 +1,6 @@
+#ifndef ERRMSG_INCLUDED
+#define ERRMSG_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -97,6 +100,8 @@ extern const char *client_errors[]; /* Error messages */
#define CR_SERVER_LOST_EXTENDED 2055
#define CR_STMT_CLOSED 2056
#define CR_NEW_STMT_METADATA 2057
-#define CR_ERROR_LAST /*Copy last error nr:*/ 2057
+#define CR_ALREADY_CONNECTED 2058
+#define CR_ERROR_LAST /*Copy last error nr:*/ 2058
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
+#endif /* ERRMSG_INCLUDED */
diff --git a/include/hash.h b/include/hash.h
index 629b404e8a7..d870e17c341 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -22,40 +22,6 @@ extern "C" {
#endif
/*
- There was a problem on MacOSX with a shared object ha_example.so.
- It used hash_search(). During build of ha_example.so no libmysys
- was specified. Since MacOSX had a hash_search() in the system
- library, it built the shared object so that the dynamic linker
- linked hash_search() to the system library, which caused a crash
- when called. To come around this, we renamed hash_search() to
- my_hash_search(), as we did long ago with hash_insert() and
- hash_reset(). However, this time we made the move complete with
- all names. To keep compatibility, we redefine the old names.
- Since every C and C++ file, that uses HASH, needs to include
- this file, the change is complete. Both names could be used
- in the code, but the my_* versions are recommended now.
-*/
-#define hash_get_key my_hash_get_key
-#define hash_free_key my_hash_free_key
-#define hash_init my_hash_init
-#define hash_init2 my_hash_init2
-#define _hash_init _my_hash_init
-#define hash_free my_hash_free
-#define hash_reset my_hash_reset
-#define hash_element my_hash_element
-#define hash_search my_hash_search
-#define hash_first my_hash_first
-#define hash_next my_hash_next
-#define hash_insert my_hash_insert
-#define hash_delete my_hash_delete
-#define hash_update my_hash_update
-#define hash_replace my_hash_replace
-#define hash_check my_hash_check
-#define hash_clear my_hash_clear
-#define hash_inited my_hash_inited
-#define hash_init_opt my_hash_init_opt
-
-/*
Overhead to store an element in hash
Can be used to approximate memory consumption for a hash
*/
diff --git a/include/help_end.h b/include/help_end.h
index 4426cb80bce..92953efe35a 100644
--- a/include/help_end.h
+++ b/include/help_end.h
@@ -1,3 +1,6 @@
+#ifndef HELP_END_INCLUDED
+#define HELP_END_INCLUDED
+
/* Copyright (C) 2004-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -20,3 +23,4 @@
#undef fputc
#undef putchar
#endif
+#endif /* HELP_END_INCLUDED */
diff --git a/include/help_start.h b/include/help_start.h
index 3ae20eea7d7..414f7ec93a0 100644
--- a/include/help_start.h
+++ b/include/help_start.h
@@ -1,3 +1,6 @@
+#ifndef HELP_START_INCLUDED
+#define HELP_START_INCLUDED
+
/* Copyright (C) 2004-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -22,3 +25,4 @@
#define fputc(s,f) consoleprintf("%c", s)
#define putchar(s) consoleprintf("%c", s)
#endif
+#endif /* HELP_START_INCLUDED */
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 451c8db549b..700f373d677 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -87,6 +87,7 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
+#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
#define MY_CHARSET_UNDEFINED 0
/* Character repertoire flags */
@@ -474,6 +475,10 @@ my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
uint my_charset_repertoire(CHARSET_INFO *cs);
+my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
+
+extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
+ const char* fmt, va_list ap);
#define _MY_U 01 /* Upper case */
#define _MY_L 02 /* Lower case */
diff --git a/include/m_string.h b/include/m_string.h
index c24bfd7aa6c..3c4c6ea088a 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -250,16 +250,10 @@ extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
/*
LEX_STRING -- a pair of a C-string and its length.
+ (it's part of the plugin API as a MYSQL_LEX_STRING)
*/
-#ifndef _my_plugin_h
-/* This definition must match the one given in mysql/plugin.h */
-struct st_mysql_lex_string
-{
- char *str;
- size_t length;
-};
-#endif
+#include <mysql/plugin.h>
typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
diff --git a/include/my_aes.h b/include/my_aes.h
index 1bbdf5663ea..2e2a66b4968 100644
--- a/include/my_aes.h
+++ b/include/my_aes.h
@@ -1,3 +1,6 @@
+#ifndef MY_AES_INCLUDED
+#define MY_AES_INCLUDED
+
/* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -63,3 +66,5 @@ int my_aes_decrypt(const char *source, int source_length, char *dest,
int my_aes_get_size(int source_length);
C_MODE_END
+
+#endif /* MY_AES_INCLUDED */
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 03f7d081981..f5da6e6a0d9 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -1,3 +1,6 @@
+#ifndef MY_ATOMIC_INCLUDED
+#define MY_ATOMIC_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -150,3 +153,4 @@ extern int my_atomic_initialize();
#endif
+#endif /* MY_ATOMIC_INCLUDED */
diff --git a/include/my_base.h b/include/my_base.h
index a01b2ec9b82..70bd9b5e073 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -255,7 +255,17 @@ enum ha_base_keytype {
HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \
HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)
-#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */
+/*
+ Key contains partial segments.
+
+ This flag is internal to the MySQL server by design. It is not supposed
+ neither to be saved in FRM-files, nor to be passed to storage engines.
+ It is intended to pass information into internal static sort_keys(KEY *,
+ KEY *) function.
+
+ This flag can be calculated -- it's based on key lengths comparison.
+*/
+#define HA_KEY_HAS_PART_KEY_SEG 65536
/* Automatic bits in key-flag */
diff --git a/include/my_bit.h b/include/my_bit.h
index 2e464e89049..5cbf4f8b83e 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -1,3 +1,6 @@
+#ifndef MY_BIT_INCLUDED
+#define MY_BIT_INCLUDED
+
/*
Some useful bit functions
*/
@@ -107,3 +110,5 @@ extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
#endif /* HAVE_INLINE */
C_MODE_END
+
+#endif /* MY_BIT_INCLUDED */
diff --git a/include/my_dbug.h b/include/my_dbug.h
index 0ba72b2210d..956a5504e86 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -16,101 +16,64 @@
#ifndef _dbug_h
#define _dbug_h
-#if defined(__cplusplus) && !defined(DBUG_OFF)
-class Dbug_violation_helper
-{
-public:
- inline Dbug_violation_helper() :
- _entered(TRUE)
- { }
-
- inline ~Dbug_violation_helper()
- {
- assert(!_entered);
- }
-
- inline void leave()
- {
- _entered= FALSE;
- }
-
-private:
- bool _entered;
-};
-#endif /* C++ */
-
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)
-struct _db_code_state_;
-extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
-extern int _db_strict_keyword_(const char *keyword);
+
+struct _db_stack_frame_ {
+ const char *func; /* function name of the previous stack frame */
+ const char *file; /* filename of the function of previous frame */
+ uint level; /* this nesting level, highest bit enables tracing */
+ struct _db_stack_frame_ *prev; /* pointer to the previous frame */
+};
+
+struct _db_code_state_;
+extern my_bool _dbug_on_;
+extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
-extern void _db_setjmp_(void);
-extern void _db_longjmp_(void);
+extern int _db_is_pushed_(void);
+extern void _db_setjmp_(void);
+extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
-extern void _db_push_(const char *control);
-extern void _db_pop_(void);
-extern void _db_set_(struct _db_code_state_ *cs, const char *control);
+extern void _db_push_(const char *control);
+extern void _db_pop_(void);
+extern void _db_set_(const char *control);
extern void _db_set_init_(const char *control);
-extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
- const char **_sfunc_,const char **_sfile_,
- uint *_slevel_, char ***);
-extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
- uint *_slevel_);
-extern void _db_pargs_(uint _line_,const char *keyword);
-extern void _db_doprnt_ _VARARGS((const char *format,...))
+extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
+ struct _db_stack_frame_ *_stack_frame_);
+extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
+extern void _db_pargs_(uint _line_,const char *keyword);
+extern void _db_doprnt_ _VARARGS((const char *format,...))
ATTRIBUTE_FORMAT(printf, 1, 2);
-extern void _db_dump_(uint _line_,const char *keyword,
+extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length);
-extern void _db_end_(void);
-extern void _db_lock_file_(void);
-extern void _db_unlock_file_(void);
-extern FILE *_db_fp_(void);
-
-#ifdef __cplusplus
-
-#define DBUG_ENTER(a) \
- const char *_db_func_, *_db_file_; \
- uint _db_level_; \
- char **_db_framep_; \
- Dbug_violation_helper dbug_violation_helper; \
- _db_enter_ (a, __FILE__, __LINE__, &_db_func_, &_db_file_, \
- &_db_level_, &_db_framep_)
-#define DBUG_VIOLATION_HELPER_LEAVE dbug_violation_helper.leave()
-
-#else /* C */
-
-#define DBUG_ENTER(a) \
- const char *_db_func_, *_db_file_; \
- uint _db_level_; \
- char **_db_framep_; \
- _db_enter_ (a, __FILE__, __LINE__, &_db_func_, &_db_file_, \
- &_db_level_, &_db_framep_)
-#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
-
-#endif /* C++ */
-
-#define DBUG_LEAVE \
- DBUG_VIOLATION_HELPER_LEAVE; \
- _db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)
+extern void _db_end_(void);
+extern void _db_lock_file_(void);
+extern void _db_unlock_file_(void);
+extern FILE *_db_fp_(void);
+extern void _db_flush_();
+extern const char* _db_get_func_(void);
+
+#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
+ _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
+#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_)
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#define DBUG_EXECUTE(keyword,a1) \
- do {if (_db_keyword_(0, (keyword))) { a1 }} while(0)
+ do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
#define DBUG_EXECUTE_IF(keyword,a1) \
- do {if (_db_strict_keyword_ (keyword)) { a1 } } while(0)
+ do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
#define DBUG_EVALUATE(keyword,a1,a2) \
- (_db_keyword_(0,(keyword)) ? (a1) : (a2))
+ (_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
- (_db_strict_keyword_((keyword)) ? (a1) : (a2))
+ (_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
#define DBUG_PRINT(keyword,arglist) \
do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0)
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
-#define DBUG_SET(a1) _db_set_ (0, (a1))
+#define DBUG_SET(a1) _db_set_ (a1)
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
#define DBUG_PROCESS(a1) _db_process_(a1)
#define DBUG_FILE _db_fp_()
@@ -123,37 +86,66 @@ extern FILE *_db_fp_(void);
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
-#define IF_DBUG(A) A
-#else /* No debugger */
+#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
+#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
+#ifndef __WIN__
+#define DBUG_ABORT() (_db_flush_(), abort())
+#else
+/*
+ Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
+ call abort() instead of _exit(3) (now it would cause a "test signal" popup).
+*/
+#include <crtdbg.h>
+#define DBUG_ABORT() (_db_flush_(),\
+ (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
+ (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
+ _exit(3))
+#endif
+#define DBUG_CHECK_CRASH(func, op) \
+ do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
+ DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
+#define DBUG_CRASH_ENTER(func) \
+ DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
+#define DBUG_CRASH_RETURN(val) \
+ DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
+#define DBUG_CRASH_VOID_RETURN \
+ DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
+
+#else /* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_LEAVE
-#define DBUG_VIOLATION_HELPER_LEAVE
-#define DBUG_RETURN(a1) do { return(a1); } while(0)
-#define DBUG_VOID_RETURN do { return; } while(0)
-#define DBUG_EXECUTE(keyword,a1) do { } while(0)
-#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
+#define DBUG_RETURN(a1) do { return(a1); } while(0)
+#define DBUG_VOID_RETURN do { return; } while(0)
+#define DBUG_EXECUTE(keyword,a1) do { } while(0)
+#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
-#define DBUG_PRINT(keyword,arglist) do { } while(0)
-#define DBUG_PUSH(a1)
-#define DBUG_SET(a1) do { } while(0)
-#define DBUG_SET_INITIAL(a1) do { } while(0)
-#define DBUG_POP()
-#define DBUG_PROCESS(a1)
+#define DBUG_PRINT(keyword,arglist) do { } while(0)
+#define DBUG_PUSH(a1) do { } while(0)
+#define DBUG_SET(a1) do { } while(0)
+#define DBUG_SET_INITIAL(a1) do { } while(0)
+#define DBUG_POP() do { } while(0)
+#define DBUG_PROCESS(a1) do { } while(0)
#define DBUG_SETJMP(a1) setjmp(a1)
#define DBUG_LONGJMP(a1) longjmp(a1)
-#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
-#define DBUG_END()
-#define DBUG_ASSERT(A) do { } while(0)
-#define DBUG_LOCK_FILE
+#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
+#define DBUG_END() do { } while(0)
+#define DBUG_ASSERT(A) do { } while(0)
+#define DBUG_LOCK_FILE do { } while(0)
#define DBUG_FILE (stderr)
-#define DBUG_UNLOCK_FILE
+#define DBUG_UNLOCK_FILE do { } while(0)
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)
-#define IF_DBUG(A)
+#define DEBUGGER_OFF do { } while(0)
+#define DEBUGGER_ON do { } while(0)
+#define DBUG_ABORT() abort()
+#define DBUG_CRASH_ENTER(func)
+#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
+#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
+
#endif
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
#endif
diff --git a/include/my_dir.h b/include/my_dir.h
index 06509a3af19..90d708ac811 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -69,7 +69,11 @@ typedef struct my_stat
#else
+#if(_MSC_VER)
+#define MY_STAT struct _stati64 /* 64 bit file size */
+#else
#define MY_STAT struct stat /* Orginal struct have what we need */
+#endif
#endif /* USE_MY_STAT_STRUCT */
diff --git a/include/my_global.h b/include/my_global.h
index 0f312f13bf0..f6d1592fc6f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -410,6 +410,7 @@ C_MODE_END
#ifndef stdin
#include <stdio.h>
#endif
+#include <stdarg.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -648,8 +649,6 @@ C_MODE_END
# endif
#endif
-#include <my_dbug.h>
-
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
#define ASCII_BITS_USED 8 /* Bit char used */
#define NEAR_F /* No near function handling */
@@ -749,7 +748,41 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '/'
#define FN_ROOTDIR "/"
#endif
-#define MY_NFILE 64 /* This is only used to save filenames */
+
+/*
+ MY_FILE_MIN is Windows speciality and is used to quickly detect
+ the mismatch of CRT and mysys file IO usage on Windows at runtime.
+ CRT file descriptors can be in the range 0-2047, whereas descriptors returned
+ by my_open() will start with 2048. If a file descriptor with value less then
+ MY_FILE_MIN is passed to mysys IO function, chances are it stemms from
+ open()/fileno() and not my_open()/my_fileno.
+
+ For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN
+ is logically 0.
+*/
+
+#ifdef _WIN32
+#define MY_FILE_MIN 2048
+#else
+#define MY_FILE_MIN 0
+#endif
+
+/*
+ MY_NFILE is the default size of my_file_info array.
+
+ It is larger on Windows, because it all file handles are stored in my_file_info
+ Default size is 16384 and this should be enough for most cases.If it is not
+ enough, --max-open-files with larger value can be used.
+
+ For Posix , my_file_info array is only used to store filenames for
+ error reporting and its size is not a limitation for number of open files.
+*/
+#ifdef _WIN32
+#define MY_NFILE (16384 + MY_FILE_MIN)
+#else
+#define MY_NFILE 64
+#endif
+
#ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT 65535
#endif
@@ -786,9 +819,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some things that this system doesn't have */
#define NO_HASH /* Not needed anymore */
-#ifdef __WIN__
-#define NO_DIR_LIBRARY /* Not standar dir-library */
-#define USE_MY_STAT_STRUCT /* For my_lib */
+#ifdef _WIN32
+#define NO_DIR_LIBRARY /* Not standard dir-library */
#endif
/* Some defines of functions for portability */
@@ -1143,6 +1175,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define reg16 register
#endif
+#include <my_dbug.h>
+
/*
Sometimes we want to make sure that the variable is not put into
a register in debugging mode so we can see its value in the core
diff --git a/include/my_handler.h b/include/my_handler.h
index a3376cb74a2..ae56331df86 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -53,8 +53,8 @@ typedef struct st_HA_KEYSEG /* Key-portion */
uint16 bit_pos; /* Position to bit part */
uint16 flag;
uint16 length; /* Keylength */
+ uint16 language;
uint8 type; /* Type of key (for sort) */
- uint8 language;
uint8 null_bit; /* bitmask to test for NULL */
uint8 bit_start,bit_end; /* if bit field */
uint8 bit_length; /* Length of bit part */
diff --git a/include/my_libwrap.h b/include/my_libwrap.h
index 9a8579475fb..8235c00d8f3 100644
--- a/include/my_libwrap.h
+++ b/include/my_libwrap.h
@@ -1,3 +1,6 @@
+#ifndef MY_LIBWRAP_INCLUDED
+#define MY_LIBWRAP_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -25,3 +28,4 @@ extern int my_hosts_access(struct request_info *req);
extern char *my_eval_client(struct request_info *req);
#endif /* HAVE_LIBWRAP */
+#endif /* MY_LIBWRAP_INCLUDED */
diff --git a/include/my_md5.h b/include/my_md5.h
index 6458f27c5cc..782bef8a27a 100644
--- a/include/my_md5.h
+++ b/include/my_md5.h
@@ -1,3 +1,6 @@
+#ifndef MY_MD5_INCLUDED
+#define MY_MD5_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -52,3 +55,5 @@ do { \
my_MD5Update (&ctx, buf, len); \
my_MD5Final (digest, &ctx); \
} while (0)
+
+#endif /* MY_MD__INCLUDED */
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
index b11dbff42f0..31c1bf2b6ac 100644
--- a/include/my_no_pthread.h
+++ b/include/my_no_pthread.h
@@ -1,3 +1,6 @@
+#ifndef MY_NO_PTHREAD_INCLUDED
+#define MY_NO_PTHREAD_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -14,9 +17,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if !defined(_my_no_pthread_h) && !defined(THREAD)
-#define _my_no_pthread_h
-
+#ifndef THREAD
/*
This block is to access some thread-related type definitions
@@ -48,3 +49,4 @@
#define rwlock_destroy(A)
#endif
+#endif /* MY_NO_PTHREAD_INCLUDED */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 9e2c2111b8e..b6d9feae067 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -31,7 +31,7 @@ extern "C" {
#if defined(__WIN__)
typedef CRITICAL_SECTION pthread_mutex_t;
-typedef HANDLE pthread_t;
+typedef DWORD pthread_t;
typedef struct thread_attr {
DWORD dwStackSize ;
DWORD dwCreatingFlag ;
@@ -64,8 +64,7 @@ typedef struct {
typedef int pthread_mutexattr_t;
-#define win_pthread_self my_thread_var->pthread_self
-#define pthread_self() win_pthread_self
+#define pthread_self() GetCurrentThreadId()
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
@@ -99,8 +98,7 @@ struct timespec {
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
-void win_pthread_init(void);
-int win_pthread_setspecific(void *A,void *B,uint length);
+
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
@@ -117,42 +115,25 @@ int pthread_attr_destroy(pthread_attr_t *connect_att);
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
+void pthread_exit(void *a);
+int pthread_join(pthread_t thread, void **value_ptr);
-void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define ETIMEDOUT 145 /* Win32 doesn't have this */
-#define getpid() GetCurrentThreadId()
#define HAVE_LOCALTIME_R 1
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
-/*
- Windows has two ways to use thread local storage. The most efficient
- is using __declspec(thread), but that does not work properly when
- used in a .dll that is loaded at runtime, after program load. So for
- libmysql.dll and libmysqld.dll we define USE_TLS in order to use the
- TlsXxx() API instead, which works in all cases.
-*/
-#ifdef USE_TLS /* For LIBMYSQL.DLL */
+
#undef SAFE_MUTEX /* This will cause conflicts */
#define pthread_key(T,V) DWORD V
#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF)
#define pthread_key_delete(A) TlsFree(A)
+#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V)))
+#define pthread_setspecific(A,B) (!TlsSetValue((A),(B)))
#define pthread_getspecific(A) (TlsGetValue(A))
#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A))
#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V))
-#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V)))
-#define pthread_setspecific(A,B) (!TlsSetValue((A),(B)))
-#else
-#define pthread_key(T,V) __declspec(thread) T V
-#define pthread_key_create(A,B) pthread_dummy(0)
-#define pthread_key_delete(A) pthread_dummy(0)
-#define pthread_getspecific(A) (&(A))
-#define my_pthread_getspecific(T,A) (&(A))
-#define my_pthread_getspecific_ptr(T,V) (V)
-#define my_pthread_setspecific_ptr(T,V) ((T)=(V),0)
-#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
-#endif /* USE_TLS */
#define pthread_equal(A,B) ((A) == (B))
#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0)
@@ -163,7 +144,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
-#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
/* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
@@ -690,6 +670,7 @@ struct st_my_thread_var
};
extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
+extern void **my_thread_var_dbug();
extern uint my_thread_end_wait_time;
#define my_thread_var (_my_thread_var())
#define my_errno my_thread_var->thr_errno
diff --git a/include/my_sys.h b/include/my_sys.h
index b4aac3a17bd..9121f0f249e 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -39,6 +39,17 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
+/**
+ Max length of an error message generated by mysys utilities.
+ Some mysys functions produce error messages. These mostly go
+ to stderr.
+ This constant defines the size of the buffer used to format
+ the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
+ since sometimes mysys errors are stored in the server diagnostics
+ area, and we would like to avoid unexpected truncation.
+*/
+#define MYSYS_ERRMSG_SIZE (512)
+
#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
@@ -90,8 +101,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
#define ME_FATALERROR 1024 /* Fatal statement error */
-#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */
-#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
@@ -220,8 +229,8 @@ extern int errno; /* declare errno */
extern char *home_dir; /* Home directory for user */
extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */
-extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
-extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
+extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
+extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
extern uint my_file_limit;
extern ulong my_thread_stack_size;
@@ -232,8 +241,9 @@ extern uint my_large_page_size;
#endif
/* charsets */
+#define MY_ALL_CHARSETS_SIZE 2048
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256];
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
extern CHARSET_INFO compiled_charsets[];
/* statistics */
@@ -321,9 +331,13 @@ enum file_type
struct st_my_file_info
{
- char * name;
- enum file_type type;
-#if defined(THREAD) && !defined(HAVE_PREAD)
+ char *name;
+#ifdef _WIN32
+ HANDLE fhandle; /* win32 file handle */
+ int oflag; /* open flags, e.g O_APPEND */
+#endif
+ enum file_type type;
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
pthread_mutex_t mutex;
#endif
};
@@ -628,43 +642,55 @@ extern void *my_memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
-#ifdef __WIN__
-extern int my_access(const char *path, int amode);
-extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
+#ifdef _WIN32
+extern int my_access(const char *path, int amode);
#else
#define my_access access
#endif
+
extern int check_if_legal_filename(const char *path);
extern int check_if_legal_tablename(const char *path);
-#if defined(__WIN__) && defined(__NT__)
+#ifdef _WIN32
extern int nt_share_delete(const char *name,myf MyFlags);
#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags))
#else
#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags))
#endif
+#ifdef _WIN32
+/* Windows-only functions (CRT equivalents)*/
+extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
+extern HANDLE my_get_osfhandle(File fd);
+extern void my_osmaperr(unsigned long last_error);
+#endif
+
#ifndef TERMINATE
extern void TERMINATE(FILE *file, uint flag);
#endif
extern void init_glob_errs(void);
+extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags);
+extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
-extern int my_error _VARARGS((int nr,myf MyFlags, ...));
-extern int my_printf_error _VARARGS((uint my_err, const char *format,
- myf MyFlags, ...))
- ATTRIBUTE_FORMAT(printf, 2, 4);
-extern int my_error_register(const char **errmsgs, int first, int last);
+extern void my_error _VARARGS((int nr,myf MyFlags, ...));
+extern void my_printf_error _VARARGS((uint my_err, const char *format,
+ myf MyFlags, ...))
+ ATTRIBUTE_FORMAT(printf, 2, 4);
+extern void my_printv_error(uint error, const char *format, myf MyFlags,
+ va_list ap);
+extern int my_error_register(const char** (*get_errmsgs) (),
+ int first, int last);
extern const char **my_error_unregister(int first, int last);
-extern int my_message(uint my_err, const char *str,myf MyFlags);
-extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
-extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
+extern void my_message(uint my_err, const char *str,myf MyFlags);
+extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
+extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);
@@ -853,6 +879,7 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
char **group_suffix);
+extern const char *args_separator;
extern int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,
diff --git a/include/my_uctype.h b/include/my_uctype.h
index 9aaf478810c..580eb646e11 100644
--- a/include/my_uctype.h
+++ b/include/my_uctype.h
@@ -1,3 +1,6 @@
+#ifndef MY_UCTYPE_INCLUDED
+#define MY_UCTYPE_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -1477,3 +1480,4 @@ MY_UNI_CTYPE my_uni_ctype[256]={
};
+#endif /* MY_UCTYPE_INCLUDED */
diff --git a/include/myisam.h b/include/myisam.h
index 19b35538c65..2df7ccf6dfa 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -162,7 +162,7 @@ typedef struct st_mi_create_info
ulonglong data_file_length;
ulonglong key_file_length;
uint old_options;
- uint8 language;
+ uint16 language;
my_bool with_auto_increment;
} MI_CREATE_INFO;
@@ -410,7 +410,7 @@ typedef struct st_mi_check_param
uint out_flag,warning_printed,error_printed,verbose;
uint opt_sort_key,total_files,max_level;
uint testflag, key_cache_block_size;
- uint8 language;
+ uint16 language;
my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
my_bool retry_repair, force_sort;
char temp_filename[FN_REFLEN],*isam_file_name;
diff --git a/include/myisampack.h b/include/myisampack.h
index 7d4871bd1cb..ecf35520a88 100644
--- a/include/myisampack.h
+++ b/include/myisampack.h
@@ -1,3 +1,6 @@
+#ifndef MYISAMPACK_INCLUDED
+#define MYISAMPACK_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -236,3 +239,4 @@
mi_int4store(((T) + 4), A); }}
#define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4)
#endif
+#endif /* MYISAMPACK_INCLUDED */
diff --git a/include/mysql.h b/include/mysql.h
index d114afb6c93..452b4374cf7 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -86,9 +86,11 @@ extern char *mysql_unix_port;
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
-#define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
-#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
-#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR)
+/**
+ Returns true if the value is a number which does not need quotes for
+ the sql_lex.cc parser to parse correctly.
+*/
+#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)
@@ -186,24 +188,10 @@ struct st_mysql_options {
unsigned long max_allowed_packet;
my_bool use_ssl; /* if to use SSL or not */
my_bool compress,named_pipe;
- /*
- On connect, find out the replication role of the server, and
- establish connections to all the peers
- */
- my_bool rpl_probe;
- /*
- Each call to mysql_real_query() will parse it to tell if it is a read
- or a write, and direct it to the slave or the master
- */
- my_bool rpl_parse;
- /*
- If set, never read from a master, only from slave, when doing
- a read that is replication-aware
- */
- my_bool no_master_reads;
-#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
- my_bool separate_thread;
-#endif
+ my_bool unused1;
+ my_bool unused2;
+ my_bool unused3;
+ my_bool unused4;
enum mysql_option methods_to_use;
char *client_ip;
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
@@ -230,15 +218,6 @@ enum mysql_protocol_type
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
-/*
- There are three types of queries - the ones that have to go to
- the master, the ones that go to a slave, and the adminstrative
- type which must happen on the pivot connectioin
-*/
-enum mysql_rpl_type
-{
- MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
-};
typedef struct character_set
{
@@ -283,21 +262,8 @@ typedef struct st_mysql
/* session-wide random string */
char scramble[SCRAMBLE_LENGTH+1];
-
- /*
- Set if this is the original connection, not a master or a slave we have
- added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
- */
- my_bool rpl_pivot;
- /*
- Pointers to the master, and the next slave connections, points to
- itself if lone connection.
- */
- struct st_mysql* master, *next_slave;
-
- struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
- /* needed for send/read/store/use result to work correctly with replication */
- struct st_mysql* last_used_con;
+ my_bool unused1;
+ void *unused2, *unused3, *unused4, *unused5;
LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods;
@@ -331,35 +297,12 @@ typedef struct st_mysql_res {
void *extension;
} MYSQL_RES;
-#define MAX_MYSQL_MANAGER_ERR 256
-#define MAX_MYSQL_MANAGER_MSG 256
-
-#define MANAGER_OK 200
-#define MANAGER_INFO 250
-#define MANAGER_ACCESS 401
-#define MANAGER_CLIENT_ERR 450
-#define MANAGER_INTERNAL_ERR 500
#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
#define MYSQL_CLIENT
#endif
-typedef struct st_mysql_manager
-{
- NET net;
- char *host, *user, *passwd;
- char *net_buf, *net_buf_pos, *net_data_end;
- unsigned int port;
- int cmd_status;
- int last_errno;
- int net_buf_size;
- my_bool free_me;
- my_bool eof;
- char last_error[MAX_MYSQL_MANAGER_ERR];
- void *extension;
-} MYSQL_MANAGER;
-
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
@@ -452,16 +395,6 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
-/* perform query on master */
-my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
-/* perform query on slave */
-my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *charset);
@@ -483,37 +416,6 @@ mysql_set_local_infile_handler(MYSQL *mysql,
void
mysql_set_local_infile_default(MYSQL *mysql);
-
-/*
- enable/disable parsing of all queries to decide if they go on master or
- slave
-*/
-void STDCALL mysql_enable_rpl_parse(MYSQL* mysql);
-void STDCALL mysql_disable_rpl_parse(MYSQL* mysql);
-/* get the value of the parse flag */
-int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);
-
-/* enable/disable reads from master */
-void STDCALL mysql_enable_reads_from_master(MYSQL* mysql);
-void STDCALL mysql_disable_reads_from_master(MYSQL* mysql);
-/* get the value of the master read flag */
-my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
-
-enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len);
-
-/* discover the master and its slaves */
-my_bool STDCALL mysql_rpl_probe(MYSQL* mysql);
-
-/* set the master, close/free the old one, if it is not a pivot */
-int STDCALL mysql_set_master(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
-int STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
-
int STDCALL mysql_shutdown(MYSQL *mysql,
enum mysql_enum_shutdown_level
shutdown_level);
@@ -560,18 +462,6 @@ void STDCALL mysql_debug(const char *debug);
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
-MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con);
-MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
- const char* host,
- const char* user,
- const char* passwd,
- unsigned int port);
-void STDCALL mysql_manager_close(MYSQL_MANAGER* con);
-int STDCALL mysql_manager_command(MYSQL_MANAGER* con,
- const char* cmd, int cmd_len);
-int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
- char* res_buf,
- int res_buf_size);
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
@@ -766,7 +656,7 @@ typedef struct st_mysql_methods
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
- void (*flush_use_result)(MYSQL *mysql);
+ void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
@@ -826,6 +716,7 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool STDCALL mysql_more_results(MYSQL *mysql);
int STDCALL mysql_next_result(MYSQL *mysql);
+int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
void STDCALL mysql_close(MYSQL *sock);
@@ -840,7 +731,6 @@ MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host,
const char *user, const char *passwd);
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
-#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#endif
#define HAVE_MYSQL_REAL_CONNECT
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 633cde41130..0ea1d0974c2 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -28,15 +28,15 @@ typedef struct st_net {
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
- my_bool unused0;
- my_bool unused;
- my_bool compress;
my_bool unused1;
- unsigned char *query_cache_query;
+ my_bool unused2;
+ my_bool compress;
+ my_bool unused3;
+ unsigned char *unused;
unsigned int last_errno;
unsigned char error;
- my_bool unused2;
- my_bool return_errno;
+ my_bool unused4;
+ my_bool unused5;
char last_error[512];
char sqlstate[5 +1];
void *extension;
@@ -277,10 +277,10 @@ struct st_mysql_options {
unsigned long max_allowed_packet;
my_bool use_ssl;
my_bool compress,named_pipe;
- my_bool rpl_probe;
- my_bool rpl_parse;
- my_bool no_master_reads;
- my_bool separate_thread;
+ my_bool unused1;
+ my_bool unused2;
+ my_bool unused3;
+ my_bool unused4;
enum mysql_option methods_to_use;
char *client_ip;
my_bool secure_auth;
@@ -301,10 +301,6 @@ enum mysql_protocol_type
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
-enum mysql_rpl_type
-{
- MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
-};
typedef struct character_set
{
unsigned int number;
@@ -344,10 +340,8 @@ typedef struct st_mysql
my_bool free_me;
my_bool reconnect;
char scramble[20 +1];
- my_bool rpl_pivot;
- struct st_mysql* master, *next_slave;
- struct st_mysql* last_used_slave;
- struct st_mysql* last_used_con;
+ my_bool unused1;
+ void *unused2, *unused3, *unused4, *unused5;
LIST *stmts;
const struct st_mysql_methods *methods;
void *thd;
@@ -371,20 +365,6 @@ typedef struct st_mysql_res {
my_bool unbuffered_fetch_cancelled;
void *extension;
} MYSQL_RES;
-typedef struct st_mysql_manager
-{
- NET net;
- char *host, *user, *passwd;
- char *net_buf, *net_buf_pos, *net_data_end;
- unsigned int port;
- int cmd_status;
- int last_errno;
- int net_buf_size;
- my_bool free_me;
- my_bool eof;
- char last_error[256];
- void *extension;
-} MYSQL_MANAGER;
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
@@ -437,14 +417,6 @@ int mysql_real_query(MYSQL *mysql, const char *q,
unsigned long length);
MYSQL_RES * mysql_store_result(MYSQL *mysql);
MYSQL_RES * mysql_use_result(MYSQL *mysql);
-my_bool mysql_master_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_master_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_slave_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_slave_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
void mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *charset);
void
@@ -459,22 +431,6 @@ mysql_set_local_infile_handler(MYSQL *mysql,
void *);
void
mysql_set_local_infile_default(MYSQL *mysql);
-void mysql_enable_rpl_parse(MYSQL* mysql);
-void mysql_disable_rpl_parse(MYSQL* mysql);
-int mysql_rpl_parse_enabled(MYSQL* mysql);
-void mysql_enable_reads_from_master(MYSQL* mysql);
-void mysql_disable_reads_from_master(MYSQL* mysql);
-my_bool mysql_reads_from_master_enabled(MYSQL* mysql);
-enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
-my_bool mysql_rpl_probe(MYSQL* mysql);
-int mysql_set_master(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
-int mysql_add_slave(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
int mysql_shutdown(MYSQL *mysql,
enum mysql_enum_shutdown_level
shutdown_level);
@@ -521,18 +477,6 @@ void mysql_debug(const char *debug);
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);
-MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con);
-MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con,
- const char* host,
- const char* user,
- const char* passwd,
- unsigned int port);
-void mysql_manager_close(MYSQL_MANAGER* con);
-int mysql_manager_command(MYSQL_MANAGER* con,
- const char* cmd, int cmd_len);
-int mysql_manager_fetch_line(MYSQL_MANAGER* con,
- char* res_buf,
- int res_buf_size);
my_bool mysql_read_query_result(MYSQL *mysql);
enum enum_mysql_stmt_state
{
@@ -616,7 +560,7 @@ typedef struct st_mysql_methods
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
- void (*flush_use_result)(MYSQL *mysql);
+ void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
@@ -671,4 +615,5 @@ my_bool mysql_rollback(MYSQL * mysql);
my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool mysql_more_results(MYSQL *mysql);
int mysql_next_result(MYSQL *mysql);
+int mysql_stmt_next_result(MYSQL_STMT *stmt);
void mysql_close(MYSQL *sock);
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 2e59262d061..f158dc20999 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@
#ifndef _my_plugin_h
#define _my_plugin_h
-
/*
On Windows, exports from DLL need to be declared
*/
@@ -34,15 +33,7 @@ class Item;
#define MYSQL_THD void*
#endif
-#ifndef _m_string_h
-/* This definition must match the one given in m_string.h */
-struct st_mysql_lex_string
-{
- char *str;
- unsigned int length;
-};
-#endif /* _m_string_h */
-typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+#include <mysql/services.h>
#define MYSQL_XIDDATASIZE 128
/**
@@ -65,7 +56,7 @@ typedef struct st_mysql_xid MYSQL_XID;
Plugin API. Common for all plugin types.
*/
-#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0100
+#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101
/*
The allowable types of plugins
@@ -75,7 +66,8 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
-#define MYSQL_MAX_PLUGIN_TYPE_NUM 5 /* The number of plugin types */
+#define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */
+#define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */
/* We use the following strings to define licenses for plugins */
#define PLUGIN_LICENSE_PROPRIETARY 0
@@ -120,7 +112,8 @@ enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+ SHOW_always_last
};
struct st_mysql_show_var {
@@ -650,6 +643,17 @@ struct st_mysql_information_schema
int interface_version;
};
+/*
+ API for Replication plugin. (MYSQL_REPLICATION_PLUGIN)
+*/
+ #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100
+
+ /**
+ Replication plugin descriptor
+ */
+ struct Mysql_replication {
+ int interface_version;
+ };
/*
st_mysql_value struct for reading values from mysqld.
@@ -733,54 +737,6 @@ int thd_killed(const MYSQL_THD thd);
*/
unsigned long thd_get_thread_id(const MYSQL_THD thd);
-
-/**
- Allocate memory in the connection's local memory pool
-
- @details
- When properly used in place of @c my_malloc(), this can significantly
- improve concurrency. Don't use this or related functions to allocate
- large chunks of memory. Use for temporary storage only. The memory
- will be freed automatically at the end of the statement; no explicit
- code is required to prevent memory leaks.
-
- @see alloc_root()
-*/
-void *thd_alloc(MYSQL_THD thd, unsigned int size);
-/**
- @see thd_alloc()
-*/
-void *thd_calloc(MYSQL_THD thd, unsigned int size);
-/**
- @see thd_alloc()
-*/
-char *thd_strdup(MYSQL_THD thd, const char *str);
-/**
- @see thd_alloc()
-*/
-char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
-/**
- @see thd_alloc()
-*/
-void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
-
-/**
- Create a LEX_STRING in this connection's local memory pool
-
- @param thd user thread connection handle
- @param lex_str pointer to LEX_STRING object to be initialized
- @param str initializer to be copied into lex_str
- @param size length of str, in bytes
- @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
- instead of using lex_str value
- @return NULL on failure, or pointer to the LEX_STRING object
-
- @see thd_alloc()
-*/
-MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
- const char *str, unsigned int size,
- int allocate_lex_string);
-
/**
Get the XID for this connection's transaction
diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp
index 50511f515ab..b7dd7bc0032 100644
--- a/include/mysql/plugin.h.pp
+++ b/include/mysql/plugin.h.pp
@@ -1,9 +1,38 @@
+#include <mysql/services.h>
+#include <mysql/service_my_snprintf.h>
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+ size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+ size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+#include <mysql/service_thd_alloc.h>
+#include <stdlib.h>
struct st_mysql_lex_string
{
char *str;
- unsigned int length;
+ size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+extern struct thd_alloc_service_st {
+ void *(*thd_alloc_func)(void*, unsigned int);
+ void *(*thd_calloc_func)(void*, unsigned int);
+ char *(*thd_strdup_func)(void*, const char *);
+ char *(*thd_strmake_func)(void*, const char *, unsigned int);
+ void *(*thd_memdup_func)(void*, const void*, unsigned int);
+ MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *,
+ const char *, unsigned int, int);
+} *thd_alloc_service;
+void *thd_alloc(void* thd, unsigned int size);
+void *thd_calloc(void* thd, unsigned int size);
+char *thd_strdup(void* thd, const char *str);
+char *thd_strmake(void* thd, const char *str, unsigned int size);
+void *thd_memdup(void* thd, const void* str, unsigned int size);
+MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -15,7 +44,8 @@ enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+ SHOW_always_last
};
struct st_mysql_show_var {
const char *name;
@@ -105,6 +135,9 @@ struct st_mysql_information_schema
{
int interface_version;
};
+ struct Mysql_replication {
+ int interface_version;
+ };
struct st_mysql_value
{
int (*value_type)(struct st_mysql_value *);
@@ -125,14 +158,6 @@ void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
-void *thd_alloc(void* thd, unsigned int size);
-void *thd_calloc(void* thd, unsigned int size);
-char *thd_strdup(void* thd, const char *str);
-char *thd_strmake(void* thd, const char *str, unsigned int size);
-void *thd_memdup(void* thd, const void* str, unsigned int size);
-MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
- const char *str, unsigned int size,
- int allocate_lex_string);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
const char *key, unsigned int key_length,
diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h
new file mode 100644
index 00000000000..ad344864c34
--- /dev/null
+++ b/include/mysql/service_my_snprintf.h
@@ -0,0 +1,98 @@
+#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ my_snprintf service
+
+ Portable and limited vsnprintf() implementation.
+
+ This is a portable, limited vsnprintf() implementation, with some
+ extra features. "Portable" means that it'll produce identical result
+ on all platforms (for example, on Windows and Linux system printf %e
+ formats the exponent differently, on different systems %p either
+ prints leading 0x or not, %s may accept null pointer or crash on
+ it). "Limited" means that it does not support all the C89 features.
+ But it supports few extensions, not in any standard.
+
+ my_vsnprintf(to, n, fmt, ap)
+
+ @param[out] to A buffer to store the result in
+ @param[in] n Store up to n-1 characters, followed by an end 0
+ @param[in] fmt printf-like format string
+ @param[in] ap Arguments
+
+ @return a number of bytes written to a buffer *excluding* terminating '\0'
+
+ @post
+ The syntax of a format string is generally the same:
+ % <flag> <width> <precision> <length modifier> <format>
+ where everithing but the format is optional.
+
+ Three one-character flags are recognized:
+ '0' has the standard zero-padding semantics;
+ '-' is parsed, but silently ignored;
+ '`' (backtick) is only supported for strings (%s) and means that the
+ string will be quoted according to MySQL identifier quoting rules.
+
+ Both <width> and <precision> can be specified as numbers or '*'.
+
+ <length modifier> can be 'l', 'll', or 'z'.
+
+ Supported formats are 's' (null pointer is accepted, printed as
+ "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x',
+ 'X', 'p' (works as 0x%x).
+
+ Standard syntax for positional arguments $n is supported.
+
+ Extensions:
+
+ Flag '`' (backtick): see above.
+
+ Format 'b': binary buffer, prints exactly <precision> bytes from the
+ argument, without stopping at '\0'.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+ size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+ size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
+#define my_snprintf my_snprintf_service->my_snprintf_type
+
+#else
+
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
+#endif
+
diff --git a/include/mysql/service_thd_alloc.h b/include/mysql/service_thd_alloc.h
new file mode 100644
index 00000000000..86158ba1359
--- /dev/null
+++ b/include/mysql/service_thd_alloc.h
@@ -0,0 +1,128 @@
+#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ This service provdes functions to allocate memory in a connection local
+ memory pool. The memory allocated there will be automatically freed at the
+ end of the statement, don't use it for allocations that should live longer
+ than that. For short living allocations this is more efficient than
+ using my_malloc and friends, and automatic "garbage collection" allows not
+ to think about memory leaks.
+
+ The pool is best for small to medium objects, don't use it for large
+ allocations - they are better served with my_malloc.
+*/
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct st_mysql_lex_string
+{
+ char *str;
+ size_t length;
+};
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+
+extern struct thd_alloc_service_st {
+ void *(*thd_alloc_func)(MYSQL_THD, unsigned int);
+ void *(*thd_calloc_func)(MYSQL_THD, unsigned int);
+ char *(*thd_strdup_func)(MYSQL_THD, const char *);
+ char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int);
+ void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int);
+ MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *,
+ const char *, unsigned int, int);
+} *thd_alloc_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size)))
+
+#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size)))
+
+#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str)))
+
+#define thd_strmake(thd,str,size) \
+ (thd_alloc_service->thd_strmake_func((thd), (str), (size)))
+
+#define thd_memdup(thd,str,size) \
+ (thd_alloc_service->thd_memdup_func((thd), (str), (size)))
+
+#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \
+ (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \
+ (size), (allocate_lex_string)))
+
+#else
+
+/**
+ Allocate memory in the connection's local memory pool
+
+ @details
+ When properly used in place of @c my_malloc(), this can significantly
+ improve concurrency. Don't use this or related functions to allocate
+ large chunks of memory. Use for temporary storage only. The memory
+ will be freed automatically at the end of the statement; no explicit
+ code is required to prevent memory leaks.
+
+ @see alloc_root()
+*/
+void *thd_alloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_calloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+char *thd_strdup(MYSQL_THD thd, const char *str);
+/**
+ @see thd_alloc()
+*/
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
+
+/**
+ Create a LEX_STRING in this connection's local memory pool
+
+ @param thd user thread connection handle
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param size length of str, in bytes
+ @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+
+ @see thd_alloc()
+*/
+MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#define MYSQL_SERVICE_THD_ALLOC_INCLUDED
+#endif
+
diff --git a/server-tools/instance-manager/command.cc b/include/mysql/services.h
index ba84285ead2..19003e66b96 100644
--- a/server-tools/instance-manager/command.cc
+++ b/include/mysql/services.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004 MySQL AB
+#ifndef MYSQL_SERVICES_INCLUDED
+/* Copyright (C) 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,18 +14,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
+#ifdef __cplusplus
+extern "C" {
#endif
-#include "manager.h"
-#include "command.h"
+#include <mysql/service_my_snprintf.h>
+#include <mysql/service_thd_alloc.h>
-Command::Command()
- :guardian(Manager::get_guardian()),
- instance_map(Manager::get_instance_map())
-{}
+#ifdef __cplusplus
+}
+#endif
-Command::~Command()
-{}
+#define MYSQL_SERVICES_INCLUDED
+#endif
diff --git a/include/mysql_com.h b/include/mysql_com.h
index db5a5eb8741..345ecd5dd93 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -27,6 +27,8 @@
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
+#define MYSQL_AUTODETECT_CHARSET_NAME "auto"
+
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
@@ -144,6 +146,7 @@ enum enum_server_command
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
+#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
@@ -167,6 +170,7 @@ enum enum_server_command
CLIENT_SECURE_CONNECTION | \
CLIENT_MULTI_STATEMENTS | \
CLIENT_MULTI_RESULTS | \
+ CLIENT_PS_MULTI_RESULTS | \
CLIENT_SSL_VERIFY_SERVER_CERT | \
CLIENT_REMEMBER_OPTIONS)
@@ -203,6 +207,12 @@ enum enum_server_command
number of result set columns.
*/
#define SERVER_STATUS_METADATA_CHANGED 1024
+#define SERVER_QUERY_WAS_SLOW 2048
+
+/**
+ To mark ResultSet containing output parameter values.
+*/
+#define SERVER_PS_OUT_PARAMS 4096
/**
Server status flags that must be cleared when starting
@@ -254,24 +264,23 @@ typedef struct st_net {
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
- my_bool unused0; /* Please remove with the next incompatible ABI change. */
- my_bool unused; /* Please remove with the next incompatible ABI change */
- my_bool compress;
my_bool unused1; /* Please remove with the next incompatible ABI change. */
+ my_bool unused2; /* Please remove with the next incompatible ABI change */
+ my_bool compress;
+ my_bool unused3; /* Please remove with the next incompatible ABI change. */
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet
*/
#endif
/*
- 'query_cache_query' should be accessed only via query cache
- functions and methods to maintain proper locking.
+ Unused, please remove with the next incompatible ABI change.
*/
- unsigned char *query_cache_query;
+ unsigned char *unused;
unsigned int last_errno;
unsigned char error;
- my_bool unused2; /* Please remove with the next incompatible ABI change. */
- my_bool return_errno;
+ my_bool unused4; /* Please remove with the next incompatible ABI change. */
+ my_bool unused5; /* Please remove with the next incompatible ABI change. */
/** Client library error message buffer. Actually belongs to struct MYSQL. */
char last_error[MYSQL_ERRMSG_SIZE];
/** Client library sqlstate buffer. Set along with the error message. */
@@ -409,10 +418,6 @@ void my_net_set_write_timeout(NET *net, uint timeout);
void my_net_set_read_timeout(NET *net, uint timeout);
#endif
-/*
- The following function is not meant for normal usage
- Currently it's used internally by manager.c
-*/
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 4a7fd3ef63c..0e5a360585e 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -1,3 +1,6 @@
+#ifndef MYSQL_EMBED_INCLUDED
+#define MYSQL_EMBED_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -28,3 +31,4 @@
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */
+#endif /* MYSQL_EMBED_INCLUDED */
diff --git a/include/rijndael.h b/include/rijndael.h
index 89963a85c99..71df1c48dbf 100644
--- a/include/rijndael.h
+++ b/include/rijndael.h
@@ -1,3 +1,6 @@
+#ifndef RIJNDAEL_INCLUDED
+#define RIJNDAEL_INCLUDED
+
/* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -39,3 +42,5 @@ void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
const uint8 pt[16], uint8 ct[16]);
void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
const uint8 ct[16], uint8 pt[16]);
+
+#endif /* RIJNDAEL_INCLUDED */
diff --git a/server-tools/instance-manager/messages.h b/include/service_versions.h
index 5d9383093bc..114957cdd86 100644
--- a/server-tools/instance-manager/messages.h
+++ b/include/service_versions.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB
+/* Copyright (C) 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,11 +13,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MESSAGES_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_MESSAGES_H
+#ifdef _WIN32
+#define SERVICE_VERSION __declspec(dllexport) void *
+#else
+#define SERVICE_VERSION void *
+#endif
-const char *message(unsigned sql_errno);
+#define VERSION_my_snprintf 0x0100
+#define VERSION_thd_alloc 0x0100
-const char *errno_to_sqlstate(unsigned sql_errno);
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MESSAGES_H
diff --git a/include/sha1.h b/include/sha1.h
index e476456a9bd..5b4dc5d46ed 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -1,3 +1,6 @@
+#ifndef SHA1_INCLUDED
+#define SHA1_INCLUDED
+
/* Copyright (C) 2002, 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -64,3 +67,5 @@ int mysql_sha1_input(SHA1_CONTEXT*, const uint8 *, unsigned int);
int mysql_sha1_result(SHA1_CONTEXT* , uint8 Message_Digest[SHA1_HASH_SIZE]);
C_MODE_END
+
+#endif /* SHA__INCLUDED */
diff --git a/include/sql_common.h b/include/sql_common.h
index 9e43d076ba9..5fd8778d62b 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -1,3 +1,6 @@
+#ifndef SQL_COMMON_INCLUDED
+#define SQL_COMMON_INCLUDED
+
/* Copyright (C) 2003-2004, 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -48,3 +51,4 @@ void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
+#endif /* SQL_COMMON_INCLUDED */
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index adb9a28503b..ce46cf65cc9 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -1,3 +1,6 @@
+#ifndef SSLOPT_CASE_INCLUDED
+#define SSLOPT_CASE_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -26,3 +29,4 @@
opt_use_ssl= 1;
break;
#endif
+#endif /* SSLOPT_CASE_INCLUDED */
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index c76b5dcd252..eae1424238b 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -1,3 +1,6 @@
+#ifndef SSLOPT_LONGOPTS_INCLUDED
+#define SSLOPT_LONGOPTS_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -43,3 +46,4 @@
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
+#endif /* SSLOPT_LONGOPTS_INCLUDED */
diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h
index 3369f870db2..4493fbc59ab 100644
--- a/include/sslopt-vars.h
+++ b/include/sslopt-vars.h
@@ -1,3 +1,6 @@
+#ifndef SSLOPT_VARS_INCLUDED
+#define SSLOPT_VARS_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -29,3 +32,4 @@ SSL_STATIC char *opt_ssl_key = 0;
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
#endif
#endif
+#endif /* SSLOPT_VARS_INCLUDED */
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 55138e4aa06..84ad50e03e3 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -14,8 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Note that we don't link with the libraries "strings" or "mysys"
# here, instead we recompile the files needed and include them
@@ -75,7 +73,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
get_password.c ../strings/int2str.c ../strings/is_prefix.c
libmysql.c ../mysys/list.c ../strings/llstr.c
- ../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
+ ../strings/longlong2str.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c
@@ -98,33 +96,17 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
- ../mysys/my_getsystime.c ../mysys/my_sync.c ${LIB_SOURCES})
-
-# Need to set USE_TLS for building the DLL, since __declspec(thread)
-# approach to thread local storage does not work properly in DLLs.
-#
-# The static library might be used to form another DLL, as is the case
-# with the ODBC driver, so it has to be compiled with USE_TLS as well.
-#
-# We create a third library without USE_TLS for internal use. We can't
-# be sure that some client application part of this build doesn't go
-# beond the documented API, and try access the Thread Local Storage.
-# The "_notls" means no Tls*() functions used, i.e. "static" TLS.
+ ../mysys/my_getsystime.c ../mysys/my_sync.c ../mysys/my_winerr.c ../mysys/my_winfile.c ${LIB_SOURCES})
+
+
ADD_LIBRARY(mysqlclient STATIC ${CLIENT_SOURCES})
ADD_DEPENDENCIES(mysqlclient GenError)
TARGET_LINK_LIBRARIES(mysqlclient)
-ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES})
-ADD_DEPENDENCIES(mysqlclient_notls GenError)
-TARGET_LINK_LIBRARIES(mysqlclient_notls)
-
ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
-IF(WIN32)
- SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS")
-ENDIF(WIN32)
ADD_DEPENDENCIES(libmysql GenError)
-TARGET_LINK_LIBRARIES(libmysql wsock32)
+TARGET_LINK_LIBRARIES(libmysql)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index eb4fd75ed11..acc709bfb89 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -31,7 +31,7 @@ pkglib_LTLIBRARIES = $(target)
noinst_PROGRAMS = conf_to_src
-target_sources = libmysql.c password.c manager.c \
+target_sources = libmysql.c password.c \
get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index f87e625771f..aaec08d1b1e 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -13,12 +13,22 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifndef CLIENT_SETTINGS_INCLUDED
+#define CLIENT_SETTINGS_INCLUDED
+#else
+#error You have already included an client_settings.h and it should not be included twice
+#endif /* CLIENT_SETTINGS_INCLUDED */
+
extern uint mysql_port;
extern char * mysql_unix_port;
-#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
- CLIENT_TRANSACTIONS | \
- CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
+#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
+ CLIENT_LONG_FLAG | \
+ CLIENT_TRANSACTIONS | \
+ CLIENT_PROTOCOL_41 | \
+ CLIENT_SECURE_CONNECTION | \
+ CLIENT_MULTI_RESULTS | \
+ CLIENT_PS_MULTI_RESULTS)
sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name);
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 95ee6862aa8..d0ed44bd7aa 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -85,6 +85,7 @@ const char *client_errors[]=
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
+ "This handle is already connected. Use a separate handle for each connection."
""
};
@@ -151,6 +152,7 @@ const char *client_errors[]=
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
+ "This handle is already connected. Use a separate handle for each connection."
""
};
@@ -215,10 +217,15 @@ const char *client_errors[]=
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
+ "This handle is already connected. Use a separate handle for each connection."
""
};
#endif
+const char** get_client_errmsgs()
+{
+ return client_errors;
+}
/*
Register client error messages for use with my_error().
@@ -232,7 +239,7 @@ const char *client_errors[]=
void init_client_errs(void)
{
- (void) my_error_register(client_errors, CR_ERROR_FIRST, CR_ERROR_LAST);
+ (void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
}
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 1264f2765ba..b8935333028 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -131,7 +131,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_port = MYSQL_PORT;
#ifndef MSDOS
{
- struct servent *serv_ptr;
+ struct servent *serv_ptr __attribute__((unused));
char *env;
/*
@@ -249,16 +249,6 @@ void STDCALL mysql_thread_end()
#endif
}
-/*
- Let the user specify that we don't want SIGPIPE; This doesn't however work
- with threaded applications as we can have multiple read in progress.
-*/
-static MYSQL* spawn_init(MYSQL* parent, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
-
-
/*
Expand wildcard to a sql string
@@ -320,7 +310,7 @@ mysql_debug(const char *debug __attribute__((unused)))
/**************************************************************************
- Close the server connection if we get a SIGPIPE
+ Ignore SIGPIPE handler
ARGSUSED
**************************************************************************/
@@ -333,305 +323,6 @@ my_pipe_sig_handler(int sig __attribute__((unused)))
#endif
}
-/* perform query on master */
-my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
- unsigned long length)
-{
- DBUG_ENTER("mysql_master_query");
- if (mysql_master_send_query(mysql, q, length))
- DBUG_RETURN(1);
- DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
-}
-
-my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
- unsigned long length)
-{
- MYSQL *master = mysql->master;
- DBUG_ENTER("mysql_master_send_query");
- if (!master->net.vio && !mysql_real_connect(master,0,0,0,0,0,0,0))
- DBUG_RETURN(1);
- master->reconnect= 1;
- mysql->last_used_con = master;
- DBUG_RETURN(simple_command(master, COM_QUERY, (const uchar*) q, length, 1));
-}
-
-
-/* perform query on slave */
-my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
- unsigned long length)
-{
- DBUG_ENTER("mysql_slave_query");
- if (mysql_slave_send_query(mysql, q, length))
- DBUG_RETURN(1);
- DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
-}
-
-
-my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
- unsigned long length)
-{
- MYSQL* last_used_slave, *slave_to_use = 0;
- DBUG_ENTER("mysql_slave_send_query");
-
- if ((last_used_slave = mysql->last_used_slave))
- slave_to_use = last_used_slave->next_slave;
- else
- slave_to_use = mysql->next_slave;
- /*
- Next_slave is always safe to use - we have a circular list of slaves
- if there are no slaves, mysql->next_slave == mysql
- */
- mysql->last_used_con = mysql->last_used_slave = slave_to_use;
- if (!slave_to_use->net.vio && !mysql_real_connect(slave_to_use, 0,0,0,
- 0,0,0,0))
- DBUG_RETURN(1);
- slave_to_use->reconnect= 1;
- DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, (const uchar*) q,
- length, 1));
-}
-
-
-/* enable/disable parsing of all queries to decide
- if they go on master or slave */
-void STDCALL mysql_enable_rpl_parse(MYSQL* mysql)
-{
- mysql->options.rpl_parse = 1;
-}
-
-void STDCALL mysql_disable_rpl_parse(MYSQL* mysql)
-{
- mysql->options.rpl_parse = 0;
-}
-
-/* get the value of the parse flag */
-int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql)
-{
- return mysql->options.rpl_parse;
-}
-
-/* enable/disable reads from master */
-void STDCALL mysql_enable_reads_from_master(MYSQL* mysql)
-{
- mysql->options.no_master_reads = 0;
-}
-
-void STDCALL mysql_disable_reads_from_master(MYSQL* mysql)
-{
- mysql->options.no_master_reads = 1;
-}
-
-/* get the value of the master read flag */
-my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql)
-{
- return !(mysql->options.no_master_reads);
-}
-
-
-/*
- We may get an error while doing replication internals.
- In this case, we add a special explanation to the original
- error
-*/
-
-static void expand_error(MYSQL* mysql, int error)
-{
- char tmp[MYSQL_ERRMSG_SIZE];
- char *p;
- uint err_length;
- strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
- p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
- err_length= (uint) (p - mysql->net.last_error);
- strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
- mysql->net.last_errno = error;
-}
-
-/*
- This function assumes we have just called SHOW SLAVE STATUS and have
- read the given result and row
-*/
-
-static my_bool get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row)
-{
- MYSQL* master;
- DBUG_ENTER("get_master");
- if (mysql_num_fields(res) < 3)
- DBUG_RETURN(1); /* safety */
-
- /* use the same username and password as the original connection */
- if (!(master = spawn_init(mysql, row[0], atoi(row[2]), 0, 0)))
- DBUG_RETURN(1);
- mysql->master = master;
- DBUG_RETURN(0);
-}
-
-
-/*
- Assuming we already know that mysql points to a master connection,
- retrieve all the slaves
-*/
-
-static my_bool get_slaves_from_master(MYSQL* mysql)
-{
- MYSQL_RES* res = 0;
- MYSQL_ROW row;
- my_bool error = 1;
- int has_auth_info;
- int port_ind;
- DBUG_ENTER("get_slaves_from_master");
-
- if (!mysql->net.vio && !mysql_real_connect(mysql,0,0,0,0,0,0,0))
- {
- expand_error(mysql, CR_PROBE_MASTER_CONNECT);
- DBUG_RETURN(1);
- }
- mysql->reconnect= 1;
-
- if (mysql_query(mysql, "SHOW SLAVE HOSTS") ||
- !(res = mysql_store_result(mysql)))
- {
- expand_error(mysql, CR_PROBE_SLAVE_HOSTS);
- DBUG_RETURN(1);
- }
-
- switch (mysql_num_fields(res)) {
- case 5:
- has_auth_info = 0;
- port_ind=2;
- break;
- case 7:
- has_auth_info = 1;
- port_ind=4;
- break;
- default:
- goto err;
- }
-
- while ((row = mysql_fetch_row(res)))
- {
- MYSQL* slave;
- const char* tmp_user, *tmp_pass;
-
- if (has_auth_info)
- {
- tmp_user = row[2];
- tmp_pass = row[3];
- }
- else
- {
- tmp_user = mysql->user;
- tmp_pass = mysql->passwd;
- }
-
- if (!(slave = spawn_init(mysql, row[1], atoi(row[port_ind]),
- tmp_user, tmp_pass)))
- goto err;
-
- /* Now add slave into the circular linked list */
- slave->next_slave = mysql->next_slave;
- mysql->next_slave = slave;
- }
- error = 0;
-err:
- if (res)
- mysql_free_result(res);
- DBUG_RETURN(error);
-}
-
-
-my_bool STDCALL mysql_rpl_probe(MYSQL* mysql)
-{
- MYSQL_RES *res= 0;
- MYSQL_ROW row;
- my_bool error= 1;
- DBUG_ENTER("mysql_rpl_probe");
-
- /*
- First determine the replication role of the server we connected to
- the most reliable way to do this is to run SHOW SLAVE STATUS and see
- if we have a non-empty master host. This is still not fool-proof -
- it is not a sin to have a master that has a dormant slave thread with
- a non-empty master host. However, it is more reliable to check
- for empty master than whether the slave thread is actually running
- */
- if (mysql_query(mysql, "SHOW SLAVE STATUS") ||
- !(res = mysql_store_result(mysql)))
- {
- expand_error(mysql, CR_PROBE_SLAVE_STATUS);
- DBUG_RETURN(1);
- }
-
- row= mysql_fetch_row(res);
- /*
- Check master host for emptiness/NULL
- For MySQL 4.0 it's enough to check for row[0]
- */
- if (row && row[0] && *(row[0]))
- {
- /* this is a slave, ask it for the master */
- if (get_master(mysql, res, row) || get_slaves_from_master(mysql))
- goto err;
- }
- else
- {
- mysql->master = mysql;
- if (get_slaves_from_master(mysql))
- goto err;
- }
-
- error = 0;
-err:
- if (res)
- mysql_free_result(res);
- DBUG_RETURN(error);
-}
-
-
-/*
- Make a not so fool-proof decision on where the query should go, to
- the master or the slave. Ideally the user should always make this
- decision himself with mysql_master_query() or mysql_slave_query().
- However, to be able to more easily port the old code, we support the
- option of an educated guess - this should work for most applications,
- however, it may make the wrong decision in some particular cases. If
- that happens, the user would have to change the code to call
- mysql_master_query() or mysql_slave_query() explicitly in the place
- where we have made the wrong decision
-*/
-
-enum mysql_rpl_type
-STDCALL mysql_rpl_query_type(const char* q, int len)
-{
- const char *q_end= q + len;
- for (; q < q_end; ++q)
- {
- char c;
- if (my_isalpha(&my_charset_latin1, (c= *q)))
- {
- switch (my_tolower(&my_charset_latin1,c)) {
- case 'i': /* insert */
- case 'u': /* update or unlock tables */
- case 'l': /* lock tables or load data infile */
- case 'd': /* drop or delete */
- case 'a': /* alter */
- return MYSQL_RPL_MASTER;
- case 'c': /* create or check */
- return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
- MYSQL_RPL_MASTER;
- case 's': /* select or show */
- return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
- MYSQL_RPL_SLAVE;
- case 'f': /* flush */
- case 'r': /* repair */
- case 'g': /* grant */
- return MYSQL_RPL_ADMIN;
- default:
- return MYSQL_RPL_SLAVE;
- }
- }
- }
- return MYSQL_RPL_MASTER; /* By default, send to master */
-}
-
/**************************************************************************
Connect to sql server
@@ -1093,68 +784,6 @@ mysql_query(MYSQL *mysql, const char *query)
}
-static MYSQL* spawn_init(MYSQL* parent, const char* host,
- unsigned int port, const char* user,
- const char* passwd)
-{
- MYSQL* child;
- DBUG_ENTER("spawn_init");
- if (!(child= mysql_init(0)))
- DBUG_RETURN(0);
-
- child->options.user= my_strdup((user) ? user :
- (parent->user ? parent->user :
- parent->options.user), MYF(0));
- child->options.password= my_strdup((passwd) ? passwd :
- (parent->passwd ?
- parent->passwd :
- parent->options.password), MYF(0));
- child->options.port= port;
- child->options.host= my_strdup((host) ? host :
- (parent->host ?
- parent->host :
- parent->options.host), MYF(0));
- if (parent->db)
- child->options.db= my_strdup(parent->db, MYF(0));
- else if (parent->options.db)
- child->options.db= my_strdup(parent->options.db, MYF(0));
-
- /*
- rpl_pivot is set to 1 in mysql_init(); Reset it as we are not doing
- replication here
- */
- child->rpl_pivot= 0;
- DBUG_RETURN(child);
-}
-
-
-int
-STDCALL mysql_set_master(MYSQL* mysql, const char* host,
- unsigned int port, const char* user,
- const char* passwd)
-{
- if (mysql->master != mysql && !mysql->master->rpl_pivot)
- mysql_close(mysql->master);
- if (!(mysql->master = spawn_init(mysql, host, port, user, passwd)))
- return 1;
- return 0;
-}
-
-
-int
-STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd)
-{
- MYSQL* slave;
- if (!(slave = spawn_init(mysql, host, port, user, passwd)))
- return 1;
- slave->next_slave = mysql->next_slave;
- mysql->next_slave = slave;
- return 0;
-}
-
/**************************************************************************
Return next field of the query results
**************************************************************************/
@@ -1483,17 +1112,17 @@ MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res)
unsigned int STDCALL mysql_field_count(MYSQL *mysql)
{
- return mysql->last_used_con->field_count;
+ return mysql->field_count;
}
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql)
{
- return mysql->last_used_con->affected_rows;
+ return mysql->affected_rows;
}
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
{
- return mysql->last_used_con->insert_id;
+ return mysql->insert_id;
}
const char *STDCALL mysql_sqlstate(MYSQL *mysql)
@@ -1858,7 +1487,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
MYSQL_DATA *fields_data;
DBUG_ENTER("cli_read_prepare_result");
- mysql= mysql->last_used_con;
if ((packet_length= cli_safe_read(mysql)) == packet_error)
DBUG_RETURN(1);
mysql->warning_count= 0;
@@ -2092,7 +1720,9 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt)
{
MYSQL_FIELD *fields, *field, *end;
MEM_ROOT *alloc= &stmt->mem_root;
- MYSQL *mysql= stmt->mysql->last_used_con;
+ MYSQL *mysql= stmt->mysql;
+
+ DBUG_ASSERT(mysql->field_count);
stmt->field_count= mysql->field_count;
@@ -2115,18 +1745,21 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt)
field= stmt->fields;
field && fields < end; fields++, field++)
{
- field->db = strdup_root(alloc,fields->db);
- field->table = strdup_root(alloc,fields->table);
- field->org_table= strdup_root(alloc,fields->org_table);
- field->name = strdup_root(alloc,fields->name);
- field->org_name = strdup_root(alloc,fields->org_name);
- field->charsetnr= fields->charsetnr;
- field->length = fields->length;
- field->type = fields->type;
- field->flags = fields->flags;
- field->decimals = fields->decimals;
- field->def = fields->def ? strdup_root(alloc,fields->def): 0;
- field->max_length= 0;
+ *field= *fields; /* To copy all numeric parts. */
+ field->catalog= strmake_root(alloc, fields->catalog,
+ fields->catalog_length);
+ field->db= strmake_root(alloc, fields->db, fields->db_length);
+ field->table= strmake_root(alloc, fields->table, fields->table_length);
+ field->org_table= strmake_root(alloc, fields->org_table,
+ fields->org_table_length);
+ field->name= strmake_root(alloc, fields->name, fields->name_length);
+ field->org_name= strmake_root(alloc, fields->org_name,
+ fields->org_name_length);
+ field->def= fields->def ? strmake_root(alloc, fields->def,
+ fields->def_length) : 0;
+ field->def_length= field->def ? fields->def_length : 0;
+ field->extension= 0; /* Avoid dangling links. */
+ field->max_length= 0; /* max_length is set in mysql_stmt_store_result() */
}
}
@@ -2479,7 +2112,6 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
DBUG_ENTER("execute");
DBUG_DUMP("packet", (uchar *) packet, length);
- mysql->last_used_con= mysql;
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
buff[4]= (char) stmt->flags;
int4store(buff+5, 1); /* iteration count */
@@ -2854,6 +2486,33 @@ static void reinit_result_set_metadata(MYSQL_STMT *stmt)
}
+static void prepare_to_fetch_result(MYSQL_STMT *stmt)
+{
+ if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
+ {
+ stmt->mysql->status= MYSQL_STATUS_READY;
+ stmt->read_row_func= stmt_read_row_from_cursor;
+ }
+ else if (stmt->flags & CURSOR_TYPE_READ_ONLY)
+ {
+ /*
+ This is a single-row result set, a result set with no rows, EXPLAIN,
+ SHOW VARIABLES, or some other command which either a) bypasses the
+ cursors framework in the server and writes rows directly to the
+ network or b) is more efficient if all (few) result set rows are
+ precached on client and server's resources are freed.
+ */
+ mysql_stmt_store_result(stmt);
+ }
+ else
+ {
+ stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled;
+ stmt->unbuffered_fetch_cancelled= FALSE;
+ stmt->read_row_func= stmt_read_row_unbuffered;
+ }
+}
+
+
/*
Send placeholders data to server (if there are placeholders)
and execute prepared statement.
@@ -2921,28 +2580,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
if (mysql->field_count)
{
reinit_result_set_metadata(stmt);
- if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
- {
- mysql->status= MYSQL_STATUS_READY;
- stmt->read_row_func= stmt_read_row_from_cursor;
- }
- else if (stmt->flags & CURSOR_TYPE_READ_ONLY)
- {
- /*
- This is a single-row result set, a result set with no rows, EXPLAIN,
- SHOW VARIABLES, or some other command which either a) bypasses the
- cursors framework in the server and writes rows directly to the
- network or b) is more efficient if all (few) result set rows are
- precached on client and server's resources are freed.
- */
- mysql_stmt_store_result(stmt);
- }
- else
- {
- stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled;
- stmt->unbuffered_fetch_cancelled= FALSE;
- stmt->read_row_func= stmt_read_row_unbuffered;
- }
+ prepare_to_fetch_result(stmt);
}
DBUG_RETURN(test(stmt->last_errno));
}
@@ -4407,7 +4045,6 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
field->max_length= 10; /* 2003-11-11 */
param->skip_result= skip_result_with_length;
break;
- break;
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP:
param->skip_result= skip_result_with_length;
@@ -4689,7 +4326,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
}
net = &mysql->net;
- mysql= mysql->last_used_con;
while ((pkt_len= cli_safe_read(mysql)) != packet_error)
{
@@ -4787,8 +4423,6 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
- mysql= mysql->last_used_con;
-
if (!stmt->field_count)
DBUG_RETURN(0);
@@ -4990,7 +4624,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
if (stmt->field_count && mysql->status != MYSQL_STATUS_READY)
{
/* There is a result set and it belongs to this statement */
- (*mysql->methods->flush_use_result)(mysql);
+ (*mysql->methods->flush_use_result)(mysql, FALSE);
if (mysql->unbuffered_fetch_owner)
*mysql->unbuffered_fetch_owner= TRUE;
mysql->status= MYSQL_STATUS_READY;
@@ -5074,7 +4708,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
Flush result set of the connection. If it does not belong
to this statement, set a warning.
*/
- (*mysql->methods->flush_use_result)(mysql);
+ (*mysql->methods->flush_use_result)(mysql, TRUE);
if (mysql->unbuffered_fetch_owner)
*mysql->unbuffered_fetch_owner= TRUE;
mysql->status= MYSQL_STATUS_READY;
@@ -5193,8 +4827,7 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
my_bool res;
DBUG_ENTER("mysql_more_results");
- res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ?
- 1: 0);
+ res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0);
DBUG_PRINT("exit",("More results exists ? %d", res));
DBUG_RETURN(res);
}
@@ -5216,13 +4849,56 @@ int STDCALL mysql_next_result(MYSQL *mysql)
net_clear_error(&mysql->net);
mysql->affected_rows= ~(my_ulonglong) 0;
- if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)
+ if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
DBUG_RETURN((*mysql->methods->next_result)(mysql));
DBUG_RETURN(-1); /* No more results */
}
+int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt)
+{
+ MYSQL *mysql= stmt->mysql;
+ int rc;
+ DBUG_ENTER("mysql_stmt_next_result");
+
+ if (!mysql)
+ DBUG_RETURN(1);
+
+ if (stmt->last_errno)
+ DBUG_RETURN(stmt->last_errno);
+
+ if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
+ {
+ if (reset_stmt_handle(stmt, RESET_STORE_RESULT))
+ DBUG_RETURN(1);
+ }
+
+ rc= mysql_next_result(mysql);
+
+ if (rc)
+ {
+ set_stmt_errmsg(stmt, &mysql->net);
+ DBUG_RETURN(rc);
+ }
+
+ stmt->state= MYSQL_STMT_EXECUTE_DONE;
+ stmt->bind_result_done= FALSE;
+
+ if (mysql->field_count)
+ {
+ alloc_stmt_fields(stmt);
+ prepare_to_fetch_result(stmt);
+ }
+ else
+ {
+ stmt->field_count= mysql->field_count;
+ }
+
+ DBUG_RETURN(0);
+}
+
+
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql)
{
return (*mysql->methods->use_result)(mysql);
diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def
index 81f86dc8726..f6e93ca35fb 100644
--- a/libmysql/libmysql.def
+++ b/libmysql/libmysql.def
@@ -135,15 +135,6 @@ EXPORTS
client_errors
mysql_set_local_infile_default
mysql_set_local_infile_handler
- mysql_disable_reads_from_master
- mysql_disable_rpl_parse
- mysql_enable_reads_from_master
- mysql_enable_rpl_parse
- mysql_master_query
- mysql_rpl_parse_enabled
- mysql_rpl_probe
- mysql_rpl_query_type
- mysql_slave_query
mysql_embedded
mysql_server_init
mysql_server_end
diff --git a/libmysql/manager.c b/libmysql/manager.c
deleted file mode 100644
index 53ffffa55c0..00000000000
--- a/libmysql/manager.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* Copyright (C) 2000-2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation.
-
- There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#if defined(THREAD)
-#include <my_pthread.h> /* because of signal() */
-#endif
-#include "mysql.h"
-#include "mysql_version.h"
-#include "mysqld_error.h"
-#include <my_sys.h>
-#include <mysys_err.h>
-#include <m_string.h>
-#include <m_ctype.h>
-#include <my_net.h>
-#include <errmsg.h>
-#include <violite.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <errno.h>
-
-#if defined(__NETWARE__)
-#include <netdb.h>
-#include <sys/select.h>
-#include <sys/utsname.h>
-#elif !defined( __WIN__)
-#include <sys/resource.h>
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-#include <netdb.h>
-#ifdef HAVE_SELECT_H
-# include <select.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#include <sys/utsname.h>
-#endif /* __WIN__ */
-
-#ifndef INADDR_NONE
-#define INADDR_NONE -1
-#endif
-
-#define RES_BUF_SHIFT 5
-#define NET_BUF_SIZE 2048
-
-MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con)
-{
- int net_buf_size=NET_BUF_SIZE;
- if (!con)
- {
- if (!(con=(MYSQL_MANAGER*)my_malloc(sizeof(*con)+net_buf_size,
- MYF(MY_WME|MY_ZEROFILL))))
- return 0;
- con->free_me=1;
- con->net_buf=(char*)con+sizeof(*con);
- }
- else
- {
- bzero((char*)con,sizeof(*con));
- if (!(con->net_buf=my_malloc(net_buf_size,MYF(0))))
- return 0;
- }
- con->net_buf_pos=con->net_data_end=con->net_buf;
- con->net_buf_size=net_buf_size;
- return con;
-}
-
-MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
- const char* host,
- const char* user,
- const char* passwd,
- unsigned int port)
-{
- my_socket sock;
- struct sockaddr_in sock_addr;
- in_addr_t ip_addr;
- char msg_buf[MAX_MYSQL_MANAGER_MSG];
- int msg_len;
- Vio* vio;
- my_bool not_used;
-
- if (!host)
- host="localhost";
- if (!user)
- user="root";
- if (!passwd)
- passwd="";
-
- if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == INVALID_SOCKET)
- {
- con->last_errno=errno;
- strmov(con->last_error,"Cannot create socket");
- goto err;
- }
- if (!(vio=vio_new(sock,VIO_TYPE_TCPIP,FALSE)))
- {
- con->last_errno=ENOMEM;
- strmov(con->last_error,"Cannot create network I/O object");
- goto err;
- }
- vio_blocking(vio, TRUE, &not_used);
- my_net_init(&con->net,vio);
- bzero((char*) &sock_addr,sizeof(sock_addr));
- sock_addr.sin_family = AF_INET;
- if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE)
- {
- memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr));
- }
- else
- {
- int tmp_errno;
- struct hostent tmp_hostent,*hp;
- char buff2[GETHOSTBYNAME_BUFF_SIZE];
- hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
- &tmp_errno);
- if (!hp)
- {
- con->last_errno=tmp_errno;
- sprintf(con->last_error,"Could not resolve host '%-.64s'",host);
- my_gethostbyname_r_free();
- goto err;
- }
- memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
- my_gethostbyname_r_free();
- }
- sock_addr.sin_port = (ushort) htons((ushort) port);
- if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
- 0))
- {
- con->last_errno=errno;
- sprintf(con->last_error ,"Could not connect to %-.64s", host);
- goto err;
- }
- /* read the greating */
- if (my_net_read(&con->net) == packet_error)
- {
- con->last_errno=errno;
- strmov(con->last_error,"Read error on socket");
- goto err;
- }
- sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
- msg_len=strlen(msg_buf);
- if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net))
- {
- con->last_errno=con->net.last_errno;
- strmov(con->last_error,"Write error on socket");
- goto err;
- }
- if (my_net_read(&con->net) == packet_error)
- {
- con->last_errno=errno;
- strmov(con->last_error,"Read error on socket");
- goto err;
- }
- if ((con->cmd_status=atoi((char*) con->net.read_pos)) != MANAGER_OK)
- {
- strmov(con->last_error,"Access denied");
- goto err;
- }
- if (!my_multi_malloc(MYF(0), &con->host, (uint)strlen(host)+1,
- &con->user, (uint)strlen(user)+1,
- &con->passwd, (uint)strlen(passwd)+1,
- NullS))
- {
- con->last_errno=ENOMEM;
- strmov(con->last_error,"Out of memory");
- goto err;
- }
- strmov(con->host,host);
- strmov(con->user,user);
- strmov(con->passwd,passwd);
- return con;
-
-err:
- {
- my_bool free_me=con->free_me;
- con->free_me=0;
- mysql_manager_close(con);
- con->free_me=free_me;
- }
- return 0;
-}
-
-void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
-{
- /*
- No need to free con->user and con->passwd, because they were
- allocated in my_multimalloc() along with con->host, freeing
- con->hosts frees the whole block
- */
- my_free((uchar*)con->host,MYF(MY_ALLOW_ZERO_PTR));
- net_end(&con->net);
- if (con->free_me)
- my_free((uchar*)con,MYF(0));
-}
-
-
-int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
- int cmd_len)
-{
- if (!cmd_len)
- cmd_len=strlen(cmd);
- if (my_net_write(&con->net,(const uchar*)cmd,cmd_len) || net_flush(&con->net))
- {
- con->last_errno=errno;
- strmov(con->last_error,"Write error on socket");
- return 1;
- }
- con->eof=0;
- return 0;
-}
-
-
-int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
- int res_buf_size)
-{
- char* res_buf_end=res_buf+res_buf_size;
- char* net_buf=(char*) con->net.read_pos, *net_buf_end;
- int res_buf_shift=RES_BUF_SHIFT;
- ulong num_bytes;
-
- if (res_buf_size<RES_BUF_SHIFT)
- {
- con->last_errno=ENOMEM;
- strmov(con->last_error,"Result buffer too small");
- return 1;
- }
-
- if ((num_bytes=my_net_read(&con->net)) == packet_error)
- {
- con->last_errno=errno;
- strmov(con->last_error,"socket read failed");
- return 1;
- }
-
- net_buf_end=net_buf+num_bytes;
-
- if ((con->eof=(net_buf[3]==' ')))
- res_buf_shift--;
- net_buf+=res_buf_shift;
- res_buf_end[-1]=0;
- for (;net_buf<net_buf_end && res_buf < res_buf_end;res_buf++,net_buf++)
- {
- if ((*res_buf=*net_buf) == '\r')
- {
- *res_buf=0;
- break;
- }
- }
- return 0;
-}
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index db398258b69..65b8e12bc26 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -13,15 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
-# Need to set USE_TLS, since __declspec(thread) approach to thread local
-# storage does not work properly in DLLs.
-IF(WIN32)
- ADD_DEFINITIONS(-DUSE_TLS)
-ENDIF(WIN32)
-
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY -DHAVE_DLOPEN)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
@@ -141,6 +132,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc ../sql/event_parse_data.cc
+ ../sql/sql_signal.cc ../sql/rpl_handler.cc
${GEN_SOURCES}
${LIB_SOURCES})
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 1f7e6ad8833..ec73741eaaf 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -78,7 +78,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
debug_sync.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc \
- sql_servers.cc event_parse_data.cc
+ sql_servers.cc event_parse_data.cc sql_signal.cc \
+ rpl_handler.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources)
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index b4eddf39c1f..5cbced8a8ff 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -483,7 +483,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= NULL;
data->embedded_info->prev_ptr= prev_row;
return_ok:
- net_send_eof(thd, thd->server_status, thd->total_warn_count);
+ net_send_eof(thd, thd->server_status,
+ thd->warning_info->statement_warn_count());
DBUG_RETURN(0);
err:
DBUG_RETURN(1);
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index 5194836a728..e4b6533f8a2 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -20,9 +20,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include)
# Currently does not work with DBUG, there are missing symbols reported.
-IF(WIN32)
- ADD_DEFINITIONS(-DUSE_TLS)
-ENDIF(WIN32)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 778d4874ad4..1a078d0d0c6 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -98,7 +98,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
thd= (THD *) mysql->thd;
}
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
#endif
@@ -112,7 +112,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
/* Clear result variables */
thd->clear_error();
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
mysql->affected_rows= ~(my_ulonglong) 0;
mysql->field_count= 0;
net_clear_error(net);
@@ -144,13 +144,13 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
thd->mysys_var= 0;
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
return result;
}
-static void emb_flush_use_result(MYSQL *mysql)
+static void emb_flush_use_result(MYSQL *mysql, my_bool)
{
THD *thd= (THD*) mysql->thd;
if (thd->cur_data)
@@ -219,7 +219,7 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt->stmt_id= thd->client_stmt_id;
stmt->param_count= thd->client_param_count;
stmt->field_count= 0;
- mysql->warning_count= thd->total_warn_count;
+ mysql->warning_count= thd->warning_info->statement_warn_count();
if (thd->first_data)
{
@@ -404,7 +404,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
static const char * emb_read_statistics(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
- return thd->is_error() ? thd->main_da.message() : "";
+ return thd->is_error() ? thd->stmt_da->message() : "";
}
@@ -656,7 +656,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
- net_end_statement(thd);
+ thd->protocol->end_statement();
emb_read_query_result(mysql);
return result;
}
@@ -706,9 +706,10 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
err:
{
NET *net= &mysql->net;
- strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
+ strmake(net->last_error, thd->stmt_da->message(),
+ sizeof(net->last_error)-1);
memcpy(net->sqlstate,
- mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
+ mysql_errno_to_sqlstate(thd->stmt_da->sql_errno()),
sizeof(net->sqlstate)-1);
}
return result;
@@ -732,8 +733,8 @@ void THD::clear_data_list()
void THD::clear_error()
{
- if (main_da.is_error())
- main_da.reset_diagnostics_area();
+ if (stmt_da->is_error())
+ stmt_da->reset_diagnostics_area();
}
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
@@ -807,7 +808,7 @@ MYSQL_DATA *THD::alloc_new_dataset()
static
bool
-write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
+write_eof_packet(THD *thd, uint server_status, uint statement_warn_count)
{
if (!thd->mysql) // bootstrap file handling
return FALSE;
@@ -824,7 +825,7 @@ write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
is cleared between substatements, and mysqltest gets confused
*/
thd->cur_data->embedded_info->warning_count=
- (thd->spcont ? 0 : min(total_warn_count, 65535));
+ (thd->spcont ? 0 : min(statement_warn_count, 65535));
return FALSE;
}
@@ -881,7 +882,7 @@ void Protocol_text::remove_last_row()
}
-bool Protocol::send_fields(List<Item> *list, uint flags)
+bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
Item *item;
@@ -890,7 +891,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
CHARSET_INFO *thd_cs= thd->variables.character_set_results;
CHARSET_INFO *cs= system_charset_info;
MYSQL_DATA *data;
- DBUG_ENTER("send_fields");
+ DBUG_ENTER("send_result_set_metadata");
if (!thd->mysql) // bootstrap file handling
DBUG_RETURN(0);
@@ -954,7 +955,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs);
client_field->catalog_length= 3;
- if (INTERNAL_NUM_FIELD(client_field))
+ if (IS_NUM(client_field->type))
client_field->flags|= NUM_FLAG;
if (flags & (int) Protocol::SEND_DEFAULTS)
@@ -981,9 +982,10 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
}
if (flags & SEND_EOF)
- write_eof_packet(thd, thd->server_status, thd->total_warn_count);
+ write_eof_packet(thd, thd->server_status,
+ thd->warning_info->statement_warn_count());
- DBUG_RETURN(prepare_for_send(list));
+ DBUG_RETURN(prepare_for_send(list->elements));
err:
my_error(ER_OUT_OF_RESOURCES, MYF(0)); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */
@@ -1043,25 +1045,24 @@ bool Protocol_binary::write()
bool
net_send_ok(THD *thd,
- uint server_status, uint total_warn_count,
- ha_rows affected_rows, ulonglong id, const char *message)
+ uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong id, const char *message)
{
DBUG_ENTER("emb_net_send_ok");
MYSQL_DATA *data;
- bool error;
MYSQL *mysql= thd->mysql;
if (!mysql) // bootstrap file handling
DBUG_RETURN(FALSE);
if (!(data= thd->alloc_new_dataset()))
- return TRUE;
+ DBUG_RETURN(TRUE);
data->embedded_info->affected_rows= affected_rows;
data->embedded_info->insert_id= id;
if (message)
strmake(data->embedded_info->info, message,
sizeof(data->embedded_info->info)-1);
- error= write_eof_packet(thd, server_status, total_warn_count);
+ bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0;
DBUG_RETURN(error);
}
@@ -1078,16 +1079,20 @@ net_send_ok(THD *thd,
*/
bool
-net_send_eof(THD *thd, uint server_status, uint total_warn_count)
+net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{
- bool error= write_eof_packet(thd, server_status, total_warn_count);
+ bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0;
return error;
}
-bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
+bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
+ const char *sqlstate)
{
+ uint error;
+ uchar converted_err[MYSQL_ERRMSG_SIZE];
+ uint32 converted_err_len;
MYSQL_DATA *data= thd->cur_data;
struct embedded_query_result *ei;
@@ -1102,8 +1107,13 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
ei= data->embedded_info;
ei->last_errno= sql_errno;
- strmake(ei->info, err, sizeof(ei->info)-1);
- strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno));
+ converted_err_len= convert_error_message((char*)converted_err,
+ sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err),
+ system_charset_info, &error);
+ strmake(ei->info, (const char*) converted_err, sizeof(ei->info)-1);
+ strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;
return FALSE;
@@ -1176,3 +1186,27 @@ int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
mysql_server_last_errno= CR_UNKNOWN_ERROR;
return 0;
}
+
+
+bool Protocol::net_store_data(const uchar *from, size_t length,
+ CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
+{
+ uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
+ uint dummy_error;
+ char *field_buf;
+ if (!thd->mysql) // bootstrap file handling
+ return false;
+
+ if (!(field_buf= (char*) alloc_root(alloc, conv_length + sizeof(uint) + 1)))
+ return true;
+ *next_field= field_buf + sizeof(uint);
+ length= copy_and_convert(*next_field, conv_length, to_cs,
+ (const char*) from, length, from_cs, &dummy_error);
+ *(uint *) field_buf= length;
+ (*next_field)[length]= 0;
+ if (next_mysql_field->max_length < length)
+ next_mysql_field->max_length= length;
+ ++next_field;
+ ++next_mysql_field;
+ return false;
+}
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index 0c20b35236d..bca076fa938 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -28,6 +28,7 @@
#include <sys/stat.h>
#include <signal.h>
#include <time.h>
+#include <sql_common.h>
#include "client_settings.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
@@ -77,17 +78,6 @@ static my_bool is_NT(void)
}
#endif
-/**************************************************************************
-** Shut down connection
-**************************************************************************/
-
-static void end_server(MYSQL *mysql)
-{
- DBUG_ENTER("end_server");
- free_old_query(mysql);
- DBUG_VOID_RETURN;
-}
-
int mysql_init_character_set(MYSQL *mysql);
@@ -99,11 +89,18 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
char name_buff[USERNAME_LENGTH];
DBUG_ENTER("mysql_real_connect");
- DBUG_PRINT("enter",("host: %s db: %s user: %s",
+ DBUG_PRINT("enter",("host: %s db: %s user: %s (libmysqld)",
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
+ /* Test whether we're already connected */
+ if (mysql->server_version)
+ {
+ set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
+ DBUG_RETURN(0);
+ }
+
if (!host || !host[0])
host= mysql->options.host;
@@ -216,7 +213,7 @@ error:
{
/* Free alloced memory */
my_bool free_me=mysql->free_me;
- end_server(mysql);
+ free_old_query(mysql);
mysql->free_me=0;
mysql_close(mysql);
mysql->free_me=free_me;
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 047cfe0fe57..d7f98f8b32b 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -13,9 +13,7 @@ EXPORTS
mysql_commit
mysql_data_seek
mysql_debug
- mysql_disable_rpl_parse
mysql_dump_debug_info
- mysql_enable_rpl_parse
mysql_eof
mysql_errno
mysql_error
@@ -61,8 +59,6 @@ EXPORTS
mysql_rollback
mysql_row_seek
mysql_row_tell
- mysql_rpl_parse_enabled
- mysql_rpl_probe
mysql_select_db
mysql_send_query
mysql_shutdown
diff --git a/server-tools/Makefile.am b/libservices/CMakeLists.txt
index 96e9d5a946e..ddfa2495ade 100644
--- a/server-tools/Makefile.am
+++ b/libservices/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2006 MySQL AB
+# Copyright (C) 2006 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,8 +13,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SUBDIRS = . instance-manager
-DIST_SUBDIRS = . instance-manager
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+SET(MYSQLSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c)
+
+ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
diff --git a/libservices/HOWTO b/libservices/HOWTO
new file mode 100644
index 00000000000..b4960cb11dc
--- /dev/null
+++ b/libservices/HOWTO
@@ -0,0 +1,100 @@
+How to create a new service
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A "service" is a set of C functions in a structure that a
+service dynamic linker uses when a dynamic plugin is loaded.
+
+If you want to export C++ class you need to provide an
+extern "C" function that will create a new instance of your class,
+and put it in a service.
+
+Data structures are not part of the service structure, but they are part
+of the API you create and usually need to be declared in the same
+service_*.h file.
+
+To turn a set of functions (foo_func1, foo_func2)
+into a service "foo" you need to
+
+1. create a new file include/mysql/service_foo.h
+
+2. the template is
+==================================================================
+ #ifndef MYSQL_SERVICE_FOO_INCLUDED
+ /* standard GPL header */
+
+ /**
+ @file
+ *exhaustive* description of the interface you provide.
+ This file is the main user documentation of the new service
+ */
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ extern struct foo_service_st {
+ int (*foo_func1_type)(...); /* fix the prototype as appropriate */
+ void (*foo_func2_type)(...); /* fix the prototype as appropriate */
+ } *foo_service;
+
+ #ifdef MYSQL_DYNAMIC_PLUGIN
+
+ #define foo_func1(...) foo_service->foo_func1_type(...)
+ #define foo_func2(...) foo_service->foo_func2_type(...)
+
+ #else
+
+ int foo_func1_type(...); /* fix the prototype as appropriate */
+ void foo_func2_type(...); /* fix the prototype as appropriate */
+
+ #endif
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+ #define MYSQL_SERVICE_FOO_INCLUDED
+ #endif
+==================================================================
+
+the service_foo.h file should be self-contained, if it needs system headers -
+include them in it, e.g. if you use size_t - #include <stdlib.h>
+
+it should also declare all the accompanying data structures, as necessary
+(e.g. thd_alloc_service declares MYSQL_LEX_STRING).
+
+3. add the new file to include/Makefile.am (pkginclude_HEADERS)
+4. add the new file to include/mysql/services.h
+5. increase the minor plugin ABI version in include/mysql/plugin.h
+ (MYSQL_PLUGIN_INTERFACE_VERSION = MYSQL_PLUGIN_INTERFACE_VERSION+1)
+6. add the version of your service to include/service_versions.h:
+==================================================================
+ #define VERSION_foo 0x0100
+==================================================================
+
+7. create a new file libservices/foo_service.h using the following template:
+==================================================================
+ /* GPL header */
+ #include <service_versions.h>
+ SERVICE_VERSION *foo_service= (void*)VERSION_foo;
+==================================================================
+
+8. add the new file to libservices/CMakeLists.txt (MYSQLSERVICES_SOURCES)
+9. add the new file to libservices/Makefile.am (libmysqlservices_a_SOURCES)
+10. and finally, register your service for dynamic linking in
+ sql/sql_plugin_services.h
+10.1 fill in the service structure:
+==================================================================
+ static struct foo_service_st foo_handler = {
+ foo_func1,
+ foo_func2
+ }
+==================================================================
+
+10.2 and add it to the list of services
+
+==================================================================
+ { "foo_service", VERSION_foo, &foo_handler }
+==================================================================
+
+that's all.
+
diff --git a/libservices/Makefile.am b/libservices/Makefile.am
new file mode 100644
index 00000000000..642081859c1
--- /dev/null
+++ b/libservices/Makefile.am
@@ -0,0 +1,19 @@
+# Copyright 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+pkglib_LIBRARIES = libmysqlservices.a
+libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c
+EXTRA_DIST = CMakeLists.txt
diff --git a/server-tools/instance-manager/angel.h b/libservices/my_snprintf_service.c
index db21c250972..40d778e4b8d 100644
--- a/server-tools/instance-manager/angel.h
+++ b/libservices/my_snprintf_service.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2006 MySQL AB
+/* Copyright (C) 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,22 +13,5 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef INCLUDES_MYSQL_ANGEL_H
-#define INCLUDES_MYSQL_ANGEL_H
-
-#ifndef __WIN__
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-#include <my_global.h>
-
-class Angel
-{
-public:
- static int main();
-};
-
-#endif // INCLUDES_MYSQL_ANGEL_H
-#endif // __WIN__
+#include <service_versions.h>
+SERVICE_VERSION my_snprintf_service= (void*)VERSION_my_snprintf;
diff --git a/server-tools/instance-manager/IMService.h b/libservices/thd_alloc_service.c
index aceafb2fca6..5d4d496774c 100644
--- a/server-tools/instance-manager/IMService.h
+++ b/libservices/thd_alloc_service.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,22 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#pragma once
-#include "WindowsService.h"
-
-class IMService: public WindowsService
-{
-public:
- static int main();
-
-private:
- IMService(void);
- ~IMService(void);
-
-protected:
- void Log(const char *msg);
- void Stop();
- void Run(DWORD argc, LPTSTR *argv);
-};
+#include <service_versions.h>
+SERVICE_VERSION *thd_alloc_service= (void*)VERSION_thd_alloc;
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 680a1ed268e..363d47f079b 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -15,7 +15,9 @@ main.plugin # Bug#47146 Linking problem with exampl
main.plugin_load # Bug#47146
rpl.rpl_cross_version* # Bug#48340 2009-12-01 Daogang rpl_cross_version: Found warnings/errors in server log file!
-rpl.rpl_get_master_version_and_clock* # Bug #49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed
+rpl.rpl_get_master_version_and_clock* # Bug#49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed
+rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
+rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
rpl.rpl_innodb_bug28430* # Bug#46029
rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
rpl.rpl_plugin_load* @solaris # Bug#47146
diff --git a/mysql-test/collections/mysql-next-mr.push b/mysql-test/collections/mysql-next-mr.push
new file mode 100644
index 00000000000..97101d5994c
--- /dev/null
+++ b/mysql-test/collections/mysql-next-mr.push
@@ -0,0 +1,5 @@
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index b819996acb0..b79093b6740 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -43,10 +43,10 @@ commit;
drop table t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
-show binlog events in 'master-bin.000001' from 106;
+show binlog events in 'master-bin.000001' from 107;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
-show binlog events in 'master-bin.000002' from 106;
+show binlog events in 'master-bin.000002' from 107;
#
diff --git a/mysql-test/extra/binlog_tests/implicit.test b/mysql-test/extra/binlog_tests/implicit.test
new file mode 100644
index 00000000000..84d80288d36
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/implicit.test
@@ -0,0 +1,28 @@
+# First part: outside a transaction
+RESET MASTER;
+eval $prepare;
+
+INSERT INTO t1 VALUES (1);
+source include/show_binlog_events.inc;
+eval $statement;
+source include/show_binlog_events.inc;
+if (`select '$cleanup' != ''`) {
+ eval $cleanup;
+}
+
+# Second part: inside a transaction
+RESET MASTER;
+eval $prepare;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+source include/show_binlog_events.inc;
+eval $statement;
+source include/show_binlog_events.inc;
+INSERT INTO t1 VALUES (3);
+source include/show_binlog_events.inc;
+COMMIT;
+source include/show_binlog_events.inc;
+if (`select '$cleanup' != ''`) {
+ eval $cleanup;
+}
+
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
index 5db79e4f848..da0b77fbc23 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -323,12 +323,12 @@ let $MYSQLD_DATADIR= `select @@datadir`;
# and does not make slave to stop)
if (`select @@binlog_format = 'ROW'`)
{
- --exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=525 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
- --exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=556 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 7db12600456..e159242ed10 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -72,7 +72,7 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+--query_vertical show slave status;
# Trigger error again to test CHANGE MASTER
@@ -94,7 +94,7 @@ change master to master_user='test';
change master to master_user='root';
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+--query_vertical show slave status;
# Trigger error again to test RESET SLAVE
@@ -116,7 +116,7 @@ stop slave;
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+--query_vertical show slave status;
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index e4ebfd68761..0517fea1be3 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -37,13 +37,13 @@ select count(*) from t1;
show binlog events;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 1;
+show binlog events from 107 limit 1;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 2;
+show binlog events from 107 limit 2;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 2,1;
+show binlog events from 107 limit 2,1;
flush logs;
# We need an extra update before doing save_master_pos.
diff --git a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
new file mode 100644
index 00000000000..50036e564a7
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
@@ -0,0 +1,121 @@
+-- connection master
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
+let $binary_log_file= master-bin.000001;
+-- source include/show_binlog_events.inc
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_binlog_events.inc
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+let $binary_log_file= ;
+let $binary_log_limit_row= 3;
+-- source include/show_binlog_events.inc
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+let $binary_log_file= ;
+let $binary_log_limit_row= 3;
+let $binary_log_limit_offset= 1;
+-- source include/show_binlog_events.inc
+
+# clear show_binlog_event/show_relaylog_events parameters
+let $binary_log_file= ;
+let $binary_log_limit_row= ;
+let $binary_log_limit_offset= ;
+
+-- sync_slave_with_master
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+let $binary_log_file= slave-bin.000001;
+-- source include/show_binlog_events.inc
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_binlog_events.inc
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+let $binary_log_file= ;
+let $binary_log_limit_row= 3;
+-- source include/show_binlog_events.inc
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+let $binary_log_file= ;
+let $binary_log_limit_row= 3;
+let $binary_log_limit_offset= 1;
+-- source include/show_binlog_events.inc
+
+# clear show_binlog_event/show_relaylog_events parameters
+let $binary_log_file= ;
+let $binary_log_limit_row= ;
+let $binary_log_limit_offset= ;
+
+-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+let $binary_log_file= slave-relay-bin.000003;
+-- source include/show_relaylog_events.inc
+
+-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_relaylog_events.inc
+
+-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
+let $binary_log_file= slave-relay-bin.000003;
+let $binary_log_limit_row= 3;
+let $binary_log_limit_offset= ;
+-- source include/show_relaylog_events.inc
+
+-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+let $binary_log_file= slave-relay-bin.000003;
+let $binary_log_limit_offset= 1;
+let $binary_log_limit_row= 3;
+-- source include/show_relaylog_events.inc
+
+FLUSH LOGS;
+
+-- connection master
+FLUSH LOGS;
+DROP TABLE t1;
+
+# clear show_binlog_event/show_relaylog_events parameters
+let $binary_log_file= ;
+let $binary_log_limit_row= ;
+let $binary_log_limit_offset= ;
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
+let $binary_log_file= master-bin.000002;
+-- source include/show_binlog_events.inc
+
+-- echo [MASTER] ********* SOW BINLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_binlog_events.inc
+
+-- sync_slave_with_master
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+let $binary_log_file= slave-bin.000002;
+-- source include/show_binlog_events.inc
+
+-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_binlog_events.inc
+
+-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+let $binary_log_file= slave-relay-bin.000005;
+-- source include/show_relaylog_events.inc
+
+-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
+let $binary_log_file= ;
+-- source include/show_relaylog_events.inc
+
+# clear show_binlog_event/show_relaylog_events parameters
+let $binary_log_name= ;
+let $binary_log_limit_row= ;
+let $binary_log_limit_offset= ;
diff --git a/mysql-test/include/bug38347.inc b/mysql-test/include/bug38347.inc
new file mode 100644
index 00000000000..ca1dbfa1bd2
--- /dev/null
+++ b/mysql-test/include/bug38347.inc
@@ -0,0 +1,21 @@
+
+--echo
+SHOW GRANTS FOR mysqltest_u1@localhost;
+
+--echo
+--echo # connection: con1 (mysqltest_u1@mysqltest_db1)
+--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
+--connection con1
+
+--echo
+SHOW CREATE TABLE t1;
+
+--echo
+--echo # connection: default
+--connection default
+
+--disconnect con1
+
+--echo
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf
new file mode 100644
index 00000000000..38f0d39127a
--- /dev/null
+++ b/mysql-test/include/default_client.cnf
@@ -0,0 +1,19 @@
+#
+# We use default-character-set=latin1 to avoid character set auto-detection
+# when running tests - not to depend on the current machine localization.
+#
+
+[mysql]
+default-character-set=latin1
+
+[mysqlshow]
+default-character-set=latin1
+
+[mysqlimport]
+default-character-set=latin1
+
+[mysqlcheck]
+default-character-set=latin1
+
+[mysql_upgrade]
+default-character-set=latin1
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index d77fee0e200..428c2166947 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -1,5 +1,6 @@
# Use default setting for mysqld processes
!include default_mysqld.cnf
+!include default_client.cnf
[mysqld.1]
diff --git a/mysql-test/include/have_community_features.inc b/mysql-test/include/have_community_features.inc
deleted file mode 100644
index 66697d8dd00..00000000000
--- a/mysql-test/include/have_community_features.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require r/have_community_features.require
---disable_query_log
-show variables like 'have_community_features';
---enable_query_log
diff --git a/mysql-test/include/have_nodebug.inc b/mysql-test/include/have_nodebug.inc
new file mode 100644
index 00000000000..3a5b073cd2e
--- /dev/null
+++ b/mysql-test/include/have_nodebug.inc
@@ -0,0 +1,4 @@
+-- require r/have_nodebug.require
+disable_query_log;
+select (version() like '%debug%') as debug;
+enable_query_log;
diff --git a/mysql-test/include/have_profiling.inc b/mysql-test/include/have_profiling.inc
new file mode 100644
index 00000000000..48f6668ff92
--- /dev/null
+++ b/mysql-test/include/have_profiling.inc
@@ -0,0 +1,4 @@
+--require r/have_profiling.require
+--disable_query_log
+show variables like 'have_profiling';
+--enable_query_log
diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc
new file mode 100644
index 00000000000..37c9a744b6a
--- /dev/null
+++ b/mysql-test/include/have_semisync_plugin.inc
@@ -0,0 +1,22 @@
+#
+# Check if dynamic loading is supported
+#
+--require r/have_dynamic_loading.require
+disable_query_log;
+show variables like 'have_dynamic_loading';
+enable_query_log;
+
+#
+# Check if the variable SEMISYNC_MASTER_PLUGIN is set
+#
+if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`)
+{
+ skip Need semisync plugins;
+}
+
+#
+# Check if --plugin-dir was setup for semisync
+#
+if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) {
+ --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use)
+}
diff --git a/mysql-test/include/have_ssl_communication.inc b/mysql-test/include/have_ssl_communication.inc
new file mode 100644
index 00000000000..6f2d5587a75
--- /dev/null
+++ b/mysql-test/include/have_ssl_communication.inc
@@ -0,0 +1,4 @@
+-- require r/have_ssl.require
+disable_query_log;
+show variables like 'have_ssl';
+enable_query_log;
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index e0eb87f02f7..25e0150dd0a 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -8,5 +8,7 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-- source include/master-slave-reset.inc
+connection master;
+sync_slave_with_master;
# Set the default connection to 'master'
connection master;
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 1842d5412bb..baa041aa058 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -1,11 +1,13 @@
############### include/query_cache_sql_prepare.inc ################
#
# This is to see how statements prepared via the PREPARE SQL command
-# go into the query cache: if using parameters they cannot; if not
-# using parameters they can.
+# go into the query cache.
# Query cache is abbreviated as "QC"
#
# Last update:
+# 2008-05-26 Kostja
+# - Add test coverage for automatic statement reprepare
+#
# 2007-05-03 ML - Move t/query_cache_sql_prepare.test
# to include/query_cache_sql_prepare.inc
# - Create two toplevel tests sourcing this routine
@@ -490,6 +492,37 @@ use test;
--echo
--echo ########################################################################
+--echo #
+--echo # Bug#27430 Crash in subquery code when in PS and table DDL changed
+--echo # after PREPARE
+--echo # Check the effect of automatic reprepare on query cache
+--echo #
+--echo ########################################################################
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+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;
+set @@global.query_cache_size=0;
+alter table t1 add column b int;
+execute stmt;
+set @@global.query_cache_size=100000;
+execute stmt;
+execute stmt;
+--echo #
+--echo # Sic: ALTER TABLE caused an automatic reprepare
+--echo # of the prepared statement. Since the query cache was disabled
+--echo # at the time of reprepare, the new prepared statement doesn't
+--echo # work with it.
+--echo #
+show status like 'Qcache_hits';
+show status like 'Qcache_queries_in_cache';
+--echo # Cleanup
+deallocate prepare stmt;
+drop table t1;
###############################################################################
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index f88806e1079..b11e6afbeca 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -69,7 +69,21 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
# Create relay log file.
copy_file $fake_relay_log $_fake_relay_log;
# Create relay log index.
---exec echo $_fake_filename-fake.000001 > $_fake_relay_index
+
+# After patch for BUG#12190, the filename used in CHANGE MASTER
+# RELAY_LOG_FILE will be automatically added the directory of the
+# relay log before comparison, thus we need to added the directory
+# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
+{
+ eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+}
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
+{
+ eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+}
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc
index 68f913a16a3..fcdc52eaf14 100644
--- a/mysql-test/include/show_binlog_events.inc
+++ b/mysql-test/include/show_binlog_events.inc
@@ -1,10 +1,35 @@
# $binlog_start can be set by caller or take a default value
+# $binary_log_file the name of the log file show
+# $binary_log_limit_row - sets the number of binlog rows to be returned
+# $binary_log_limit_offset - sets the offset where to start returning events
+
+let $show_binlog_events= show binlog events;
if (!$binlog_start)
{
- let $binlog_start=106;
+ # defaults to chop the first event in the binary log
+ let $binlog_start=107;
}
+
+if (!`SELECT '$binary_log_file' = ''`)
+{
+ let $show_binlog_events= $show_binlog_events in '$binary_log_file';
+}
+let $show_binlog_events= $show_binlog_events from $binlog_start;
+
+if ($binary_log_limit_row)
+{
+ let $limit= limit;
+ if ($binary_log_limit_offset)
+ {
+ let $limit= $limit $binary_log_limit_offset, ;
+ }
+
+ let $limit= $limit $binary_log_limit_row;
+ let $show_binlog_events= $show_binlog_events $limit;
+}
+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
---eval show binlog events from $binlog_start
+--eval $show_binlog_events
diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc
index 5dd272c562d..0e1a889bacc 100644
--- a/mysql-test/include/show_binlog_events2.inc
+++ b/mysql-test/include/show_binlog_events2.inc
@@ -1,4 +1,4 @@
---let $binlog_start=106
+--let $binlog_start=107
--replace_result $binlog_start <binlog_start>
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
diff --git a/mysql-test/include/show_relaylog_events.inc b/mysql-test/include/show_relaylog_events.inc
new file mode 100644
index 00000000000..6f63b055d58
--- /dev/null
+++ b/mysql-test/include/show_relaylog_events.inc
@@ -0,0 +1,35 @@
+# $binlog_start can be set by caller or take a default value
+# $binary_log_file the name of the log file show
+# $binary_log_limit_row - sets the number of binlog rows to be returned
+# $binary_log_limit_offset - sets the offset where to start returning events
+
+let $show_binlog_events= show relaylog events;
+
+if (!$binlog_start)
+{
+ # defaults to chop the first event in the binary log
+ let $binlog_start=106;
+}
+
+if (!`SELECT '$binary_log_file' = ''`)
+{
+ let $show_binlog_events= $show_binlog_events in '$binary_log_file';
+}
+let $show_binlog_events= $show_binlog_events from $binlog_start;
+
+if ($binary_log_limit_row)
+{
+ let $limit= limit;
+ if ($binary_log_limit_offset)
+ {
+ let $limit= $limit $binary_log_limit_offset, ;
+ }
+
+ let $limit= $limit $binary_log_limit_row;
+ let $show_binlog_events= $show_binlog_events $limit;
+}
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
+--replace_column 2 # 4 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /Server ver:.*$/SERVER_VERSION, BINLOG_VERSION/
+--eval $show_binlog_events
diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc
index cbe63e26318..606bc63779d 100644
--- a/mysql-test/include/test_fieldsize.inc
+++ b/mysql-test/include/test_fieldsize.inc
@@ -22,7 +22,7 @@ eval $test_insert;
connection slave;
START SLAVE;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index 82e57922913..1e690bdfe9c 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -49,6 +49,8 @@ if (!$_slave_timeout_counter)
{
let $_slave_timeout_counter= 3000;
}
+# Save resulting counter for later use.
+let $slave_tcnt= $_slave_timeout_counter;
let $_slave_param_comparison= $slave_param_comparison;
if (`SELECT '$_slave_param_comparison' = ''`)
@@ -70,7 +72,7 @@ while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_
# This has to be outside the loop until BUG#41913 has been fixed
if (!$_slave_timeout_counter)
{
- --echo **** ERROR: timeout after $slave_timeout seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
+ --echo **** ERROR: timeout after $slave_tcnt deci-seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
if (`SELECT '$slave_error_message' != ''`)
{
--echo Message: $slave_error_message
diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc
index a4362e52d01..8a989becc18 100644
--- a/mysql-test/include/wait_until_disconnected.inc
+++ b/mysql-test/include/wait_until_disconnected.inc
@@ -7,7 +7,7 @@ let $counter= 500;
let $mysql_errno= 0;
while (!$mysql_errno)
{
- --error 0,1053,2002,2006,2013
+ --error 0,1040,1053,2002,2003,2006,2013
show status;
dec $counter;
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index c4d68e7127c..8431a88ef1e 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -40,7 +40,7 @@ sub fix_charset_dir {
sub fix_language {
my ($self, $config, $group_name, $group)= @_;
return my_find_dir($self->get_basedir($group),
- \@share_locations, "english");
+ \@share_locations);
}
sub fix_datadir {
@@ -142,8 +142,9 @@ sub fix_secure_file_priv {
sub fix_std_data {
my ($self, $config, $group_name, $group)= @_;
- my $basedir= $self->get_basedir($group);
- return "$basedir/mysql-test/std_data";
+ return my_find_dir($self->get_basedir($group),
+ ["share/mysql-test", "mysql-test"],
+ "std_data");
}
sub ssl_supported {
@@ -198,7 +199,7 @@ my @mysqld_rules=
{ 'basedir' => sub { return shift->{ARGS}->{basedir}; } },
{ 'tmpdir' => \&fix_tmpdir },
{ 'character-sets-dir' => \&fix_charset_dir },
- { 'language' => \&fix_language },
+ { 'lc-messages-dir' => \&fix_language },
{ 'datadir' => \&fix_datadir },
{ 'pid-file' => \&fix_pidfile },
{ '#host' => \&fix_host },
@@ -357,11 +358,14 @@ sub post_check_client_group {
if (IS_WINDOWS)
{
- # Shared memory base may or may not be defined (e.g not defined in embedded)
- my $shm = $group_to_copy_from->option("shared-memory-base-name");
- if (defined $shm)
+ if (! $self->{ARGS}->{embedded})
{
- $config->insert($client_group_name,"shared-memory-base-name", $shm->value());
+ # Shared memory base may or may not be defined (e.g not defined in embedded)
+ my $shm = $group_to_copy_from->option("shared-memory-base-name");
+ if (defined $shm)
+ {
+ $config->insert($client_group_name,"shared-memory-base-name", $shm->value());
+ }
}
}
}
diff --git a/mysql-test/lib/t/testMyConfigFactory.t b/mysql-test/lib/t/testMyConfigFactory.t
index 16fdd9db539..e3ab5d54b5b 100755
--- a/mysql-test/lib/t/testMyConfigFactory.t
+++ b/mysql-test/lib/t/testMyConfigFactory.t
@@ -67,11 +67,11 @@ is( $config->value('client', 'host'),
ok ( $config->value("mysqld.1", 'character-sets-dir') =~ /$basedir.*charsets$/,
"'character-sets-dir' generated");
-ok ( $config->value("mysqld.1", 'language') =~ /$basedir.*english$/,
- "'language' generated");
+ok ( $config->value("mysqld.1", 'lc-messages-dir') =~ /$basedir.*share$/,
+ "'lc-messages-dir' generated");
ok ( $config->value("ENV", 'MASTER_MY_PORT') =~ /\d/,
- "'language' generated");
+ "'lc-messages-dir' generated");
my $gen2_cnf= "$dir/gen2.cnf";
open(OUT, ">", $gen2_cnf) or die;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 8b14a2afaee..f76cb008c3c 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -820,7 +820,6 @@ sub command_line_setup {
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \$opt_experimental,
- 'skip-im' => \&ignore_option,
# Specify ports
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
@@ -961,12 +960,12 @@ sub command_line_setup {
}
# Look for language files and charsetsdir, use same share
- $path_language= mtr_path_exists("$basedir/share/mysql/english",
- "$basedir/sql/share/english",
- "$basedir/share/english");
+ $path_language= mtr_path_exists("$basedir/share/mysql",
+ "$basedir/sql/share",
+ "$basedir/share");
- my $path_share= dirname($path_language);
+ my $path_share= $path_language;
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
if (using_extern())
@@ -1441,7 +1440,7 @@ sub collect_mysqld_features {
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--datadir=%s", mixed_path($tmpdir));
- mtr_add_arg($args, "--language=%s", $path_language);
+ mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--verbose");
mtr_add_arg($args, "--help");
@@ -1831,6 +1830,44 @@ sub environment_setup {
$ENV{'EXAMPLE_PLUGIN_LOAD'}= "";
}
+ # --------------------------------------------------------------------------
+ # Add the path where mysqld will find semisync plugins
+ # --------------------------------------------------------------------------
+ if (!$opt_embedded_server) {
+ my $semisync_master_filename;
+ my $semisync_slave_filename;
+ if (IS_WINDOWS)
+ {
+ $semisync_master_filename = "semisync_master.dll";
+ $semisync_slave_filename = "semisync_slave.dll";
+ }
+ else
+ {
+ $semisync_master_filename = "libsemisync_master.so";
+ $semisync_slave_filename = "libsemisync_slave.so";
+ }
+ my $lib_semisync_master_plugin=
+ mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename),
+ "$basedir/plugin/semisync/.libs/" . $semisync_master_filename,
+ "$basedir/lib/mysql/plugin/" . $semisync_master_filename);
+ my $lib_semisync_slave_plugin=
+ mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_slave_filename),
+ "$basedir/plugin/semisync/.libs/" . $semisync_slave_filename,
+ "$basedir/lib/mysql/plugin/" . $semisync_slave_filename);
+ if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
+ {
+ $ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin);
+ $ENV{'SEMISYNC_SLAVE_PLUGIN'}= basename($lib_semisync_slave_plugin);
+ $ENV{'SEMISYNC_PLUGIN_OPT'}= "--plugin-dir=".dirname($lib_semisync_master_plugin);
+ }
+ else
+ {
+ $ENV{'SEMISYNC_MASTER_PLUGIN'}= "";
+ $ENV{'SEMISYNC_SLAVE_PLUGIN'}= "";
+ $ENV{'SEMISYNC_PLUGIN_OPT'}="--plugin-dir=";
+ }
+ }
+
# ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so
# ----------------------------------------------------
@@ -2709,7 +2746,7 @@ sub mysql_install_db {
my $install_datadir= $datadir || $mysqld->value('datadir');
my $install_basedir= $mysqld->value('basedir');
- my $install_lang= $mysqld->value('language');
+ my $install_lang= $mysqld->value('lc-messages-dir');
my $install_chsdir= $mysqld->value('character-sets-dir');
mtr_report("Installing system database...");
@@ -2732,7 +2769,7 @@ sub mysql_install_db {
$path_vardir_trace);
}
- mtr_add_arg($args, "--language=%s", $install_lang);
+ mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang);
mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir);
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 06f4e7fbe8a..15171798279 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1339,3 +1339,11 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
End of 5.1 tests
+CREATE TABLE t1(c CHAR(10),
+i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES('a',2),('b',4),('c',6);
+ALTER TABLE t1
+DROP i,
+ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+AUTO_INCREMENT = 1;
+DROP TABLE t1;
diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result
index 79e12afd237..8b67e4be38a 100644
--- a/mysql-test/r/bench_count_distinct.result
+++ b/mysql-test/r/bench_count_distinct.result
@@ -5,7 +5,7 @@ count(distinct n)
100
explain extended select count(distinct n) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index NULL n 4 NULL 200 100.00 Using index
+1 SIMPLE t1 range NULL n 4 NULL 10 100.00 Using index for group-by
Warnings:
Note 1003 select count(distinct `test`.`t1`.`n`) AS `count(distinct n)` from `test`.`t1`
drop table t1;
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 4a5b8fcf4aa..6b0954655e9 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -362,12 +362,12 @@ select cast(19999999999999999999 as signed);
cast(19999999999999999999 as signed)
9223372036854775807
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select cast(-19999999999999999999 as signed);
cast(-19999999999999999999 as signed)
-9223372036854775808
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select -9223372036854775808;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -9223372036854775808 8 20 20 N 32897 0 63
@@ -385,7 +385,7 @@ def -((9223372036854775808)) 8 20 20 N 32897 0 63
-9223372036854775808
select -(-(9223372036854775808));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def -(-(9223372036854775808)) 246 21 19 N 129 0 63
+def -(-(9223372036854775808)) 246 21 19 N 32897 0 63
-(-(9223372036854775808))
9223372036854775808
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index dd61396e485..c53de220b60 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -380,7 +380,7 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
99999.99
Warnings:
-Error 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
+Warning 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
drop table t1;
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
mt mediumtext, lt longtext);
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index f9563b89b76..d931879ce23 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -47,11 +47,11 @@ insert into t1 values (0x01,0x01);
select * from t1 where a=b;
a b
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x01'
select * from t1 where a=b and b=0x01;
a b
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x01'
drop table if exists t1;
CREATE TABLE t1 (b int(2) zerofill, c int(2) zerofill);
INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2);
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index b829ef30fb1..471cc6e9a3d 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1922,3 +1922,37 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
# -- End of Bug#45829
End of 5.1 tests
+
+# --
+# -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
+# -- failed when redefining trigger
+
+CREATE TABLE B (
+pk INTEGER AUTO_INCREMENT,
+int_key INTEGER NOT NULL,
+PRIMARY KEY (pk),
+KEY (int_key)
+);
+INSERT IGNORE INTO B VALUES ('9', '9');
+CREATE TABLE IF NOT EXISTS t1 (
+`pk` INTEGER NOT NULL AUTO_INCREMENT ,
+`int` INTEGER ,
+PRIMARY KEY ( `pk` )
+) SELECT `pk` , `int_key` FROM B ;
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ;
+END ; |
+CREATE TABLE IF NOT EXISTS t1 (
+`pk` INTEGER NOT NULL AUTO_INCREMENT ,
+`int` INTEGER ,
+PRIMARY KEY ( `pk` )
+) SELECT `pk` , `int_key` FROM B ;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+UPDATE A SET `pk`=1 WHERE `pk`=0 ;
+END ;|
+ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
+DROP TABLE t1;
+DROP TABLE B;
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index b42094550bd..67262a4935d 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -548,6 +548,36 @@ SELECT * FROM t1 WHERE s2 = s3;
s1 s2 s3
a A A
DROP TABLE t1;
+create table t1 (a varchar(1) character set latin1 collate latin1_general_ci);
+insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c');
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+create index i on t1 (a);
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+drop table t1;
SET NAMES latin1;
CREATE TABLE t1
(s1 char(10) COLLATE latin1_german1_ci,
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index 044885d1ea7..bb971e5453b 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -29,22 +29,22 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 370|
+SHOW BINLOG EVENTS FROM 371|
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 370 Query 1 536 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
+master-bin.000001 371 Query 1 537 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
-master-bin.000001 536 Query 1 785 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
+master-bin.000001 537 Query 1 786 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 785 Query 1 1049 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
-master-bin.000001 1049 Query 1 1138 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1138 Query 1 1217 use `test`; DROP TABLE t4
+master-bin.000001 786 Query 1 1050 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
+master-bin.000001 1050 Query 1 1139 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1139 Query 1 1218 use `test`; DROP TABLE t4
End of 5.0 tests
-SHOW BINLOG EVENTS FROM 365;
+SHOW BINLOG EVENTS FROM 366;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932;
diff --git a/mysql-test/r/ctype_errors.result b/mysql-test/r/ctype_errors.result
new file mode 100644
index 00000000000..d8218e40e6f
--- /dev/null
+++ b/mysql-test/r/ctype_errors.result
@@ -0,0 +1,32 @@
+Start of 5.4 tests
+CREATE TABLE t1(f1 INT);
+SET lc_messages=ru_RU;
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages ru_RU
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: \0422\0430\0431\043B\0438\0446\0430 't1' \0443\0436\0435 \0441\0443\0449\0435\0441\0442\0432\0443\0435\0442
+SET NAMES utf8;
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: Таблица 't1' уже ÑущеÑтвует
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages en_US
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: Table 't1' already exists
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages en_US
+SET GLOBAL lc_messages=ru_RU;
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages ru_RU
+SET GLOBAL lc_messages=en_US;
+DROP TABLE t1;
+drop table `ק`;
+ERROR 42S02: Unknown table 'ק'
+SET lc_messages=cs_CZ;
+SET NAMES UTF8;
+USE nonexistant;
+ERROR 42000: Nezn-Bámá databáze 'nonexistant'
+End of 5.4 tests
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index d5585dcfad9..00da0db1735 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -5,7 +5,7 @@ Variable_name Value
character_sets_dir MYSQL_TEST_DIR/std_data/
show collation like 'utf8_test_ci';
Collation Charset Id Default Compiled Sortlen
-utf8_test_ci utf8 240 8
+utf8_test_ci utf8 353 8
create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
insert into t1 values ('a');
select * from t1 where c1='b';
@@ -14,7 +14,7 @@ a
drop table t1;
show collation like 'ucs2_test_ci';
Collation Charset Id Default Compiled Sortlen
-ucs2_test_ci ucs2 241 8
+ucs2_test_ci ucs2 358 8
create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
insert into t1 values ('a');
select * from t1 where c1='b';
@@ -56,9 +56,10 @@ INSERT INTO t1 SELECT REPEAT('a',11);
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
DROP TABLE t1;
+Vietnamese experimental collation
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
-ucs2_vn_ci ucs2 242 8
+ucs2_vn_ci ucs2 359 8
create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
insert into t1 values (0x0061),(0x0041),(0x00E0),(0x00C0),(0x1EA3),(0x1EA2),
(0x00E3),(0x00C3),(0x00E1),(0x00C1),(0x1EA1),(0x1EA0);
@@ -337,3 +338,34 @@ latin1_test latin1 99 Yes 1
select "foo" = "foo " collate latin1_test;
"foo" = "foo " collate latin1_test
1
+The following tests check that two-byte collation IDs work
+select * from information_schema.collations where id>256 order by id;
+COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
+utf8_test_ci utf8 353 8
+ucs2_test_ci ucs2 358 8
+ucs2_vn_ci ucs2 359 8
+utf8_maxuserid_ci utf8 2047 8
+show collation like '%test%';
+Collation Charset Id Default Compiled Sortlen
+latin1_test latin1 99 Yes 1
+utf8_test_ci utf8 353 8
+ucs2_test_ci ucs2 358 8
+show collation like 'ucs2_vn_ci';
+Collation Charset Id Default Compiled Sortlen
+ucs2_vn_ci ucs2 359 8
+create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
+insert into t1 values (0x0061);
+set @@character_set_results=NULL;
+select * from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 c1 c1 254 2 2 Y 0 0 359
+c1
+
+drop table t1;
+CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
+s1
+a
+b
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index ee95812c03e..15eb0ad2c55 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -162,10 +162,10 @@ Field Type Null Key Default Extra
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
+ERROR HY000: Invalid utf8 character string: 'good\xD0\xCC\xCF\xC8\xCF'
SET NAMES utf8;
CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
+ERROR HY000: Invalid utf8 character string: 'good\xD0\xCC\xCF\xC8\xCF'
set names latin1;
create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result
index 005d46062fb..af69a9e77d6 100644
--- a/mysql-test/r/ctype_ucs2_def.result
+++ b/mysql-test/r/ctype_ucs2_def.result
@@ -19,7 +19,7 @@ col2 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
INSERT INTO t1 VALUES('A ', 'A ');
-ERROR 23000: Duplicate entry '' for key 'key1'
+ERROR 23000: Duplicate entry 'A -A ' for key 'key1'
DROP TABLE t1;
CREATE TABLE t1 (
c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 6f4ae965ca0..4ff48bd380a 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -363,9 +363,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10)));
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -396,9 +396,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb;
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -430,19 +430,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -453,19 +453,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -483,14 +483,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -519,14 +519,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -549,14 +549,14 @@ unique key a (c(1))
) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -577,9 +577,9 @@ create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10)
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -611,19 +611,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -641,14 +641,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -677,14 +677,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -707,14 +707,14 @@ unique key a (c(1))
) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -1631,27 +1631,27 @@ select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
select char(195 using utf8);
char(195 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'C3'
+Warning 1300 Invalid utf8 character string: 'C3'
select char(196 using utf8);
char(196 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'C4'
+Warning 1300 Invalid utf8 character string: 'C4'
select char(2557 using utf8);
char(2557 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FD'
+Warning 1300 Invalid utf8 character string: 'FD'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
select hex(convert(char(2557 using latin1) using utf8));
hex(convert(char(2557 using latin1) using utf8))
09C3BD
@@ -1815,12 +1815,12 @@ select hex(char(0xFF using utf8));
hex(char(0xFF using utf8))
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: 'FF'
select hex(_utf8 0x616263FF);
ERROR HY000: Invalid utf8 character string: 'FF'
select hex(_utf8 X'616263FF');
@@ -1880,3 +1880,115 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
70000 1092
DROP TABLE t1;
End of 5.0 tests
+Start of 5.4 tests
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+predicted_order int NOT NULL,
+utf8_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8;
+INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
+SELECT predicted_order, hex(utf8_encoding) FROM t1 ORDER BY utf8_encoding COLLATE utf8_sinhala_ci;
+predicted_order hex(utf8_encoding)
+1 E0B7B4
+2 E0B685
+3 E0B686
+4 E0B687
+5 E0B688
+6 E0B689
+7 E0B68A
+8 E0B68B
+9 E0B68C
+10 E0B68D
+11 E0B68E
+12 E0B68F
+13 E0B690
+14 E0B691
+15 E0B692
+16 E0B693
+17 E0B694
+18 E0B695
+19 E0B696
+20 E0B682
+21 E0B683
+22 E0B69A
+23 E0B69AE0B78F
+24 E0B69AE0B790
+25 E0B69AE0B791
+26 E0B69AE0B792
+27 E0B69AE0B793
+28 E0B69AE0B794
+29 E0B69AE0B796
+30 E0B69AE0B798
+31 E0B69AE0B7B2
+32 E0B69AE0B79F
+33 E0B69AE0B7B3
+34 E0B69AE0B799
+35 E0B69AE0B79A
+36 E0B69AE0B79B
+37 E0B69AE0B79C
+38 E0B69AE0B79D
+39 E0B69AE0B79E
+40 E0B69AE0B78A
+41 E0B69B
+42 E0B69C
+43 E0B69D
+44 E0B69E
+45 E0B69F
+46 E0B6A0
+47 E0B6A1
+48 E0B6A2
+49 E0B6A3
+50 E0B6A5
+51 E0B6A4
+52 E0B6A6
+53 E0B6A7
+54 E0B6A8
+55 E0B6A9
+56 E0B6AA
+57 E0B6AB
+58 E0B6AC
+59 E0B6AD
+60 E0B6AE
+61 E0B6AF
+62 E0B6B0
+63 E0B6B1
+64 E0B6B3
+65 E0B6B4
+66 E0B6B5
+67 E0B6B6
+68 E0B6B7
+69 E0B6B8
+70 E0B6B9
+71 E0B6BA
+72 E0B6BB
+73 E0B6BBE0B78AE2808D
+74 E0B6BD
+75 E0B780
+76 E0B781
+77 E0B782
+78 E0B783
+79 E0B784
+80 E0B785
+81 E0B786
+82 E0B78F
+83 E0B790
+84 E0B791
+85 E0B792
+86 E0B793
+87 E0B794
+88 E0B796
+89 E0B798
+90 E0B7B2
+91 E0B79F
+92 E0B7B3
+93 E0B799
+94 E0B79A
+95 E0B79B
+96 E0B79C
+97 E0B79D
+98 E0B79E
+99 E0B78A
+100 E0B78AE2808DE0B6BA
+101 E0B78AE2808DE0B6BB
+DROP TABLE t1;
+End of 5.4 tests
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 7e185daa668..b0b8316fe33 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -89,7 +89,7 @@ select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')
NULL
Warnings:
-Error 1411 Incorrect time value: '22.30.61' for function str_to_date
+Warning 1411 Incorrect time value: '22.30.61' for function str_to_date
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
@@ -361,21 +361,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
@@ -395,21 +395,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
truncate table t1;
insert into t1 values
('10:20:10AM', '%h:%i:%s'),
@@ -449,7 +449,7 @@ select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'))
NULL
Warnings:
-Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
+Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index fe24c17a1c5..66ef4df32eb 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1323,7 +1323,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1596,7 +1596,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2031,7 +2031,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2226,7 +2226,7 @@ END|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2239,7 +2239,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2252,7 +2252,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2265,7 +2265,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2361,7 +2361,7 @@ set names koi8r|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2374,7 +2374,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2387,7 +2387,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2400,7 +2400,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2634,7 +2634,7 @@ set names koi8r|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2647,7 +2647,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2660,7 +2660,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2673,7 +2673,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index cf4272bf90c..f1f9592f5cf 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'теÑÑ‚' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'теÑÑ‚' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'теÑÑ‚' AS `теÑÑ‚` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -1323,7 +1323,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1596,7 +1596,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -2031,7 +2031,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10);
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(перем1));
INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
@@ -2226,7 +2226,7 @@ END|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2239,7 +2239,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2252,7 +2252,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2265,7 +2265,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2361,7 +2361,7 @@ set names utf8|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2374,7 +2374,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2387,7 +2387,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2400,7 +2400,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2634,7 +2634,7 @@ set names utf8|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2647,7 +2647,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2660,7 +2660,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2673,7 +2673,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10);
SELECT
COLLATION(перем1) AS c1,
@@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
@@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(перем1) AS c1,
diff --git a/mysql-test/r/debug_sync.result b/mysql-test/r/debug_sync.result
index 47e968f79cf..8b46334204c 100644
--- a/mysql-test/r/debug_sync.result
+++ b/mysql-test/r/debug_sync.result
@@ -243,7 +243,7 @@ GRANT ALL ON *.* TO mysqltest_2@localhost;
REVOKE SUPER ON *.* FROM mysqltest_2@localhost;
connection con1, mysqltest_2
SET DEBUG_SYNC= 'RESET';
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
connection default
DROP USER mysqltest_2@localhost;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index d8048a703a2..2bc77c52bec 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -252,7 +252,7 @@ HEX(a)
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT DELAYED INTO t1 SET b= b();
-ERROR 42S22: Unknown column 'b' in 'field list'
+ERROR 42000: FUNCTION test.b does not exist
DROP TABLE t1;
End of 5.0 tests
DROP TABLE IF EXISTS t1,t2;
@@ -323,3 +323,25 @@ Got one of the listed errors
UNLOCK TABLES;
DROP TABLE t1, t2;
End of 5.1 tests
+#
+# Bug #47274 assert in open_table on CREATE TABLE <already existing>
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
+# The following CREATE TABLEs before gave an assert.
+INSERT DELAYED t1 VALUES (4);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+REPLACE DELAYED t1 VALUES (5);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+INSERT DELAYED t1 VALUES (6);
+CREATE TABLE t1 (f1 INTEGER);
+ERROR 42S01: Table 't1' already exists
+CREATE TABLE t2 (f1 INTEGER);
+INSERT DELAYED t1 VALUES (7);
+CREATE TABLE t1 LIKE t2;
+ERROR 42S01: Table 't1' already exists
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/r/drop-no_root.result b/mysql-test/r/drop-no_root.result
new file mode 100644
index 00000000000..3e1f2fe2cf0
--- /dev/null
+++ b/mysql-test/r/drop-no_root.result
@@ -0,0 +1,28 @@
+
+# --
+# -- Bug#26704: Failing DROP DATABASE brings mysql-client out of sync.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(c INT);
+use mysql_test;
+
+chmod 000 mysql_test/t1.frm
+
+DROP DATABASE mysql_test;
+
+SELECT DATABASE();
+DATABASE()
+mysql_test
+
+rm -f mysql_test/t1.MYD mysql_test/t1.MYI
+chmod 666 mysql_test/t1.frm
+rm -f mysql_test/t1.frm
+
+DROP DATABASE mysql_test;
+
+use test;
+
+# -- End of Bug#26704.
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index b798b49dd34..42739b10d50 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -121,3 +121,17 @@ ERROR 42000: Incorrect table name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
use test;
drop database mysqltestbug26703;
End of 5.1 tests
+
+# --
+# -- Bug#37431 (DROP TABLE does not report errors correctly).
+# --
+DROP TABLE IF EXISTS t1;
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+SHOW WARNINGS;
+Level Code Message
+Error 1051 Unknown table 't1'
+
+# --
+# -- End of Bug#37431.
+# --
diff --git a/mysql-test/r/drop_debug.result b/mysql-test/r/drop_debug.result
new file mode 100644
index 00000000000..75346b88bc6
--- /dev/null
+++ b/mysql-test/r/drop_debug.result
@@ -0,0 +1,21 @@
+
+# --
+# -- Bug#43138: DROP DATABASE failure does not clean up message list.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+
+SET SESSION DEBUG = "+d,bug43138";
+
+DROP DATABASE mysql_test;
+Warnings:
+Error 1051 Unknown table 't1'
+
+SET SESSION DEBUG = "-d,bug43138";
+
+# --
+# -- End of Bug#43138.
+# --
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index 022a32d9c9b..d15daf2e4b0 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -55,3 +55,32 @@ Error 1054 Unknown column 'b' in 'field list'
INSERT INTO t1 SELECT b FROM t1;
ERROR 42S22: Unknown column 'b' in 'field list'
DROP TABLE t1;
+SET NAMES utf8;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+SET sql_quote_show_create='TRÃœE';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+SET sql_quote_show_create=TRÃœE;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+SET NAMES latin1;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create='TR.E';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR.E'
+SET sql_quote_show_create=TR.E;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'E'
+SET NAMES binary;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index e7b645f5556..e068158e6ce 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -123,80 +123,80 @@ set names utf8;
CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1;
SHOW CREATE EVENT root6;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root6 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root7 on schedule every 2 year do select 1;
SHOW CREATE EVENT root7;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root7 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8 on schedule every '2:5' year_month do select 1;
SHOW CREATE EVENT root8;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root8 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8_1 on schedule every '2:15' year_month do select 1;
SHOW CREATE EVENT root8_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root8_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1;
SHOW CREATE EVENT root9;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root9 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root10 on schedule every '20:5' day_hour do select 1;
SHOW CREATE EVENT root10;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root10 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root11 on schedule every '20:25' day_hour do select 1;
SHOW CREATE EVENT root11;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root11 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root12 on schedule every '20:25' hour_minute do select 1;
SHOW CREATE EVENT root12;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root12 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13 on schedule every '25:25' hour_minute do select 1;
SHOW CREATE EVENT root13;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root13 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13_1 on schedule every '11:65' hour_minute do select 1;
SHOW CREATE EVENT root13_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root13_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root14 on schedule every '35:35' minute_second do select 1;
SHOW CREATE EVENT root14;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root14 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root15 on schedule every '35:66' minute_second do select 1;
SHOW CREATE EVENT root15;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root15 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root16 on schedule every '35:56' day_minute do select 1;
SHOW CREATE EVENT root16;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root16 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17 on schedule every '35:12:45' day_minute do select 1;
SHOW CREATE EVENT root17;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root17 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17_1 on schedule every '35:25:65' day_minute do select 1;
SHOW CREATE EVENT root17_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root17_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root18 on schedule every '35:12:45' hour_second do select 1;
SHOW CREATE EVENT root18;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root18 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root19 on schedule every '15:59:85' hour_second do select 1;
SHOW CREATE EVENT root19;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root19 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root20 on schedule every '50:20:12:45' day_second do select 1;
SHOW CREATE EVENT root20;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root20 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
set names cp1251;
create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
SHOW CREATE EVENT ðóóò21;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ðóóò21 SYSTEM CREATE EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
+ðóóò21 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
insert into mysql.event (
db,
name,
@@ -271,7 +271,7 @@ event_name
intact_check
SHOW CREATE EVENT intact_check;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
+intact_check SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT no_such_event;
ERROR HY000: Unknown event 'no_such_event'
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index db503f7aa6d..44eaa668b04 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -134,7 +134,7 @@ create event e1 on schedule every 10 hour do select 1;
lock table t1 read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -152,7 +152,7 @@ unlock tables;
lock table t1 write;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -170,7 +170,7 @@ unlock tables;
lock table t1 read, mysql.event read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -188,7 +188,7 @@ unlock tables;
lock table t1 write, mysql.event read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -210,7 +210,7 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
lock table mysql.event write;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 50bfa97c59f..efe6df41ac6 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -16,7 +16,7 @@ DROP EVENT Lower_case;
SET NAMES cp1251;
CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100;
CREATE EVENT ÄîËåÍ_ðåãèñòúð_1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200;
-ERROR HY000: Event 'ДоЛеÐ_региÑÑ‚ÑŠÑ€_1251' already exists
+ERROR HY000: Event 'ÄîËåÍ_ðåãèñòúð_1251' already exists
DROP EVENT ÄîËåÍ_ðåãèñòúð_1251;
SET NAMES utf8;
CREATE EVENT долен_региÑÑ‚ÑŠÑ€_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
@@ -77,7 +77,7 @@ set sql_mode='traditional';
alter event e_16407 do select 1;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
drop event e_16407;
set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
@@ -114,8 +114,8 @@ insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
events_test ee_16407_4
select /*2*/ user, host, db, info from information_schema.processlist
where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
@@ -138,8 +138,8 @@ ee_16407_4 0000-00-00
"OK, last check before we drop them"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
events_test ee_16407_4
drop event ee_16407_2;
drop event ee_16407_3;
@@ -185,8 +185,8 @@ ee_16407_6 2004-02-29
"And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
@@ -375,7 +375,7 @@ SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
ALTER DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 HOUR;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
@@ -386,7 +386,7 @@ event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
DROP EVENT e1;
ERROR HY000: Unknown event 'e1'
DROP USER mysqltest_u1@localhost;
@@ -434,9 +434,9 @@ CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
@@ -444,13 +444,13 @@ events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NU
events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e1 +05:00 CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e2;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e2 -05:00 CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e3;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e3 +00:00 CREATE DEFINER=`root`@`localhost` EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
The following should fail, and nothing should be altered.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00';
diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result
index 1aadf7e11f4..0fb589dfba5 100644
--- a/mysql-test/r/events_grant.result
+++ b/mysql-test/r/events_grant.result
@@ -6,7 +6,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
CREATE DATABASE events_test2;
CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
@@ -59,53 +59,53 @@ USE events_test;
"We should see 4 events : one_event, two_event, three_event & four_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
DROP DATABASE events_test2;
"We should see 3 events : one_event, two_event, three_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
CREATE DATABASE events_test2;
USE events_test2;
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
"Should see 4 events - one, two, three & five"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
USE test;
"Should see 3 events - one, two & three"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
"Let's test ALTER EVENT which changes the definer"
USE events_test;
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
USE events_test;
ALTER EVENT one_event COMMENT "comment";
"The definer should be root@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
ALTER EVENT one_event DO SELECT 12;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
+def events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
"make the definer again root@localhost"
ALTER EVENT one_event COMMENT "new comment";
"test DROP by another user"
@@ -113,9 +113,9 @@ DROP EVENT one_event;
"One event should not be there"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
DROP DATABASE events_test;
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 5a1bf1a1290..3c449cf11a1 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -64,7 +64,7 @@ explain extended select * from v1 where f2=1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
explain extended select * from t1 where 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -74,7 +74,7 @@ explain extended select * from t1 where 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
explain extended select * from t1 having 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
@@ -84,7 +84,7 @@ explain extended select * from t1 having 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual having 1
drop view v1;
drop table t1;
CREATE TABLE t1(c INT);
@@ -210,4 +210,24 @@ Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP colum
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
+#
+# Bug#30302: Tables that were optimized away are printed in the
+# EXPLAIN EXTENDED warning.
+#
+create table t1(f1 int);
+create table t2(f2 int);
+insert into t1 values(1);
+insert into t2 values(1),(2);
+explain extended select * from t1 where f1=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select '1' AS `f1` from dual where 1
+explain extended select * from t1 join t2 on f1=f2 where f1=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select '1' AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where (`test`.`t2`.`f2` = 1)
+drop table t1,t2;
End of 5.1 tests.
diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result
index c7fd7a11877..4348dbd67e5 100644
--- a/mysql-test/r/flush_block_commit_notembedded.result
+++ b/mysql-test/r/flush_block_commit_notembedded.result
@@ -9,13 +9,13 @@ INSERT t1 VALUES (1);
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 107
# Switch to connection con1
COMMIT;
# Switch to connection con2
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 107
UNLOCK TABLES;
# Switch to connection con1
DROP TABLE t1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 6022231907b..df3fc7e050c 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -494,6 +494,14 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
a
City Of God
DROP TABLE t1;
+create table t1(a text,b date,fulltext index(a))engine=myisam;
+insert into t1 set a='water',b='2008-08-04';
+select 1 from t1 where match(a) against ('water' in boolean mode) and b>='2008-08-01';
+1
+1
+drop table t1;
+show warnings;
+Level Code Message
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
('test', 1),('test', 2),('test', 3),('test', 4);
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index b4e61d0e4fc..650cc9c2c70 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -65,8 +65,8 @@ NULL
50000
NULL
Warnings:
-Error 1259 ZLIB: Input data corrupted
-Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
+Warning 1259 ZLIB: Input data corrupted
+Warning 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
@@ -96,12 +96,12 @@ explain select * from t1 where uncompress(a) is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
Warnings:
-Error 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
select * from t1 where uncompress(a) is null;
a
foo
Warnings:
-Error 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
explain select *, uncompress(a) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
@@ -109,13 +109,13 @@ select *, uncompress(a) from t1;
a uncompress(a)
foo NULL
Warnings:
-Error 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
select *, uncompress(a), uncompress(a) is null from t1;
a uncompress(a) uncompress(a) is null
foo NULL 1
Warnings:
-Error 1259 ZLIB: Input data corrupted
-Error 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
drop table t1;
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1), (1111), (11111);
diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result
index a8f59f73e88..68a3a58e63f 100644
--- a/mysql-test/r/func_default.result
+++ b/mysql-test/r/func_default.result
@@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1`
+Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from dual
select * from t1 where str <> default(str);
str strnull intg rel
0 0
diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result
index 8fbf36b45b9..91ff4e218fb 100644
--- a/mysql-test/r/func_encrypt.result
+++ b/mysql-test/r/func_encrypt.result
@@ -124,7 +124,7 @@ select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
@@ -138,12 +138,12 @@ select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
@@ -177,7 +177,7 @@ select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_decrypt'
+Warning 1108 Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/func_encrypt_nossl.result b/mysql-test/r/func_encrypt_nossl.result
index d0df2335afa..fc003eec226 100644
--- a/mysql-test/r/func_encrypt_nossl.result
+++ b/mysql-test/r/func_encrypt_nossl.result
@@ -2,83 +2,83 @@ select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
NULL NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
NULL NULL NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
@@ -90,9 +90,9 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 3b78851a1b9..ebec186591d 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -153,10 +153,10 @@ grp group_concat(c)
4
5 NULL
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
show warnings;
Level Code Message
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
set group_concat_max_len = 1024;
select group_concat(sum(c)) from t1 group by grp;
ERROR HY000: Invalid use of group function
@@ -380,25 +380,29 @@ group_concat(b)
bb,c
BB,C
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,c
BB,C
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
a,bb
A,BB
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 6 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
a,bb
A,BB
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 6 was cut by GROUP_CONCAT()
insert into t1 values (1, concat(repeat('1', 300), '2')),
(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')),
(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')),
@@ -426,25 +430,29 @@ group_concat(b)
bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 7 was cut by GROUP_CONCAT()
+Warning 1260 Row 14 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 5 was cut by GROUP_CONCAT()
+Warning 1260 Row 10 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
drop table t1;
create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
b varchar(255) character set koi8r);
@@ -751,22 +759,22 @@ SELECT GROUP_CONCAT( a ) FROM t1;
GROUP_CONCAT( a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
GROUP_CONCAT( DISTINCT a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
GROUP_CONCAT( a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
GROUP_CONCAT( DISTINCT a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SET group_concat_max_len = DEFAULT;
DROP TABLE t1;
SET group_concat_max_len= 65535;
@@ -979,3 +987,31 @@ GROUP BY t1.a
1
DROP TABLE t1, t2;
End of 5.0 tests
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a VARCHAR(6), b INT);
+CREATE TABLE t2 (a VARCHAR(6), b INT);
+INSERT INTO t1 VALUES ('111111', 1);
+INSERT INTO t1 VALUES ('222222', 2);
+INSERT INTO t1 VALUES ('333333', 3);
+INSERT INTO t1 VALUES ('444444', 4);
+INSERT INTO t1 VALUES ('555555', 5);
+SET group_concat_max_len = 5;
+SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
+SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
+GROUP_CONCAT(a) b
+11111 1
+22222 2
+33333 3
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+ERROR HY000: Row 1 was cut by GROUP_CONCAT()
+UPDATE t1 SET a = '11111' WHERE b = 1;
+UPDATE t1 SET a = '22222' WHERE b = 2;
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+ERROR HY000: Row 3 was cut by GROUP_CONCAT()
+SET group_concat_max_len = DEFAULT;
+SET @@sql_mode = @old_sql_mode;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index fd7ef72409e..33ae2e0a5a4 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -225,27 +225,27 @@ select ln(-1);
ln(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log10(-1);
log10(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log2(-1);
log2(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log(2,-1);
log(2,-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log(-2,1);
log(-2,1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
set sql_mode='';
select round(111,-10);
round(111,-10)
@@ -382,6 +382,9 @@ y
SELECT b DIV 900 y FROM t1 GROUP BY y;
y
0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'str1'
+Warning 1292 Truncated incorrect INTEGER value: 'str2'
SELECT c DIV 900 y FROM t1 GROUP BY y;
y
0
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 54aad23402f..43f90e2e2e6 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -52,7 +52,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from `test`.`t1` where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
+Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from dual where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
select * from t1 where xxx regexp('is a test of some long text to ');
xxx
this is a test of some long text to see what happens
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index bbc5390895b..87b88692a34 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -194,7 +194,7 @@ date("1997-12-31 23:59:59.000001") as f8,
time("1997-12-31 23:59:59.000001") as f9;
describe t1;
Field Type Null Key Default Extra
-f1 date NO 0000-00-00
+f1 date YES NULL
f2 datetime YES NULL
f3 time YES NULL
f4 time YES NULL
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 2a2fe50ad0f..35ce190feb3 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1151,6 +1151,9 @@ INSERT INTO t2 VALUES (0), (1);
SELECT * FROM t1, t2 WHERE num=str;
str num
notnumber 0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
+Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
str num
notnumber 0
@@ -1433,7 +1436,7 @@ select benchmark(-1, 1);
benchmark(-1, 1)
NULL
Warnings:
-Error 1411 Incorrect count value: '-1' for function benchmark
+Warning 1411 Incorrect count value: '-1' for function benchmark
set @password="password";
set @my_data="clear text to encode";
select md5(encode(@my_data, "password"));
@@ -1533,7 +1536,7 @@ select locate('lo','hello',-18446744073709551615);
locate('lo','hello',-18446744073709551615)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551615);
locate('lo','hello',18446744073709551615)
0
@@ -1541,22 +1544,22 @@ select locate('lo','hello',-18446744073709551616);
locate('lo','hello',-18446744073709551616)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551616);
locate('lo','hello',18446744073709551616)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',-18446744073709551617);
locate('lo','hello',-18446744073709551617)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551617);
locate('lo','hello',18446744073709551617)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 10);
left('hello', 10)
hello
@@ -1588,8 +1591,8 @@ select left('hello', -18446744073709551615);
left('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551615);
left('hello', 18446744073709551615)
hello
@@ -1597,26 +1600,26 @@ select left('hello', -18446744073709551616);
left('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551616);
left('hello', 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', -18446744073709551617);
left('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551617);
left('hello', 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 10);
right('hello', 10)
hello
@@ -1648,8 +1651,8 @@ select right('hello', -18446744073709551615);
right('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551615);
right('hello', 18446744073709551615)
hello
@@ -1657,26 +1660,26 @@ select right('hello', -18446744073709551616);
right('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551616);
right('hello', 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', -18446744073709551617);
right('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551617);
right('hello', 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 2, -1);
substring('hello', 2, -1)
@@ -1708,8 +1711,8 @@ select substring('hello', -18446744073709551615, 1);
substring('hello', -18446744073709551615, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 1);
substring('hello', 18446744073709551615, 1)
@@ -1717,26 +1720,26 @@ select substring('hello', -18446744073709551616, 1);
substring('hello', -18446744073709551616, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 1);
substring('hello', 18446744073709551616, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, 1);
substring('hello', -18446744073709551617, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 1);
substring('hello', 18446744073709551617, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -1);
substring('hello', 1, -1)
@@ -1762,8 +1765,8 @@ select substring('hello', 1, -18446744073709551615);
substring('hello', 1, -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551615);
substring('hello', 1, 18446744073709551615)
hello
@@ -1771,26 +1774,26 @@ select substring('hello', 1, -18446744073709551616);
substring('hello', 1, -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551616);
substring('hello', 1, 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -18446744073709551617);
substring('hello', 1, -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551617);
substring('hello', 1, 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -1, -1);
substring('hello', -1, -1)
@@ -1816,10 +1819,10 @@ select substring('hello', -18446744073709551615, -18446744073709551615);
substring('hello', -18446744073709551615, -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 18446744073709551615);
substring('hello', 18446744073709551615, 18446744073709551615)
@@ -1827,34 +1830,34 @@ select substring('hello', -18446744073709551616, -18446744073709551616);
substring('hello', -18446744073709551616, -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 18446744073709551616);
substring('hello', 18446744073709551616, 18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, -18446744073709551617);
substring('hello', -18446744073709551617, -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 18446744073709551617);
substring('hello', 18446744073709551617, 18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, 1, 'hi');
insert('hello', -1, 1, 'hi')
hello
@@ -1880,7 +1883,7 @@ select insert('hello', -18446744073709551615, 1, 'hi');
insert('hello', -18446744073709551615, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 1, 'hi');
insert('hello', 18446744073709551615, 1, 'hi')
hello
@@ -1888,22 +1891,22 @@ select insert('hello', -18446744073709551616, 1, 'hi');
insert('hello', -18446744073709551616, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 1, 'hi');
insert('hello', 18446744073709551616, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, 1, 'hi');
insert('hello', -18446744073709551617, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 1, 'hi');
insert('hello', 18446744073709551617, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -1, 'hi');
insert('hello', 1, -1, 'hi')
hi
@@ -1929,7 +1932,7 @@ select insert('hello', 1, -18446744073709551615, 'hi');
insert('hello', 1, -18446744073709551615, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551615, 'hi');
insert('hello', 1, 18446744073709551615, 'hi')
hi
@@ -1937,22 +1940,22 @@ select insert('hello', 1, -18446744073709551616, 'hi');
insert('hello', 1, -18446744073709551616, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551616, 'hi');
insert('hello', 1, 18446744073709551616, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -18446744073709551617, 'hi');
insert('hello', 1, -18446744073709551617, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551617, 'hi');
insert('hello', 1, 18446744073709551617, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, -1, 'hi');
insert('hello', -1, -1, 'hi')
hello
@@ -1978,8 +1981,8 @@ select insert('hello', -18446744073709551615, -18446744073709551615, 'hi');
insert('hello', -18446744073709551615, -18446744073709551615, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 18446744073709551615, 'hi');
insert('hello', 18446744073709551615, 18446744073709551615, 'hi')
hello
@@ -1987,26 +1990,26 @@ select insert('hello', -18446744073709551616, -18446744073709551616, 'hi');
insert('hello', -18446744073709551616, -18446744073709551616, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 18446744073709551616, 'hi');
insert('hello', 18446744073709551616, 18446744073709551616, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, -18446744073709551617, 'hi');
insert('hello', -18446744073709551617, -18446744073709551617, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 18446744073709551617, 'hi');
insert('hello', 18446744073709551617, 18446744073709551617, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', -1);
repeat('hello', -1)
@@ -2038,8 +2041,8 @@ select repeat('hello', -18446744073709551615);
repeat('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551615);
repeat('hello', 18446744073709551615)
NULL
@@ -2049,27 +2052,27 @@ select repeat('hello', -18446744073709551616);
repeat('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551616);
repeat('hello', 18446744073709551616)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select repeat('hello', -18446744073709551617);
repeat('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551617);
repeat('hello', 18446744073709551617)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-1);
space(-1)
@@ -2102,8 +2105,8 @@ select space(-18446744073709551615);
space(-18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551615);
space(18446744073709551615)
NULL
@@ -2113,27 +2116,27 @@ select space(-18446744073709551616);
space(-18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551616);
space(18446744073709551616)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-18446744073709551617);
space(-18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551617);
space(18446744073709551617)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -1, '1');
rpad('hello', -1, '1')
@@ -2166,8 +2169,8 @@ select rpad('hello', -18446744073709551615, '1');
rpad('hello', -18446744073709551615, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551615, '1');
rpad('hello', 18446744073709551615, '1')
NULL
@@ -2177,27 +2180,27 @@ select rpad('hello', -18446744073709551616, '1');
rpad('hello', -18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551616, '1');
rpad('hello', 18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -18446744073709551617, '1');
rpad('hello', -18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551617, '1');
rpad('hello', 18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -1, '1');
lpad('hello', -1, '1')
@@ -2230,8 +2233,8 @@ select lpad('hello', -18446744073709551615, '1');
lpad('hello', -18446744073709551615, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551615, '1');
lpad('hello', 18446744073709551615, '1')
NULL
@@ -2241,27 +2244,27 @@ select lpad('hello', -18446744073709551616, '1');
lpad('hello', -18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551616, '1');
lpad('hello', 18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -18446744073709551617, '1');
lpad('hello', -18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551617, '1');
lpad('hello', 18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
SET @orig_sql_mode = @@SQL_MODE;
SET SQL_MODE=traditional;
@@ -2269,12 +2272,12 @@ SELECT CHAR(0xff,0x8f USING utf8);
CHAR(0xff,0x8f USING utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
CHAR(0xff,0x8f USING utf8) IS NULL
1
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
SET SQL_MODE=@orig_sql_mode;
select substring('abc', cast(2 as unsigned int));
substring('abc', cast(2 as unsigned int))
@@ -2558,3 +2561,133 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
2 DERIVED t1 ALL NULL NULL NULL NULL 2
drop table t1;
+Start of 5.4 tests
+SELECT format(12345678901234567890.123, 3);
+format(12345678901234567890.123, 3)
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, NULL);
+format(12345678901234567890.123, 3, NULL)
+12,345,678,901,234,567,890.123
+Warnings:
+Warning 1649 Unknown locale: 'NULL'
+SELECT format(12345678901234567890.123, 3, 'ar_AE');
+format(12345678901234567890.123, 3, 'ar_AE')
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, 'ar_SA');
+format(12345678901234567890.123, 3, 'ar_SA')
+12345678901234567890.123
+SELECT format(12345678901234567890.123, 3, 'be_BY');
+format(12345678901234567890.123, 3, 'be_BY')
+12.345.678.901.234.567.890,123
+SELECT format(12345678901234567890.123, 3, 'de_DE');
+format(12345678901234567890.123, 3, 'de_DE')
+12.345.678.901.234.567.890,123
+SELECT format(12345678901234567890.123, 3, 'en_IN');
+format(12345678901234567890.123, 3, 'en_IN')
+1,23,45,67,89,01,23,45,67,890.123
+SELECT format(12345678901234567890.123, 3, 'en_US');
+format(12345678901234567890.123, 3, 'en_US')
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, 'it_CH');
+format(12345678901234567890.123, 3, 'it_CH')
+12'345'678'901'234'567'890,123
+SELECT format(12345678901234567890.123, 3, 'ru_RU');
+format(12345678901234567890.123, 3, 'ru_RU')
+12 345 678 901 234 567 890,123
+SELECT format(12345678901234567890.123, 3, 'ta_IN');
+format(12345678901234567890.123, 3, 'ta_IN')
+1,23,45,67,89,01,23,45,67,890.123
+CREATE TABLE t1 (fmt CHAR(5) NOT NULL);
+INSERT INTO t1 VALUES ('ar_AE');
+INSERT INTO t1 VALUES ('ar_SA');
+INSERT INTO t1 VALUES ('be_BY');
+INSERT INTO t1 VALUES ('de_DE');
+INSERT INTO t1 VALUES ('en_IN');
+INSERT INTO t1 VALUES ('en_US');
+INSERT INTO t1 VALUES ('it_CH');
+INSERT INTO t1 VALUES ('ru_RU');
+INSERT INTO t1 VALUES ('ta_IN');
+SELECT fmt, format(12345678901234567890.123, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890.123, 3, fmt)
+ar_AE 12,345,678,901,234,567,890.123
+ar_SA 12345678901234567890.123
+be_BY 12.345.678.901.234.567.890,123
+de_DE 12.345.678.901.234.567.890,123
+en_IN 1,23,45,67,89,01,23,45,67,890.123
+en_US 12,345,678,901,234,567,890.123
+it_CH 12'345'678'901'234'567'890,123
+ru_RU 12 345 678 901 234 567 890,123
+ta_IN 1,23,45,67,89,01,23,45,67,890.123
+SELECT fmt, format(12345678901234567890.123, 0, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890.123, 0, fmt)
+ar_AE 12,345,678,901,234,567,890
+ar_SA 12345678901234567890
+be_BY 12.345.678.901.234.567.890
+de_DE 12.345.678.901.234.567.890
+en_IN 1,23,45,67,89,01,23,45,67,890
+en_US 12,345,678,901,234,567,890
+it_CH 12'345'678'901'234'567'890
+ru_RU 12 345 678 901 234 567 890
+ta_IN 1,23,45,67,89,01,23,45,67,890
+SELECT fmt, format(12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890, 3, fmt)
+ar_AE 12,345,678,901,234,567,890.000
+ar_SA 12345678901234567890.000
+be_BY 12.345.678.901.234.567.890,000
+de_DE 12.345.678.901.234.567.890,000
+en_IN 1,23,45,67,89,01,23,45,67,890.000
+en_US 12,345,678,901,234,567,890.000
+it_CH 12'345'678'901'234'567'890,000
+ru_RU 12 345 678 901 234 567 890,000
+ta_IN 1,23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-12345678901234567890, 3, fmt)
+ar_AE -12,345,678,901,234,567,890.000
+ar_SA -12345678901234567890.000
+be_BY -12.345.678.901.234.567.890,000
+de_DE -12.345.678.901.234.567.890,000
+en_IN -1,23,45,67,89,01,23,45,67,890.000
+en_US -12,345,678,901,234,567,890.000
+it_CH -12'345'678'901'234'567'890,000
+ru_RU -12 345 678 901 234 567 890,000
+ta_IN -1,23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-02345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-02345678901234567890, 3, fmt)
+ar_AE -2,345,678,901,234,567,890.000
+ar_SA -2345678901234567890.000
+be_BY -2.345.678.901.234.567.890,000
+de_DE -2.345.678.901.234.567.890,000
+en_IN -23,45,67,89,01,23,45,67,890.000
+en_US -2,345,678,901,234,567,890.000
+it_CH -2'345'678'901'234'567'890,000
+ru_RU -2 345 678 901 234 567 890,000
+ta_IN -23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-00345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-00345678901234567890, 3, fmt)
+ar_AE -345,678,901,234,567,890.000
+ar_SA -345678901234567890.000
+be_BY -345.678.901.234.567.890,000
+de_DE -345.678.901.234.567.890,000
+en_IN -3,45,67,89,01,23,45,67,890.000
+en_US -345,678,901,234,567,890.000
+it_CH -345'678'901'234'567'890,000
+ru_RU -345 678 901 234 567 890,000
+ta_IN -3,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-00045678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-00045678901234567890, 3, fmt)
+ar_AE -45,678,901,234,567,890.000
+ar_SA -45678901234567890.000
+be_BY -45.678.901.234.567.890,000
+de_DE -45.678.901.234.567.890,000
+en_IN -45,67,89,01,23,45,67,890.000
+en_US -45,678,901,234,567,890.000
+it_CH -45'678'901'234'567'890,000
+ru_RU -45 678 901 234 567 890,000
+ta_IN -45,67,89,01,23,45,67,890.000
+DROP TABLE t1;
+SELECT format(123, 1, 'Non-existent-locale');
+format(123, 1, 'Non-existent-locale')
+123.0
+Warnings:
+Warning 1649 Unknown locale: 'Non-existent-locale'
+End of 5.4 tests
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index a97e6869d09..96a7bafccfc 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -87,7 +87,7 @@ explain extended select - a from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select -('1') AS `- a` from `test`.`t1`
+Note 1003 select -('1') AS `- a` from dual
drop table t1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 0fa143d95bc..5e72b69c41d 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -814,7 +814,7 @@ create table t1 select last_day('2000-02-05') as a,
from_days(to_days("960101")) as b;
describe t1;
Field Type Null Key Default Extra
-a date NO 0000-00-00
+a date YES NULL
b date YES NULL
select * from t1;
a b
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 92beccd2a9e..542a056c68c 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -13,8 +13,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
grant delete on mysqltest.* to mysqltest_1@localhost;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
@@ -44,15 +44,15 @@ delete from mysql.user where user='mysqltest_1';
flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
@@ -387,10 +387,10 @@ SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
-'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
-'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
-'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
+'mysqltest_3'@'localhost' def mysqltest_1 t1 a UPDATE NO
+'mysqltest_3'@'localhost' def mysqltest_2 t1 c SELECT NO
+'mysqltest_3'@'localhost' def mysqltest_1 t2 b SELECT NO
+'mysqltest_3'@'localhost' def mysqltest_2 t2 d UPDATE NO
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
@@ -403,7 +403,7 @@ SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_CATALOG,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_3'@'localhost' NULL USAGE NO
+'mysqltest_3'@'localhost' def USAGE NO
update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1'
update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
@@ -483,6 +483,7 @@ Show view Tables To see views with SHOW CREATE VIEW
Shutdown Server Admin To shut down the server
Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
Trigger Tables To use triggers
+Create tablespace Server Admin To create/alter/drop tablespaces
Update Tables To update existing rows
Usage Server Admin No privileges - allow connect only
create database mysqltest;
@@ -710,8 +711,8 @@ GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL mysqltest SELECT NO
-'mysqltest_8'@'' NULL mysqltest SELECT NO
+'mysqltest_8'@'%' def mysqltest SELECT NO
+'mysqltest_8'@'' def mysqltest SELECT NO
select * from t1;
a
revoke select on mysqltest.* from mysqltest_8@'';
@@ -762,8 +763,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL test t1 a UPDATE NO
-'mysqltest_8'@'' NULL test t1 a UPDATE NO
+'mysqltest_8'@'%' def test t1 a UPDATE NO
+'mysqltest_8'@'' def test t1 a UPDATE NO
select * from t1;
a
revoke update (a) on t1 from mysqltest_8@'';
@@ -805,8 +806,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL test t1 UPDATE NO
-'mysqltest_8'@'' NULL test t1 UPDATE NO
+'mysqltest_8'@'%' def test t1 UPDATE NO
+'mysqltest_8'@'' def test t1 UPDATE NO
select * from t1;
a
revoke update on t1 from mysqltest_8@'';
@@ -844,9 +845,9 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'host8' NULL USAGE NO
-'mysqltest_8'@'%' NULL USAGE NO
-'mysqltest_8'@'' NULL USAGE NO
+'mysqltest_8'@'host8' def USAGE NO
+'mysqltest_8'@'%' def USAGE NO
+'mysqltest_8'@'' def USAGE NO
select * from t1;
a
flush privileges;
@@ -869,8 +870,8 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'host8' NULL USAGE NO
-'mysqltest_8'@'%' NULL USAGE NO
+'mysqltest_8'@'host8' def USAGE NO
+'mysqltest_8'@'%' def USAGE NO
drop user mysqltest_8;
connect(localhost,mysqltest_8,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_8'@'localhost' (using password: NO)
@@ -914,13 +915,13 @@ SHOW CREATE VIEW mysqltest2.v_ny;
View Create View character_set_client collation_connection
v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` latin1 latin1_swedish_ci
SHOW CREATE TABLE mysqltest3.t_nn;
-ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
+ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
SHOW CREATE VIEW mysqltest3.t_nn;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
SHOW CREATE VIEW mysqltest3.v_nn;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
SHOW CREATE TABLE mysqltest3.v_nn;
-ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
+ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
SHOW CREATE TABLE mysqltest2.t_nn;
Table Create Table
t_nn CREATE TABLE `t_nn` (
@@ -1413,3 +1414,713 @@ DROP USER 'user1';
DROP USER 'user1'@'localhost';
DROP USER 'user2';
DROP DATABASE db1;
+#
+# Bug #25863 No database selected error, but documentation
+# says * for global allowed
+#
+GRANT ALL ON * TO mysqltest_1;
+ERROR 3D000: No database selected
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+USE test;
+GRANT ALL ON * TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
+GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+#########################################################################
+#
+# Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
+#
+#########################################################################
+
+# --
+# -- Prepare the environment.
+# --
+DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.columns_priv WHERE User LIKE 'mysqltest_%';
+FLUSH PRIVILEGES;
+DROP DATABASE IF EXISTS mysqltest_db1;
+CREATE DATABASE mysqltest_db1;
+CREATE TABLE mysqltest_db1.t1(a INT);
+
+# --
+# -- Check that global privileges don't allow SHOW CREATE TABLE.
+# --
+GRANT EVENT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT CREATE TEMPORARY TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT LOCK TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT ALTER ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT CREATE ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT EXECUTE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT FILE ON *.* TO mysqltest_u1@localhost;
+GRANT CREATE USER ON *.* TO mysqltest_u1@localhost;
+GRANT PROCESS ON *.* TO mysqltest_u1@localhost;
+GRANT RELOAD ON *.* TO mysqltest_u1@localhost;
+GRANT REPLICATION CLIENT ON *.* TO mysqltest_u1@localhost;
+GRANT REPLICATION SLAVE ON *.* TO mysqltest_u1@localhost;
+GRANT SHOW DATABASES ON *.* TO mysqltest_u1@localhost;
+GRANT SHUTDOWN ON *.* TO mysqltest_u1@localhost;
+GRANT USAGE ON *.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global SELECT allows SHOW CREATE TABLE.
+# --
+
+GRANT SELECT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SELECT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global INSERT allows SHOW CREATE TABLE.
+# --
+
+GRANT INSERT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INSERT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global UPDATE allows SHOW CREATE TABLE.
+# --
+
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT UPDATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global DELETE allows SHOW CREATE TABLE.
+# --
+
+GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DELETE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global CREATE allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global DROP allows SHOW CREATE TABLE.
+# --
+
+GRANT DROP ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DROP ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global ALTER allows SHOW CREATE TABLE.
+# --
+
+GRANT ALTER ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT ALTER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global INDEX allows SHOW CREATE TABLE.
+# --
+
+GRANT INDEX ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INDEX ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global REFERENCES allows SHOW CREATE TABLE.
+# --
+
+GRANT REFERENCES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT REFERENCES ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global GRANT OPTION allows SHOW CREATE TABLE.
+# --
+
+GRANT GRANT OPTION ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global CREATE VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global SHOW VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT SHOW VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SHOW VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level SELECT allows SHOW CREATE TABLE.
+# --
+
+GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SELECT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level INSERT allows SHOW CREATE TABLE.
+# --
+
+GRANT INSERT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INSERT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level UPDATE allows SHOW CREATE TABLE.
+# --
+
+GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT UPDATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level DELETE allows SHOW CREATE TABLE.
+# --
+
+GRANT DELETE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DELETE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level CREATE allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level DROP allows SHOW CREATE TABLE.
+# --
+
+GRANT DROP ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DROP ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level ALTER allows SHOW CREATE TABLE.
+# --
+
+GRANT ALTER ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT ALTER ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level INDEX allows SHOW CREATE TABLE.
+# --
+
+GRANT INDEX ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INDEX ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level REFERENCES allows SHOW CREATE TABLE.
+# --
+
+GRANT REFERENCES ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT REFERENCES ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level GRANT OPTION allows SHOW CREATE TABLE.
+# --
+
+GRANT GRANT OPTION ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level CREATE VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level SHOW VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT SHOW VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Cleanup.
+# --
+
+DROP DATABASE mysqltest_db1;
+DROP USER mysqltest_u1@localhost;
+
+# End of Bug#38347.
+
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 12269f0cb1c..3032ca854bd 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -121,9 +121,9 @@ mysqltest_5@host5, mysqltest_6@host6, mysqltest_7@host7;
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
set sql_log_off = 1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
set sql_log_bin = 0;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
delete from mysql.user where user like 'mysqltest\_1';
delete from mysql.db where user like 'mysqltest\_1';
drop database mysqltest_1;
@@ -391,7 +391,7 @@ grant all on mysqltest_1.* to mysqltest_u1@localhost;
use mysqltest_2;
create table t1 (i int);
show create table mysqltest_2.t1;
-ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
create table t1 like mysqltest_2.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
new file mode 100644
index 00000000000..28ad9d04151
--- /dev/null
+++ b/mysql-test/r/grant4.result
@@ -0,0 +1,123 @@
+drop database if exists mysqltest_db1;
+create database mysqltest_db1;
+use mysqltest_db1;
+create table t_column_priv_only (a int, b int);
+create table t_select_priv like t_column_priv_only;
+create table t_no_priv like t_column_priv_only;
+grant all privileges on test.* to mysqltest_u1@localhost;
+grant insert (a) on mysqltest_db1.t_column_priv_only to mysqltest_u1@localhost;
+grant select on mysqltest_db1.t_select_priv to mysqltest_u1@localhost;
+** Connect as restricted user mysqltest_u1.
+
+** Test column level privileges only. No SELECT privileges on the table.
+** INSERT INTO ... VALUES ...
+** Attempting to insert values to a table with only column privileges
+** should work.
+insert into mysqltest_db1.t_column_priv_only (a) VALUES (1);
+
+** SHOW COLUMNS
+** Should succeed because we have privileges (any) on at least one of the columns.
+select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_column_priv_only';
+Field Type Null Key Default Extra
+a int(11) YES NULL
+show columns from mysqltest_db1.t_column_priv_only;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+** SHOW COLUMNS
+** Should fail because there are no privileges on any column combination.
+show columns from mysqltest_db1.t_no_priv;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
+** However, select from I_S.COLUMNS will succeed but not show anything:
+select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_no_priv';
+Field Type Null Key Default Extra
+
+** CREATE TABLE ... LIKE ... require SELECT privleges and will fail.
+create table test.t_no_priv like mysqltest_db1.column_priv_only;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'column_priv_only'
+
+** Just to be sure... SELECT also fails.
+select * from mysqltest_db1.t_column_priv_only;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
+
+** SHOW CREATE TABLE ... require any privileges on all columns (the entire table).
+** First we try and fail on a table with only one column privilege.
+show create table mysqltest_db1.t_column_priv_only;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
+
+** Now we do the same on a table with SELECT privileges.
+
+** SHOW COLUMNS
+** Success because we got some privileges on the table (SELECT_ACL)
+show columns from mysqltest_db1.t_select_priv;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b int(11) YES NULL
+
+** CREATE TABLE ... LIKE ... require SELECT privleges and will SUCCEED.
+drop table if exists test.t_duplicated;
+create table test.t_duplicated like mysqltest_db1.t_select_priv;
+drop table test.t_duplicated;
+
+** SHOW CREATE TABLE will succeed because we have a privilege on all columns in the table (table-level privilege).
+show create table mysqltest_db1.t_select_priv;
+Table Create Table
+t_select_priv CREATE TABLE `t_select_priv` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+** SHOW CREATE TABLE will fail if there is no grants at all:
+show create table mysqltest_db1.t_no_priv;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
+
+use mysqltest_db1;
+CREATE TABLE t5 (s1 INT);
+CREATE INDEX i ON t5 (s1);
+CREATE TABLE t6 (s1 INT, s2 INT);
+CREATE VIEW v5 AS SELECT * FROM t5;
+CREATE VIEW v6 AS SELECT * FROM t6;
+CREATE VIEW v2 AS SELECT * FROM t_select_priv;
+CREATE VIEW v3 AS SELECT * FROM t_select_priv;
+CREATE INDEX i ON t6 (s1);
+GRANT UPDATE (s2) ON t6 to mysqltest_u1@localhost;
+GRANT UPDATE (s2) ON v6 to mysqltest_u1@localhost;
+GRANT SHOW VIEW ON v2 to mysqltest_u1@localhost;
+GRANT SHOW VIEW, SELECT ON v3 to mysqltest_u1@localhost;
+use mysqltest_db1;
+** Connect as restricted user mysqltest_u1.
+** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough).
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+def mysqltest_db1 t5 1 mysqltest_db1 i 1 s1 A NULL NULL NULL YES BTREE
+** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column combination.
+SHOW INDEX FROM t5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
+** SHOW INDEX FROM t6 will succeed because there exist a privilege on a column combination on t6.
+SHOW INDEX FROM t6;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t6 1 i 1 s1 A NULL NULL NULL YES BTREE
+** CHECK TABLE requires any privilege on any column combination and should succeed for t6:
+CHECK TABLE t6;
+Table Op Msg_type Msg_text
+mysqltest_db1.t6 check status OK
+** With no privileges access is naturally denied:
+CHECK TABLE t5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
+** CHECKSUM TABLE requires SELECT privileges on the table. The following should fail:
+CHECKSUM TABLE t6;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't6'
+** And this should work:
+CHECKSUM TABLE t_select_priv;
+Table Checksum
+mysqltest_db1.t_select_priv 0
+SHOW CREATE VIEW v5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v5'
+SHOW CREATE VIEW v6;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v6'
+SHOW CREATE VIEW v2;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v2'
+SHOW CREATE VIEW v3;
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
+drop database mysqltest_db1;
+drop user mysqltest_u1@localhost;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 662cc5be034..ba1c2a79ad9 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -1800,23 +1800,23 @@ b
a
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
+1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
+1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 Using where; Using index for group-by (scanning)
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
+1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by
Warnings:
Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`b` = 'c') and (`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
-explain extended select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+explain extended select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
+1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by
Warnings:
-Note 1003 select (ord(`test`.`t1`.`a1`) + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `ord(a1) + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
+Note 1003 select (98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
count(distinct a1,a2,b)
4
@@ -1829,8 +1829,8 @@ count(distinct a1,a2,b)
select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
count(distinct b)
1
-select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
-ord(a1) + count(distinct a1,a2,b)
+select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+98 + count(distinct a1,a2,b)
104
explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
@@ -2525,3 +2525,257 @@ a MAX(b)
2 1
DROP TABLE t;
End of 5.1 tests
+#
+# WL#3220 (Loose index scan for COUNT DISTINCT)
+#
+CREATE TABLE t1 (a INT, b INT, c INT, KEY (a,b));
+INSERT INTO t1 VALUES (1,1,1), (1,2,1), (1,3,1), (1,4,1);
+INSERT INTO t1 SELECT a, b + 4, 1 FROM t1;
+INSERT INTO t1 SELECT a + 1, b, 1 FROM t1;
+CREATE TABLE t2 (a INT, b INT, c INT, d INT, e INT, f INT, KEY (a,b,c));
+INSERT INTO t2 VALUES (1,1,1,1,1,1), (1,2,1,1,1,1), (1,3,1,1,1,1),
+(1,4,1,1,1,1);
+INSERT INTO t2 SELECT a, b + 4, c,d,e,f FROM t2;
+INSERT INTO t2 SELECT a + 1, b, c,d,e,f FROM t2;
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT COUNT(DISTINCT a,b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a,b) FROM t1;
+COUNT(DISTINCT a,b)
+16
+EXPLAIN SELECT COUNT(DISTINCT b,a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b,a) FROM t1;
+COUNT(DISTINCT b,a)
+16
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT COUNT(DISTINCT b) FROM t1;
+COUNT(DISTINCT b)
+8
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+COUNT(DISTINCT a)
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+COUNT(DISTINCT b)
+8
+8
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index; Using filesort
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+COUNT(DISTINCT a)
+2
+2
+2
+2
+2
+2
+2
+2
+EXPLAIN SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+COUNT(DISTINCT a, b + 0)
+16
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+COUNT(DISTINCT a)
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+1
+1
+EXPLAIN SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+1
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1_1 index NULL a 10 NULL 16 Using index; Using temporary; Using filesort
+1 SIMPLE t1_2 index NULL a 10 NULL 16 Using index; Using join buffer
+SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+COUNT(DISTINCT t1_1.a)
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT a), 12 FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a), 12 FROM t1;
+COUNT(DISTINCT a) 12
+2 12
+EXPLAIN SELECT COUNT(DISTINCT a, b, c) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a, b, c) FROM t2;
+COUNT(DISTINCT a, b, c)
+16
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT a)
+2 3 1.5000
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT f)
+2 3 1.0000
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, a)
+16 16
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, f)
+16 8
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, d)
+16 8
+EXPLAIN SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+a c COUNT(DISTINCT c, a, b)
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+EXPLAIN SELECT COUNT(DISTINCT c, a, b) FROM t2
+WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a a 15 NULL 1 Using where; Using index for group-by
+SELECT COUNT(DISTINCT c, a, b) FROM t2
+WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+COUNT(DISTINCT c, a, b)
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref a a 5 const 1 Using where; Using index
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+GROUP BY b;
+COUNT(DISTINCT b) SUM(DISTINCT b)
+EXPLAIN SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+a COUNT(DISTINCT b) SUM(DISTINCT b)
+2 8 36
+2 8 36
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+COUNT(DISTINCT b) SUM(DISTINCT b)
+8 36
+8 36
+EXPLAIN SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
+SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+COUNT(DISTINCT a, b)
+0
+EXPLAIN SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+WHERE b = 13 AND c = 42 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using where; Using index for group-by
+SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+WHERE b = 13 AND c = 42 GROUP BY a;
+a COUNT(DISTINCT a) SUM(DISTINCT a)
+EXPLAIN SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using where; Using index for group-by
+SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+COUNT(DISTINCT a, b) SUM(DISTINCT a)
+0 NULL
+EXPLAIN SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+SUM(DISTINCT a) MAX(b)
+1 8
+2 8
+EXPLAIN SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+42 * (a + c + COUNT(DISTINCT c, a, b))
+126
+126
+126
+126
+126
+126
+126
+168
+168
+168
+168
+168
+168
+168
+168
+168
+EXPLAIN SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+(SUM(DISTINCT a) + MAX(b))
+9
+10
+DROP TABLE t1,t2;
+# end of WL#3220 tests
diff --git a/mysql-test/r/have_community_features.require b/mysql-test/r/have_community_features.require
deleted file mode 100644
index 9233bba91e1..00000000000
--- a/mysql-test/r/have_community_features.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_community_features YES
diff --git a/mysql-test/r/have_nodebug.require b/mysql-test/r/have_nodebug.require
new file mode 100644
index 00000000000..ff251521aa8
--- /dev/null
+++ b/mysql-test/r/have_nodebug.require
@@ -0,0 +1,2 @@
+debug
+0
diff --git a/mysql-test/r/have_profiling.require b/mysql-test/r/have_profiling.require
new file mode 100644
index 00000000000..453ee5bb084
--- /dev/null
+++ b/mysql-test/r/have_profiling.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_profiling YES
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 9c3cc8fc89e..f0b934ebd3a 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0)
+Note 1003 select count('0') AS `b` from dual where 0 having (`b` >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result
new file mode 100644
index 00000000000..248b8d606dc
--- /dev/null
+++ b/mysql-test/r/information_schema-big.result
@@ -0,0 +1,93 @@
+DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
+DROP VIEW IF EXISTS v1;
+#
+# Bug#18925: subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
+#
+SELECT t.table_name, c1.column_name
+FROM information_schema.tables t
+INNER JOIN
+information_schema.columns c1
+ON t.table_schema = c1.table_schema AND
+t.table_name = c1.table_name
+WHERE t.table_schema = 'information_schema' AND
+c1.ordinal_position =
+( SELECT COALESCE(MIN(c2.ordinal_position),1)
+FROM information_schema.columns c2
+WHERE c2.table_schema = t.table_schema AND
+c2.table_name = t.table_name AND
+c2.column_name LIKE '%SCHEMA%'
+ )
+AND t.table_name NOT LIKE 'innodb%';
+table_name column_name
+CHARACTER_SETS CHARACTER_SET_NAME
+COLLATIONS COLLATION_NAME
+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
+COLUMNS TABLE_SCHEMA
+COLUMN_PRIVILEGES TABLE_SCHEMA
+ENGINES ENGINE
+EVENTS EVENT_SCHEMA
+FILES TABLE_SCHEMA
+GLOBAL_STATUS VARIABLE_NAME
+GLOBAL_VARIABLES VARIABLE_NAME
+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARTITIONS TABLE_SCHEMA
+PLUGINS PLUGIN_NAME
+PROCESSLIST ID
+PROFILING QUERY_ID
+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
+ROUTINES ROUTINE_SCHEMA
+SCHEMATA SCHEMA_NAME
+SCHEMA_PRIVILEGES TABLE_SCHEMA
+SESSION_STATUS VARIABLE_NAME
+SESSION_VARIABLES VARIABLE_NAME
+STATISTICS TABLE_SCHEMA
+TABLES TABLE_SCHEMA
+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
+TABLE_PRIVILEGES TABLE_SCHEMA
+TRIGGERS TRIGGER_SCHEMA
+USER_PRIVILEGES GRANTEE
+VIEWS TABLE_SCHEMA
+SELECT t.table_name, c1.column_name
+FROM information_schema.tables t
+INNER JOIN
+information_schema.columns c1
+ON t.table_schema = c1.table_schema AND
+t.table_name = c1.table_name
+WHERE t.table_schema = 'information_schema' AND
+c1.ordinal_position =
+( SELECT COALESCE(MIN(c2.ordinal_position),1)
+FROM information_schema.columns c2
+WHERE c2.table_schema = 'information_schema' AND
+c2.table_name = t.table_name AND
+c2.column_name LIKE '%SCHEMA%'
+ )
+AND t.table_name NOT LIKE 'innodb%';
+table_name column_name
+CHARACTER_SETS CHARACTER_SET_NAME
+COLLATIONS COLLATION_NAME
+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
+COLUMNS TABLE_SCHEMA
+COLUMN_PRIVILEGES TABLE_SCHEMA
+ENGINES ENGINE
+EVENTS EVENT_SCHEMA
+FILES TABLE_SCHEMA
+GLOBAL_STATUS VARIABLE_NAME
+GLOBAL_VARIABLES VARIABLE_NAME
+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARTITIONS TABLE_SCHEMA
+PLUGINS PLUGIN_NAME
+PROCESSLIST ID
+PROFILING QUERY_ID
+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
+ROUTINES ROUTINE_SCHEMA
+SCHEMATA SCHEMA_NAME
+SCHEMA_PRIVILEGES TABLE_SCHEMA
+SESSION_STATUS VARIABLE_NAME
+SESSION_VARIABLES VARIABLE_NAME
+STATISTICS TABLE_SCHEMA
+TABLES TABLE_SCHEMA
+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
+TABLE_PRIVILEGES TABLE_SCHEMA
+TRIGGERS TRIGGER_SCHEMA
+USER_PRIVILEGES GRANTEE
+VIEWS TABLE_SCHEMA
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index ffa9b596d2f..04234eb3cc4 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -9,9 +9,9 @@ create user mysqltest_3@localhost;
create user mysqltest_3;
select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL mtr latin1 latin1_swedish_ci NULL
-NULL mysql latin1 latin1_swedish_ci NULL
-NULL test latin1 latin1_swedish_ci NULL
+def mtr latin1 latin1_swedish_ci NULL
+def mysql latin1 latin1_swedish_ci NULL
+def test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
@@ -162,7 +162,7 @@ t1
t4
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
-NULL mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
+def mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
show keys from t3 where Key_name = "a_data";
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
@@ -189,7 +189,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
show columns from mysqltest.t1 where field like "%a%";
Field Type Null Key Default Extra
a int(11) YES NULL
@@ -394,11 +394,11 @@ show keys from v4;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
select * from information_schema.views where TABLE_NAME like "v%";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v0 select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v1 select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v3 select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v4 select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
drop view v0, v1, v2, v3, v4;
create table t1 (a int);
grant select,update,insert on t1 to mysqltest_1@localhost;
@@ -406,38 +406,38 @@ grant select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@local
grant all on test.* to mysqltest_1@localhost with grant option;
select * from information_schema.USER_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL USAGE NO
+'mysqltest_1'@'localhost' def USAGE NO
select * from information_schema.SCHEMA_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test SELECT YES
-'mysqltest_1'@'localhost' NULL test INSERT YES
-'mysqltest_1'@'localhost' NULL test UPDATE YES
-'mysqltest_1'@'localhost' NULL test DELETE YES
-'mysqltest_1'@'localhost' NULL test CREATE YES
-'mysqltest_1'@'localhost' NULL test DROP YES
-'mysqltest_1'@'localhost' NULL test REFERENCES YES
-'mysqltest_1'@'localhost' NULL test INDEX YES
-'mysqltest_1'@'localhost' NULL test ALTER YES
-'mysqltest_1'@'localhost' NULL test CREATE TEMPORARY TABLES YES
-'mysqltest_1'@'localhost' NULL test LOCK TABLES YES
-'mysqltest_1'@'localhost' NULL test EXECUTE YES
-'mysqltest_1'@'localhost' NULL test CREATE VIEW YES
-'mysqltest_1'@'localhost' NULL test SHOW VIEW YES
-'mysqltest_1'@'localhost' NULL test CREATE ROUTINE YES
-'mysqltest_1'@'localhost' NULL test ALTER ROUTINE YES
-'mysqltest_1'@'localhost' NULL test EVENT YES
-'mysqltest_1'@'localhost' NULL test TRIGGER YES
+'mysqltest_1'@'localhost' def test SELECT YES
+'mysqltest_1'@'localhost' def test INSERT YES
+'mysqltest_1'@'localhost' def test UPDATE YES
+'mysqltest_1'@'localhost' def test DELETE YES
+'mysqltest_1'@'localhost' def test CREATE YES
+'mysqltest_1'@'localhost' def test DROP YES
+'mysqltest_1'@'localhost' def test REFERENCES YES
+'mysqltest_1'@'localhost' def test INDEX YES
+'mysqltest_1'@'localhost' def test ALTER YES
+'mysqltest_1'@'localhost' def test CREATE TEMPORARY TABLES YES
+'mysqltest_1'@'localhost' def test LOCK TABLES YES
+'mysqltest_1'@'localhost' def test EXECUTE YES
+'mysqltest_1'@'localhost' def test CREATE VIEW YES
+'mysqltest_1'@'localhost' def test SHOW VIEW YES
+'mysqltest_1'@'localhost' def test CREATE ROUTINE YES
+'mysqltest_1'@'localhost' def test ALTER ROUTINE YES
+'mysqltest_1'@'localhost' def test EVENT YES
+'mysqltest_1'@'localhost' def test TRIGGER YES
select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test t1 SELECT NO
-'mysqltest_1'@'localhost' NULL test t1 INSERT NO
-'mysqltest_1'@'localhost' NULL test t1 UPDATE NO
+'mysqltest_1'@'localhost' def test t1 SELECT NO
+'mysqltest_1'@'localhost' def test t1 INSERT NO
+'mysqltest_1'@'localhost' def test t1 UPDATE NO
select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test t1 a SELECT NO
-'mysqltest_1'@'localhost' NULL test t1 a INSERT NO
-'mysqltest_1'@'localhost' NULL test t1 a UPDATE NO
-'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
+'mysqltest_1'@'localhost' def test t1 a SELECT NO
+'mysqltest_1'@'localhost' def test t1 a INSERT NO
+'mysqltest_1'@'localhost' def test t1 a UPDATE NO
+'mysqltest_1'@'localhost' def test t1 a REFERENCES NO
delete from mysql.user where user like 'mysqltest%';
delete from mysql.db where user like 'mysqltest%';
delete from mysql.tables_priv where user like 'mysqltest%';
@@ -460,17 +460,17 @@ t1 CREATE TABLE `t1` (
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL test PRIMARY test t1 PRIMARY KEY
-NULL test constraint_1 test t1 UNIQUE
-NULL test key_1 test t1 UNIQUE
-NULL test key_2 test t1 UNIQUE
+def test PRIMARY test t1 PRIMARY KEY
+def test constraint_1 test t1 UNIQUE
+def test key_1 test t1 UNIQUE
+def test key_2 test t1 UNIQUE
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
-NULL test PRIMARY NULL test t1 a 1 NULL NULL NULL NULL
-NULL test constraint_1 NULL test t1 a 1 NULL NULL NULL NULL
-NULL test key_1 NULL test t1 a 1 NULL NULL NULL NULL
-NULL test key_2 NULL test t1 a 1 NULL NULL NULL NULL
+def test PRIMARY def test t1 a 1 NULL NULL NULL NULL
+def test constraint_1 def test t1 a 1 NULL NULL NULL NULL
+def test key_1 def test t1 a 1 NULL NULL NULL NULL
+def test key_2 def test t1 a 1 NULL NULL NULL NULL
select table_name from information_schema.TABLES where table_schema like "test%";
table_name
t1
@@ -491,13 +491,13 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION;
create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
select * from information_schema.views;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
grant select (a) on test.t1 to joe@localhost with grant option;
select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'joe'@'localhost' NULL test t1 a SELECT YES
+'joe'@'localhost' def test t1 a SELECT YES
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
drop view v1, v2, v3;
@@ -592,7 +592,7 @@ proc definer char(77)
proc created timestamp
proc modified timestamp
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
-proc comment char(64)
+proc comment text
proc character_set_client char(32)
proc collation_connection char(32)
proc db_collation char(32)
@@ -641,7 +641,7 @@ TABLE_CONSTRAINTS SYSTEM VIEW
TABLE_PRIVILEGES SYSTEM VIEW
TRIGGERS SYSTEM VIEW
create table t1(a int);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
use test;
show tables;
Tables_in_test
@@ -771,6 +771,7 @@ information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
+information_schema ROUTINES ROUTINE_COMMENT
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema VIEWS VIEW_DEFINITION
@@ -894,17 +895,17 @@ end if;
end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest');
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL test trg1 INSERT NULL test t1 0 NULL begin
+def test trg1 INSERT def test t1 0 NULL begin
if new.j > 10 then
set new.j := 10;
end if;
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL test trg2 UPDATE NULL test t1 0 NULL begin
+def test trg2 UPDATE def test t1 0 NULL begin
if old.i % 2 = 0 then
set new.j := -1;
end if;
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL test trg3 UPDATE NULL test t1 0 NULL begin
+def test trg3 UPDATE def test t1 0 NULL begin
if new.j = -1 then
set @fired:= "Yes";
end if;
@@ -922,14 +923,14 @@ grant select on mysqltest.* to user3@localhost;
grant select on *.* to user4@localhost;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
+'user1'@'localhost' def mysqltest t1 f1 SELECT NO
select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL USAGE NO
+'user1'@'localhost' def USAGE NO
show grants;
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
@@ -938,12 +939,12 @@ select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL mysqltest t2 SELECT NO
+'user2'@'localhost' def mysqltest t2 SELECT NO
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL USAGE NO
+'user2'@'localhost' def USAGE NO
show grants;
Grants for user2@localhost
GRANT USAGE ON *.* TO 'user2'@'localhost'
@@ -954,10 +955,10 @@ select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL mysqltest SELECT NO
+'user3'@'localhost' def mysqltest SELECT NO
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL USAGE NO
+'user3'@'localhost' def USAGE NO
show grants;
Grants for user3@localhost
GRANT USAGE ON *.* TO 'user3'@'localhost'
@@ -965,22 +966,22 @@ GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
select * from information_schema.column_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
+'user1'@'localhost' def mysqltest t1 f1 SELECT NO
select * from information_schema.table_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL mysqltest t2 SELECT NO
+'user2'@'localhost' def mysqltest t2 SELECT NO
select * from information_schema.schema_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL mysqltest SELECT NO
+'user3'@'localhost' def mysqltest SELECT NO
select * from information_schema.user_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL USAGE NO
-'user2'@'localhost' NULL USAGE NO
-'user3'@'localhost' NULL USAGE NO
-'user4'@'localhost' NULL SELECT NO
+'user1'@'localhost' def USAGE NO
+'user2'@'localhost' def USAGE NO
+'user3'@'localhost' def USAGE NO
+'user4'@'localhost' def SELECT NO
show grants;
Grants for user4@localhost
GRANT SELECT ON *.* TO 'user4'@'localhost'
@@ -1176,8 +1177,8 @@ sql security definer view v2 as select 1;
select * from information_schema.views
where table_name='v1' or table_name='v2';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@@ -1226,94 +1227,6 @@ f1()
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
-SELECT t.table_name, c1.column_name
-FROM information_schema.tables t
-INNER JOIN
-information_schema.columns c1
-ON t.table_schema = c1.table_schema AND
-t.table_name = c1.table_name
-WHERE t.table_schema = 'information_schema' AND
-c1.ordinal_position =
-( SELECT COALESCE(MIN(c2.ordinal_position),1)
-FROM information_schema.columns c2
-WHERE c2.table_schema = t.table_schema AND
-c2.table_name = t.table_name AND
-c2.column_name LIKE '%SCHEMA%'
- )
-AND t.table_name not like 'innodb_%';
-table_name column_name
-CHARACTER_SETS CHARACTER_SET_NAME
-COLLATIONS COLLATION_NAME
-COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
-COLUMNS TABLE_SCHEMA
-COLUMN_PRIVILEGES TABLE_SCHEMA
-ENGINES ENGINE
-EVENTS EVENT_SCHEMA
-FILES TABLE_SCHEMA
-GLOBAL_STATUS VARIABLE_NAME
-GLOBAL_VARIABLES VARIABLE_NAME
-KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
-PARTITIONS TABLE_SCHEMA
-PLUGINS PLUGIN_NAME
-PROCESSLIST ID
-PROFILING QUERY_ID
-REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
-ROUTINES ROUTINE_SCHEMA
-SCHEMATA SCHEMA_NAME
-SCHEMA_PRIVILEGES TABLE_SCHEMA
-SESSION_STATUS VARIABLE_NAME
-SESSION_VARIABLES VARIABLE_NAME
-STATISTICS TABLE_SCHEMA
-TABLES TABLE_SCHEMA
-TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
-TABLE_PRIVILEGES TABLE_SCHEMA
-TRIGGERS TRIGGER_SCHEMA
-USER_PRIVILEGES GRANTEE
-VIEWS TABLE_SCHEMA
-SELECT t.table_name, c1.column_name
-FROM information_schema.tables t
-INNER JOIN
-information_schema.columns c1
-ON t.table_schema = c1.table_schema AND
-t.table_name = c1.table_name
-WHERE t.table_schema = 'information_schema' AND
-c1.ordinal_position =
-( SELECT COALESCE(MIN(c2.ordinal_position),1)
-FROM information_schema.columns c2
-WHERE c2.table_schema = 'information_schema' AND
-c2.table_name = t.table_name AND
-c2.column_name LIKE '%SCHEMA%'
- )
-AND t.table_name not like 'innodb_%';
-table_name column_name
-CHARACTER_SETS CHARACTER_SET_NAME
-COLLATIONS COLLATION_NAME
-COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
-COLUMNS TABLE_SCHEMA
-COLUMN_PRIVILEGES TABLE_SCHEMA
-ENGINES ENGINE
-EVENTS EVENT_SCHEMA
-FILES TABLE_SCHEMA
-GLOBAL_STATUS VARIABLE_NAME
-GLOBAL_VARIABLES VARIABLE_NAME
-KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
-PARTITIONS TABLE_SCHEMA
-PLUGINS PLUGIN_NAME
-PROCESSLIST ID
-PROFILING QUERY_ID
-REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
-ROUTINES ROUTINE_SCHEMA
-SCHEMATA SCHEMA_NAME
-SCHEMA_PRIVILEGES TABLE_SCHEMA
-SESSION_STATUS VARIABLE_NAME
-SESSION_VARIABLES VARIABLE_NAME
-STATISTICS TABLE_SCHEMA
-TABLES TABLE_SCHEMA
-TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
-TABLE_PRIVILEGES TABLE_SCHEMA
-TRIGGERS TRIGGER_SCHEMA
-USER_PRIVILEGES GRANTEE
-VIEWS TABLE_SCHEMA
SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
MAX(table_name)
VIEWS
@@ -1557,7 +1470,7 @@ CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_P
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'test';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL test latin1 latin1_swedish_ci NULL
+def test latin1 latin1_swedish_ci NULL
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
count(*)
0
@@ -1575,7 +1488,7 @@ AS SELECT *
FROM information_schema.tables;
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'v1';
VIEW_DEFINITION
-select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
+select `information_schema`.`tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`information_schema`.`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`tables`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`information_schema`.`tables`.`ENGINE` AS `ENGINE`,`information_schema`.`tables`.`VERSION` AS `VERSION`,`information_schema`.`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`information_schema`.`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`information_schema`.`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`information_schema`.`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`information_schema`.`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`information_schema`.`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`information_schema`.`tables`.`DATA_FREE` AS `DATA_FREE`,`information_schema`.`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`information_schema`.`tables`.`CREATE_TIME` AS `CREATE_TIME`,`information_schema`.`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`information_schema`.`tables`.`CHECK_TIME` AS `CHECK_TIME`,`information_schema`.`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`information_schema`.`tables`.`CHECKSUM` AS `CHECKSUM`,`information_schema`.`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`information_schema`.`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
DROP VIEW v1;
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME ='information_schema';
@@ -1731,3 +1644,66 @@ TEST_RESULT
OK
SET TIMESTAMP=DEFAULT;
End of 5.1 tests.
+create table information_schema.t1 (f1 INT);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop table information_schema.t1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop temporary table if exists information_schema.t1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create temporary table information_schema.t1 (f1 INT);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop view information_schema.v1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create view information_schema.v1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create trigger mysql.trg1 after insert on information_schema.t1 for each row set @a=1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create table t1 select * from information_schema.t1;
+ERROR 42S02: Unknown table 't1' in information_schema
+CREATE TABLE t1(f1 char(100));
+REPAIR TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+CHECKSUM TABLE t1, information_schema.tables;
+Table Checksum
+test.t1 0
+information_schema.tables 0
+ANALYZE TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+CHECK TABLE t1, information_schema.tables;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+information_schema.tables check note The storage engine for the table doesn't support check
+OPTIMIZE TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+RENAME TABLE v1 to v2, information_schema.tables to t2;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+LOCK TABLES t1 READ, information_schema.tables READ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE t1;
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE KEY_COLUMN_USAGE ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE PARTITIONS ALL NULL TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE REFERENTIAL_CONSTRAINTS ALL NULL CONSTRAINT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
+WHERE TABLE_NAME='t1' and TABLE_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE TABLE_CONSTRAINTS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE EVENT_OBJECT_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE TRIGGERS ALL NULL EVENT_OBJECT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+SELECT *
+FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
+LEFT JOIN INFORMATION_SCHEMA.COLUMNS
+USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
+WHERE COLUMNS.TABLE_SCHEMA = 'test'
+AND COLUMNS.TABLE_NAME = 't1';
+TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 5fa38f93993..bed73d9faf7 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -3,7 +3,7 @@ drop view if exists v1,v2;
drop function if exists f1;
drop function if exists f2;
use INFORMATION_SCHEMA;
-show tables where Tables_in_information_schema not like "Innodb%";
+show tables where Tables_in_information_schema NOT LIKE 'Innodb%';
Tables_in_information_schema
CHARACTER_SETS
COLLATIONS
@@ -119,12 +119,12 @@ create table t1 (f1 char(4));
create view v1 as select f1 from t1;
grant insert on v1 to testdb_2@localhost;
create view v5 as select f1 from t1;
-grant show view on v5 to testdb_2@localhost;
+grant select, show view on v5 to testdb_2@localhost;
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
use testdb_1;
create view v6 as select f1 from t1;
-grant show view on v6 to testdb_2@localhost;
+grant select, show view on v6 to testdb_2@localhost;
create table t2 (f1 char(4));
create definer=`no_such_user`@`no_such_host` view v7 as select * from t2;
Warnings:
@@ -152,11 +152,13 @@ create view v2 as select f1 from testdb_1.v1;
create view v4 as select f1,f2 from testdb_1.v3;
show fields from testdb_1.v5;
Field Type Null Key Default Extra
+f1 char(4) YES NULL
show create view testdb_1.v5;
View Create View character_set_client collation_connection
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
show fields from testdb_1.v6;
Field Type Null Key Default Extra
+f1 char(4) YES NULL
show create view testdb_1.v6;
View Create View character_set_client collation_connection
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
@@ -171,9 +173,9 @@ v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY
Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
revoke insert(f1) on v3 from testdb_2@localhost;
-revoke show view on v5 from testdb_2@localhost;
+revoke select,show view on v5 from testdb_2@localhost;
use testdb_1;
-revoke show view on v6 from testdb_2@localhost;
+revoke select,show view on v6 from testdb_2@localhost;
show fields from testdb_1.v5;
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5'
show create view testdb_1.v5;
@@ -203,7 +205,7 @@ show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci
show create view testdb_1.v1;
-ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
+ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v1'
select table_name from information_schema.columns a
where a.table_name = 'v2';
table_name
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 4f36fd2b8b5..fbb7e7e8397 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -8,22 +8,22 @@ FOREIGN KEY (id, t2_id) REFERENCES t2(t1_id, id) ON DELETE CASCADE) ENGINE=INNO
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL test PRIMARY test t1 PRIMARY KEY
-NULL test PRIMARY test t2 PRIMARY KEY
-NULL test t2_ibfk_1 test t2 FOREIGN KEY
-NULL test t2_ibfk_2 test t2 FOREIGN KEY
-NULL test PRIMARY test t3 PRIMARY KEY
-NULL test t3_ibfk_1 test t3 FOREIGN KEY
+def test PRIMARY test t1 PRIMARY KEY
+def test PRIMARY test t2 PRIMARY KEY
+def test t2_ibfk_1 test t2 FOREIGN KEY
+def test t2_ibfk_2 test t2 FOREIGN KEY
+def test PRIMARY test t3 PRIMARY KEY
+def test t3_ibfk_1 test t3 FOREIGN KEY
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
-NULL test PRIMARY NULL test t1 id 1 NULL NULL NULL NULL
-NULL test PRIMARY NULL test t2 id 1 NULL NULL NULL NULL
-NULL test t2_ibfk_1 NULL test t2 t1_id 1 1 test t1 id
-NULL test t2_ibfk_2 NULL test t2 t1_id 1 1 test t1 id
-NULL test PRIMARY NULL test t3 id 1 NULL NULL NULL NULL
-NULL test t3_ibfk_1 NULL test t3 id 1 1 test t2 t1_id
-NULL test t3_ibfk_1 NULL test t3 t2_id 2 2 test t2 id
+def test PRIMARY def test t1 id 1 NULL NULL NULL NULL
+def test PRIMARY def test t2 id 1 NULL NULL NULL NULL
+def test t2_ibfk_1 def test t2 t1_id 1 1 test t1 id
+def test t2_ibfk_2 def test t2 t1_id 1 1 test t1 id
+def test PRIMARY def test t3 id 1 NULL NULL NULL NULL
+def test t3_ibfk_1 def test t3 id 1 1 test t2 t1_id
+def test t3_ibfk_1 def test t3 t2_id 2 2 test t2 id
drop table t3, t2, t1;
CREATE TABLE t1(a1 INT NOT NULL, a2 INT NOT NULL,
PRIMARY KEY(a1, a2)) ENGINE=INNODB;
diff --git a/mysql-test/r/information_schema_part.result b/mysql-test/r/information_schema_part.result
index 04dc9ccf2c0..11c57ceb2c2 100644
--- a/mysql-test/r/information_schema_part.result
+++ b/mysql-test/r/information_schema_part.result
@@ -7,9 +7,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t1";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
-NULL test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
-NULL test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
+def test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
+def test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
create table t2 (a int not null,b int not null,c int not null, primary key(a,b))
partition by range (a)
partitions 3
@@ -19,27 +19,27 @@ partition x3 values less than maxvalue tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t2";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
-NULL test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
-NULL test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
+def test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
+def test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
create table t3 (f1 date)
partition by hash(month(f1))
partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t3";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
create table t4 (f1 date, f2 int)
partition by key(f1,f2)
partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t4";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
drop table t1,t2,t3,t4;
create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
partition by range (a)
@@ -63,14 +63,14 @@ subpartition x22 tablespace t2)
);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
drop table t1,t2;
create table t1 (
a int not null,
@@ -88,10 +88,10 @@ subpartition x22 tablespace t2 nodegroup 1)
);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
+def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
+def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
+def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
+def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
show tables;
Tables_in_test
t1
@@ -99,7 +99,7 @@ drop table t1;
create table t1(f1 int, f2 int);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
+def test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
drop table t1;
create table t1 (f1 date)
partition by linear hash(month(f1))
@@ -107,9 +107,9 @@ partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t1";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
drop table t1;
create table t1 (a int)
PARTITION BY RANGE (a)
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 04d5ee99789..7208c529e89 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -2723,7 +2723,7 @@ create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
insert into t1 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
+ERROR 23000: Duplicate entry 'A\x00' for key 'PRIMARY'
insert into t2 values (0x41),(0x4120);
insert into t3 values (0x41),(0x4120),(0x4100);
ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY'
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 402ab3c1b16..76ff2cfc0f3 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2274,3 +2274,23 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1,t2;
End of 5.1 tests
+#
+# Test for bug #39932 "create table fails if column for FK is in different
+# case than in corr index".
+#
+drop tables if exists t1, t2;
+create table t1 (pk int primary key) engine=InnoDB;
+# Even although the below statement uses uppercased field names in
+# foreign key definition it still should be able to find explicitly
+# created supporting index. So it should succeed and should not
+# create any additional supporting indexes.
+create table t2 (fk int, key x (fk),
+constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `fk` int(11) DEFAULT NULL,
+ KEY `x` (`fk`),
+ CONSTRAINT `x` FOREIGN KEY (`fk`) REFERENCES `t1` (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2, t1;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 3f91039d592..36d2b9ef348 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -355,17 +355,17 @@ insert into t2 values (1,12), (2,24);
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-3 NULL
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-12 NULL
drop view v1;
drop table t1,t2;
create table t1 (id int primary key auto_increment, data int, unique(data));
@@ -639,3 +639,43 @@ CREATE TABLE t2(f1 CHAR(1));
INSERT INTO t2 SELECT f1 FROM t1;
DROP TABLE t1, t2;
End of 5.0 tests.
+#
+# Bug#34898 "mysql_info() reports 0 warnings while
+# mysql_warning_count() reports 1"
+# Check that the number of warnings reported by
+# mysql_info() is correct.
+#
+drop table if exists t1;
+create table t1 (data varchar(4) not null);
+set sql_mode='error_for_division_by_zero';
+#
+# Demonstrate that the number of warnings matches
+# the information in mysql_info().
+#
+insert t1 (data) values ('letter'), (1/0);
+affected rows: 2
+info: Records: 2 Duplicates: 0 Warnings: 3
+Warnings:
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+update t1 set data='envelope' where 1/0 or 1;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 3
+Warnings:
+Warning 1365 Division by 0
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1265 Data truncated for column 'data' at row 2
+insert t1 (data) values (default), (1/0), ('dead beef');
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 4
+Warnings:
+Warning 1364 Field 'data' doesn't have a default value
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+Warning 1265 Data truncated for column 'data' at row 3
+set sql_mode=default;
+drop table t1;
+#
+# End of 5.4 tests
+#
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index baabf48cb2f..d443e20df76 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -752,8 +752,8 @@ statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statist
columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA COLUMN_COMMENT
-user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL BTREE NULL mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-user User NULL mysql 0 mysql PRIMARY 2 A NULL NULL BTREE NULL mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+user Host def mysql 0 mysql PRIMARY 1 A NULL NULL BTREE def mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+user User def mysql 0 mysql PRIMARY 2 A NULL NULL BTREE def mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
drop table t1;
drop table t2;
drop table t3;
diff --git a/mysql-test/r/join_optimizer.result b/mysql-test/r/join_optimizer.result
new file mode 100644
index 00000000000..9e667506cfa
--- /dev/null
+++ b/mysql-test/r/join_optimizer.result
@@ -0,0 +1,37 @@
+drop table if exists t0,t1,t2,t3;
+#
+# BUG#38049 incorrect rows estimations with references from preceding table
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a varchar(32));
+insert into t1 values ('owner'),('requester'),('admincc'),('cc');
+CREATE TABLE t2 (
+id int(11) NOT NULL,
+type varchar(32) default NULL,
+PRIMARY KEY (id)
+);
+insert into t2 values (1,'owner'), (2,'admincc');
+CREATE TABLE t3 (
+id int(11) NOT NULL,
+domain varchar(32) default NULL,
+type varchar(32) default NULL,
+PRIMARY KEY (id)
+);
+set @domain='system';
+set @pk=0;
+INSERT INTO t3 select @pk:=@pk+1, 'system', t1.a from t1;
+INSERT INTO t3 select @pk:=@pk+1, 'queue', t1.a from t1, t0 where t0.a<3;
+INSERT INTO t3 select @pk:=@pk+1, 'ticket', t1.a from t1, t0 A, t0 B, t0 C;
+CREATE INDEX groups_d ON t3(domain);
+CREATE INDEX groups_t ON t3(type);
+CREATE INDEX groups_td ON t3(type, domain);
+CREATE INDEX groups_dt ON t3(domain, type);
+For table g this must use ref(groups_dt) and #rows should be around 15 and not 335:
+explain
+SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt)
+WHERE g.domain = 'queue' AND g.type = a.type;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a ALL NULL NULL NULL NULL 2
+1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using where
+drop table t0,t1,t2,t3;
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 1e4fc91b8bd..bc77072f67a 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -942,25 +942,29 @@ group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index fcc09a0244d..21fcfceff81 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -251,13 +251,13 @@ insert t1 values ('cccc', 'tttt'),
(0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
(0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
insert t1 (c) values ('cc22');
-ERROR 23000: Duplicate entry 'cc22' for key 'c'
+ERROR 23000: Duplicate entry 'cc' for key 'c'
insert t1 (t) values ('ttt22');
-ERROR 23000: Duplicate entry 'ttt22' for key 't'
+ERROR 23000: Duplicate entry 'ttt' for key 't'
insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'б!#"Ð' for key 'c'
+ERROR 23000: Duplicate entry '\0431!' for key 'c'
insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'бб!#"б' for key 't'
+ERROR 23000: Duplicate entry '\0431\0431!' for key 't'
select c from t1 where c='cccc';
c
cccc
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result
new file mode 100644
index 00000000000..55e6759748a
--- /dev/null
+++ b/mysql-test/r/loadxml.result
@@ -0,0 +1,75 @@
+drop table if exists t1, t2;
+create table t1 (a int, b varchar(64));
+-- Load a static XML file
+load xml infile '../../std_data/loadxml.dat' into table t1
+rows identified by '<row>';
+select * from t1 order by a;
+a b
+1 b1
+2 b2
+3 b3
+11 b11
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+delete from t1;
+-- Load a static XML file with 'IGNORE num ROWS'
+load xml infile '../../std_data/loadxml.dat' into table t1
+rows identified by '<row>' ignore 4 rows;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+-- Check 'mysqldump --xml' + 'LOAD XML' round trip
+delete from t1;
+load xml infile 'MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1 rows identified by '<row>';;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+--Check that default row tag is '<row>
+delete from t1;
+load xml infile 'MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1;;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+-- Check that 'xml' is not a keyword
+select 1 as xml;
+xml
+1
+create table t2(fl text);
+LOAD XML LOCAL INFILE "MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';;
+drop table t1;
+drop table t2;
+create table t1 (
+id int(11) not null,
+text text,
+primary key (id)
+) engine=MyISAM default charset=latin1;
+load xml infile '../../std_data/loadxml2.dat' into table t1;
+select * from t1;
+id text
+1 line1
+line2
+line3
+drop table t1;
diff --git a/mysql-test/r/locale.result b/mysql-test/r/locale.result
index 89883b070d2..af7f9e3c132 100644
--- a/mysql-test/r/locale.result
+++ b/mysql-test/r/locale.result
@@ -1,6 +1,69 @@
DROP TABLE IF EXISTS t1;
Start of 5.4 tests
#
+# WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
+#
+SET NAMES utf8;
+SET @@lc_time_names=109;
+SELECT @@lc_time_names;
+@@lc_time_names
+el_GR
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES
+('2006-01-01'),('2006-01-02'),('2006-01-03'),
+('2006-01-04'),('2006-01-05'),('2006-01-06'),('2006-01-07');
+SELECT a, date_format(a,'%a') as abday, dayname(a) as day FROM t1 ORDER BY a;
+a abday day
+2006-01-01 ÎšÏ…Ï ÎšÏ…Ïιακή
+2006-01-02 Δευ ΔευτέÏα
+2006-01-03 ΤÏί ΤÏίτη
+2006-01-04 Τετ ΤετάÏτη
+2006-01-05 Πέμ Πέμπτη
+2006-01-06 Î Î±Ï Î Î±Ïασκευή
+2006-01-07 Σάβ Σάββατο
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES
+('2006-01-01'),('2006-02-01'),('2006-03-01'),
+('2006-04-01'),('2006-05-01'),('2006-06-01'),
+('2006-07-01'),('2006-08-01'),('2006-09-01'),
+('2006-10-01'),('2006-11-01'),('2006-12-01');
+SELECT a, date_format(a,'%b') as abmon, monthname(a) as mon FROM t1 ORDER BY a;
+a abmon mon
+2006-01-01 Ιαν ΙανουάÏιος
+2006-02-01 Φεβ ΦεβÏουάÏιος
+2006-03-01 ÎœÎ¬Ï ÎœÎ¬Ïτιος
+2006-04-01 Î‘Ï€Ï Î‘Ï€Ïίλιος
+2006-05-01 Μάι Μάιος
+2006-06-01 ΙοÏν ΙοÏνιος
+2006-07-01 ΙοÏλ ΙοÏλιος
+2006-08-01 ΑÏγ ΑÏγουστος
+2006-09-01 Σεπ ΣεπτέμβÏιος
+2006-10-01 Οκτ ΟκτώβÏιος
+2006-11-01 Îοέ ÎοέμβÏιος
+2006-12-01 Δεκ ΔεκέμβÏιος
+SELECT format(123456.789, 3, 'el_GR');
+format(123456.789, 3, 'el_GR')
+123456.789
+DROP TABLE t1;
+#
+# Bug#46633 Obsolete Serbian locale name
+#
+SET lc_messages=sr_YU;
+Warnings:
+Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages sr_RS
+SET lc_messages=sr_RS;
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages sr_RS
+SET lc_time_names=sr_RS;
+SELECT format(123456.789, 3, 'sr_RS');
+format(123456.789, 3, 'sr_RS')
+123456.789
+#
# Bug#43207 wrong LC_TIME names for romanian locale
#
SET NAMES utf8;
diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result
new file mode 100644
index 00000000000..fc4e8c850f6
--- /dev/null
+++ b/mysql-test/r/lock_sync.result
@@ -0,0 +1,66 @@
+#
+# Test for bug #45143 "All connections hang on concurrent ALTER TABLE".
+#
+# Concurrent execution of statements which required weak write lock
+# (TL_WRITE_ALLOW_WRITE) on several instances of the same table and
+# statements which tried to acquire stronger write lock (TL_WRITE,
+# TL_WRITE_ALLOW_READ) on this table might have led to deadlock.
+drop table if exists t1;
+# Create auxiliary connections used through the test.
+# Reset DEBUG_SYNC facility before using it.
+set debug_sync= 'RESET';
+# Turn off logging so calls to locking subsystem performed
+# for general_log table won't interfere with our test.
+set @old_general_log = @@global.general_log;
+set @@global.general_log= OFF;
+create table t1 (i int) engine=InnoDB;
+insert into t1 values (1);
+# Prepare user lock which will be used for resuming execution of
+# the first statement after it acquires TL_WRITE_ALLOW_WRITE lock.
+select get_lock("lock_bug45143_wait", 0);
+get_lock("lock_bug45143_wait", 0)
+1
+# Switch to connection 'con_bug45143_1'.
+# Sending:
+insert into t1 values (get_lock("lock_bug45143_wait", 100));;
+# Switch to connection 'con_bug45143_2'.
+# Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
+# and then gets blocked on user lock 'lock_bug45143_wait'.
+# Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE
+# lock for the first instance of 't1'.
+set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
+# Sending:
+select count(*) > 0 from t1 as a, t1 as b for update;;
+# Switch to connection 'con_bug45143_3'.
+# Wait until the above SELECT ... FOR UPDATE is blocked after
+# acquiring lock for the the first instance of 't1'.
+set debug_sync= 'now WAIT_FOR parked';
+# Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
+lock table t1 write;;
+# Switch to connection 'default'.
+# Wait until this LOCK TABLES statement starts waiting for table lock.
+# Allow SELECT ... FOR UPDATE to resume.
+# Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance
+# of 't1' it should be able to get lock on the second instance without
+# waiting, even although there is another thread which has such lock
+# on this table and also there is a thread waiting for a TL_WRITE on it.
+set debug_sync= 'now SIGNAL go';
+# Switch to connection 'con_bug45143_2'.
+# Reap SELECT ... FOR UPDATE
+count(*) > 0
+1
+# Switch to connection 'default'.
+# Resume execution of the INSERT statement.
+select release_lock("lock_bug45143_wait");
+release_lock("lock_bug45143_wait")
+1
+# Switch to connection 'con_bug45143_1'.
+# Reap INSERT statement.
+# Switch to connection 'con_bug45143_3'.
+# Reap LOCK TABLES statement.
+unlock tables;
+# Switch to connection 'default'.
+# Do clean-up.
+set debug_sync= 'RESET';
+set @@global.general_log= @old_general_log;
+drop table t1;
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 5c3e3d789a1..56e30ac59f8 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -309,6 +309,30 @@ SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
+
+# --
+# -- Bug#38124: "general_log_file" variable silently unset when
+# -- using expression
+# --
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124.LOG
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124-2.LOG
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+@@general_log_file
+G38124
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+@@general_log_file = @my_glf
+1
+SET GLOBAL general_log_file = @old_general_log_file;
# Close connection con1
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
diff --git a/mysql-test/r/log_state_bug33693.result b/mysql-test/r/log_state_bug33693.result
new file mode 100644
index 00000000000..abf20fc7aa7
--- /dev/null
+++ b/mysql-test/r/log_state_bug33693.result
@@ -0,0 +1,3 @@
+SELECT INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run');;
+INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run')
+0
diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result
index 4a59801692d..30f835a8ea3 100644
--- a/mysql-test/r/lowercase_fs_off.result
+++ b/mysql-test/r/lowercase_fs_off.result
@@ -22,8 +22,8 @@ f1
GRANT SELECT ON t1 to user_1@localhost;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user_1'@'localhost' NULL d1 T1 SELECT NO
-'user_1'@'localhost' NULL d1 t1 SELECT NO
+'user_1'@'localhost' def d1 T1 SELECT NO
+'user_1'@'localhost' def d1 t1 SELECT NO
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
DROP USER user_1@localhost;
DROP DATABASE d1;
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index 51c2ac0faf5..cf87fd1b5a4 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -174,3 +174,74 @@ TABLE_SCHEMA TABLE_NAME
mysqltest_LC2 myUC
use test;
drop database mysqltest_LC2;
+# End of 5.1 tests
+#
+# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+# lowercasing table name". Due to not properly normalizing table names
+# in lower_case_table_names modes in this function queries to I_S which
+# were executed through it left entries with incorrect key in table
+# definition cache. As result further queries to I_S that used this
+# function produced stale results in cases when table definition was
+# changed by a DDL statement. Also combination of this issue and a
+# similar problem in CREATE TABLE (it also has peeked into table
+# definition cache using non-normalized key) led to spurious
+# ER_TABLE_EXISTS_ERROR errors when one tried to create table with the
+# same name as a previously existing but dropped table.
+#
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int) comment='Old comment';
+create table t_bug44738_lowercase (i int) comment='Old comment';
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
+ order by table_name;
+table_schema table_name table_comment
+mysqltest_UPPERCASE t_bug44738_lowercase Old comment
+mysqltest_UPPERCASE t_bug44738_UPPERCASE Old comment
+alter table t_bug44738_UPPERCASE comment='New comment';
+alter table t_bug44738_lowercase comment='New comment';
+# There should be no stale entries in TDC for our tables after the
+# above ALTER TABLE statements so new version of comments should be
+# returned by the below query to I_S.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
+ order by table_name;
+table_schema table_name table_comment
+mysqltest_UPPERCASE t_bug44738_lowercase New comment
+mysqltest_UPPERCASE t_bug44738_UPPERCASE New comment
+drop database mysqltest_UPPERCASE;
+use test;
+# Let us check that the original test case which led to discovery
+# of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+drop table t_bug44738_UPPERCASE;
+# After the above DROP TABLE there are no entries in TDC which correspond
+# to our table and therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+# Finally, let us check that another issue which was exposed by
+# the original test case is solved. I.e. that fuse in CREATE TABLE
+# which ensures that table is not created if there is an entry for
+# it in TDC even though it was removed from disk uses normalized
+# version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+# Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+# Simulate manual removal of the table.
+# After manual removal of table still there should be an entry for table
+# in TDC so attempt to create table with the same name should fail.
+create table t_bug44738_UPPERCASE (i int);
+ERROR 42S01: Table 't_bug44738_uppercase' already exists
+# And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 893ea5acf88..83152a0dd8d 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -914,7 +914,7 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
-test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check Warning Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
ALTER TABLE t2 MODIFY a INT;
@@ -2023,7 +2023,7 @@ CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
+def test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
DROP TABLE tm1;
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
@@ -2220,3 +2220,39 @@ tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH R
DROP TRIGGER tr1;
DROP TABLE t1, t2, t3;
End of 5.1 tests
+#
+# An additional test case for Bug#27430 Crash in subquery code
+# when in PS and table DDL changed after PREPARE
+#
+# Test merge table with too many merge children.
+#
+drop table if exists t_parent;
+set @save_table_definition_cache=@@global.table_definition_cache;
+#
+# Set @@global.table_definition_cache to minimum
+#
+set @@global.table_definition_cache=400;
+set @a=null;
+#
+# Create 400 merge children
+#
+set @a=concat("create table t_parent (a int) union(", @a,
+") insert_method=first engine=mrg_myisam");
+prepare stmt from @a;
+execute stmt;
+prepare stmt from "select * from t_parent";
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+deallocate prepare stmt;
+#
+# Create merge parent
+#
+#
+# Cleanup
+#
+drop table t_parent;
+set @@global.table_definition_cache=@save_table_definition_cache;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 6b498e55d85..58dd97ee9f3 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -2,7 +2,7 @@ drop table if exists t1,t2;
select 1, 1.0, -1, "hello", NULL;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def 1 8 1 1 N 32897 0 63
-def 1.0 246 4 3 N 129 1 63
+def 1.0 246 4 3 N 32897 1 63
def -1 8 2 2 N 32897 0 63
def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63
@@ -18,7 +18,7 @@ def test t1 t1 d d 3 11 0 Y 32768 0 63
def test t1 t1 e e 8 20 0 Y 32768 0 63
def test t1 t1 f f 4 3 0 Y 32768 2 63
def test t1 t1 g g 5 4 0 Y 32768 3 63
-def test t1 t1 h h 246 7 0 Y 0 4 63
+def test t1 t1 h h 246 7 0 Y 32768 4 63
def test t1 t1 i i 13 4 0 Y 32864 0 63
def test t1 t1 j j 10 10 0 Y 128 0 63
def test t1 t1 k k 7 19 0 N 9441 0 63
@@ -199,3 +199,95 @@ def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
DROP TABLE t1;
End of 5.0 tests
+create table t1(
+# numeric types
+bool_col bool,
+boolean_col boolean,
+bit_col bit(5),
+tiny tinyint,
+tiny_uns tinyint unsigned,
+small smallint,
+small_uns smallint unsigned,
+medium mediumint,
+medium_uns mediumint unsigned,
+int_col int,
+int_col_uns int unsigned,
+big bigint,
+big_uns bigint unsigned,
+decimal_col decimal(10,5),
+# synonyms of DECIMAL
+numeric_col numeric(10),
+fixed_col fixed(10),
+dec_col dec(10),
+decimal_col_uns decimal(10,5) unsigned,
+fcol float,
+fcol_uns float unsigned,
+dcol double,
+double_precision_col double precision,
+dcol_uns double unsigned,
+# date/time types
+date_col date,
+time_col time,
+timestamp_col timestamp,
+year_col year,
+datetime_col datetime,
+# string types
+char_col char(5),
+varchar_col varchar(10),
+binary_col binary(10),
+varbinary_col varbinary(10),
+tinyblob_col tinyblob,
+blob_col blob,
+mediumblob_col mediumblob,
+longblob_col longblob,
+text_col text,
+mediumtext_col mediumtext,
+longtext_col longtext,
+enum_col enum("A","B","C"),
+set_col set("F","E","D")
+);
+select * from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 bool_col bool_col 1 1 0 Y 32768 0 63
+def test t1 t1 boolean_col boolean_col 1 1 0 Y 32768 0 63
+def test t1 t1 bit_col bit_col 16 5 0 Y 32 0 63
+def test t1 t1 tiny tiny 1 4 0 Y 32768 0 63
+def test t1 t1 tiny_uns tiny_uns 1 3 0 Y 32800 0 63
+def test t1 t1 small small 2 6 0 Y 32768 0 63
+def test t1 t1 small_uns small_uns 2 5 0 Y 32800 0 63
+def test t1 t1 medium medium 9 9 0 Y 32768 0 63
+def test t1 t1 medium_uns medium_uns 9 8 0 Y 32800 0 63
+def test t1 t1 int_col int_col 3 11 0 Y 32768 0 63
+def test t1 t1 int_col_uns int_col_uns 3 10 0 Y 32800 0 63
+def test t1 t1 big big 8 20 0 Y 32768 0 63
+def test t1 t1 big_uns big_uns 8 20 0 Y 32800 0 63
+def test t1 t1 decimal_col decimal_col 246 12 0 Y 32768 5 63
+def test t1 t1 numeric_col numeric_col 246 11 0 Y 32768 0 63
+def test t1 t1 fixed_col fixed_col 246 11 0 Y 32768 0 63
+def test t1 t1 dec_col dec_col 246 11 0 Y 32768 0 63
+def test t1 t1 decimal_col_uns decimal_col_uns 246 11 0 Y 32800 5 63
+def test t1 t1 fcol fcol 4 12 0 Y 32768 31 63
+def test t1 t1 fcol_uns fcol_uns 4 12 0 Y 32800 31 63
+def test t1 t1 dcol dcol 5 22 0 Y 32768 31 63
+def test t1 t1 double_precision_col double_precision_col 5 22 0 Y 32768 31 63
+def test t1 t1 dcol_uns dcol_uns 5 22 0 Y 32800 31 63
+def test t1 t1 date_col date_col 10 10 0 Y 128 0 63
+def test t1 t1 time_col time_col 11 8 0 Y 128 0 63
+def test t1 t1 timestamp_col timestamp_col 7 19 0 N 9441 0 63
+def test t1 t1 year_col year_col 13 4 0 Y 32864 0 63
+def test t1 t1 datetime_col datetime_col 12 19 0 Y 128 0 63
+def test t1 t1 char_col char_col 254 5 0 Y 0 0 8
+def test t1 t1 varchar_col varchar_col 253 10 0 Y 0 0 8
+def test t1 t1 binary_col binary_col 254 10 0 Y 128 0 63
+def test t1 t1 varbinary_col varbinary_col 253 10 0 Y 128 0 63
+def test t1 t1 tinyblob_col tinyblob_col 252 255 0 Y 144 0 63
+def test t1 t1 blob_col blob_col 252 65535 0 Y 144 0 63
+def test t1 t1 mediumblob_col mediumblob_col 252 16777215 0 Y 144 0 63
+def test t1 t1 longblob_col longblob_col 252 4294967295 0 Y 144 0 63
+def test t1 t1 text_col text_col 252 65535 0 Y 16 0 8
+def test t1 t1 mediumtext_col mediumtext_col 252 16777215 0 Y 16 0 8
+def test t1 t1 longtext_col longtext_col 252 4294967295 0 Y 16 0 8
+def test t1 t1 enum_col enum_col 254 1 0 Y 256 0 8
+def test t1 t1 set_col set_col 254 5 0 Y 2048 0 8
+bool_col boolean_col bit_col tiny tiny_uns small small_uns medium medium_uns int_col int_col_uns big big_uns decimal_col numeric_col fixed_col dec_col decimal_col_uns fcol fcol_uns dcol double_precision_col dcol_uns date_col time_col timestamp_col year_col datetime_col char_col varchar_col binary_col varbinary_col tinyblob_col blob_col mediumblob_col longblob_col text_col mediumtext_col longtext_col enum_col set_col
+drop table t1;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 449333a4ae6..4f22029814c 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -604,7 +604,7 @@ a b
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 206
+master-bin.000001 207
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@@ -614,7 +614,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 221
+master-bin.000001 222
drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3;
diff --git a/mysql-test/r/myisam-system.result b/mysql-test/r/myisam-system.result
index e0629d955ae..b3ba8066f5c 100644
--- a/mysql-test/r/myisam-system.result
+++ b/mysql-test/r/myisam-system.result
@@ -2,7 +2,7 @@ drop table if exists t1,t2;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
-Error 2 Can't find file: 't1' (errno: 2)
+Warning 2 Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 5c6a0e2f93d..8debb3a9414 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -207,6 +207,8 @@ Warning (Code 1286): Unknown table engine 'nonexistent2'
Warning (Code 1266): Using storage engine MyISAM for table 't2'
Error (Code 1050): Table 't2' already exists
drop tables t1, t2;
+Variable_name Value
+lc_messages ru_RU
<TABLE BORDER=1><TR><TH>&lt;</TH></TR><TR><TD>&lt; &amp; &gt;</TD></TR></TABLE>create table t1 (a char(5));
insert into t1 values ('\0b\0');
a
diff --git a/mysql-test/r/mysql_locale_posix.result b/mysql-test/r/mysql_locale_posix.result
new file mode 100644
index 00000000000..72a473bb89e
--- /dev/null
+++ b/mysql-test/r/mysql_locale_posix.result
@@ -0,0 +1,72 @@
+SET NAMES utf8;
+DROP DATABASE IF EXISTS `ó`;
+DROP DATABASE IF EXISTS `Ä‚Å‚`;
+DROP DATABASE IF EXISTS `цÐ`;
+DROP DATABASE IF EXISTS `ó`;
+
+iso88591
+@@character_set_client
+latin1
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+iso88592
+@@character_set_client
+latin2
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+koi8r
+@@character_set_client
+koi8r
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+utf8
+@@character_set_client
+utf8
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+Database: Ä‚Å‚
++--------+
+| Tables |
++--------+
++--------+
+Database: цÐ
++--------+
+| Tables |
++--------+
++--------+
+SHOW DATABASES LIKE 'ó';
+Database (ó)
+ó
+SHOW DATABASES LIKE 'Ä‚Å‚';
+Database (Ä‚Å‚)
+Ä‚Å‚
+SHOW DATABASES LIKE 'цÐ';
+Database (цÐ)
+цÐ
+SHOW DATABASES LIKE 'ó';
+Database (ó)
+ó
+DROP DATABASE `ó`;
+DROP DATABASE `Ä‚Å‚`;
+DROP DATABASE `цÐ`;
+DROP DATABASE `ó`;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 384442f8c31..b96b579d9b5 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -127,3 +127,4 @@ mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
set GLOBAL sql_mode=default;
+The --upgrade-system-tables option was used, databases won't be touched.
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 5f1a0565b10..89f7e1dab95 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -162,8 +162,8 @@ CREATE TABLE t1 (a INT);
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL #mysql50#a@b tr1 INSERT NULL #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL #mysql50#a@b tr2 INSERT NULL #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def #mysql50#a@b tr1 INSERT def #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def #mysql50#a@b tr2 INSERT def #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
Warnings:
Warning 1603 Triggers for table `#mysql50#a@b`.`#mysql50#c@d` have no creation context
Warning 1603 Triggers for table `#mysql50#a@b`.`t1` have no creation context
@@ -172,8 +172,8 @@ USE `a@b`;
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL a@b tr1 INSERT NULL a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
-NULL a@b tr2 INSERT NULL a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+def a@b tr1 INSERT def a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+def a@b tr2 INSERT def a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
INSERT INTO `c@d` VALUES (2), (1);
SELECT * FROM `c@d`;
a
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 8162e1aca05..13d36fab2f1 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -40,7 +40,7 @@ CREATE TABLE `t1` (
`a` decimal(64,20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
+INSERT INTO `t1` VALUES (1234567890123456789012345678901234567890.00000000000000000000),(987654321098765432109876543210987654321.00000000000000000000);
DROP TABLE t1;
#
# Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
@@ -77,7 +77,7 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
@@ -85,7 +85,7 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -108,7 +108,7 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -135,7 +135,7 @@ CREATE TABLE `t1` (
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2391,7 +2391,7 @@ trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
update t1 set a = 4 where a=3;
@@ -2468,7 +2468,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
+/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg3 after update on t1 for each row
begin
@@ -2500,7 +2500,7 @@ UNLOCK TABLES;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
+/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg4 before insert on t2 for each row
begin
@@ -2594,12 +2594,12 @@ trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg4 INSERT t2 begin
if new.a > 10 then
set @fired:= "No";
end if;
-end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1, t2;
#
# Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
@@ -3554,11 +3554,11 @@ use test;
create user mysqltest_1@localhost;
create table t1(a int, b varchar(34));
reset master;
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
grant RELOAD on *.* to mysqltest_1@localhost;
-mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
-mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
@@ -3611,7 +3611,7 @@ DROP TABLE IF EXISTS `TABLES`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TEMPORARY TABLE `TABLES` (
- `TABLE_CATALOG` varchar(512) DEFAULT NULL,
+ `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
@@ -4223,7 +4223,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
show create event ee1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
+ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
drop database first;
create database second;
use second;
@@ -4232,7 +4232,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
show create event ee1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
+ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
show events;
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index e5f5a53c1f3..84ef17857f4 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 7e14a0ea7c8..625dbf0790f 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -433,14 +433,12 @@ create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
-ERROR 42000: VALUES value must be of same type as partition function near '),
-partition p1 values less than (10))' at line 3
+ERROR HY000: VALUES value must be of same type as partition function
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
partition p1 values in (10));
-ERROR 42000: VALUES value must be of same type as partition function near '),
-partition p1 values in (10))' at line 3
+ERROR HY000: VALUES value must be of same type as partition function
create table t1 (a bigint unsigned)
partition by range (a)
(partition p0 values less than (100),
@@ -1254,7 +1252,6 @@ COMMIT;
END|
CALL test.p1(12);
Warnings:
-Note 1051 Unknown table 't1'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
CALL test.p1(13);
Warnings:
@@ -1435,7 +1432,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
create table t1 (s1 int auto_increment primary key)
partition by list (s1)
(partition p1 values in (1),
diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result
new file mode 100644
index 00000000000..784df3045f0
--- /dev/null
+++ b/mysql-test/r/partition_column.result
@@ -0,0 +1,578 @@
+drop table if exists t1;
+create table t1 (a int, b int)
+partition by range columns (a,b)
+( partition p0 values less than (maxvalue, 10),
+partition p1 values less than (maxvalue, maxvalue));
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+create table t1 (a int, b int, c int)
+partition by range columns (a,b,c)
+( partition p0 values less than (1, maxvalue, 10),
+partition p1 values less than (1, maxvalue, maxvalue));
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
+partition by range columns(a)
+( partition p0 values less than ('a'),
+partition p1 values less than ('b'),
+partition p2 values less than ('c'),
+partition p3 values less than ('d'));
+insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c');
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+alter table t1 remove partitioning;
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+drop table t1;
+create table t1 (a varchar(2) character set latin1,
+b varchar(2) character set latin1)
+partition by list columns(a,b)
+(partition p0 values in (('a','a')));
+insert into t1 values ('A','A');
+select * from t1 where b <> 'a' collate latin1_bin AND
+a = 'A' collate latin1_bin;
+a b
+A A
+alter table t1 remove partitioning;
+select * from t1 where b <> 'a' collate latin1_bin AND
+a = 'A' collate latin1_bin;
+a b
+A A
+drop table t1;
+create table t1 (a varchar(5))
+partition by list columns(a)
+( partition p0 values in ('\''),
+ partition p1 values in ('\\'),
+ partition p2 values in ('\0'));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('''') ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */
+drop table t1;
+set @@sql_mode=allow_invalid_dates;
+create table t1 (a char, b char, c date)
+partition by range columns (a,b,c)
+( partition p0 values less than (0,0,to_days('3000-11-31')));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a char, b char, c date)
+partition by range columns (a,b,c)
+( partition p0 values less than (0,0,'3000-11-31'));
+ERROR HY000: Partition column values of incorrect type
+set @@sql_mode='';
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, 0, MAXVALUE, '1900-01-01'),
+partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
+partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
+partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
+partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
+partition p2 values less than (1, 'b', MAXVALUE, MAXVALUE),
+partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(10) DEFAULT NULL,
+ `c` varchar(25) DEFAULT NULL,
+ `d` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c,d)
+SUBPARTITION BY HASH (to_seconds(d))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1,'a',MAXVALUE,'1999-01-01') ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1,'b',MAXVALUE,MAXVALUE) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int, b int)
+partition by range columns (a,b)
+(partition p0 values less than (NULL, maxvalue));
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
+create table t1 (a int, b int)
+partition by list columns(a,b)
+( partition p0 values in ((maxvalue, 0)));
+Got one of the listed errors
+create table t1 (a int, b int)
+partition by list columns (a,b)
+( partition p0 values in ((0,0)));
+alter table t1 add partition
+(partition p1 values in (maxvalue, maxvalue));
+Got one of the listed errors
+drop table t1;
+create table t1 (a int, b int)
+partition by key (a,a);
+ERROR HY000: Duplicate partition field name 'a'
+create table t1 (a int, b int)
+partition by list columns(a,a)
+( partition p values in ((1,1)));
+ERROR HY000: Duplicate partition field name 'a'
+create table t1 (a int signed)
+partition by list (a)
+( partition p0 values in (1, 3, 5, 7, 9, NULL),
+partition p1 values in (2, 4, 6, 8, 0));
+insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
+select * from t1 where NULL <= a;
+a
+select * from t1 where a is null;
+a
+NULL
+explain partitions select * from t1 where a is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= 1;
+a
+1
+0
+drop table t1;
+create table t1 (a int signed)
+partition by list columns(a)
+( partition p0 values in (1, 3, 5, 7, 9, NULL),
+partition p1 values in (2, 4, 6, 8, 0));
+insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
+select * from t1 where a <= NULL;
+a
+select * from t1 where a is null;
+a
+NULL
+explain partitions select * from t1 where a is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= 1;
+a
+1
+0
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+( partition p0 values in ((1, NULL), (2, NULL), (NULL, NULL)),
+partition p1 values in ((1,1), (2,2)),
+partition p2 values in ((3, NULL), (NULL, 1)));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST COLUMNS a,b (1,NULL),(2,NULL),(NULL,NULL)
+LIST COLUMNS a,b (1,1),(2,2)
+LIST COLUMNS a,b (3,NULL),(NULL,1)
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a,b)
+(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
+insert into t1 values (3, NULL);
+insert into t1 values (NULL, 1);
+insert into t1 values (NULL, NULL);
+insert into t1 values (1, NULL);
+insert into t1 values (2, NULL);
+insert into t1 values (1,1);
+insert into t1 values (2,2);
+select * from t1 where a = 1;
+a b
+1 NULL
+1 1
+select * from t1 where a = 2;
+a b
+2 NULL
+2 2
+select * from t1 where a > 8;
+a b
+select * from t1 where a not between 8 and 8;
+a b
+2 NULL
+2 2
+3 NULL
+1 NULL
+1 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a,b)
+(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+( partition p0 values in (1),
+partition p1 values in (1));
+ERROR HY000: Multiple definition of same constant in list partitioning
+create table t1 (a int)
+partition by list (a)
+( partition p0 values in (2, 1),
+partition p1 values in (4, NULL, 3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST a 2,1
+LIST a NULL,4,3
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (NULL,4,3) ENGINE = MyISAM) */
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+insert into t1 values (4);
+insert into t1 values (NULL);
+insert into t1 values (5);
+ERROR HY000: Table has no partition for value 5
+drop table t1;
+create table t1 (a int)
+partition by list columns(a)
+( partition p0 values in (2, 1),
+partition p1 values in ((4), (NULL), (3)));
+ERROR 42000: Row expressions in VALUES IN only allowed for multi-field column partitioning near '))' at line 4
+create table t1 (a int)
+partition by list columns(a)
+( partition p0 values in (2, 1),
+partition p1 values in (4, NULL, 3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST COLUMNS a 2,1
+LIST COLUMNS a 4,NULL,3
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+insert into t1 values (4);
+insert into t1 values (NULL);
+insert into t1 values (5);
+ERROR HY000: Table has no partition for value from column_list
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int, b char(10), c varchar(5), d int)
+partition by range columns(a,b,c)
+subpartition by key (c,d)
+subpartitions 3
+( partition p0 values less than (1,'abc','abc'),
+partition p1 values less than (2,'abc','abc'),
+partition p2 values less than (3,'abc','abc'),
+partition p3 values less than (4,'abc','abc'));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(10) DEFAULT NULL,
+ `c` varchar(5) DEFAULT NULL,
+ `d` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
+SUBPARTITION BY KEY (c,d)
+SUBPARTITIONS 3
+(PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (2,'abc','abc') ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (3,'abc','abc') ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (4,'abc','abc') ENGINE = MyISAM) */
+insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3);
+insert into t1 values (1,'b','c',1),(2,'b','c',2),(3,'b','c',3);
+insert into t1 values (1,'c','d',1),(2,'c','d',2),(3,'c','d',3);
+insert into t1 values (1,'d','e',1),(2,'d','e',2),(3,'d','e',3);
+select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR
+(a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2))));
+a b c d
+1 a b 1
+1 b c 1
+drop table t1;
+create table t1 (a int, b varchar(2), c int)
+partition by range columns (a, b, c)
+(partition p0 values less than (1, 'A', 1),
+partition p1 values less than (1, 'B', 1));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c 1,'A',1
+RANGE COLUMNS a,b,c 1,'B',1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(2) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
+(PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */
+insert into t1 values (1, 'A', 1);
+explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 system NULL NULL NULL NULL 1
+select * from t1 where a = 1 AND b <= 'A' and c = 1;
+a b c
+1 A 1
+drop table t1;
+create table t1 (a char, b char, c char)
+partition by list columns(a)
+( partition p0 values in ('a'));
+insert into t1 (a) values ('a');
+select * from t1 where a = 'a';
+a b c
+a NULL NULL
+drop table t1;
+create table t1 (d time)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2040-01-01'));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (d timestamp)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2040-01-01'));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+create table t1 (d bit(1))
+partition by range columns(d)
+( partition p0 values less than (0),
+partition p1 values less than (1));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (maxvalue, 10));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2009-01-01'));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('1999-01-01'),
+partition p1 values less than ('2000-01-01'));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('3000-01-01'));
+drop table t1;
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p2 values less than (99,99),
+partition p1 values less than (99,999));
+insert into t1 values (99,998);
+select * from t1 where b = 998;
+a b
+99 998
+drop table t1;
+create table t1 as select to_seconds(null) as to_seconds;
+select data_type from information_schema.columns
+where column_name='to_seconds';
+data_type
+int
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+(partition p0 values in ((maxvalue,maxvalue)));
+ERROR 42000: Cannot use MAXVALUE as value in VALUES IN near 'maxvalue,maxvalue)))' at line 3
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (maxvalue,maxvalue));
+drop table t1;
+create table t1 (a int)
+partition by list columns(a)
+(partition p0 values in (0));
+select partition_method from information_schema.partitions where table_name='t1';
+partition_method
+LIST COLUMNS
+drop table t1;
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than ('H23456'),
+partition p1 values less than ('M23456'));
+insert into t1 values ('F23456');
+select * from t1;
+a
+F23456
+drop table t1;
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (H23456),
+partition p1 values less than (M23456));
+ERROR 42S22: Unknown column 'H23456' in 'field list'
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (23456),
+partition p1 values less than (23456));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (10));
+ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (1,1,1);
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (1, 0),
+partition p1 values less than (2, maxvalue),
+partition p2 values less than (3, 3),
+partition p3 values less than (10, maxvalue));
+insert into t1 values (11,0);
+ERROR HY000: Table has no partition for value from column_list
+insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
+select * from t1;
+a b
+0 1
+1 1
+2 1
+3 1
+3 4
+4 9
+9 1
+alter table t1
+partition by range columns(b,a)
+(partition p0 values less than (1,2),
+partition p1 values less than (3,3),
+partition p2 values less than (9,5));
+explain partitions select * from t1 where b < 2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 2;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+explain partitions select * from t1 where b < 4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 4;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+alter table t1 reorganize partition p1 into
+(partition p11 values less than (2,2),
+partition p12 values less than (3,3));
+alter table t1 reorganize partition p0 into
+(partition p01 values less than (0,3),
+partition p02 values less than (1,1));
+ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
+alter table t1 reorganize partition p2 into
+(partition p2 values less than(9,6,1));
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+alter table t1 reorganize partition p2 into
+(partition p2 values less than (10));
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+alter table t1 reorganize partition p2 into
+(partition p21 values less than (4,7),
+partition p22 values less than (9,5));
+explain partitions select * from t1 where b < 4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p11,p12,p21 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 4;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+subpartition by hash (b)
+subpartitions 2
+(partition p0 values in ((0,0), (1,1)),
+partition p1 values in ((1000,1000)));
+insert into t1 values (1000,1000);
+drop table t1;
+create table t1 (a char, b char, c char)
+partition by range columns(a,b,c)
+( partition p0 values less than ('a','b','c'));
+alter table t1 add partition
+(partition p1 values less than ('b','c','d'));
+drop table t1;
diff --git a/mysql-test/r/partition_column_prune.result b/mysql-test/r/partition_column_prune.result
new file mode 100644
index 00000000000..82c49453d43
--- /dev/null
+++ b/mysql-test/r/partition_column_prune.result
@@ -0,0 +1,66 @@
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+create table t1 (a char, b char, c char)
+partition by range columns(a,b,c)
+( partition p0 values less than ('a','b','c'));
+insert into t1 values ('a', NULL, 'd');
+explain partitions select * from t1 where a = 'a' AND c = 'd';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a = 'a' AND c = 'd';
+a b c
+a NULL d
+drop table t1;
+create table t1 (a int not null) partition by range columns(a) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition p2 values less than (30),
+partition p3 values less than (40),
+partition p4 values less than (50),
+partition p5 values less than (60),
+partition p6 values less than (70)
+);
+insert into t1 values (5),(15),(25),(35),(45),(55),(65);
+insert into t1 values (5),(15),(25),(35),(45),(55),(65);
+create table t2 (a int not null) partition by range(a) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition p2 values less than (30),
+partition p3 values less than (40),
+partition p4 values less than (50),
+partition p5 values less than (60),
+partition p6 values less than (70)
+);
+insert into t2 values (5),(15),(25),(35),(45),(55),(65);
+insert into t2 values (5),(15),(25),(35),(45),(55),(65);
+explain partitions select * from t1 where a > 35 and a < 45;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t2 where a > 35 and a < 45;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+drop table t1, t2;
+create table t1 (a int not null, b int not null )
+partition by range columns(a,b) (
+partition p01 values less than (2,10),
+partition p02 values less than (2,20),
+partition p03 values less than (2,30),
+partition p11 values less than (4,10),
+partition p12 values less than (4,20),
+partition p13 values less than (4,30),
+partition p21 values less than (6,10),
+partition p22 values less than (6,20),
+partition p23 values less than (6,30)
+);
+insert into t1 values (2,5), (2,15), (2,25),
+(4,5), (4,15), (4,25), (6,5), (6,15), (6,25);
+insert into t1 select * from t1;
+explain partitions select * from t1 where a=2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p01,p02,p03,p11 ALL NULL NULL NULL NULL 13 Using where
+explain partitions select * from t1 where a=4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p11,p12,p13,p21 ALL NULL NULL NULL NULL 16 Using where
+explain partitions select * from t1 where a=2 and b < 22;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p01,p02,p03 ALL NULL NULL NULL NULL 16 Using where
+drop table t1;
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 607afb71da5..47ea799f497 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -273,7 +273,7 @@ select * from t1 where a = 'y';
a
y
drop table t1;
-create table t1 (a varchar(65531)) partition by key (a);
+create table t1 (a varchar(3068)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -286,7 +286,7 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
-create table t1 (a varchar(65532)) partition by key (a);
+create table t1 (a varchar(3069)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -299,7 +299,7 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
-create table t1 (a varchar(65533) not null) partition by key (a);
+create table t1 (a varchar(3070) not null) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -312,6 +312,8 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
+create table t1 (a varchar(3070)) partition by key (a);
+ERROR HY000: The total length of the partitioning fields is too large
create table t1 (a varchar(65533)) partition by key (a);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
create table t1 (a varchar(65534) not null) partition by key (a);
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 511806d64bd..d24c3de3cc0 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -361,8 +361,7 @@ partition by range (a)
partitions 2
(partition x1 values less than (4.0) tablespace ts1,
partition x2 values less than (8) tablespace ts2);
-ERROR 42000: VALUES value must be of same type as partition function near ') tablespace ts1,
-partition x2 values less than (8) tablespace ts2)' at line 8
+ERROR HY000: VALUES value must be of same type as partition function
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -412,8 +411,7 @@ partition by list (a)
partitions 2
(partition x1 values less than 4,
partition x2 values less than (5));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
-partition x2 values less than (5))' at line 8
+ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -423,7 +421,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than (5));
-ERROR 42000: MAXVALUE can only be used in last partition definition near '))' at line 9
+ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -433,7 +431,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than maxvalue);
-ERROR 42000: MAXVALUE can only be used in last partition definition near 'maxvalue)' at line 9
+ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -602,8 +600,7 @@ partition by list (a)
partitions 2
(partition x1 values in (4.0, 12+8),
partition x2 values in (3, 21));
-ERROR 42000: VALUES value must be of same type as partition function near ' 12+8),
-partition x2 values in (3, 21))' at line 8
+ERROR HY000: VALUES value must be of same type as partition function
CREATE TABLE t1 (
a int not null,
b int not null,
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 19da70db5a0..dcefd70ff43 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -93,7 +93,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 9 Using where
drop table t1;
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 4323d167b10..d95e7dc43fd 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,4 +1,39 @@
drop table if exists t1;
+create table t1 (a varchar(5), b int signed, c varchar(10), d datetime)
+partition by range columns(b,c)
+subpartition by hash(to_seconds(d))
+( partition p0 values less than (2, 'b'),
+partition p1 values less than (4, 'd'),
+partition p2 values less than (10, 'za'));
+insert into t1 values ('a', 3, 'w', '2001-10-27 04:34:00');
+insert into t1 values ('r', 7, 'w', '2001-10-27 05:34:00');
+insert into t1 values ('g', 10, 'w', '2001-10-27 06:34:00');
+update t1 set a = 'c' where a > 'f';
+drop table t1;
+create table t1 (a varchar(5))
+engine=memory
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
+create table t1 (a varchar(5))
+engine=myisam
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
+create table t1 (a varchar(5))
+engine=innodb
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
create table t1 (a int not null,
b datetime not null,
primary key (a,b))
diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result
index a68a67c6386..e22fc11e5bb 100644
--- a/mysql-test/r/partition_list.result
+++ b/mysql-test/r/partition_list.result
@@ -54,6 +54,17 @@ subpartitions 2
partition p1 values in (1),
partition pnull values in (null, 2),
partition p3 values in (3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST a 0
+LIST a 0
+LIST a 1
+LIST a 1
+LIST a NULL,2
+LIST a NULL,2
+LIST a 3
+LIST a 3
insert into t1 values (0,0),(0,1),(1,0),(1,1),(null,0),(null,1);
insert into t1 values (2,0),(2,1),(3,0),(3,1);
explain partitions select * from t1 where a is null;
diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result
index f8403988f47..a13278d724e 100644
--- a/mysql-test/r/partition_mgm_err.result
+++ b/mysql-test/r/partition_mgm_err.result
@@ -41,7 +41,7 @@ ERROR HY000: Reorganize of range partitions cannot change total ranges except fo
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (4),
PARTITION x11 VALUES LESS THAN (2));
-ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (6),
PARTITION x11 VALUES LESS THAN (4));
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 3128c57b2cf..d7790cd8075 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -656,6 +656,335 @@ EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
DROP TABLE t1;
+# TO_SECONDS, test of LIST and index
+CREATE TABLE t1 (a DATE, KEY(a))
+PARTITION BY LIST (TO_SECONDS(a))
+(PARTITION `p0001-01-01` VALUES IN (TO_SECONDS('0001-01-01')),
+PARTITION `p2001-01-01` VALUES IN (TO_SECONDS('2001-01-01')),
+PARTITION `pNULL` VALUES IN (NULL),
+PARTITION `p0000-01-02` VALUES IN (TO_SECONDS('0000-01-02')),
+PARTITION `p1001-01-01` VALUES IN (TO_SECONDS('1001-01-01')));
+INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
+('1001-00-00'), ('1001-01-01'), ('1002-00-00'), ('2001-01-01');
+SELECT * FROM t1 WHERE a < '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a <= '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a >= '1001-01-01';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-01-01';
+a
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-01-01';
+a
+1001-01-01
+SELECT * FROM t1 WHERE a < '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+SELECT * FROM t1 WHERE a <= '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a >= '1001-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-00-00';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-00-00';
+a
+1001-00-00
+# Disabling warnings for the invalid date
+SELECT * FROM t1 WHERE a < '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a <= '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a >= '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a > '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a = '1999-02-31';
+a
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+a
+0001-01-01
+1001-00-00
+1001-01-01
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1001-01-01 system a NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+# Disabling warnings for the invalid date
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL,p1001-01-01 range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
+# test without index
+ALTER TABLE t1 DROP KEY a;
+SELECT * FROM t1 WHERE a < '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a <= '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a >= '1001-01-01';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-01-01';
+a
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-01-01';
+a
+1001-01-01
+SELECT * FROM t1 WHERE a < '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+SELECT * FROM t1 WHERE a <= '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a >= '1001-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-00-00';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-00-00';
+a
+1001-00-00
+# Disabling warnings for the invalid date
+SELECT * FROM t1 WHERE a < '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a <= '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a >= '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a > '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a = '1999-02-31';
+a
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+a
+0001-01-01
+1001-00-00
+1001-01-01
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+# Disabling warnings for the invalid date
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+DROP TABLE t1;
# Test with DATETIME column NOT NULL
CREATE TABLE t1 (
a int(10) unsigned NOT NULL,
@@ -2228,3 +2557,22 @@ explain partitions select * from t1 where recdate < '2006-01-01 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
+#
+# BUG#33730 Full table scan instead selected partitions for query more than 10 partitions
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int)
+partition by range(a+0) (
+partition p0 values less than (64),
+partition p1 values less than (128),
+partition p2 values less than (255)
+);
+insert into t1 select A.a + 10*B.a from t0 A, t0 B;
+explain partitions select * from t1 where a between 10 and 13;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 64 Using where
+explain partitions select * from t1 where a between 10 and 10+33;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 100 Using where
+drop table t0, t1;
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 02d2f6359c5..87cb4fba306 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,6 +1,99 @@
drop table if exists t1, t2;
create table t1 (a int)
partition by range (a)
+( partition p0 values less than (NULL),
+partition p1 values less than (MAXVALUE));
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
+create table t1 (a datetime not null)
+partition by range (TO_SECONDS(a))
+( partition p0 VALUES LESS THAN (TO_SECONDS('2007-03-08 00:00:00')),
+partition p1 VALUES LESS THAN (TO_SECONDS('2007-04-01 00:00:00')));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE TO_SECONDS(a) 63340531200
+RANGE TO_SECONDS(a) 63342604800
+INSERT INTO t1 VALUES ('2007-03-01 12:00:00'), ('2007-03-07 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-08 12:00:00'), ('2007-03-15 12:00:00');
+explain partitions select * from t1 where a < '2007-03-08 00:00:00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a < '2007-03-08 00:00:01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a < '2007-03-07 23:59:59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
+drop table t1;
+create table t1 (a date)
+partition by range(to_seconds(a))
+(partition p0 values less than (to_seconds('2004-01-01')),
+partition p1 values less than (to_seconds('2005-01-01')));
+insert into t1 values ('2003-12-30'),('2004-12-31');
+select * from t1;
+a
+2003-12-30
+2004-12-31
+explain partitions select * from t1 where a <= '2003-12-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a <= '2003-12-31';
+a
+2003-12-30
+explain partitions select * from t1 where a <= '2005-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= '2005-01-01';
+a
+2003-12-30
+2004-12-31
+drop table t1;
+create table t1 (a datetime)
+partition by range(to_seconds(a))
+(partition p0 values less than (to_seconds('2004-01-01 12:00:00')),
+partition p1 values less than (to_seconds('2005-01-01 12:00:00')));
+insert into t1 values ('2004-01-01 11:59:29'),('2005-01-01 11:59:59');
+select * from t1;
+a
+2004-01-01 11:59:29
+2005-01-01 11:59:59
+explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a <= '2004-01-01 11:59:59';
+a
+2004-01-01 11:59:29
+explain partitions select * from t1 where a <= '2005-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= '2005-01-01';
+a
+2004-01-01 11:59:29
+drop table t1;
+create table t1 (a int, b char(20))
+partition by range columns(a,b)
+(partition p0 values less than (1));
+ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
+create table t1 (a int, b char(20))
+partition by range columns(b)
+(partition p0 values less than ("b"));
+drop table t1;
+create table t1 (a int)
+partition by range (a)
( partition p0 values less than (maxvalue));
alter table t1 add partition (partition p1 values less than (100000));
ERROR HY000: MAXVALUE can only be used in last partition definition
diff --git a/mysql-test/r/partition_truncate.result b/mysql-test/r/partition_truncate.result
new file mode 100644
index 00000000000..8f594a319df
--- /dev/null
+++ b/mysql-test/r/partition_truncate.result
@@ -0,0 +1,18 @@
+drop table if exists t1, t2, t3, t4;
+create table t1 (a int)
+partition by list (a)
+(partition p1 values in (0));
+alter table t1 truncate partition p1,p1;
+ERROR HY000: Incorrect partition name
+alter table t1 truncate partition p0;
+ERROR HY000: Incorrect partition name
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+subpartition by hash (a)
+subpartitions 1
+(partition p1 values in (1)
+(subpartition sp1));
+alter table t1 truncate partition sp1;
+ERROR HY000: Incorrect partition name
+drop table t1;
diff --git a/mysql-test/r/partition_utf8.result b/mysql-test/r/partition_utf8.result
new file mode 100644
index 00000000000..0fae7bb16b6
--- /dev/null
+++ b/mysql-test/r/partition_utf8.result
@@ -0,0 +1,53 @@
+set names utf8;
+create table t1 (a varchar(2) character set cp1250)
+partition by list columns (a)
+( partition p0 values in (0x81));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a varchar(2) character set cp1250)
+partition by list columns (a)
+( partition p0 values in (0x80));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a varchar(1500), b varchar(1570))
+partition by list columns(a,b)
+( partition p0 values in (('a','b')));
+ERROR HY000: The total length of the partitioning fields is too large
+create table t1 (a varchar(1023) character set utf8 collate utf8_spanish2_ci)
+partition by range columns(a)
+( partition p0 values less than ('CZ'),
+partition p1 values less than ('CH'),
+partition p2 values less than ('D'));
+insert into t1 values ('czz'),('chi'),('ci'),('cg');
+select * from t1 where a between 'cg' AND 'ci';
+a
+ci
+cg
+drop table t1;
+create table t1 (a varchar(2) character set ucs2)
+partition by list columns (a)
+(partition p0 values in (0x2020),
+partition p1 values in (''));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('†') ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */
+insert into t1 values ('');
+insert into t1 values (_ucs2 0x2020);
+drop table t1;
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 782d2a5a9a4..85fbd1353cc 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -12,6 +12,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
SELECT * FROM t1;
a
DROP TABLE t1;
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+Variable_name Value
+example_func_example enum_var is 0, ulong_var is 500, really
+show variables like 'example%';
+Variable_name Value
+example_enum_var e1
+example_ulong_var 500
UNINSTALL PLUGIN example;
UNINSTALL PLUGIN EXAMPLE;
ERROR 42000: PLUGIN EXAMPLE does not exist
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index c96074eb830..f20c459d7dc 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -298,6 +298,13 @@ id
1
2
3
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
select @@profiling;
@@profiling
1
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 1f8a077af40..6c7e83134d7 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1194,13 +1194,13 @@ SET @aux= "SELECT COUNT(*)
prepare my_stmt from @aux;
execute my_stmt;
COUNT(*)
-39
+40
execute my_stmt;
COUNT(*)
-39
+40
execute my_stmt;
COUNT(*)
-39
+40
deallocate prepare my_stmt;
drop procedure if exists p1|
drop table if exists t1|
@@ -2748,17 +2748,21 @@ Warnings:
Note 1051 Unknown table 't1'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't2'
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
drop procedure proc_1;
create function func_1() returns int begin show warnings; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -2922,4 +2926,165 @@ execute stmt;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
drop table t1;
deallocate prepare stmt;
+
End of 5.1 tests.
+
+#
+# WL#4435: Support OUT-parameters in prepared statements.
+#
+
+DROP PROCEDURE IF EXISTS p_string;
+DROP PROCEDURE IF EXISTS p_double;
+DROP PROCEDURE IF EXISTS p_int;
+DROP PROCEDURE IF EXISTS p_decimal;
+
+CREATE PROCEDURE p_string(
+IN v0 INT,
+OUT v1 CHAR(32),
+IN v2 CHAR(32),
+INOUT v3 CHAR(32))
+BEGIN
+SET v0 = -1;
+SET v1 = 'test_v1';
+SET v2 = 'n/a';
+SET v3 = 'test_v3';
+END|
+
+CREATE PROCEDURE p_double(
+IN v0 INT,
+OUT v1 DOUBLE(4, 2),
+IN v2 DOUBLE(4, 2),
+INOUT v3 DOUBLE(4, 2))
+BEGIN
+SET v0 = -1;
+SET v1 = 12.34;
+SET v2 = 98.67;
+SET v3 = 56.78;
+END|
+
+CREATE PROCEDURE p_int(
+IN v0 CHAR(10),
+OUT v1 INT,
+IN v2 INT,
+INOUT v3 INT)
+BEGIN
+SET v0 = 'n/a';
+SET v1 = 1234;
+SET v2 = 9876;
+SET v3 = 5678;
+END|
+
+CREATE PROCEDURE p_decimal(
+IN v0 INT,
+OUT v1 DECIMAL(4, 2),
+IN v2 DECIMAL(4, 2),
+INOUT v3 DECIMAL(4, 2))
+BEGIN
+SET v0 = -1;
+SET v1 = 12.34;
+SET v2 = 98.67;
+SET v3 = 56.78;
+END|
+
+PREPARE stmt_str FROM 'CALL p_string(?, ?, ?, ?)';
+PREPARE stmt_dbl FROM 'CALL p_double(?, ?, ?, ?)';
+PREPARE stmt_int FROM 'CALL p_int(?, ?, ?, ?)';
+PREPARE stmt_dec FROM 'CALL p_decimal(?, ?, ?, ?)';
+
+SET @x_str_1 = NULL;
+SET @x_str_2 = NULL;
+SET @x_str_3 = NULL;
+SET @x_dbl_1 = NULL;
+SET @x_dbl_2 = NULL;
+SET @x_dbl_3 = NULL;
+SET @x_int_1 = NULL;
+SET @x_int_2 = NULL;
+SET @x_int_3 = NULL;
+SET @x_dec_1 = NULL;
+SET @x_dec_2 = NULL;
+SET @x_dec_3 = NULL;
+
+-- Testing strings...
+
+EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+@x_int_1 @x_str_1 @x_str_2 @x_str_3
+NULL test_v1 NULL test_v3
+
+EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+@x_int_1 @x_str_1 @x_str_2 @x_str_3
+NULL test_v1 NULL test_v3
+
+-- Testing doubles...
+
+EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
+NULL 12.34 NULL 56.78
+
+EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
+NULL 12.34 NULL 56.78
+
+-- Testing ints...
+
+EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+@x_str_1 @x_int_1 @x_int_2 @x_int_3
+test_v1 1234 NULL 5678
+
+EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+@x_str_1 @x_int_1 @x_int_2 @x_int_3
+test_v1 1234 NULL 5678
+
+-- Testing decs...
+
+EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
+1234 12.34 NULL 56.78
+
+EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
+1234 12.34 NULL 56.78
+
+DEALLOCATE PREPARE stmt_str;
+DEALLOCATE PREPARE stmt_dbl;
+DEALLOCATE PREPARE stmt_int;
+DEALLOCATE PREPARE stmt_dec;
+
+DROP PROCEDURE p_string;
+DROP PROCEDURE p_double;
+DROP PROCEDURE p_int;
+DROP PROCEDURE p_decimal;
+
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+
+CREATE PROCEDURE p1(OUT v1 CHAR(10))
+SET v1 = 'test1';
+
+CREATE PROCEDURE p2(OUT v2 CHAR(10))
+BEGIN
+SET @query = 'CALL p1(?)';
+PREPARE stmt1 FROM @query;
+EXECUTE stmt1 USING @u1;
+DEALLOCATE PREPARE stmt1;
+SET v2 = @u1;
+END|
+
+CALL p2(@a);
+SELECT @a;
+@a
+test1
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+# End of WL#4435.
+
+End of 6.0 tests.
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index 1b2a0cc50b2..3ab65c24040 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -279,6 +279,9 @@ b char(10) YES NULL
SET @arg00=1;
execute stmt4 using @arg00;
Field Type Null Key Default Extra
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index a91d13d11a1..c51863b73f7 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1807,8 +1807,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1829,7 +1829,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1927,8 +1927,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1974,8 +1974,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2024,8 +2024,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2064,8 +2064,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2112,8 +2112,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2156,8 +2156,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2202,8 +2202,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2240,8 +2240,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 50c94d6cc4e..2670451f24e 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1790,8 +1790,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1812,7 +1812,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1910,8 +1910,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index a85809d3800..4372c470b2d 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -60,8 +60,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1791,8 +1791,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1813,7 +1813,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1911,8 +1911,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1958,8 +1958,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2008,8 +2008,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2048,8 +2048,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2096,8 +2096,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2140,8 +2140,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2186,8 +2186,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2224,8 +2224,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index fd1b69c0ffd..35a43f7c032 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -102,8 +102,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1727,8 +1727,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1749,7 +1749,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1847,8 +1847,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1894,8 +1894,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1944,8 +1944,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1984,8 +1984,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2032,8 +2032,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2076,8 +2076,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2122,8 +2122,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2160,8 +2160,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -3124,8 +3124,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -4749,8 +4749,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -4771,7 +4771,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -4869,8 +4869,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -4916,8 +4916,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -4966,8 +4966,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5006,8 +5006,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5054,8 +5054,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5098,8 +5098,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5144,8 +5144,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5182,8 +5182,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 2817bec2198..20e0fe2f1cc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -889,7 +889,7 @@ select group_concat(a) FROM t1 group by b;
group_concat(a)
1234567890
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
set group_concat_max_len=1024;
select group_concat(a) FROM t1 group by b;
group_concat(a)
@@ -992,19 +992,19 @@ COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
diff --git a/mysql-test/r/query_cache_disabled.result b/mysql-test/r/query_cache_disabled.result
new file mode 100644
index 00000000000..f2f58580ca2
--- /dev/null
+++ b/mysql-test/r/query_cache_disabled.result
@@ -0,0 +1,14 @@
+SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
+Variable_name Value
+query_cache_type OFF
+SET GLOBAL query_cache_type=ON;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_type=DEMAND;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_type=OFF;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_size=1024*1024;
+SHOW GLOBAL VARIABLES LIKE 'query_cache_size';
+Variable_name Value
+query_cache_size 1048576
+SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index 0efb2540c64..f686e876a60 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
use test;
########################################################################
+#
+# Bug#27430 Crash in subquery code when in PS and table DDL changed
+# after PREPARE
+# Check the effect of automatic reprepare on query cache
+#
+########################################################################
+drop table if exists t1;
+create table t1 (a varchar(255));
+insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
+flush status;
+prepare stmt from "select a from t1";
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=0;
+alter table t1 add column b int;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=100000;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+#
+# Sic: ALTER TABLE caused an automatic reprepare
+# of the prepared statement. Since the query cache was disabled
+# at the time of reprepare, the new prepared statement doesn't
+# work with it.
+#
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+# Cleanup
+deallocate prepare stmt;
+drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result
index dc0c4a0193a..e594161f2e9 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
use test;
########################################################################
+#
+# Bug#27430 Crash in subquery code when in PS and table DDL changed
+# after PREPARE
+# Check the effect of automatic reprepare on query cache
+#
+########################################################################
+drop table if exists t1;
+create table t1 (a varchar(255));
+insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
+flush status;
+prepare stmt from "select a from t1";
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=0;
+alter table t1 add column b int;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=100000;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+#
+# Sic: ALTER TABLE caused an automatic reprepare
+# of the prepared statement. Since the query cache was disabled
+# at the time of reprepare, the new prepared statement doesn't
+# work with it.
+#
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+# Cleanup
+deallocate prepare stmt;
+drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 64e00521cd2..aa04bfc25ea 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1587,8 +1587,8 @@ str_to_date('2007-20-00', '%Y-%m-%d') <= ''
NULL
Warnings:
Warning 1292 Truncated incorrect date value: ''
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
SELECT str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20';
str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20'
1
@@ -1598,7 +1598,7 @@ SELECT str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND '';
str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND ''
NULL
Warnings:
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
SELECT str_to_date('', '%Y-%m-%d');
str_to_date('', '%Y-%m-%d')
0000-00-00
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index d0b2a575a32..75ce166cb24 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4490,7 +4490,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
+Note 1003 select '1' AS `a`,'1' AS `b` from dual where 1
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
a b
1 1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index e6550bee954..091d932a6fc 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -61,18 +61,18 @@ Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
-def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
-def STATISTICS PACKED Packed 253 10 0 Y 0 0 8
-def STATISTICS NULLABLE Null 253 3 0 N 1 0 8
-def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
-def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 8
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 8
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
t1 1 b 1 b A 1 NULL NULL BTREE
@@ -99,45 +99,45 @@ drop table t1;
-- after Bug#29394 is implemented.
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLES TABLE_NAME Name 253 64 0 N 1 0 8
-def TABLES ENGINE Engine 253 64 0 Y 0 0 8
-def TABLES VERSION Version 8 21 0 Y 32800 0 63
-def TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
-def TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
-def TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
-def TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
-def TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
-def TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
-def TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
-def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
-def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
-def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
-def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
-def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
-def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
-def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
-def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
+def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8
+def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8
+def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
+def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
+def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
+def information_schema TABLES TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
Database
information_schema
mtr
@@ -145,7 +145,7 @@ mysql
test
show databases like "test%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
Database (test%)
test
create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
@@ -626,18 +626,18 @@ PRIMARY KEY(field1(1000))
);
show index from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
-def STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
-def STATISTICS PACKED Packed 253 10 0 Y 0 0 63
-def STATISTICS NULLABLE Null 253 3 0 N 1 0 63
-def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
-def STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 63
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 63
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE
drop table t1;
@@ -808,7 +808,6 @@ show plugins;
show columns in t1;
show slave hosts;
show keys in t1;
-show column types;
show table types;
show storage engines;
show authors;
@@ -859,21 +858,21 @@ set names utf8;
----------------------------------------------------------------
SHOW CHARACTER SET LIKE 'utf8';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
-def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
-def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
-def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
+def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
Charset Description Default collation Maxlen
utf8 UTF-8 Unicode utf8_general_ci 3
----------------------------------------------------------------
SHOW COLLATION LIKE 'latin1_bin';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
-def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
-def COLLATIONS ID Id 8 11 2 N 32769 0 63
-def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
-def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
-def COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
+def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
+def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
+def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 32769 0 63
+def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
+def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
+def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
Collation Charset Id Default Compiled Sortlen
latin1_bin latin1 47 Yes 1
----------------------------------------------------------------
@@ -886,7 +885,7 @@ mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
----------------------------------------------------------------
SHOW DATABASES LIKE 'mysqltest1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
Database (mysqltest1)
mysqltest1
----------------------------------------------------------------
@@ -902,18 +901,18 @@ t1 CREATE TABLE `t1` (
----------------------------------------------------------------
SHOW INDEX FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
-def STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
-def STATISTICS PACKED Packed 253 30 0 Y 0 0 33
-def STATISTICS NULLABLE Null 253 9 0 N 1 0 33
-def STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
-def STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 0 0 33
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 1 0 33
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 c A 0 NULL NULL BTREE
----------------------------------------------------------------
@@ -930,17 +929,17 @@ TABLE_COMMENT
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
-def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
-def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
-def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
-def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
-def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
+def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
+def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
+def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
+def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
+def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
+def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
-NULL test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
+def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
----------------------------------------------------------------
SELECT
TABLE_CATALOG,
@@ -960,53 +959,53 @@ COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
-def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
-def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
-def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
-def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
-def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
-def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
-def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
-def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
-def COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
-def COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
+def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
+def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
+def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
+def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
+def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
+def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
+def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
+def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
+def test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
----------------------------------------------------------------
SHOW TABLES LIKE 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
+def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
Tables_in_test (t1)
t1
----------------------------------------------------------------
SHOW COLUMNS FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
-def COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
-def COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
-def COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
-def COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
-def COLUMNS EXTRA Extra 253 81 0 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
+def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
+def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
Field Type Null Key Default Extra
c int(11) NO PRI NULL
----------------------------------------------------------------
SHOW TRIGGERS LIKE 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
-def TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
-def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
-def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
-def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
-def TRIGGERS CREATED Created 12 19 0 Y 128 0 63
-def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
-def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
-def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
-def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
-def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63
+def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci
----------------------------------------------------------------
@@ -1031,25 +1030,25 @@ DEFINER
FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_name = 't1_bi';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33
-def TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
-def TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
-def TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
-def TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33
-def TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
-def TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
-def TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
-def TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
-def TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
-def TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
-def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
-def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
-def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
-def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
-def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
-NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
+def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
----------------------------------------------------------------
SHOW CREATE VIEW v1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1064,18 +1063,18 @@ SELECT *
FROM INFORMATION_SCHEMA.VIEWS
WHERE table_name = 'v1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
-def VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
-def VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
-def VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
-def VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
-def VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
+def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
+def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
+def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
+def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
+def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
----------------------------------------------------------------
SHOW CREATE PROCEDURE p1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1111,26 +1110,26 @@ DEFINER
FROM INFORMATION_SCHEMA.ROUTINES
WHERE routine_name = 'p1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
-def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
-def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
-def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
-def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
-def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
-def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
-def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
-def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
-def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
-def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
-def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
-def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
-def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
+def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
SHOW CREATE FUNCTION f1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1166,26 +1165,26 @@ DEFINER
FROM INFORMATION_SCHEMA.ROUTINES
WHERE routine_name = 'f1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
-def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
-def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
-def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
-def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
-def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
-def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
-def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
-def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
-def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
-def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
-def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
-def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
-def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
+def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-f1 NULL test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
DROP DATABASE mysqltest1;
DROP TABLE t1;
@@ -1442,7 +1441,7 @@ FOR EACH ROW
SET NEW.c1 = 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
SHOW CREATE EVENT ev1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
DROP VIEW v1;
DROP PROCEDURE p1;
DROP FUNCTION f1;
diff --git a/mysql-test/r/signal.result b/mysql-test/r/signal.result
new file mode 100644
index 00000000000..7fb09b87778
--- /dev/null
+++ b/mysql-test/r/signal.result
@@ -0,0 +1,2362 @@
+#
+# PART 1: syntax
+#
+#
+# Test every new reserved and non reserved keywords
+#
+drop table if exists signal_non_reserved;
+create table signal_non_reserved (
+class_origin int,
+subclass_origin int,
+constraint_catalog int,
+constraint_schema int,
+constraint_name int,
+catalog_name int,
+schema_name int,
+table_name int,
+column_name int,
+cursor_name int,
+message_text int,
+sqlcode int
+);
+drop table signal_non_reserved;
+drop table if exists diag_non_reserved;
+create table diag_non_reserved (
+diagnostics int,
+current int,
+stacked int,
+exception int
+);
+drop table diag_non_reserved;
+drop table if exists diag_cond_non_reserved;
+create table diag_cond_non_reserved (
+condition_identifier int,
+condition_number int,
+condition_name int,
+connection_name int,
+message_length int,
+message_octet_length int,
+parameter_mode int,
+parameter_name int,
+parameter_ordinal_position int,
+returned_sqlstate int,
+routine_catalog int,
+routine_name int,
+routine_schema int,
+server_name int,
+specific_name int,
+trigger_catalog int,
+trigger_name int,
+trigger_schema int
+);
+drop table diag_cond_non_reserved;
+drop table if exists diag_stmt_non_reserved;
+create table diag_stmt_non_reserved (
+number int,
+more int,
+command_function int,
+command_function_code int,
+dynamic_function int,
+dynamic_function_code int,
+row_count int,
+transactions_committed int,
+transactions_rolled_back int,
+transaction_active int
+);
+drop table diag_stmt_non_reserved;
+drop table if exists test_reserved;
+create table test_reserved (signal int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'signal int)' at line 1
+create table test_reserved (resignal int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'resignal int)' at line 1
+create table test_reserved (condition int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition int)' at line 1
+#
+# Test the SIGNAL syntax
+#
+drop procedure if exists test_invalid;
+drop procedure if exists test_signal_syntax;
+drop function if exists test_signal_func;
+create procedure test_invalid()
+begin
+SIGNAL;
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL foo;
+end $$
+ERROR 42000: Undefined CONDITION: foo
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR 1234;
+SIGNAL foo;
+end $$
+ERROR HY000: SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+SIGNAL SQLSTATE '23000';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+SIGNAL SQLSTATE VALUE '23000';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET
+CLASS_ORIGIN = 'foo',
+SUBCLASS_ORIGIN = 'foo',
+CONSTRAINT_CATALOG = 'foo',
+CONSTRAINT_SCHEMA = 'foo',
+CONSTRAINT_NAME = 'foo',
+CATALOG_NAME = 'foo',
+SCHEMA_NAME = 'foo',
+TABLE_NAME = 'foo',
+COLUMN_NAME = 'foo',
+CURSOR_NAME = 'foo',
+MESSAGE_TEXT = 'foo',
+MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+SIGNAL SQLSTATE '00000' $$
+ERROR 42000: Bad SQLSTATE: '00000'
+SIGNAL SQLSTATE '00001' $$
+ERROR 42000: Bad SQLSTATE: '00001'
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '00000';
+end $$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '00001';
+end $$
+ERROR 42000: Bad SQLSTATE: '00001'
+#
+# Test conditions information that SIGNAL can not set
+#
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET bla_bla = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bla_bla = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONDITION_IDENTIFIER = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONDITION_IDENTIFIER = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONDITION_NUMBER = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONDITION_NUMBER = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONNECTION_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONNECTION_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET MESSAGE_LENGTH = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MESSAGE_LENGTH = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET MESSAGE_OCTET_LENGTH = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MESSAGE_OCTET_LENGTH = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_MODE = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARAMETER_MODE = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARAMETER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_ORDINAL_POSITION = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARAMETER_ORDINAL_POSITION = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET RETURNED_SQLSTATE = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURNED_SQLSTATE = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_CATALOG = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ROUTINE_CATALOG = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ROUTINE_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_SCHEMA = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ROUTINE_SCHEMA = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET SERVER_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SERVER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET SPECIFIC_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SPECIFIC_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_CATALOG = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER_CATALOG = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_NAME = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_SCHEMA = 'foo';
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER_SCHEMA = 'foo';
+end' at line 3
+#
+# Test the RESIGNAL syntax
+#
+drop procedure if exists test_invalid;
+drop procedure if exists test_resignal_syntax;
+create procedure test_invalid()
+begin
+RESIGNAL foo;
+end $$
+ERROR 42000: Undefined CONDITION: foo
+create procedure test_resignal_syntax()
+begin
+RESIGNAL;
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR 1234;
+RESIGNAL foo;
+end $$
+ERROR HY000: SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo;
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SQLSTATE '23000';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SQLSTATE VALUE '23000';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET
+CLASS_ORIGIN = 'foo',
+SUBCLASS_ORIGIN = 'foo',
+CONSTRAINT_CATALOG = 'foo',
+CONSTRAINT_SCHEMA = 'foo',
+CONSTRAINT_NAME = 'foo',
+CATALOG_NAME = 'foo',
+SCHEMA_NAME = 'foo',
+TABLE_NAME = 'foo',
+COLUMN_NAME = 'foo',
+CURSOR_NAME = 'foo',
+MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+RESIGNAL SQLSTATE '00000';
+end $$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure test_invalid()
+begin
+RESIGNAL SQLSTATE '00001';
+end $$
+ERROR 42000: Bad SQLSTATE: '00001'
+#
+# PART 2: non preparable statements
+#
+prepare stmt from 'SIGNAL SQLSTATE \'23000\'';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt from 'RESIGNAL SQLSTATE \'23000\'';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+#
+# PART 3: runtime execution
+#
+drop procedure if exists test_signal;
+drop procedure if exists test_resignal;
+drop table if exists t_warn;
+drop table if exists t_cursor;
+create table t_warn(a integer(2));
+create table t_cursor(a integer);
+#
+# SIGNAL can also appear in a query
+#
+SIGNAL foo;
+ERROR 42000: Undefined CONDITION: foo
+SIGNAL SQLSTATE '01000';
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+SIGNAL SQLSTATE '02000';
+ERROR 02000: Unhandled user-defined not found condition
+SIGNAL SQLSTATE '23000';
+ERROR 23000: Unhandled user-defined exception condition
+SIGNAL SQLSTATE VALUE '23000';
+ERROR 23000: Unhandled user-defined exception condition
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65536;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '65536'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 99999;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '99999'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 4294967295;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '4294967295'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 0;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '0'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = -1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65535;
+ERROR HY000: Unhandled user-defined exception condition
+#
+# RESIGNAL can also appear in a query
+#
+RESIGNAL;
+ERROR 0K000: RESIGNAL when handler not active
+RESIGNAL foo;
+ERROR 42000: Undefined CONDITION: foo
+RESIGNAL SQLSTATE '12345';
+ERROR 0K000: RESIGNAL when handler not active
+RESIGNAL SQLSTATE VALUE '12345';
+ERROR 0K000: RESIGNAL when handler not active
+#
+# Different kind of SIGNAL conditions
+#
+create procedure test_signal()
+begin
+# max range
+DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+SIGNAL foo SET MYSQL_ERRNO = 65535;
+end $$
+call test_signal() $$
+ERROR AABBB: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# max range
+DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+SIGNAL foo SET MYSQL_ERRNO = 65536;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '65536'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET MYSQL_ERRNO = 9999;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning
+DECLARE too_few_records CONDITION FOR SQLSTATE '01000';
+SIGNAL too_few_records SET MYSQL_ERRNO = 1261;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1261 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found
+DECLARE sp_fetch_no_data CONDITION FOR SQLSTATE '02000';
+SIGNAL sp_fetch_no_data SET MYSQL_ERRNO = 1329;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error
+DECLARE sp_cursor_already_open CONDITION FOR SQLSTATE '24000';
+SIGNAL sp_cursor_already_open SET MYSQL_ERRNO = 1325;
+end $$
+call test_signal() $$
+ERROR 24000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error
+DECLARE lock_deadlock CONDITION FOR SQLSTATE '40001';
+SIGNAL lock_deadlock SET MYSQL_ERRNO = 1213;
+end $$
+call test_signal() $$
+ERROR 40001: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Unknown -> error
+DECLARE foo CONDITION FOR SQLSTATE "99999";
+SIGNAL foo;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning, no subclass
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning, with subclass
+DECLARE warn CONDITION FOR SQLSTATE "01123";
+SIGNAL warn;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found, no subclass
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found, with subclass
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+SIGNAL not_found;
+end $$
+call test_signal() $$
+ERROR 02XXX: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error, no subclass
+DECLARE error CONDITION FOR SQLSTATE "12000";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 12000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error, with subclass
+DECLARE error CONDITION FOR SQLSTATE "12ABC";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 12ABC: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error, no subclass
+DECLARE error CONDITION FOR SQLSTATE "40000";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 40000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error, with subclass
+DECLARE error CONDITION FOR SQLSTATE "40001";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 40001: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test the scope of condition
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+begin
+DECLARE foo CONDITION FOR 8888;
+end;
+SIGNAL foo SET MYSQL_ERRNO=9999; /* outer */
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR 9999;
+begin
+DECLARE foo CONDITION FOR SQLSTATE '88888';
+SIGNAL foo SET MYSQL_ERRNO=8888; /* inner */
+end;
+end $$
+call test_signal() $$
+ERROR 88888: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test SET MYSQL_ERRNO
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1111 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55000";
+SIGNAL error SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 55000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test SET MESSAGE_TEXT
+#
+SIGNAL SQLSTATE '77777' SET MESSAGE_TEXT='' $$
+ERROR 77777:
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '77777';
+SIGNAL foo SET
+MESSAGE_TEXT = "",
+MYSQL_ERRNO=5678;
+end $$
+call test_signal() $$
+ERROR 77777:
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET
+MESSAGE_TEXT = "Something bad happened",
+MYSQL_ERRNO=9999;
+end $$
+call test_signal() $$
+ERROR 99999: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+ERROR 02000: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55000";
+SIGNAL error SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+ERROR 55000: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "01000";
+SIGNAL something SET MESSAGE_TEXT = _utf8 "This is a UTF8 text";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 This is a UTF8 text
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "01000";
+SIGNAL something SET MESSAGE_TEXT = "";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+SIGNAL warn SET MESSAGE_TEXT = "á a";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 á a
+show warnings $$
+Level Code Message
+Warning 1642 á a
+drop procedure test_signal $$
+#
+# Test SET complex expressions
+#
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+MYSQL_ERRNO = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CLASS_ORIGIN = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CLASS_ORIGIN' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+SUBCLASS_ORIGIN = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'SUBCLASS_ORIGIN' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_CATALOG = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_CATALOG' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_SCHEMA = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_SCHEMA' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CATALOG_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CATALOG_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+SCHEMA_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'SCHEMA_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+TABLE_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'TABLE_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+COLUMN_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'COLUMN_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CURSOR_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CURSOR_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+MESSAGE_TEXT = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE '99999';
+DECLARE message_text VARCHAR(64) DEFAULT "Local string variable";
+DECLARE sqlcode INTEGER DEFAULT 1234;
+SIGNAL something SET
+MESSAGE_TEXT = message_text,
+MYSQL_ERRNO = sqlcode;
+end $$
+call test_signal() $$
+ERROR 99999: Local string variable
+drop procedure test_signal $$
+create procedure test_signal(message_text VARCHAR(64), sqlcode INTEGER)
+begin
+DECLARE something CONDITION FOR SQLSTATE "12345";
+SIGNAL something SET
+MESSAGE_TEXT = message_text,
+MYSQL_ERRNO = sqlcode;
+end $$
+call test_signal("Parameter string", NULL) $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'NULL'
+call test_signal(NULL, 1234) $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+call test_signal("Parameter string", 5678) $$
+ERROR 12345: Parameter string
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "AABBB";
+SIGNAL something SET
+MESSAGE_TEXT = @message_text,
+MYSQL_ERRNO = @sqlcode;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+set @sqlcode= 12 $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+set @message_text= "User variable" $$
+call test_signal() $$
+ERROR AABBB: User variable
+drop procedure test_signal $$
+create procedure test_invalid()
+begin
+DECLARE something CONDITION FOR SQLSTATE "AABBB";
+SIGNAL something SET
+MESSAGE_TEXT = @message_text := 'illegal',
+MYSQL_ERRNO = @sqlcode := 1234;
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
+MYSQL_ERRNO = @sqlcode := 1234;
+end' at line 5
+create procedure test_signal()
+begin
+DECLARE aaa VARCHAR(64);
+DECLARE bbb VARCHAR(64);
+DECLARE ccc VARCHAR(64);
+DECLARE ddd VARCHAR(64);
+DECLARE eee VARCHAR(64);
+DECLARE fff VARCHAR(64);
+DECLARE ggg VARCHAR(64);
+DECLARE hhh VARCHAR(64);
+DECLARE iii VARCHAR(64);
+DECLARE jjj VARCHAR(64);
+DECLARE kkk VARCHAR(64);
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+set aaa= repeat("A", 64);
+set bbb= repeat("B", 64);
+set ccc= repeat("C", 64);
+set ddd= repeat("D", 64);
+set eee= repeat("E", 64);
+set fff= repeat("F", 64);
+set ggg= repeat("G", 64);
+set hhh= repeat("H", 64);
+set iii= repeat("I", 64);
+set jjj= repeat("J", 64);
+set kkk= repeat("K", 64);
+SIGNAL warn SET
+CLASS_ORIGIN = aaa,
+SUBCLASS_ORIGIN = bbb,
+CONSTRAINT_CATALOG = ccc,
+CONSTRAINT_SCHEMA = ddd,
+CONSTRAINT_NAME = eee,
+CATALOG_NAME = fff,
+SCHEMA_NAME = ggg,
+TABLE_NAME = hhh,
+COLUMN_NAME = iii,
+CURSOR_NAME = jjj,
+MESSAGE_TEXT = kkk,
+MYSQL_ERRNO = 65535;
+end $$
+call test_signal() $$
+Warnings:
+Warning 65535 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+SIGNAL warn SET
+MYSQL_ERRNO = 999999999999999999999999999999999999999999999999999;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '999999999999999999999999999999999999999999999999999'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE aaax VARCHAR(65);
+DECLARE bbbx VARCHAR(65);
+DECLARE cccx VARCHAR(65);
+DECLARE dddx VARCHAR(65);
+DECLARE eeex VARCHAR(65);
+DECLARE fffx VARCHAR(65);
+DECLARE gggx VARCHAR(65);
+DECLARE hhhx VARCHAR(65);
+DECLARE iiix VARCHAR(65);
+DECLARE jjjx VARCHAR(65);
+DECLARE kkkx VARCHAR(65);
+DECLARE lllx VARCHAR(129);
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+set aaax= concat(repeat("A", 64), "X");
+set bbbx= concat(repeat("B", 64), "X");
+set cccx= concat(repeat("C", 64), "X");
+set dddx= concat(repeat("D", 64), "X");
+set eeex= concat(repeat("E", 64), "X");
+set fffx= concat(repeat("F", 64), "X");
+set gggx= concat(repeat("G", 64), "X");
+set hhhx= concat(repeat("H", 64), "X");
+set iiix= concat(repeat("I", 64), "X");
+set jjjx= concat(repeat("J", 64), "X");
+set kkkx= concat(repeat("K", 64), "X");
+set lllx= concat(repeat("1", 100),
+repeat("2", 20),
+repeat("8", 8),
+"X");
+SIGNAL warn SET
+CLASS_ORIGIN = aaax,
+SUBCLASS_ORIGIN = bbbx,
+CONSTRAINT_CATALOG = cccx,
+CONSTRAINT_SCHEMA = dddx,
+CONSTRAINT_NAME = eeex,
+CATALOG_NAME = fffx,
+SCHEMA_NAME = gggx,
+TABLE_NAME = hhhx,
+COLUMN_NAME = iiix,
+CURSOR_NAME = jjjx,
+MESSAGE_TEXT = lllx,
+MYSQL_ERRNO = 10000;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1647 Data truncated for condition item 'CLASS_ORIGIN'
+Warning 1647 Data truncated for condition item 'SUBCLASS_ORIGIN'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_CATALOG'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_SCHEMA'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_NAME'
+Warning 1647 Data truncated for condition item 'CATALOG_NAME'
+Warning 1647 Data truncated for condition item 'SCHEMA_NAME'
+Warning 1647 Data truncated for condition item 'TABLE_NAME'
+Warning 1647 Data truncated for condition item 'COLUMN_NAME'
+Warning 1647 Data truncated for condition item 'CURSOR_NAME'
+Warning 1647 Data truncated for condition item 'MESSAGE_TEXT'
+Warning 10000 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222288888888
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for SQLSTATE "01234"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for SQLWARNING
+begin
+select "Caught by SQLWARNING";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLWARNING
+Caught by SQLWARNING
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for SQLSTATE "02ABC"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for NOT FOUND
+begin
+select "Caught by NOT FOUND";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by NOT FOUND
+Caught by NOT FOUND
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for SQLSTATE "55555"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for SQLEXCEPTION
+begin
+select "Caught by SQLEXCEPTION";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLEXCEPTION
+Caught by SQLEXCEPTION
+drop procedure test_signal $$
+#
+# Test where SIGNAL can be used
+#
+create function test_signal_func() returns integer
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+SIGNAL warn SET
+MESSAGE_TEXT = "This function SIGNAL a warning",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+test_signal_func()
+5
+Warnings:
+Warning 1012 This function SIGNAL a warning
+drop function test_signal_func $$
+create function test_signal_func() returns integer
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+SIGNAL not_found SET
+MESSAGE_TEXT = "This function SIGNAL not found",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+ERROR 02XXX: This function SIGNAL not found
+drop function test_signal_func $$
+create function test_signal_func() returns integer
+begin
+DECLARE error CONDITION FOR SQLSTATE "50000";
+SIGNAL error SET
+MESSAGE_TEXT = "This function SIGNAL an error",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+ERROR 50000: This function SIGNAL an error
+drop function test_signal_func $$
+drop table if exists t1 $$
+create table t1 (a integer) $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+set msg= concat("This trigger SIGNAL a warning, a=", NEW.a);
+SIGNAL warn SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (1), (2) $$
+Warnings:
+Warning 1012 This trigger SIGNAL a warning, a=1
+Warning 1012 This trigger SIGNAL a warning, a=2
+drop trigger t1_ai $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+set msg= concat("This trigger SIGNAL a not found, a=", NEW.a);
+SIGNAL not_found SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (3), (4) $$
+ERROR 02XXX: This trigger SIGNAL a not found, a=3
+drop trigger t1_ai $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE error CONDITION FOR SQLSTATE "03XXX";
+set msg= concat("This trigger SIGNAL an error, a=", NEW.a);
+SIGNAL error SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (5), (6) $$
+ERROR 03XXX: This trigger SIGNAL an error, a=5
+drop table t1 $$
+create table t1 (errno integer, msg varchar(128)) $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+SIGNAL warn SET
+MESSAGE_TEXT = NEW.msg,
+MYSQL_ERRNO = NEW.errno;
+end $$
+insert into t1 set errno=1012, msg='Warning message 1 in trigger' $$
+Warnings:
+Warning 1012 Warning message 1 in trigger
+insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$
+Warnings:
+Warning 1013 Warning message 2 in trigger
+drop table t1 $$
+drop table if exists t1 $$
+drop procedure if exists p1 $$
+drop function if exists f1 $$
+create table t1 (s1 int) $$
+insert into t1 values (1) $$
+create procedure p1()
+begin
+declare a int;
+declare c cursor for select f1() from t1;
+declare continue handler for sqlstate '03000'
+ select "caught 03000";
+declare continue handler for 1326
+select "caught cursor is not open";
+select "Before open";
+open c;
+select "Before fetch";
+fetch c into a;
+select "Before close";
+close c;
+end $$
+create function f1() returns int
+begin
+signal sqlstate '03000';
+return 5;
+end $$
+drop table t1 $$
+drop procedure p1 $$
+drop function f1 $$
+#
+# Test the RESIGNAL runtime
+#
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1012 Raising a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02222";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: Raising a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 55555: Raising an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02000: No data - zero rows fetched, selected, or processed
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 42S02: Unknown table 'no_such_table'
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 5555 RESIGNAL of a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02111: RESIGNAL of a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "33333";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL of an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 5555 RESIGNAL of a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02000: RESIGNAL of not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 42S02: RESIGNAL of an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1012 Raising a warning
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Warning 1012 Raising a warning
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Warning 1012 Raising a warning
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1012 Raising a not found
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Error 1012 Raising a not found
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Error 1012 Raising a not found
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1012 Raising an error
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Error 1012 Raising an error
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Error 1012 Raising an error
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Warning 1264 Out of range value for column 'a' at row 1
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Warning 1264 Out of range value for column 'a' at row 1
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1051 Unknown table 'no_such_table'
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Error 1051 Unknown table 'no_such_table'
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Error 1051 Unknown table 'no_such_table'
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+#
+# More complex cases
+#
+drop procedure if exists peter_p1 $$
+drop procedure if exists peter_p2 $$
+CREATE PROCEDURE peter_p1 ()
+BEGIN
+DECLARE x CONDITION FOR 1231;
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '2';
+RESIGNAL SET MYSQL_ERRNO = 9999;
+END;
+BEGIN
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '1';
+RESIGNAL SET SCHEMA_NAME = 'test';
+END;
+SET @@sql_mode=NULL;
+END;
+END
+$$
+CREATE PROCEDURE peter_p2 ()
+BEGIN
+DECLARE x CONDITION for 9999;
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '3';
+RESIGNAL SET MESSAGE_TEXT = 'Hi, I am a useless error message';
+END;
+CALL peter_p1();
+END
+$$
+CALL peter_p2() $$
+1
+1
+2
+2
+3
+3
+ERROR 42000: Hi, I am a useless error message
+show warnings $$
+Level Code Message
+Error 9999 Hi, I am a useless error message
+drop procedure peter_p1 $$
+drop procedure peter_p2 $$
+CREATE PROCEDURE peter_p1 ()
+BEGIN
+DECLARE x CONDITION FOR SQLSTATE '42000';
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '2';
+RESIGNAL x SET MYSQL_ERRNO = 9999;
+END;
+BEGIN
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '1';
+RESIGNAL x SET
+SCHEMA_NAME = 'test',
+MYSQL_ERRNO= 1231;
+END;
+/* Raises ER_WRONG_VALUE_FOR_VAR : 1231, SQLSTATE 42000 */
+SET @@sql_mode=NULL;
+END;
+END
+$$
+CREATE PROCEDURE peter_p2 ()
+BEGIN
+DECLARE x CONDITION for SQLSTATE '42000';
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '3';
+RESIGNAL x SET
+MESSAGE_TEXT = 'Hi, I am a useless error message',
+MYSQL_ERRNO = 9999;
+END;
+CALL peter_p1();
+END
+$$
+CALL peter_p2() $$
+1
+1
+2
+2
+3
+3
+ERROR 42000: Hi, I am a useless error message
+show warnings $$
+Level Code Message
+Error 1231 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 1231 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 9999 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 9999 Hi, I am a useless error message
+drop procedure peter_p1 $$
+drop procedure peter_p2 $$
+drop procedure if exists peter_p3 $$
+Warnings:
+Note 1305 PROCEDURE peter_p3 does not exist
+create procedure peter_p3()
+begin
+declare continue handler for sqlexception
+resignal sqlstate '99002' set mysql_errno = 2;
+signal sqlstate '99001' set mysql_errno = 1, message_text = "Original";
+end $$
+call peter_p3() $$
+ERROR 99002: Original
+show warnings $$
+Level Code Message
+Error 1 Original
+Error 2 Original
+drop procedure peter_p3 $$
+drop table t_warn;
+drop table t_cursor;
+#
+# Miscelaneous test cases
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 0x12; /* 18 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 0b00010010; /* 18 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = '65'; /* 65 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'A'; /* illegal */
+end $$
+call test_signal $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'A'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = "65"; /* 65 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = "A"; /* illegal */
+end $$
+call test_signal $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'A'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = `65`; /* illegal */
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column '65' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = `A`; /* illegal */
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column 'A' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 3.141592; /* 3 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT= 0x41; /* A */
+end $$
+call test_signal $$
+ERROR 12345: A
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT= 0b01000001; /* A */
+end $$
+call test_signal $$
+ERROR 12345: A
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = "Hello";
+end $$
+call test_signal $$
+ERROR 12345: Hello
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = 'Hello';
+end $$
+call test_signal $$
+ERROR 12345: Hello
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = `Hello`;
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column 'Hello' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = 65.4321;
+end $$
+call test_signal $$
+ERROR 12345: 65.4321
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE céèçà foo CONDITION FOR SQLSTATE '12345';
+SIGNAL céèçà SET MYSQL_ERRNO = 1000;
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '©Ã¨Ã§Ã  foo CONDITION FOR SQLSTATE '12345';
+SIGNAL céèçà SET ' at line 3
+create procedure test_signal()
+begin
+DECLARE "céèçà" CONDITION FOR SQLSTATE '12345';
+SIGNAL "céèçà" SET MYSQL_ERRNO = 1000;
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"céèçà" CONDITION FOR SQLSTATE '12345';
+SIGNAL "céèçà" S' at line 3
+create procedure test_signal()
+begin
+DECLARE 'céèçà' CONDITION FOR SQLSTATE '12345';
+SIGNAL 'céèçà' SET MYSQL_ERRNO = 1000;
+end $$
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''céèçà' CONDITION FOR SQLSTATE '12345';
+SIGNAL 'céèçà' S' at line 3
+create procedure test_signal()
+begin
+DECLARE `céèçà` CONDITION FOR SQLSTATE '12345';
+SIGNAL `céèçà` SET MYSQL_ERRNO = 1000;
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+SIGNAL SQLSTATE '77777' SET MYSQL_ERRNO = 1000, MESSAGE_TEXT='ÃÂÃÅÄ';
+end $$
+drop procedure test_signal $$
diff --git a/mysql-test/r/signal_code.result b/mysql-test/r/signal_code.result
new file mode 100644
index 00000000000..8cda8877216
--- /dev/null
+++ b/mysql-test/r/signal_code.result
@@ -0,0 +1,35 @@
+use test;
+drop procedure if exists signal_proc;
+drop function if exists signal_func;
+create procedure signal_proc()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+RESIGNAL foo;
+RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+end $$
+create function signal_func() returns int
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+RESIGNAL foo;
+RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+return 0;
+end $$
+show procedure code signal_proc;
+Pos Instruction
+0 stmt 135 "SIGNAL foo"
+1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 136 "RESIGNAL foo"
+3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+drop procedure signal_proc;
+show function code signal_func;
+Pos Instruction
+0 stmt 135 "SIGNAL foo"
+1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 136 "RESIGNAL foo"
+3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+4 freturn 3 0
+drop function signal_func;
diff --git a/mysql-test/r/signal_demo1.result b/mysql-test/r/signal_demo1.result
new file mode 100644
index 00000000000..752f23a48d6
--- /dev/null
+++ b/mysql-test/r/signal_demo1.result
@@ -0,0 +1,270 @@
+drop database if exists demo;
+create database demo;
+use demo;
+create table ab_physical_person (
+person_id integer,
+first_name VARCHAR(50),
+middle_initial CHAR,
+last_name VARCHAR(50),
+primary key (person_id));
+create table ab_moral_person (
+company_id integer,
+name VARCHAR(100),
+primary key (company_id));
+create table in_inventory (
+item_id integer,
+descr VARCHAR(50),
+stock integer,
+primary key (item_id));
+create table po_order (
+po_id integer auto_increment,
+cust_type char, /* arc relationship, see cust_id */
+cust_id integer, /* FK to ab_physical_person *OR* ab_moral_person */
+primary key (po_id));
+create table po_order_line (
+po_id integer, /* FK to po_order.po_id */
+line_no integer,
+item_id integer, /* FK to in_inventory.item_id */
+qty integer);
+#
+# Schema integrity enforcement
+#
+create procedure check_pk_person(in person_type char, in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+/*
+Test integrity constraints for an 'arc' relationship.
+Based on 'person_type', 'id' points to either a
+physical person, or a moral person.
+*/
+case person_type
+when 'P' then
+begin
+select count(person_id) from ab_physical_person
+where ab_physical_person.person_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('No such physical person, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end;
+when 'M' then
+begin
+select count(company_id) from ab_moral_person
+where ab_moral_person.company_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('No such moral person, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end;
+else
+begin
+set msg= concat('No such person type:', person_type);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 20000;
+end;
+end case;
+end
+$$
+create procedure check_pk_inventory(in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+select count(item_id) from in_inventory
+where in_inventory.item_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('Failed integrity constraint, table in_inventory, PK:',
+id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end
+$$
+create procedure check_pk_order(in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+select count(po_id) from po_order
+where po_order.po_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('Failed integrity constraint, table po_order, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end
+$$
+create trigger po_order_bi before insert on po_order
+for each row
+begin
+call check_pk_person(NEW.cust_type, NEW.cust_id);
+end
+$$
+create trigger po_order_bu before update on po_order
+for each row
+begin
+call check_pk_person(NEW.cust_type, NEW.cust_id);
+end
+$$
+create trigger po_order_line_bi before insert on po_order_line
+for each row
+begin
+call check_pk_order(NEW.po_id);
+call check_pk_inventory(NEW.item_id);
+end
+$$
+create trigger po_order_line_bu before update on po_order_line
+for each row
+begin
+call check_pk_order(NEW.po_id);
+call check_pk_inventory(NEW.item_id);
+end
+$$
+#
+# Application helpers
+#
+create procedure po_create_order(
+in p_cust_type char,
+in p_cust_id integer,
+out id integer)
+begin
+insert into po_order set cust_type = p_cust_type, cust_id = p_cust_id;
+set id = last_insert_id();
+end
+$$
+create procedure po_add_order_line(
+in po integer,
+in line integer,
+in item integer,
+in q integer)
+begin
+insert into po_order_line set
+po_id = po, line_no = line, item_id = item, qty = q;
+end
+$$
+#
+# Create sample data
+#
+insert into ab_physical_person values
+( 1, "John", "A", "Doe"),
+( 2, "Marry", "B", "Smith")
+;
+insert into ab_moral_person values
+( 3, "ACME real estate, INC"),
+( 4, "Local school")
+;
+insert into in_inventory values
+( 100, "Table, dinner", 5),
+( 101, "Chair", 20),
+( 200, "Table, coffee", 3),
+( 300, "School table", 25),
+( 301, "School chairs", 50)
+;
+select * from ab_physical_person order by person_id;
+person_id first_name middle_initial last_name
+1 John A Doe
+2 Marry B Smith
+select * from ab_moral_person order by company_id;
+company_id name
+3 ACME real estate, INC
+4 Local school
+select * from in_inventory order by item_id;
+item_id descr stock
+100 Table, dinner 5
+101 Chair 20
+200 Table, coffee 3
+300 School table 25
+301 School chairs 50
+#
+# Entering an order
+#
+set @my_po = 0;
+/* John Doe wants 1 table and 4 chairs */
+call po_create_order("P", 1, @my_po);
+call po_add_order_line (@my_po, 1, 100, 1);
+call po_add_order_line (@my_po, 2, 101, 4);
+/* Marry Smith wants a coffee table */
+call po_create_order("P", 2, @my_po);
+call po_add_order_line (@my_po, 1, 200, 1);
+#
+# Entering bad data in an order
+#
+call po_add_order_line (@my_po, 1, 999, 1);
+ERROR 45000: Failed integrity constraint, table in_inventory, PK:999
+#
+# Entering bad data in an unknown order
+#
+call po_add_order_line (99, 1, 100, 1);
+ERROR 45000: Failed integrity constraint, table po_order, PK:99
+#
+# Entering an order for an unknown company
+#
+call po_create_order("M", 7, @my_po);
+ERROR 45000: No such moral person, PK:7
+#
+# Entering an order for an unknown person type
+#
+call po_create_order("X", 1, @my_po);
+ERROR 45000: No such person type:X
+/* The local school wants 10 class tables and 20 chairs */
+call po_create_order("M", 4, @my_po);
+call po_add_order_line (@my_po, 1, 300, 10);
+call po_add_order_line (@my_po, 2, 301, 20);
+select * from po_order;
+po_id cust_type cust_id
+1 P 1
+2 P 2
+3 M 4
+select * from po_order_line;
+po_id line_no item_id qty
+1 1 100 1
+1 2 101 4
+2 1 200 1
+3 1 300 10
+3 2 301 20
+select po_id as "PO#",
+( case cust_type
+when "P" then concat (pp.first_name,
+" ",
+pp.middle_initial,
+" ",
+pp.last_name)
+when "M" then mp.name
+end ) as "Sold to"
+ from po_order po
+left join ab_physical_person pp on po.cust_id = pp.person_id
+left join ab_moral_person mp on po.cust_id = company_id
+;
+PO# Sold to
+1 John A Doe
+2 Marry B Smith
+3 Local school
+select po_id as "PO#",
+ol.line_no as "Line",
+ol.item_id as "Item",
+inv.descr as "Description",
+ol.qty as "Quantity"
+ from po_order_line ol, in_inventory inv
+where inv.item_id = ol.item_id
+order by ol.item_id, ol.line_no;
+PO# Line Item Description Quantity
+1 1 100 Table, dinner 1
+1 2 101 Chair 4
+2 1 200 Table, coffee 1
+3 1 300 School table 10
+3 2 301 School chairs 20
+drop database demo;
diff --git a/mysql-test/r/signal_demo2.result b/mysql-test/r/signal_demo2.result
new file mode 100644
index 00000000000..223030b0624
--- /dev/null
+++ b/mysql-test/r/signal_demo2.result
@@ -0,0 +1,197 @@
+drop database if exists demo;
+create database demo;
+use demo;
+create procedure proc_top_a(p1 integer)
+begin
+## DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+end;
+select "Starting ...";
+call proc_middle_a(p1);
+select "The end";
+end
+$$
+create procedure proc_middle_a(p1 integer)
+begin
+DECLARE l integer;
+# without RESIGNAL:
+# Should be: DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
+DECLARE EXIT HANDLER for 1 /* not sure how to handle exceptions */
+begin
+select "Oops ... now what ?";
+end;
+select "In prod_middle()";
+create temporary table t1(a integer, b integer);
+select GET_LOCK("user_mutex", 10) into l;
+insert into t1 set a = p1, b = p1;
+call proc_bottom_a(p1);
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end
+$$
+create procedure proc_bottom_a(p1 integer)
+begin
+select "In proc_bottom()";
+if (p1 = 1) then
+begin
+select "Doing something that works ...";
+select * from t1;
+end;
+end if;
+if (p1 = 2) then
+begin
+select "Doing something that fail (simulate an error) ...";
+drop table no_such_table;
+end;
+end if;
+if (p1 = 3) then
+begin
+select "Doing something that *SHOULD* works ...";
+select * from t1;
+end;
+end if;
+end
+$$
+call proc_top_a(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+call proc_top_a(2);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that fail (simulate an error) ...
+Doing something that fail (simulate an error) ...
+ERROR 42S02: Unknown table 'no_such_table'
+call proc_top_a(3);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+ERROR 42S01: Table 't1' already exists
+call proc_top_a(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+ERROR 42S01: Table 't1' already exists
+drop temporary table if exists t1;
+create procedure proc_top_b(p1 integer)
+begin
+select "Starting ...";
+call proc_middle_b(p1);
+select "The end";
+end
+$$
+create procedure proc_middle_b(p1 integer)
+begin
+DECLARE l integer;
+DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+begin
+DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+/* Ignore errors from the cleanup code */
+end;
+select "Doing cleanup !";
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end;
+RESIGNAL;
+end;
+select "In prod_middle()";
+create temporary table t1(a integer, b integer);
+select GET_LOCK("user_mutex", 10) into l;
+insert into t1 set a = p1, b = p1;
+call proc_bottom_b(p1);
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end
+$$
+create procedure proc_bottom_b(p1 integer)
+begin
+select "In proc_bottom()";
+if (p1 = 1) then
+begin
+select "Doing something that works ...";
+select * from t1;
+end;
+end if;
+if (p1 = 2) then
+begin
+select "Doing something that fail (simulate an error) ...";
+drop table no_such_table;
+end;
+end if;
+if (p1 = 3) then
+begin
+select "Doing something that *SHOULD* works ...";
+select * from t1;
+end;
+end if;
+end
+$$
+call proc_top_b(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+call proc_top_b(2);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that fail (simulate an error) ...
+Doing something that fail (simulate an error) ...
+Doing cleanup !
+Doing cleanup !
+ERROR 42S02: Unknown table 'no_such_table'
+call proc_top_b(3);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that *SHOULD* works ...
+Doing something that *SHOULD* works ...
+a b
+3 3
+The end
+The end
+call proc_top_b(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+drop database demo;
diff --git a/mysql-test/r/signal_demo3.result b/mysql-test/r/signal_demo3.result
new file mode 100644
index 00000000000..aa769659e51
--- /dev/null
+++ b/mysql-test/r/signal_demo3.result
@@ -0,0 +1,143 @@
+SET @start_global_value = @@global.max_error_count;
+SELECT @start_global_value;
+@start_global_value
+64
+SET @start_session_value = @@session.max_error_count;
+SELECT @start_session_value;
+@start_session_value
+64
+drop database if exists demo;
+create database demo;
+use demo;
+create procedure proc_1()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_1';
+call proc_2();
+end
+$$
+create procedure proc_2()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_2';
+call proc_3();
+end
+$$
+create procedure proc_3()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_3';
+call proc_4();
+end
+$$
+create procedure proc_4()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_4';
+call proc_5();
+end
+$$
+create procedure proc_5()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_5';
+call proc_6();
+end
+$$
+create procedure proc_6()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_6';
+call proc_7();
+end
+$$
+create procedure proc_7()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_7';
+call proc_8();
+end
+$$
+create procedure proc_8()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_8';
+call proc_9();
+end
+$$
+create procedure proc_9()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_9';
+## Do something that fails, to see how errors are reported
+drop table oops_it_is_not_here;
+end
+$$
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1051 Unknown table 'oops_it_is_not_here'
+Error 1644 Oops in proc_9
+Error 1644 Oops in proc_8
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 5;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+5
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 7;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+7
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 9;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+9
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_9
+Error 1644 Oops in proc_8
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+drop database demo;
+SET @@global.max_error_count = @start_global_value;
+SELECT @@global.max_error_count;
+@@global.max_error_count
+64
+SET @@session.max_error_count = @start_session_value;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+64
diff --git a/mysql-test/r/signal_sqlmode.result b/mysql-test/r/signal_sqlmode.result
new file mode 100644
index 00000000000..8fed85eb4a9
--- /dev/null
+++ b/mysql-test/r/signal_sqlmode.result
@@ -0,0 +1,86 @@
+SET @save_sql_mode=@@sql_mode;
+SET sql_mode='';
+drop procedure if exists p;
+drop procedure if exists p2;
+drop procedure if exists p3;
+create procedure p()
+begin
+declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
+set utf8_var = concat(repeat('A', 128), 'X');
+select length(utf8_var), utf8_var;
+end
+$$
+create procedure p2()
+begin
+declare msg VARCHAR(129) CHARACTER SET UTF8;
+set msg = concat(repeat('A', 128), 'X');
+select length(msg), msg;
+signal sqlstate '55555' set message_text = msg;
+end
+$$
+create procedure p3()
+begin
+declare name VARCHAR(65) CHARACTER SET UTF8;
+set name = concat(repeat('A', 64), 'X');
+select length(name), name;
+signal sqlstate '55555' set
+message_text = 'Message',
+table_name = name;
+end
+$$
+call p;
+length(utf8_var) utf8_var
+128 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+Warnings:
+Warning 1265 Data truncated for column 'utf8_var' at row 1
+call p2;
+length(msg) msg
+129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR 55555: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+call p3;
+length(name) name
+65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR 55555: Message
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+SET sql_mode='STRICT_ALL_TABLES';
+create procedure p()
+begin
+declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
+set utf8_var = concat(repeat('A', 128), 'X');
+select length(utf8_var), utf8_var;
+end
+$$
+create procedure p2()
+begin
+declare msg VARCHAR(129) CHARACTER SET UTF8;
+set msg = concat(repeat('A', 128), 'X');
+select length(msg), msg;
+signal sqlstate '55555' set message_text = msg;
+end
+$$
+create procedure p3()
+begin
+declare name VARCHAR(65) CHARACTER SET UTF8;
+set name = concat(repeat('A', 64), 'X');
+select length(name), name;
+signal sqlstate '55555' set
+message_text = 'Message',
+table_name = name;
+end
+$$
+call p;
+ERROR 22001: Data too long for column 'utf8_var' at row 1
+call p2;
+length(msg) msg
+129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR HY000: Data too long for condition item 'MESSAGE_TEXT'
+call p3;
+length(name) name
+65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR HY000: Data too long for condition item 'TABLE_NAME'
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+SET @@sql_mode=@save_sql_mode;
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 39770dc4f2a..949976719ea 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -155,11 +155,11 @@ Pos Instruction
0 stmt 9 "drop temporary table if exists sudoku..."
1 stmt 1 "create temporary table sudoku_work ( ..."
2 stmt 1 "create temporary table sudoku_schedul..."
-3 stmt 94 "call sudoku_init()"
+3 stmt 93 "call sudoku_init()"
4 jump_if_not 7(8) p_naive@0
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
6 jump 8
-7 stmt 94 "call sudoku_count()"
+7 stmt 93 "call sudoku_count()"
8 stmt 6 "insert into sudoku_schedule (row,col)..."
9 set v_scounter@2 0
10 set v_i@3 1
diff --git a/mysql-test/r/sp-dynamic.result b/mysql-test/r/sp-dynamic.result
index 34b76a9424f..cdfeb8ab020 100644
--- a/mysql-test/r/sp-dynamic.result
+++ b/mysql-test/r/sp-dynamic.result
@@ -97,8 +97,6 @@ end|
call p1()|
a
1
-Warnings:
-Note 1051 Unknown table 't1'
call p1()|
a
1
@@ -371,9 +369,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
@@ -382,9 +377,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
diff --git a/mysql-test/r/sp-no-code.result b/mysql-test/r/sp-no-code.result
new file mode 100644
index 00000000000..77d2c93eaf6
--- /dev/null
+++ b/mysql-test/r/sp-no-code.result
@@ -0,0 +1,4 @@
+show procedure code foo;
+ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
+show function code foo;
+ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index c45ada2047a..4ea26d1021a 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -349,9 +349,9 @@ CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
---> connection: mysqltest_1_con
USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
---> connection: mysqltest_2_con
use mysqltest;
diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result
index f5420a62f63..f167986e82c 100644
--- a/mysql-test/r/sp-vars.result
+++ b/mysql-test/r/sp-vars.result
@@ -110,24 +110,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -143,21 +125,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -198,24 +165,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -231,21 +180,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -451,10 +385,6 @@ FF
HEX(v10)
FF
Warnings:
-Warning 1264 Out of range value for column 'v8' at row 1
-Warning 1264 Out of range value for column 'v9' at row 1
-Warning 1264 Out of range value for column 'v10' at row 1
-Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
DROP PROCEDURE p1;
@@ -1228,3 +1158,30 @@ f1() @b
0 abc
drop function f1;
drop table t1;
+
+---------------------------------------------------------------
+BUG#28299
+---------------------------------------------------------------
+
+CREATE PROCEDURE ctest()
+BEGIN
+DECLARE i CHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL ctest();
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'string '
+DROP PROCEDURE ctest;
+CREATE PROCEDURE vctest()
+BEGIN
+DECLARE i VARCHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL vctest();
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'string'
+DROP PROCEDURE vctest;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 83ad7545685..91a4ceae55c 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -526,8 +526,6 @@ end|
delete from t1|
create table t3 ( s char(16), d int)|
call into_test4()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t3|
s d
into4 NULL
@@ -1120,8 +1118,6 @@ end|
select f9()|
f9()
6
-Warnings:
-Note 1051 Unknown table 't3'
select f9() from t1 limit 1|
f9()
6
@@ -1162,8 +1158,6 @@ drop temporary table t3|
select f12_1()|
f12_1()
3
-Warnings:
-Note 1051 Unknown table 't3'
select f12_1() from t1 limit 1|
f12_1()
3
@@ -2069,12 +2063,7 @@ end if;
insert into t4 values (2, rc, t3);
end|
call bug1863(10)|
-Warnings:
-Note 1051 Unknown table 'temp_t1'
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug1863(10)|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t4|
f1 rc t3
2 0 NULL
@@ -2339,11 +2328,7 @@ begin
end|
call bug4579_1()|
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
@@ -2392,7 +2377,6 @@ create procedure bug4902()
begin
show charset like 'foo';
show collation like 'foo';
-show column types;
show create table t1;
show create database test;
show databases like 'foo';
@@ -2410,9 +2394,6 @@ end|
call bug4902()|
Charset Description Default collation Maxlen
Collation Charset Id Default Compiled Sortlen
-Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
-tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
-tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
Table Create Table
t1 CREATE TABLE `t1` (
`id` char(16) NOT NULL DEFAULT '',
@@ -2434,9 +2415,6 @@ Level Code Message
call bug4902()|
Charset Description Default collation Maxlen
Collation Charset Id Default Compiled Sortlen
-Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
-tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
-tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
Table Create Table
t1 CREATE TABLE `t1` (
`id` char(16) NOT NULL DEFAULT '',
@@ -3736,9 +3714,6 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-Warnings:
-Warning 1264 Out of range value for column 'spv1' at row 1
-Warning 1366 Incorrect decimal value: 'test' for column 'spv1' at row 1
call bug12589_2()|
Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
@@ -6106,35 +6081,6 @@ bug5274_f2()
x
Warnings:
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
drop procedure if exists proc_21513|
@@ -6229,20 +6175,17 @@ f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
PREPARE s1 FROM 'SELECT f1(2)';
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
@@ -6254,6 +6197,7 @@ create procedure mysqltest_db1.sp_bug28551() begin end;
call mysqltest_db1.sp_bug28551();
show warnings;
Level Code Message
+Note 1008 Can't drop database 'mysqltest_db1'; database doesn't exist
drop database mysqltest_db1;
drop database if exists mysqltest_db1;
drop table if exists test.t1;
@@ -7040,3 +6984,35 @@ DROP PROCEDURE p5;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t_non_existing;
+DROP TABLE IF EXISTS t1;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+DECLARE v INT;
+SELECT a INTO v FROM t_non_existing;
+RETURN 1;
+END|
+CREATE TABLE t1 (a INT) ENGINE = myisam;
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 WHERE a = f1();
+ERROR 42S02: Table 'test.t_non_existing' doesn't exist
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non
+# strict SQL mode
+#
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1 ()
+COMMENT
+'12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+BEGIN
+END;
+SELECT comment FROM mysql.proc WHERE name = "p1";
+comment
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
+SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1";
+routine_comment
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
+DROP PROCEDURE p1;
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 831616f491b..228fe008447 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -21,9 +21,11 @@ end|
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE bug4902_2 does not exist
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE bug4902_2 does not exist
drop procedure bug4902_2|
drop table if exists t1|
create table t1 (
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 3cc251bc0a6..be45e5ff5d7 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -556,3 +556,30 @@ f1 bug13575(f1)
3 ccc
drop function bug13575|
drop table t3|
+#
+# End of 5.1 tests
+#
+#
+# Bug #35877 Update .. WHERE with function, constraint violation, crash
+#
+DROP TABLE IF EXISTS t1_aux|
+DROP TABLE IF EXISTS t1_not_null|
+DROP FUNCTION IF EXISTS f1_two_inserts|
+# MyISAM test
+CREATE TABLE t1_not_null (f1 BIGINT, f2 BIGINT NOT NULL)|
+CREATE TABLE t1_aux (f1 BIGINT, f2 BIGINT)|
+INSERT INTO t1_aux VALUES (1,1)|
+CREATE FUNCTION f1_two_inserts() returns INTEGER
+BEGIN
+INSERT INTO t1_not_null SET f1 = 10, f2 = NULL;
+RETURN 1;
+END|
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+ERROR 23000: Column 'f2' cannot be null
+# InnoDB test
+ALTER TABLE t1_not_null ENGINE = InnoDB|
+ALTER TABLE t1_aux ENGINE = InnoDB|
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+ERROR 23000: Column 'f2' cannot be null
+DROP TABLE t1_aux, t1_not_null|
+DROP FUNCTION f1_two_inserts|
diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result
index 7a6173b89e2..117f6de754a 100644
--- a/mysql-test/r/sp_trans_log.result
+++ b/mysql-test/r/sp_trans_log.result
@@ -14,15 +14,5 @@ end|
reset master|
insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-show binlog events from 106 /* with fixes for #23333 will show there is the query */|
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # #
-master-bin.000001 # Table_map 1 # #
-master-bin.000001 # Table_map 1 # #
-master-bin.000001 # Write_rows 1 # #
-master-bin.000001 # Query 1 # #
-select count(*),@a from t1 /* must be 1,1 */|
-count(*) @a
-1 1
drop table t1,t2;
drop function if exists bug23333;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 0b0d5a38d0b..e83879274a1 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -506,6 +506,12 @@ mysqltest_32753@localhost
set session sql_mode=@OLD_SQL_MODE;
flush privileges;
drop user mysqltest_32753@localhost;
+SET @org_mode=@@sql_mode;
+SET @@sql_mode='traditional';
+SELECT @@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%';
+@@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%'
+1
+SET sql_mode=@org_mode;
DROP TABLE IF EXISTS t1,t2;
CREATE USER 'user_PCTFL'@'localhost' identified by 'PWD';
CREATE USER 'user_no_PCTFL'@'localhost' identified by 'PWD';
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 241f4198bf7..897c9072203 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -2,7 +2,7 @@ set @org_mode=@@sql_mode;
set @@sql_mode='ansi,traditional';
select @@sql_mode;
@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
@@ -315,8 +315,8 @@ MOD(col1,0)
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES(-129);
ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(128);
@@ -343,7 +343,7 @@ SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 1;
MOD(col1,0)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
ERROR 22003: Out of range value for column 'col1' at row 1
UPDATE t1 SET col2=col2 + 50 WHERE col2 > 0;
@@ -353,16 +353,16 @@ ERROR 22012: Division by 0
set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO';
INSERT INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
set @@sql_mode='ansi,traditional';
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
MOD(col1,0)
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES ('');
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
@@ -374,8 +374,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
set @@sql_mode='ansi';
INSERT INTO t1 values (1/0,1/0);
set @@sql_mode='ansi,traditional';
@@ -457,8 +457,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-32769,-1),(32768,65536);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -541,8 +541,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-8388609,-1),(8388608,16777216);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -625,8 +625,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 values (-2147483649, -1),(2147643648,4294967296);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -707,8 +707,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-9223372036854775809,-1),(9223372036854775808,18446744073709551616);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -794,7 +794,7 @@ Warnings:
Note 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(1000),(-1000);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -861,7 +861,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+3.4E+39,-3.4E+39);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -910,7 +910,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) values (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+1.9E+309,-1.9E+309);
ERROR 22007: Illegal double '1.9E+309' value found during parsing
INSERT IGNORE INTO t1 VALUES ('+2.0E+309','-2.0E+309');
@@ -1080,13 +1080,13 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc'
insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
Warnings:
-Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
+Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r'));
Warnings:
-Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
+Warning 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T'));
Warnings:
-Error 1411 Incorrect time value: 'abc' for function str_to_date
+Warning 1411 Incorrect time value: 'abc' for function str_to_date
insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i'));
insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r'));
insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T'));
@@ -1104,9 +1104,9 @@ select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') I
count(*)
7
Warnings:
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
drop table t1;
create table t1 (col1 char(3), col2 integer);
insert into t1 (col1) values (cast(1000 as char(3)));
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 665473df3ef..2056b06a80d 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1)
+Note 1003 select 1 AS `1` from dual having ((select '1' AS `a`) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -203,7 +203,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from dual
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -314,7 +314,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select (select '2' AS `a` from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select (select '2' AS `a` from dual where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -1429,7 +1429,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from dual)
(select * from t1);
s1
tttt
@@ -1617,7 +1617,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
+Note 1003 select 'e' AS `s1` from dual where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index d5fb1a7bbde..3a0576768b2 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -864,7 +864,7 @@ Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
-Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM
+Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from dual group by `c`) AS `(SELECT COUNT(a) FROM
(SELECT COUNT(b) FROM t1) AS x GROUP BY c
)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
DROP TABLE t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 17fd95ab1c8..679e50fcad9 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -110,6 +110,7 @@ user CREATE TABLE `user` (
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
@@ -201,7 +202,7 @@ proc CREATE TABLE `proc` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
- `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 2bcd919e0db..14ef4f54f27 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -31,8 +31,8 @@ Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest_db1 wl2818_trg1 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 wl2818_trg2 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER wl2818_trg1;
Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 4476735735c..1a6494e03ad 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -1073,7 +1073,7 @@ NULL
SET @x=2;
UPDATE t1 SET i1 = @x;
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1086,8 +1086,8 @@ NULL
SET @x=4;
UPDATE t1 SET i1 = @x;
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1190,16 +1190,16 @@ create trigger t4_bu before update on t4 for each row set @t4_bu_called:=1|
insert into t1 values(10, 10)|
set @a:=1/0|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select 1/0 from t1|
1/0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
create trigger t1_bi before insert on t1 for each row set @a:=1/0|
insert into t1 values(20, 20)|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
drop trigger t1_bi|
create trigger t1_bi before insert on t1 for each row
begin
@@ -1219,7 +1219,7 @@ end|
set @check=0, @t4_bi_called=0, @t4_bu_called=0|
insert into t1 values(30, 30)|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select @check, @t4_bi_called, @t4_bu_called|
@check @t4_bi_called @t4_bu_called
2 1 1
@@ -2088,3 +2088,30 @@ SELECT * FROM t2;
a b
DROP TABLE t1, t2;
End of 5.1 tests.
+#
+# Bug#34453 Can't change size of file (Errcode: 1224)
+#
+DROP TRIGGER IF EXISTS t1_bi;
+DROP TRIGGER IF EXISTS t1_bd;
+DROP TABLE IF EXISTS t1;
+DROP TEMPORARY TABLE IF EXISTS t2;
+CREATE TABLE t1 (s1 INT);
+CREATE TEMPORARY TABLE t2 (s1 INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t2;
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+s1
+0
+0
+SELECT * FROM t2;
+s1
+0
+0
+# Reported to give ERROR 14 (HY000):
+# Can't change size of file (Errcode: 1224)
+# on Windows
+DELETE FROM t1;
+DROP TABLE t1;
+DROP TEMPORARY TABLE t2;
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index d66308a9bd7..c39e3d1c85d 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -117,7 +117,7 @@ CREATE DEFINER='mysqltest_inv'@'localhost'
TRIGGER trg1 BEFORE INSERT ON t1
FOR EACH ROW
SET @new_sum = 0;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
---> connection: default
use mysqltest_db1;
@@ -170,11 +170,11 @@ Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigge
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
---> connection: default
DROP USER mysqltest_dfn@localhost;
@@ -471,7 +471,7 @@ SELECT trigger_name FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema = 'db1';
trigger_name
SHOW CREATE TRIGGER db1.trg;
-ERROR 42000: Access denied; you need the TRIGGER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the TRIGGER privilege(s) for this operation
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
End of 5.1 tests.
diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result
index 432c58272a2..01841bf27fc 100644
--- a/mysql-test/r/type_binary.result
+++ b/mysql-test/r/type_binary.result
@@ -47,7 +47,7 @@ create table t1 (s1 binary(2) primary key);
insert into t1 values (0x01);
insert into t1 values (0x0120);
insert into t1 values (0x0100);
-ERROR 23000: Duplicate entry '' for key 'PRIMARY'
+ERROR 23000: Duplicate entry '\x01\x00' for key 'PRIMARY'
select hex(s1) from t1 order by s1;
hex(s1)
0100
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 51feab0a421..e8c8c6c65a4 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -71,7 +71,7 @@ hex(a)
1
1
alter table t1 add unique (a);
-ERROR 23000: Duplicate entry '' for key 'a'
+ERROR 23000: Duplicate entry '\x00' for key 'a'
drop table t1;
create table t1 (a bit(2));
insert into t1 values (b'00'), (b'01'), (b'10'), (b'100');
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index f96e07b0c5e..92be736ff9a 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -276,3 +276,25 @@ a
0000-00-01
drop table t1;
End of 5.1 tests
+#
+# Bug #33629: last_day function can return null, but has 'not null'
+# flag set for result
+#
+SELECT 1 FROM (SELECT LAST_DAY('0')) a;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '0'
+SELECT 1 FROM (SELECT MAKEDATE(2011,0)) a;
+1
+1
+CREATE TABLE t1 AS
+SELECT LAST_DAY('1970-01-01') AS f1,
+MAKEDATE(1970, 1) AS f2;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+f1 date YES NULL
+f2 date YES NULL
+DROP TABLE t1;
+#
+End of 6.0 tests
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index b6281443751..054fda90c02 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -517,7 +517,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
+Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from dual where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id cur_date
@@ -529,7 +529,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
+Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from dual where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id cur_date
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 76c5ea8f756..67898b7f335 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -3,13 +3,13 @@ SET SQL_WARNINGS=1;
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
datatype_id int(11) DEFAULT '0' NOT NULL,
-minvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
-maxvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
+min_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
+max_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
valuename varchar(20),
forecolor int(11),
backcolor int(11),
PRIMARY KEY (id),
-UNIQUE datatype_id (datatype_id, minvalue, maxvalue)
+UNIQUE datatype_id (datatype_id, min_value, max_value)
);
INSERT INTO t1 VALUES ( '1', '4', '0.0000000000', '0.0000000000', 'Ei saja', '0', '16776960');
INSERT INTO t1 VALUES ( '2', '4', '1.0000000000', '1.0000000000', 'Sajab', '16777215', '255');
@@ -143,12 +143,12 @@ INSERT INTO t1 VALUES ( '139', '21', '326.0000000000', '326.0000000000', 'Lumine
INSERT INTO t1 VALUES ( '143', '16', '-4.9000000000', '-0.1000000000', '', NULL, '15774720');
INSERT INTO t1 VALUES ( '145', '15', '0.0000000000', '1.9000000000', '', '0', '16769024');
INSERT INTO t1 VALUES ( '146', '16', '0.0000000000', '1.9000000000', '', '0', '16769024');
-select * from t1 where minvalue<=1 and maxvalue>=-1 and datatype_id=16;
-id datatype_id minvalue maxvalue valuename forecolor backcolor
+select * from t1 where min_value<=1 and max_value>=-1 and datatype_id=16;
+id datatype_id min_value max_value valuename forecolor backcolor
143 16 -4.9000000000 -0.1000000000 NULL 15774720
146 16 0.0000000000 1.9000000000 0 16769024
-select * from t1 where minvalue<=-1 and maxvalue>=-1 and datatype_id=16;
-id datatype_id minvalue maxvalue valuename forecolor backcolor
+select * from t1 where min_value<=-1 and max_value>=-1 and datatype_id=16;
+id datatype_id min_value max_value valuename forecolor backcolor
143 16 -4.9000000000 -0.1000000000 NULL 15774720
drop table t1;
create table t1 (a decimal(10,2));
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 70ee3a56cf3..172b343e003 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -185,7 +185,7 @@ select 1e10/0e0;
1e10/0e0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10));
insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890);
select * from wl1612;
@@ -205,27 +205,27 @@ NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
select col2/0 from wl1612;
col2/0
NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
select col3/0 from wl1612;
col3/0
NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
insert into wl1612 values(5,5000.0005,5000.0005);
insert into wl1612 values(6,5000.0005,5000.0005);
select sum(col2),sum(col3) from wl1612;
@@ -788,12 +788,12 @@ select 1 / 1E-500;
1 / 1E-500
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select 1 / 0;
1 / 0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
set sql_mode='ansi,traditional';
CREATE TABLE Sow6_2f (col1 NUMERIC(4,2));
INSERT INTO Sow6_2f VALUES (10.55);
@@ -819,11 +819,11 @@ NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO Sow6_2f VALUES ('a59b');
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
drop table Sow6_2f;
@@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999
x
99999999999999999999999999999999999999999999999999999999999999999
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
x
100000000000000000000000000000000000000000000000000000000000000000
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
@@ -1380,15 +1380,15 @@ create table t1 (c1 decimal(64));
insert into t1 values(
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(1e100);
Warnings:
@@ -1432,7 +1432,7 @@ select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
create table t1(a decimal(18));
insert into t1 values(123456789012345678);
alter table t1 modify column a decimal(19);
@@ -1444,12 +1444,12 @@ select cast(11.1234 as DECIMAL(3,2));
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select * from (select cast(11.1234 as DECIMAL(3,2))) t;
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2))
from (select 11.1233 as a
UNION select 11.1234
@@ -1460,9 +1460,9 @@ cast(a as DECIMAL(3,2))
9.99
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2)), count(*)
from (select 11.1233 as a
UNION select 11.1234
@@ -1471,10 +1471,10 @@ UNION select 12.1234
cast(a as DECIMAL(3,2)) count(*)
9.99 3
Warnings:
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
@@ -1560,7 +1560,7 @@ select cast(143.481 as decimal(2,1));
cast(143.481 as decimal(2,1))
9.9
Warnings:
-Error 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
+Warning 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
select cast(-3.4 as decimal(2,1));
cast(-3.4 as decimal(2,1))
-3.4
@@ -1568,12 +1568,12 @@ select cast(99.6 as decimal(2,0));
cast(99.6 as decimal(2,0))
99
Warnings:
-Error 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
+Warning 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
select cast(-13.4 as decimal(2,1));
cast(-13.4 as decimal(2,1))
-9.9
Warnings:
-Error 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
+Warning 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
select cast(98.6 as decimal(2,0));
cast(98.6 as decimal(2,0))
99
@@ -1674,7 +1674,7 @@ CREATE TABLE t1 SELECT
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
AS c1;
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
DESC t1;
Field Type Null Key Default Extra
c1 decimal(65,0) NO 0
@@ -1799,7 +1799,7 @@ CREATE TABLE t1 (a DECIMAL(30,30));
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1;
Warnings:
-Note 1265 Data truncated for column 'c1' at row 3
+Note 1265 Data truncated for column 'c1' at row 4
DESC t2;
Field Type Null Key Default Extra
c1 decimal(32,30) YES NULL
diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result
index 96042a91bae..6b614960422 100644
--- a/mysql-test/r/type_varchar.result
+++ b/mysql-test/r/type_varchar.result
@@ -489,3 +489,23 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1a'
Warning 1292 Truncated incorrect INTEGER value: 't'
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 's'
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 's '
+DROP TABLE t1;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index c1cd1840df8..0a999fb18f3 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -812,16 +812,16 @@ select @@lc_time_names;
@@lc_time_names
en_US
LC_TIME_NAMES: testing locale with the last ID:
-set lc_time_names=108;
+set lc_time_names=109;
select @@lc_time_names;
@@lc_time_names
-zh_HK
+el_GR
LC_TIME_NAMES: testing a number beyond the valid ID range:
-set lc_time_names=109;
-ERROR HY000: Unknown locale: '109'
+set lc_time_names=110;
+ERROR HY000: Unknown locale: '110'
select @@lc_time_names;
@@lc_time_names
-zh_HK
+el_GR
LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
select @@lc_time_names;
@@ -864,7 +864,7 @@ select @@query_prealloc_size = @test;
@@query_prealloc_size = @test
1
set global sql_mode=repeat('a',80);
-ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
End of 4.1 tests
create table t1 (a int);
select a into @x from t1;
@@ -1176,18 +1176,18 @@ ERROR HY000: Variable 'init_file' is a read only variable
SET @@global.init_file= 'x';
ERROR HY000: Variable 'init_file' is a read only variable
#
-SHOW VARIABLES like 'language';
+SHOW VARIABLES like 'lc_messages_dir';
Variable_name Value
-language #
-SELECT @@session.language;
-ERROR HY000: Variable 'language' is a GLOBAL variable
-SELECT @@global.language;
-@@global.language
+lc_messages_dir #
+SELECT @@session.lc_messages_dir;
+ERROR HY000: Variable 'lc_messages_dir' is a GLOBAL variable
+SELECT @@global.lc_messages_dir;
+@@global.lc_messages_dir
#
-SET @@session.language= 'x';
-ERROR HY000: Variable 'language' is a read only variable
-SET @@global.language= 'x';
-ERROR HY000: Variable 'language' is a read only variable
+SET @@session.lc_messages_dir= 'x';
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
+SET @@global.lc_messages_dir= 'x';
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
#
SHOW VARIABLES like 'large_page_size';
Variable_name Value
@@ -1488,3 +1488,168 @@ SELECT @@GLOBAL.max_binlog_cache_size;
5368709120
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
End of 5.1 tests
+
+#
+# Bug#34828: OF is taken as OFF and a value of 0 is set for variable SQL_notes.
+#
+
+# Checking sql_notes...
+SET @sql_notes_saved = @@sql_notes;
+
+SET @@sql_notes = ON;
+SELECT @@sql_notes;
+@@sql_notes
+1
+
+SET @@sql_notes = OF;
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'OF'
+SELECT @@sql_notes;
+@@sql_notes
+1
+
+SET @@sql_notes = OFF;
+SELECT @@sql_notes;
+@@sql_notes
+0
+
+SET @@sql_notes = @sql_notes_saved;
+
+# Checking delay_key_write...
+SET @delay_key_write_saved = @@delay_key_write;
+
+SET GLOBAL delay_key_write = ON;
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = OF;
+ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'OF'
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = AL;
+ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'AL'
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = OFF;
+SELECT @@delay_key_write;
+@@delay_key_write
+OFF
+
+SET GLOBAL delay_key_write = ALL;
+SELECT @@delay_key_write;
+@@delay_key_write
+ALL
+
+SET GLOBAL delay_key_write = @delay_key_write_saved;
+
+# Checking sql_safe_updates...
+SET @sql_safe_updates_saved = @@sql_safe_updates;
+
+SET @@sql_safe_updates = ON;
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+1
+
+SET @@sql_safe_updates = OF;
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'OF'
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+1
+
+SET @@sql_safe_updates = OFF;
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+0
+
+SET @@sql_safe_updates = @sql_safe_updates_saved;
+
+# Checking foreign_key_checks...
+SET @foreign_key_checks_saved = @@foreign_key_checks;
+
+SET @@foreign_key_checks = ON;
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+1
+
+SET @@foreign_key_checks = OF;
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'OF'
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+1
+
+SET @@foreign_key_checks = OFF;
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+0
+
+SET @@foreign_key_checks = @foreign_key_checks_saved;
+
+# Checking unique_checks...
+SET @unique_checks_saved = @@unique_checks;
+
+SET @@unique_checks = ON;
+SELECT @@unique_checks;
+@@unique_checks
+1
+
+SET @@unique_checks = OF;
+ERROR 42000: Variable 'unique_checks' can't be set to the value of 'OF'
+SELECT @@unique_checks;
+@@unique_checks
+1
+
+SET @@unique_checks = OFF;
+SELECT @@unique_checks;
+@@unique_checks
+0
+
+SET @@unique_checks = @unique_checks_saved;
+
+# Checking sql_buffer_result...
+SET @sql_buffer_result_saved = @@sql_buffer_result;
+
+SET @@sql_buffer_result = ON;
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+1
+
+SET @@sql_buffer_result = OF;
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'OF'
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+1
+
+SET @@sql_buffer_result = OFF;
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+0
+
+SET @@sql_buffer_result = @sql_buffer_result_saved;
+
+# Checking sql_quote_show_create...
+SET @sql_quote_show_create_saved = @@sql_quote_show_create;
+
+SET @@sql_quote_show_create = ON;
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+1
+
+SET @@sql_quote_show_create = OF;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'OF'
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+1
+
+SET @@sql_quote_show_create = OFF;
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+0
+
+SET @@sql_quote_show_create = @sql_quote_show_create_saved;
+
+# End of Bug#34828.
+
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index b5e374aaf8c..69bcf349f51 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1111,8 +1111,8 @@ insert into v1 values(3);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (2),(3),(0);
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1125,8 +1125,8 @@ create table t2 (a int);
insert into t2 values (2),(3),(0);
insert ignore into v1 SELECT a from t2;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a desc;
a
1
@@ -1148,7 +1148,7 @@ a
update v1 set a=a+1;
update ignore v1,t2 set v1.a=v1.a+1 where v1.a=t2.a;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1182,7 +1182,7 @@ insert into v1 values (1) on duplicate key update a=2;
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (1) on duplicate key update a=2;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1283,7 +1283,7 @@ insert ignore into v1 values (6);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (6),(3);
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
s1
3
@@ -1328,9 +1328,9 @@ delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 4
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a,b;
a b
1 row 1
@@ -1354,7 +1354,7 @@ concat('|',a,'|') concat('|',b,'|')
delete from t1;
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1261 Row 2 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|')
@@ -2342,11 +2342,11 @@ CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a;
EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
-1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+1 SIMPLE t2 ref a a 10 const,test.t1.b 1 Using where; Using index
EXPLAIN SELECT * FROM v1 WHERE a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
-1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+1 SIMPLE t2 ref a a 10 const,test.t1.b 1 Using where; Using index
EXPLAIN SELECT * FROM v2 WHERE a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 2d5c515d0b5..65fbf2d87b6 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -16,7 +16,7 @@ create table mysqltest.t2 (a int, b int);
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create definer=root@localhost view v1 as select * from mysqltest.t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create view v1 as select * from mysqltest.t1;
alter view v1 as select * from mysqltest.t1;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
@@ -779,11 +779,11 @@ GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
GRANT SELECT ON db26813.t1 TO u26813@localhost;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v3 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
@@ -799,17 +799,17 @@ CREATE USER u29908_1@localhost;
CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
SELECT f1 FROM t1;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
CREATE USER u29908_2@localhost;
-GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
+GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 8a87852d582..e2bce537179 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -35,7 +35,7 @@ Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
-Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
+Warning 1366 Incorrect integer value: 'då' for column 'a' at row 2
set SQL_WARNINGS=1;
insert into t1 values ("hej");
Warnings:
@@ -43,7 +43,7 @@ Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
-Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
+Warning 1366 Incorrect integer value: 'då' for column 'a' at row 2
drop table t1;
set SQL_WARNINGS=0;
drop temporary table if exists not_exists;
diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml
index 3dc647d8195..40fe70ebca0 100644
--- a/mysql-test/std_data/Index.xml
+++ b/mysql-test/std_data/Index.xml
@@ -1,23 +1,29 @@
<charsets>
<charset name="utf8">
- <collation name="utf8_test_ci" id="240">
+ <collation name="utf8_test_ci" id="353">
<rules>
<reset>a</reset>
<s>b</s>
</rules>
</collation>
+ <collation name="utf8_maxuserid_ci" id="2047">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
</charset>
<charset name="ucs2">
- <collation name="ucs2_test_ci" id="241">
+ <collation name="ucs2_test_ci" id="358">
<rules>
<reset>a</reset>
<s>b</s>
</rules>
</collation>
- <collation name="ucs2_vn_ci" id="242">
+ <collation name="ucs2_vn_ci" id="359">
<!-- Vietnamese experimental collation -->
<rules>
<reset>A</reset>
diff --git a/mysql-test/std_data/loadxml.dat b/mysql-test/std_data/loadxml.dat
new file mode 100644
index 00000000000..b72fac9da74
--- /dev/null
+++ b/mysql-test/std_data/loadxml.dat
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="test">
+ <table_structure name="t1">
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ <field Field="b" Type="varchar(128)" Null="YES" Key="" Extra="" />
+ <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="2007-02-09 09:08:36" Update_time="2007-02-09 09:08:54" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t1">
+ <row>
+ <field name="a">1</field>
+ <field name="b">b1</field>
+ </row>
+ <row>
+ <field name="a">2</field>
+ <field name="b">b2</field>
+ </row>
+ <row>
+ <field name="a">3</field>
+ <field name="b">b3</field>
+ </row>
+ <row>
+ <field name="a">11</field>
+ <field name="b">b11</field>
+ </row>
+
+ <!-- Check field values as tags -->
+ <row>
+ <a>111</a>
+ <b>b111</b>
+ </row>
+
+ <row>
+ <a>112</a>
+ <b>b112 &amp; &lt; &gt; &quot; &apos; &unknown; -- check entities</b>
+ </row>
+
+
+ <!-- Check field values in attributes -->
+ <row a=212 b="b212"></row>
+
+ <!-- Bug#29752 Linefeeds break LOAD XML INFILE -->
+ <!-- Check varios combinations of TAB and NL -->
+
+ <row
+ a=213 b="b213">
+ </row>
+
+ <row
+ a=214
+ b="b214">
+ </row>
+
+ <row a=215 b="b215"></row>
+
+ <row a=216 b="&bb
+b;"></row>
+
+ <!-- End of bug#29752 -->
+
+ </table_data>
+</database>
+</mysqldump>
+
diff --git a/mysql-test/std_data/loadxml2.dat b/mysql-test/std_data/loadxml2.dat
new file mode 100644
index 00000000000..f0d966cf9b6
--- /dev/null
+++ b/mysql-test/std_data/loadxml2.dat
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="test_of_xml_import">
+ <table_structure name="t1">
+ <field Field="id" Type="int(11)" Null="NO" Key="PRI" Extra="" />
+ <field Field="text" Type="text" Null="YES" Key="" Extra="" />
+ <key Table="t1" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="id" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_Comment="" />
+ <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="1" Avg_row_length="32" Data_length="32" Max_data_length="281474976710655" Index_length="2048" Data_free="0" Create_time="2009-06-18 10:02:37" Update_time="2009-06-18 10:02:43" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t1">
+ <row>
+ <field name="id">1</field>
+ <field name="text">line1
+line2
+line3</field>
+ </row>
+ </table_data>
+</database>
+</mysqldump>
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 21ebb891103..548013fcbf2 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -13,16 +13,16 @@ set session sql_log_bin = 1;
set global sql_log_bin = 1;
ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL
set session sql_log_bin = 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
**** Variable BINLOG_FORMAT ****
[root]
set global binlog_format = row;
set session binlog_format = row;
[plain]
set global binlog_format = row;
-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 session binlog_format = row;
-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
**** Clean up ****
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
diff --git a/mysql-test/suite/binlog/r/binlog_implicit_commit.result b/mysql-test/suite/binlog/r/binlog_implicit_commit.result
new file mode 100644
index 00000000000..ea43b31bde9
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_implicit_commit.result
@@ -0,0 +1,345 @@
+CREATE TABLE t1 (id INT) ENGINE = InnoDB;
+SET BINLOG_FORMAT = STATEMENT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Xid # # COMMIT /* XID */
+INSERT INTO t1 VALUES (3);
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+INSERT INTO t1 VALUES (1);
+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 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+SET AUTOCOMMIT = 1;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+INSERT INTO t1 VALUES (1);
+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 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+SET AUTOCOMMIT = 0;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+SET BINLOG_FORMAT = ROW;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+INSERT INTO t1 VALUES (3);
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+INSERT INTO t1 VALUES (1);
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+SET AUTOCOMMIT = 1;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+INSERT INTO t1 VALUES (1);
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+SET AUTOCOMMIT = 0;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 1;
+BEGIN;
+INSERT INTO t1 VALUES (2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET AUTOCOMMIT = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+INSERT INTO t1 VALUES (3);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+COMMIT;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+LOCK TABLES t1 WRITE;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+INSERT INTO t1 VALUES (2);
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+UNLOCK TABLES;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+COMMIT;
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index d49ceb00501..69d877c5adc 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -34,7 +34,7 @@ purge binary logs TO 'master-bin.000002';
ERROR HY000: Fatal error during log purge
show warnings;
Level Code Message
-Error 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
+Warning 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
Error 1377 Fatal error during log purge
reset master;
End of tests
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index 1922897f631..424f7d60829 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -156,9 +156,10 @@ select * from t2 /* must be (3,1), (4,4) */;
a b
1 1
4 4
-show master status /* there must no UPDATE in binlog */;
+there must no UPDATE in binlog
+show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@@ -166,8 +167,9 @@ insert into t2 values (1,2),(3,4),(4,4);
reset master;
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 no UPDATE query event */;
+there must no UPDATE in binlog
+show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
drop table t1, t2;
End of tests
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 4d32a4f4739..7dc37d7c365 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -26,7 +26,7 @@ create table t1 (n int) engine=innodb;
begin;
commit;
drop table t1;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events in 'master-bin.000001' from 107;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
master-bin.000001 # Query 1 # BEGIN
@@ -232,7 +232,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
+show binlog events in 'master-bin.000002' from 107;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query 1 # use `test`; drop table t1
set @ac = @@autocommit;
@@ -247,25 +247,8 @@ commit;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb
-master-bin.000001 205 Query 1 273 BEGIN
-master-bin.000001 273 Table_map 1 314 table_id: # (test.t1)
-master-bin.000001 314 Write_rows 1 348 table_id: # flags: STMT_END_F
-master-bin.000001 348 Table_map 1 389 table_id: # (test.t1)
-master-bin.000001 389 Write_rows 1 423 table_id: # flags: STMT_END_F
-master-bin.000001 423 Table_map 1 464 table_id: # (test.t1)
-master-bin.000001 464 Write_rows 1 498 table_id: # flags: STMT_END_F
-master-bin.000001 498 Xid 1 525 COMMIT /* XID */
-master-bin.000001 525 Query 1 601 use `test`; drop table t1
-set @bcs = @@binlog_cache_size;
-set global binlog_cache_size=4096;
-reset master;
-create table t1 (a int) engine=innodb;
-show binlog events from 0;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 206 use `test`; create table t1(n int) engine=innodb
master-bin.000001 206 Query 1 274 BEGIN
master-bin.000001 274 Table_map 1 315 table_id: # (test.t1)
master-bin.000001 315 Write_rows 1 349 table_id: # flags: STMT_END_F
@@ -273,802 +256,819 @@ master-bin.000001 349 Table_map 1 390 table_id: # (test.t1)
master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F
master-bin.000001 424 Table_map 1 465 table_id: # (test.t1)
master-bin.000001 465 Write_rows 1 499 table_id: # flags: STMT_END_F
-master-bin.000001 499 Table_map 1 540 table_id: # (test.t1)
-master-bin.000001 540 Write_rows 1 574 table_id: # flags: STMT_END_F
-master-bin.000001 574 Table_map 1 615 table_id: # (test.t1)
-master-bin.000001 615 Write_rows 1 649 table_id: # flags: STMT_END_F
-master-bin.000001 649 Table_map 1 690 table_id: # (test.t1)
-master-bin.000001 690 Write_rows 1 724 table_id: # flags: STMT_END_F
-master-bin.000001 724 Table_map 1 765 table_id: # (test.t1)
-master-bin.000001 765 Write_rows 1 799 table_id: # flags: STMT_END_F
-master-bin.000001 799 Table_map 1 840 table_id: # (test.t1)
-master-bin.000001 840 Write_rows 1 874 table_id: # flags: STMT_END_F
-master-bin.000001 874 Table_map 1 915 table_id: # (test.t1)
-master-bin.000001 915 Write_rows 1 949 table_id: # flags: STMT_END_F
-master-bin.000001 949 Table_map 1 990 table_id: # (test.t1)
-master-bin.000001 990 Write_rows 1 1024 table_id: # flags: STMT_END_F
-master-bin.000001 1024 Table_map 1 1065 table_id: # (test.t1)
-master-bin.000001 1065 Write_rows 1 1099 table_id: # flags: STMT_END_F
-master-bin.000001 1099 Table_map 1 1140 table_id: # (test.t1)
-master-bin.000001 1140 Write_rows 1 1174 table_id: # flags: STMT_END_F
-master-bin.000001 1174 Table_map 1 1215 table_id: # (test.t1)
-master-bin.000001 1215 Write_rows 1 1249 table_id: # flags: STMT_END_F
-master-bin.000001 1249 Table_map 1 1290 table_id: # (test.t1)
-master-bin.000001 1290 Write_rows 1 1324 table_id: # flags: STMT_END_F
-master-bin.000001 1324 Table_map 1 1365 table_id: # (test.t1)
-master-bin.000001 1365 Write_rows 1 1399 table_id: # flags: STMT_END_F
-master-bin.000001 1399 Table_map 1 1440 table_id: # (test.t1)
-master-bin.000001 1440 Write_rows 1 1474 table_id: # flags: STMT_END_F
-master-bin.000001 1474 Table_map 1 1515 table_id: # (test.t1)
-master-bin.000001 1515 Write_rows 1 1549 table_id: # flags: STMT_END_F
-master-bin.000001 1549 Table_map 1 1590 table_id: # (test.t1)
-master-bin.000001 1590 Write_rows 1 1624 table_id: # flags: STMT_END_F
-master-bin.000001 1624 Table_map 1 1665 table_id: # (test.t1)
-master-bin.000001 1665 Write_rows 1 1699 table_id: # flags: STMT_END_F
-master-bin.000001 1699 Table_map 1 1740 table_id: # (test.t1)
-master-bin.000001 1740 Write_rows 1 1774 table_id: # flags: STMT_END_F
-master-bin.000001 1774 Table_map 1 1815 table_id: # (test.t1)
-master-bin.000001 1815 Write_rows 1 1849 table_id: # flags: STMT_END_F
-master-bin.000001 1849 Table_map 1 1890 table_id: # (test.t1)
-master-bin.000001 1890 Write_rows 1 1924 table_id: # flags: STMT_END_F
-master-bin.000001 1924 Table_map 1 1965 table_id: # (test.t1)
-master-bin.000001 1965 Write_rows 1 1999 table_id: # flags: STMT_END_F
-master-bin.000001 1999 Table_map 1 2040 table_id: # (test.t1)
-master-bin.000001 2040 Write_rows 1 2074 table_id: # flags: STMT_END_F
-master-bin.000001 2074 Table_map 1 2115 table_id: # (test.t1)
-master-bin.000001 2115 Write_rows 1 2149 table_id: # flags: STMT_END_F
-master-bin.000001 2149 Table_map 1 2190 table_id: # (test.t1)
-master-bin.000001 2190 Write_rows 1 2224 table_id: # flags: STMT_END_F
-master-bin.000001 2224 Table_map 1 2265 table_id: # (test.t1)
-master-bin.000001 2265 Write_rows 1 2299 table_id: # flags: STMT_END_F
-master-bin.000001 2299 Table_map 1 2340 table_id: # (test.t1)
-master-bin.000001 2340 Write_rows 1 2374 table_id: # flags: STMT_END_F
-master-bin.000001 2374 Table_map 1 2415 table_id: # (test.t1)
-master-bin.000001 2415 Write_rows 1 2449 table_id: # flags: STMT_END_F
-master-bin.000001 2449 Table_map 1 2490 table_id: # (test.t1)
-master-bin.000001 2490 Write_rows 1 2524 table_id: # flags: STMT_END_F
-master-bin.000001 2524 Table_map 1 2565 table_id: # (test.t1)
-master-bin.000001 2565 Write_rows 1 2599 table_id: # flags: STMT_END_F
-master-bin.000001 2599 Table_map 1 2640 table_id: # (test.t1)
-master-bin.000001 2640 Write_rows 1 2674 table_id: # flags: STMT_END_F
-master-bin.000001 2674 Table_map 1 2715 table_id: # (test.t1)
-master-bin.000001 2715 Write_rows 1 2749 table_id: # flags: STMT_END_F
-master-bin.000001 2749 Table_map 1 2790 table_id: # (test.t1)
-master-bin.000001 2790 Write_rows 1 2824 table_id: # flags: STMT_END_F
-master-bin.000001 2824 Table_map 1 2865 table_id: # (test.t1)
-master-bin.000001 2865 Write_rows 1 2899 table_id: # flags: STMT_END_F
-master-bin.000001 2899 Table_map 1 2940 table_id: # (test.t1)
-master-bin.000001 2940 Write_rows 1 2974 table_id: # flags: STMT_END_F
-master-bin.000001 2974 Table_map 1 3015 table_id: # (test.t1)
-master-bin.000001 3015 Write_rows 1 3049 table_id: # flags: STMT_END_F
-master-bin.000001 3049 Table_map 1 3090 table_id: # (test.t1)
-master-bin.000001 3090 Write_rows 1 3124 table_id: # flags: STMT_END_F
-master-bin.000001 3124 Table_map 1 3165 table_id: # (test.t1)
-master-bin.000001 3165 Write_rows 1 3199 table_id: # flags: STMT_END_F
-master-bin.000001 3199 Table_map 1 3240 table_id: # (test.t1)
-master-bin.000001 3240 Write_rows 1 3274 table_id: # flags: STMT_END_F
-master-bin.000001 3274 Table_map 1 3315 table_id: # (test.t1)
-master-bin.000001 3315 Write_rows 1 3349 table_id: # flags: STMT_END_F
-master-bin.000001 3349 Table_map 1 3390 table_id: # (test.t1)
-master-bin.000001 3390 Write_rows 1 3424 table_id: # flags: STMT_END_F
-master-bin.000001 3424 Table_map 1 3465 table_id: # (test.t1)
-master-bin.000001 3465 Write_rows 1 3499 table_id: # flags: STMT_END_F
-master-bin.000001 3499 Table_map 1 3540 table_id: # (test.t1)
-master-bin.000001 3540 Write_rows 1 3574 table_id: # flags: STMT_END_F
-master-bin.000001 3574 Table_map 1 3615 table_id: # (test.t1)
-master-bin.000001 3615 Write_rows 1 3649 table_id: # flags: STMT_END_F
-master-bin.000001 3649 Table_map 1 3690 table_id: # (test.t1)
-master-bin.000001 3690 Write_rows 1 3724 table_id: # flags: STMT_END_F
-master-bin.000001 3724 Table_map 1 3765 table_id: # (test.t1)
-master-bin.000001 3765 Write_rows 1 3799 table_id: # flags: STMT_END_F
-master-bin.000001 3799 Table_map 1 3840 table_id: # (test.t1)
-master-bin.000001 3840 Write_rows 1 3874 table_id: # flags: STMT_END_F
-master-bin.000001 3874 Table_map 1 3915 table_id: # (test.t1)
-master-bin.000001 3915 Write_rows 1 3949 table_id: # flags: STMT_END_F
-master-bin.000001 3949 Table_map 1 3990 table_id: # (test.t1)
-master-bin.000001 3990 Write_rows 1 4024 table_id: # flags: STMT_END_F
-master-bin.000001 4024 Table_map 1 4065 table_id: # (test.t1)
-master-bin.000001 4065 Write_rows 1 4099 table_id: # flags: STMT_END_F
-master-bin.000001 4099 Table_map 1 4140 table_id: # (test.t1)
-master-bin.000001 4140 Write_rows 1 4174 table_id: # flags: STMT_END_F
-master-bin.000001 4174 Table_map 1 4215 table_id: # (test.t1)
-master-bin.000001 4215 Write_rows 1 4249 table_id: # flags: STMT_END_F
-master-bin.000001 4249 Table_map 1 4290 table_id: # (test.t1)
-master-bin.000001 4290 Write_rows 1 4324 table_id: # flags: STMT_END_F
-master-bin.000001 4324 Table_map 1 4365 table_id: # (test.t1)
-master-bin.000001 4365 Write_rows 1 4399 table_id: # flags: STMT_END_F
-master-bin.000001 4399 Table_map 1 4440 table_id: # (test.t1)
-master-bin.000001 4440 Write_rows 1 4474 table_id: # flags: STMT_END_F
-master-bin.000001 4474 Table_map 1 4515 table_id: # (test.t1)
-master-bin.000001 4515 Write_rows 1 4549 table_id: # flags: STMT_END_F
-master-bin.000001 4549 Table_map 1 4590 table_id: # (test.t1)
-master-bin.000001 4590 Write_rows 1 4624 table_id: # flags: STMT_END_F
-master-bin.000001 4624 Table_map 1 4665 table_id: # (test.t1)
-master-bin.000001 4665 Write_rows 1 4699 table_id: # flags: STMT_END_F
-master-bin.000001 4699 Table_map 1 4740 table_id: # (test.t1)
-master-bin.000001 4740 Write_rows 1 4774 table_id: # flags: STMT_END_F
-master-bin.000001 4774 Table_map 1 4815 table_id: # (test.t1)
-master-bin.000001 4815 Write_rows 1 4849 table_id: # flags: STMT_END_F
-master-bin.000001 4849 Table_map 1 4890 table_id: # (test.t1)
-master-bin.000001 4890 Write_rows 1 4924 table_id: # flags: STMT_END_F
-master-bin.000001 4924 Table_map 1 4965 table_id: # (test.t1)
-master-bin.000001 4965 Write_rows 1 4999 table_id: # flags: STMT_END_F
-master-bin.000001 4999 Table_map 1 5040 table_id: # (test.t1)
-master-bin.000001 5040 Write_rows 1 5074 table_id: # flags: STMT_END_F
-master-bin.000001 5074 Table_map 1 5115 table_id: # (test.t1)
-master-bin.000001 5115 Write_rows 1 5149 table_id: # flags: STMT_END_F
-master-bin.000001 5149 Table_map 1 5190 table_id: # (test.t1)
-master-bin.000001 5190 Write_rows 1 5224 table_id: # flags: STMT_END_F
-master-bin.000001 5224 Table_map 1 5265 table_id: # (test.t1)
-master-bin.000001 5265 Write_rows 1 5299 table_id: # flags: STMT_END_F
-master-bin.000001 5299 Table_map 1 5340 table_id: # (test.t1)
-master-bin.000001 5340 Write_rows 1 5374 table_id: # flags: STMT_END_F
-master-bin.000001 5374 Table_map 1 5415 table_id: # (test.t1)
-master-bin.000001 5415 Write_rows 1 5449 table_id: # flags: STMT_END_F
-master-bin.000001 5449 Table_map 1 5490 table_id: # (test.t1)
-master-bin.000001 5490 Write_rows 1 5524 table_id: # flags: STMT_END_F
-master-bin.000001 5524 Table_map 1 5565 table_id: # (test.t1)
-master-bin.000001 5565 Write_rows 1 5599 table_id: # flags: STMT_END_F
-master-bin.000001 5599 Table_map 1 5640 table_id: # (test.t1)
-master-bin.000001 5640 Write_rows 1 5674 table_id: # flags: STMT_END_F
-master-bin.000001 5674 Table_map 1 5715 table_id: # (test.t1)
-master-bin.000001 5715 Write_rows 1 5749 table_id: # flags: STMT_END_F
-master-bin.000001 5749 Table_map 1 5790 table_id: # (test.t1)
-master-bin.000001 5790 Write_rows 1 5824 table_id: # flags: STMT_END_F
-master-bin.000001 5824 Table_map 1 5865 table_id: # (test.t1)
-master-bin.000001 5865 Write_rows 1 5899 table_id: # flags: STMT_END_F
-master-bin.000001 5899 Table_map 1 5940 table_id: # (test.t1)
-master-bin.000001 5940 Write_rows 1 5974 table_id: # flags: STMT_END_F
-master-bin.000001 5974 Table_map 1 6015 table_id: # (test.t1)
-master-bin.000001 6015 Write_rows 1 6049 table_id: # flags: STMT_END_F
-master-bin.000001 6049 Table_map 1 6090 table_id: # (test.t1)
-master-bin.000001 6090 Write_rows 1 6124 table_id: # flags: STMT_END_F
-master-bin.000001 6124 Table_map 1 6165 table_id: # (test.t1)
-master-bin.000001 6165 Write_rows 1 6199 table_id: # flags: STMT_END_F
-master-bin.000001 6199 Table_map 1 6240 table_id: # (test.t1)
-master-bin.000001 6240 Write_rows 1 6274 table_id: # flags: STMT_END_F
-master-bin.000001 6274 Table_map 1 6315 table_id: # (test.t1)
-master-bin.000001 6315 Write_rows 1 6349 table_id: # flags: STMT_END_F
-master-bin.000001 6349 Table_map 1 6390 table_id: # (test.t1)
-master-bin.000001 6390 Write_rows 1 6424 table_id: # flags: STMT_END_F
-master-bin.000001 6424 Table_map 1 6465 table_id: # (test.t1)
-master-bin.000001 6465 Write_rows 1 6499 table_id: # flags: STMT_END_F
-master-bin.000001 6499 Table_map 1 6540 table_id: # (test.t1)
-master-bin.000001 6540 Write_rows 1 6574 table_id: # flags: STMT_END_F
-master-bin.000001 6574 Table_map 1 6615 table_id: # (test.t1)
-master-bin.000001 6615 Write_rows 1 6649 table_id: # flags: STMT_END_F
-master-bin.000001 6649 Table_map 1 6690 table_id: # (test.t1)
-master-bin.000001 6690 Write_rows 1 6724 table_id: # flags: STMT_END_F
-master-bin.000001 6724 Table_map 1 6765 table_id: # (test.t1)
-master-bin.000001 6765 Write_rows 1 6799 table_id: # flags: STMT_END_F
-master-bin.000001 6799 Table_map 1 6840 table_id: # (test.t1)
-master-bin.000001 6840 Write_rows 1 6874 table_id: # flags: STMT_END_F
-master-bin.000001 6874 Table_map 1 6915 table_id: # (test.t1)
-master-bin.000001 6915 Write_rows 1 6949 table_id: # flags: STMT_END_F
-master-bin.000001 6949 Table_map 1 6990 table_id: # (test.t1)
-master-bin.000001 6990 Write_rows 1 7024 table_id: # flags: STMT_END_F
-master-bin.000001 7024 Table_map 1 7065 table_id: # (test.t1)
-master-bin.000001 7065 Write_rows 1 7099 table_id: # flags: STMT_END_F
-master-bin.000001 7099 Table_map 1 7140 table_id: # (test.t1)
-master-bin.000001 7140 Write_rows 1 7174 table_id: # flags: STMT_END_F
-master-bin.000001 7174 Table_map 1 7215 table_id: # (test.t1)
-master-bin.000001 7215 Write_rows 1 7249 table_id: # flags: STMT_END_F
-master-bin.000001 7249 Table_map 1 7290 table_id: # (test.t1)
-master-bin.000001 7290 Write_rows 1 7324 table_id: # flags: STMT_END_F
-master-bin.000001 7324 Table_map 1 7365 table_id: # (test.t1)
-master-bin.000001 7365 Write_rows 1 7399 table_id: # flags: STMT_END_F
-master-bin.000001 7399 Table_map 1 7440 table_id: # (test.t1)
-master-bin.000001 7440 Write_rows 1 7474 table_id: # flags: STMT_END_F
-master-bin.000001 7474 Table_map 1 7515 table_id: # (test.t1)
-master-bin.000001 7515 Write_rows 1 7549 table_id: # flags: STMT_END_F
-master-bin.000001 7549 Table_map 1 7590 table_id: # (test.t1)
-master-bin.000001 7590 Write_rows 1 7624 table_id: # flags: STMT_END_F
-master-bin.000001 7624 Table_map 1 7665 table_id: # (test.t1)
-master-bin.000001 7665 Write_rows 1 7699 table_id: # flags: STMT_END_F
-master-bin.000001 7699 Table_map 1 7740 table_id: # (test.t1)
-master-bin.000001 7740 Write_rows 1 7774 table_id: # flags: STMT_END_F
-master-bin.000001 7774 Table_map 1 7815 table_id: # (test.t1)
-master-bin.000001 7815 Write_rows 1 7849 table_id: # flags: STMT_END_F
-master-bin.000001 7849 Table_map 1 7890 table_id: # (test.t1)
-master-bin.000001 7890 Write_rows 1 7924 table_id: # flags: STMT_END_F
-master-bin.000001 7924 Table_map 1 7965 table_id: # (test.t1)
-master-bin.000001 7965 Write_rows 1 7999 table_id: # flags: STMT_END_F
-master-bin.000001 7999 Table_map 1 8040 table_id: # (test.t1)
-master-bin.000001 8040 Write_rows 1 8074 table_id: # flags: STMT_END_F
-master-bin.000001 8074 Table_map 1 8115 table_id: # (test.t1)
-master-bin.000001 8115 Write_rows 1 8149 table_id: # flags: STMT_END_F
-master-bin.000001 8149 Table_map 1 8190 table_id: # (test.t1)
-master-bin.000001 8190 Write_rows 1 8224 table_id: # flags: STMT_END_F
-master-bin.000001 8224 Table_map 1 8265 table_id: # (test.t1)
-master-bin.000001 8265 Write_rows 1 8299 table_id: # flags: STMT_END_F
-master-bin.000001 8299 Table_map 1 8340 table_id: # (test.t1)
-master-bin.000001 8340 Write_rows 1 8374 table_id: # flags: STMT_END_F
-master-bin.000001 8374 Table_map 1 8415 table_id: # (test.t1)
-master-bin.000001 8415 Write_rows 1 8449 table_id: # flags: STMT_END_F
-master-bin.000001 8449 Table_map 1 8490 table_id: # (test.t1)
-master-bin.000001 8490 Write_rows 1 8524 table_id: # flags: STMT_END_F
-master-bin.000001 8524 Table_map 1 8565 table_id: # (test.t1)
-master-bin.000001 8565 Write_rows 1 8599 table_id: # flags: STMT_END_F
-master-bin.000001 8599 Table_map 1 8640 table_id: # (test.t1)
-master-bin.000001 8640 Write_rows 1 8674 table_id: # flags: STMT_END_F
-master-bin.000001 8674 Table_map 1 8715 table_id: # (test.t1)
-master-bin.000001 8715 Write_rows 1 8749 table_id: # flags: STMT_END_F
-master-bin.000001 8749 Table_map 1 8790 table_id: # (test.t1)
-master-bin.000001 8790 Write_rows 1 8824 table_id: # flags: STMT_END_F
-master-bin.000001 8824 Table_map 1 8865 table_id: # (test.t1)
-master-bin.000001 8865 Write_rows 1 8899 table_id: # flags: STMT_END_F
-master-bin.000001 8899 Table_map 1 8940 table_id: # (test.t1)
-master-bin.000001 8940 Write_rows 1 8974 table_id: # flags: STMT_END_F
-master-bin.000001 8974 Table_map 1 9015 table_id: # (test.t1)
-master-bin.000001 9015 Write_rows 1 9049 table_id: # flags: STMT_END_F
-master-bin.000001 9049 Table_map 1 9090 table_id: # (test.t1)
-master-bin.000001 9090 Write_rows 1 9124 table_id: # flags: STMT_END_F
-master-bin.000001 9124 Table_map 1 9165 table_id: # (test.t1)
-master-bin.000001 9165 Write_rows 1 9199 table_id: # flags: STMT_END_F
-master-bin.000001 9199 Table_map 1 9240 table_id: # (test.t1)
-master-bin.000001 9240 Write_rows 1 9274 table_id: # flags: STMT_END_F
-master-bin.000001 9274 Table_map 1 9315 table_id: # (test.t1)
-master-bin.000001 9315 Write_rows 1 9349 table_id: # flags: STMT_END_F
-master-bin.000001 9349 Table_map 1 9390 table_id: # (test.t1)
-master-bin.000001 9390 Write_rows 1 9424 table_id: # flags: STMT_END_F
-master-bin.000001 9424 Table_map 1 9465 table_id: # (test.t1)
-master-bin.000001 9465 Write_rows 1 9499 table_id: # flags: STMT_END_F
-master-bin.000001 9499 Table_map 1 9540 table_id: # (test.t1)
-master-bin.000001 9540 Write_rows 1 9574 table_id: # flags: STMT_END_F
-master-bin.000001 9574 Table_map 1 9615 table_id: # (test.t1)
-master-bin.000001 9615 Write_rows 1 9649 table_id: # flags: STMT_END_F
-master-bin.000001 9649 Table_map 1 9690 table_id: # (test.t1)
-master-bin.000001 9690 Write_rows 1 9724 table_id: # flags: STMT_END_F
-master-bin.000001 9724 Table_map 1 9765 table_id: # (test.t1)
-master-bin.000001 9765 Write_rows 1 9799 table_id: # flags: STMT_END_F
-master-bin.000001 9799 Table_map 1 9840 table_id: # (test.t1)
-master-bin.000001 9840 Write_rows 1 9874 table_id: # flags: STMT_END_F
-master-bin.000001 9874 Table_map 1 9915 table_id: # (test.t1)
-master-bin.000001 9915 Write_rows 1 9949 table_id: # flags: STMT_END_F
-master-bin.000001 9949 Table_map 1 9990 table_id: # (test.t1)
-master-bin.000001 9990 Write_rows 1 10024 table_id: # flags: STMT_END_F
-master-bin.000001 10024 Table_map 1 10065 table_id: # (test.t1)
-master-bin.000001 10065 Write_rows 1 10099 table_id: # flags: STMT_END_F
-master-bin.000001 10099 Table_map 1 10140 table_id: # (test.t1)
-master-bin.000001 10140 Write_rows 1 10174 table_id: # flags: STMT_END_F
-master-bin.000001 10174 Table_map 1 10215 table_id: # (test.t1)
-master-bin.000001 10215 Write_rows 1 10249 table_id: # flags: STMT_END_F
-master-bin.000001 10249 Table_map 1 10290 table_id: # (test.t1)
-master-bin.000001 10290 Write_rows 1 10324 table_id: # flags: STMT_END_F
-master-bin.000001 10324 Table_map 1 10365 table_id: # (test.t1)
-master-bin.000001 10365 Write_rows 1 10399 table_id: # flags: STMT_END_F
-master-bin.000001 10399 Table_map 1 10440 table_id: # (test.t1)
-master-bin.000001 10440 Write_rows 1 10474 table_id: # flags: STMT_END_F
-master-bin.000001 10474 Table_map 1 10515 table_id: # (test.t1)
-master-bin.000001 10515 Write_rows 1 10549 table_id: # flags: STMT_END_F
-master-bin.000001 10549 Table_map 1 10590 table_id: # (test.t1)
-master-bin.000001 10590 Write_rows 1 10624 table_id: # flags: STMT_END_F
-master-bin.000001 10624 Table_map 1 10665 table_id: # (test.t1)
-master-bin.000001 10665 Write_rows 1 10699 table_id: # flags: STMT_END_F
-master-bin.000001 10699 Table_map 1 10740 table_id: # (test.t1)
-master-bin.000001 10740 Write_rows 1 10774 table_id: # flags: STMT_END_F
-master-bin.000001 10774 Table_map 1 10815 table_id: # (test.t1)
-master-bin.000001 10815 Write_rows 1 10849 table_id: # flags: STMT_END_F
-master-bin.000001 10849 Table_map 1 10890 table_id: # (test.t1)
-master-bin.000001 10890 Write_rows 1 10924 table_id: # flags: STMT_END_F
-master-bin.000001 10924 Table_map 1 10965 table_id: # (test.t1)
-master-bin.000001 10965 Write_rows 1 10999 table_id: # flags: STMT_END_F
-master-bin.000001 10999 Table_map 1 11040 table_id: # (test.t1)
-master-bin.000001 11040 Write_rows 1 11074 table_id: # flags: STMT_END_F
-master-bin.000001 11074 Table_map 1 11115 table_id: # (test.t1)
-master-bin.000001 11115 Write_rows 1 11149 table_id: # flags: STMT_END_F
-master-bin.000001 11149 Table_map 1 11190 table_id: # (test.t1)
-master-bin.000001 11190 Write_rows 1 11224 table_id: # flags: STMT_END_F
-master-bin.000001 11224 Table_map 1 11265 table_id: # (test.t1)
-master-bin.000001 11265 Write_rows 1 11299 table_id: # flags: STMT_END_F
-master-bin.000001 11299 Table_map 1 11340 table_id: # (test.t1)
-master-bin.000001 11340 Write_rows 1 11374 table_id: # flags: STMT_END_F
-master-bin.000001 11374 Table_map 1 11415 table_id: # (test.t1)
-master-bin.000001 11415 Write_rows 1 11449 table_id: # flags: STMT_END_F
-master-bin.000001 11449 Table_map 1 11490 table_id: # (test.t1)
-master-bin.000001 11490 Write_rows 1 11524 table_id: # flags: STMT_END_F
-master-bin.000001 11524 Table_map 1 11565 table_id: # (test.t1)
-master-bin.000001 11565 Write_rows 1 11599 table_id: # flags: STMT_END_F
-master-bin.000001 11599 Table_map 1 11640 table_id: # (test.t1)
-master-bin.000001 11640 Write_rows 1 11674 table_id: # flags: STMT_END_F
-master-bin.000001 11674 Table_map 1 11715 table_id: # (test.t1)
-master-bin.000001 11715 Write_rows 1 11749 table_id: # flags: STMT_END_F
-master-bin.000001 11749 Table_map 1 11790 table_id: # (test.t1)
-master-bin.000001 11790 Write_rows 1 11824 table_id: # flags: STMT_END_F
-master-bin.000001 11824 Table_map 1 11865 table_id: # (test.t1)
-master-bin.000001 11865 Write_rows 1 11899 table_id: # flags: STMT_END_F
-master-bin.000001 11899 Table_map 1 11940 table_id: # (test.t1)
-master-bin.000001 11940 Write_rows 1 11974 table_id: # flags: STMT_END_F
-master-bin.000001 11974 Table_map 1 12015 table_id: # (test.t1)
-master-bin.000001 12015 Write_rows 1 12049 table_id: # flags: STMT_END_F
-master-bin.000001 12049 Table_map 1 12090 table_id: # (test.t1)
-master-bin.000001 12090 Write_rows 1 12124 table_id: # flags: STMT_END_F
-master-bin.000001 12124 Table_map 1 12165 table_id: # (test.t1)
-master-bin.000001 12165 Write_rows 1 12199 table_id: # flags: STMT_END_F
-master-bin.000001 12199 Table_map 1 12240 table_id: # (test.t1)
-master-bin.000001 12240 Write_rows 1 12274 table_id: # flags: STMT_END_F
-master-bin.000001 12274 Table_map 1 12315 table_id: # (test.t1)
-master-bin.000001 12315 Write_rows 1 12349 table_id: # flags: STMT_END_F
-master-bin.000001 12349 Table_map 1 12390 table_id: # (test.t1)
-master-bin.000001 12390 Write_rows 1 12424 table_id: # flags: STMT_END_F
-master-bin.000001 12424 Table_map 1 12465 table_id: # (test.t1)
-master-bin.000001 12465 Write_rows 1 12499 table_id: # flags: STMT_END_F
-master-bin.000001 12499 Table_map 1 12540 table_id: # (test.t1)
-master-bin.000001 12540 Write_rows 1 12574 table_id: # flags: STMT_END_F
-master-bin.000001 12574 Table_map 1 12615 table_id: # (test.t1)
-master-bin.000001 12615 Write_rows 1 12649 table_id: # flags: STMT_END_F
-master-bin.000001 12649 Table_map 1 12690 table_id: # (test.t1)
-master-bin.000001 12690 Write_rows 1 12724 table_id: # flags: STMT_END_F
-master-bin.000001 12724 Table_map 1 12765 table_id: # (test.t1)
-master-bin.000001 12765 Write_rows 1 12799 table_id: # flags: STMT_END_F
-master-bin.000001 12799 Table_map 1 12840 table_id: # (test.t1)
-master-bin.000001 12840 Write_rows 1 12874 table_id: # flags: STMT_END_F
-master-bin.000001 12874 Table_map 1 12915 table_id: # (test.t1)
-master-bin.000001 12915 Write_rows 1 12949 table_id: # flags: STMT_END_F
-master-bin.000001 12949 Table_map 1 12990 table_id: # (test.t1)
-master-bin.000001 12990 Write_rows 1 13024 table_id: # flags: STMT_END_F
-master-bin.000001 13024 Table_map 1 13065 table_id: # (test.t1)
-master-bin.000001 13065 Write_rows 1 13099 table_id: # flags: STMT_END_F
-master-bin.000001 13099 Table_map 1 13140 table_id: # (test.t1)
-master-bin.000001 13140 Write_rows 1 13174 table_id: # flags: STMT_END_F
-master-bin.000001 13174 Table_map 1 13215 table_id: # (test.t1)
-master-bin.000001 13215 Write_rows 1 13249 table_id: # flags: STMT_END_F
-master-bin.000001 13249 Table_map 1 13290 table_id: # (test.t1)
-master-bin.000001 13290 Write_rows 1 13324 table_id: # flags: STMT_END_F
-master-bin.000001 13324 Table_map 1 13365 table_id: # (test.t1)
-master-bin.000001 13365 Write_rows 1 13399 table_id: # flags: STMT_END_F
-master-bin.000001 13399 Table_map 1 13440 table_id: # (test.t1)
-master-bin.000001 13440 Write_rows 1 13474 table_id: # flags: STMT_END_F
-master-bin.000001 13474 Table_map 1 13515 table_id: # (test.t1)
-master-bin.000001 13515 Write_rows 1 13549 table_id: # flags: STMT_END_F
-master-bin.000001 13549 Table_map 1 13590 table_id: # (test.t1)
-master-bin.000001 13590 Write_rows 1 13624 table_id: # flags: STMT_END_F
-master-bin.000001 13624 Table_map 1 13665 table_id: # (test.t1)
-master-bin.000001 13665 Write_rows 1 13699 table_id: # flags: STMT_END_F
-master-bin.000001 13699 Table_map 1 13740 table_id: # (test.t1)
-master-bin.000001 13740 Write_rows 1 13774 table_id: # flags: STMT_END_F
-master-bin.000001 13774 Table_map 1 13815 table_id: # (test.t1)
-master-bin.000001 13815 Write_rows 1 13849 table_id: # flags: STMT_END_F
-master-bin.000001 13849 Table_map 1 13890 table_id: # (test.t1)
-master-bin.000001 13890 Write_rows 1 13924 table_id: # flags: STMT_END_F
-master-bin.000001 13924 Table_map 1 13965 table_id: # (test.t1)
-master-bin.000001 13965 Write_rows 1 13999 table_id: # flags: STMT_END_F
-master-bin.000001 13999 Table_map 1 14040 table_id: # (test.t1)
-master-bin.000001 14040 Write_rows 1 14074 table_id: # flags: STMT_END_F
-master-bin.000001 14074 Table_map 1 14115 table_id: # (test.t1)
-master-bin.000001 14115 Write_rows 1 14149 table_id: # flags: STMT_END_F
-master-bin.000001 14149 Table_map 1 14190 table_id: # (test.t1)
-master-bin.000001 14190 Write_rows 1 14224 table_id: # flags: STMT_END_F
-master-bin.000001 14224 Table_map 1 14265 table_id: # (test.t1)
-master-bin.000001 14265 Write_rows 1 14299 table_id: # flags: STMT_END_F
-master-bin.000001 14299 Table_map 1 14340 table_id: # (test.t1)
-master-bin.000001 14340 Write_rows 1 14374 table_id: # flags: STMT_END_F
-master-bin.000001 14374 Table_map 1 14415 table_id: # (test.t1)
-master-bin.000001 14415 Write_rows 1 14449 table_id: # flags: STMT_END_F
-master-bin.000001 14449 Table_map 1 14490 table_id: # (test.t1)
-master-bin.000001 14490 Write_rows 1 14524 table_id: # flags: STMT_END_F
-master-bin.000001 14524 Table_map 1 14565 table_id: # (test.t1)
-master-bin.000001 14565 Write_rows 1 14599 table_id: # flags: STMT_END_F
-master-bin.000001 14599 Table_map 1 14640 table_id: # (test.t1)
-master-bin.000001 14640 Write_rows 1 14674 table_id: # flags: STMT_END_F
-master-bin.000001 14674 Table_map 1 14715 table_id: # (test.t1)
-master-bin.000001 14715 Write_rows 1 14749 table_id: # flags: STMT_END_F
-master-bin.000001 14749 Table_map 1 14790 table_id: # (test.t1)
-master-bin.000001 14790 Write_rows 1 14824 table_id: # flags: STMT_END_F
-master-bin.000001 14824 Table_map 1 14865 table_id: # (test.t1)
-master-bin.000001 14865 Write_rows 1 14899 table_id: # flags: STMT_END_F
-master-bin.000001 14899 Table_map 1 14940 table_id: # (test.t1)
-master-bin.000001 14940 Write_rows 1 14974 table_id: # flags: STMT_END_F
-master-bin.000001 14974 Table_map 1 15015 table_id: # (test.t1)
-master-bin.000001 15015 Write_rows 1 15049 table_id: # flags: STMT_END_F
-master-bin.000001 15049 Table_map 1 15090 table_id: # (test.t1)
-master-bin.000001 15090 Write_rows 1 15124 table_id: # flags: STMT_END_F
-master-bin.000001 15124 Table_map 1 15165 table_id: # (test.t1)
-master-bin.000001 15165 Write_rows 1 15199 table_id: # flags: STMT_END_F
-master-bin.000001 15199 Table_map 1 15240 table_id: # (test.t1)
-master-bin.000001 15240 Write_rows 1 15274 table_id: # flags: STMT_END_F
-master-bin.000001 15274 Table_map 1 15315 table_id: # (test.t1)
-master-bin.000001 15315 Write_rows 1 15349 table_id: # flags: STMT_END_F
-master-bin.000001 15349 Table_map 1 15390 table_id: # (test.t1)
-master-bin.000001 15390 Write_rows 1 15424 table_id: # flags: STMT_END_F
-master-bin.000001 15424 Table_map 1 15465 table_id: # (test.t1)
-master-bin.000001 15465 Write_rows 1 15499 table_id: # flags: STMT_END_F
-master-bin.000001 15499 Table_map 1 15540 table_id: # (test.t1)
-master-bin.000001 15540 Write_rows 1 15574 table_id: # flags: STMT_END_F
-master-bin.000001 15574 Table_map 1 15615 table_id: # (test.t1)
-master-bin.000001 15615 Write_rows 1 15649 table_id: # flags: STMT_END_F
-master-bin.000001 15649 Table_map 1 15690 table_id: # (test.t1)
-master-bin.000001 15690 Write_rows 1 15724 table_id: # flags: STMT_END_F
-master-bin.000001 15724 Table_map 1 15765 table_id: # (test.t1)
-master-bin.000001 15765 Write_rows 1 15799 table_id: # flags: STMT_END_F
-master-bin.000001 15799 Table_map 1 15840 table_id: # (test.t1)
-master-bin.000001 15840 Write_rows 1 15874 table_id: # flags: STMT_END_F
-master-bin.000001 15874 Table_map 1 15915 table_id: # (test.t1)
-master-bin.000001 15915 Write_rows 1 15949 table_id: # flags: STMT_END_F
-master-bin.000001 15949 Table_map 1 15990 table_id: # (test.t1)
-master-bin.000001 15990 Write_rows 1 16024 table_id: # flags: STMT_END_F
-master-bin.000001 16024 Table_map 1 16065 table_id: # (test.t1)
-master-bin.000001 16065 Write_rows 1 16099 table_id: # flags: STMT_END_F
-master-bin.000001 16099 Table_map 1 16140 table_id: # (test.t1)
-master-bin.000001 16140 Write_rows 1 16174 table_id: # flags: STMT_END_F
-master-bin.000001 16174 Table_map 1 16215 table_id: # (test.t1)
-master-bin.000001 16215 Write_rows 1 16249 table_id: # flags: STMT_END_F
-master-bin.000001 16249 Table_map 1 16290 table_id: # (test.t1)
-master-bin.000001 16290 Write_rows 1 16324 table_id: # flags: STMT_END_F
-master-bin.000001 16324 Table_map 1 16365 table_id: # (test.t1)
-master-bin.000001 16365 Write_rows 1 16399 table_id: # flags: STMT_END_F
-master-bin.000001 16399 Table_map 1 16440 table_id: # (test.t1)
-master-bin.000001 16440 Write_rows 1 16474 table_id: # flags: STMT_END_F
-master-bin.000001 16474 Table_map 1 16515 table_id: # (test.t1)
-master-bin.000001 16515 Write_rows 1 16549 table_id: # flags: STMT_END_F
-master-bin.000001 16549 Table_map 1 16590 table_id: # (test.t1)
-master-bin.000001 16590 Write_rows 1 16624 table_id: # flags: STMT_END_F
-master-bin.000001 16624 Table_map 1 16665 table_id: # (test.t1)
-master-bin.000001 16665 Write_rows 1 16699 table_id: # flags: STMT_END_F
-master-bin.000001 16699 Table_map 1 16740 table_id: # (test.t1)
-master-bin.000001 16740 Write_rows 1 16774 table_id: # flags: STMT_END_F
-master-bin.000001 16774 Table_map 1 16815 table_id: # (test.t1)
-master-bin.000001 16815 Write_rows 1 16849 table_id: # flags: STMT_END_F
-master-bin.000001 16849 Table_map 1 16890 table_id: # (test.t1)
-master-bin.000001 16890 Write_rows 1 16924 table_id: # flags: STMT_END_F
-master-bin.000001 16924 Table_map 1 16965 table_id: # (test.t1)
-master-bin.000001 16965 Write_rows 1 16999 table_id: # flags: STMT_END_F
-master-bin.000001 16999 Table_map 1 17040 table_id: # (test.t1)
-master-bin.000001 17040 Write_rows 1 17074 table_id: # flags: STMT_END_F
-master-bin.000001 17074 Table_map 1 17115 table_id: # (test.t1)
-master-bin.000001 17115 Write_rows 1 17149 table_id: # flags: STMT_END_F
-master-bin.000001 17149 Table_map 1 17190 table_id: # (test.t1)
-master-bin.000001 17190 Write_rows 1 17224 table_id: # flags: STMT_END_F
-master-bin.000001 17224 Table_map 1 17265 table_id: # (test.t1)
-master-bin.000001 17265 Write_rows 1 17299 table_id: # flags: STMT_END_F
-master-bin.000001 17299 Table_map 1 17340 table_id: # (test.t1)
-master-bin.000001 17340 Write_rows 1 17374 table_id: # flags: STMT_END_F
-master-bin.000001 17374 Table_map 1 17415 table_id: # (test.t1)
-master-bin.000001 17415 Write_rows 1 17449 table_id: # flags: STMT_END_F
-master-bin.000001 17449 Table_map 1 17490 table_id: # (test.t1)
-master-bin.000001 17490 Write_rows 1 17524 table_id: # flags: STMT_END_F
-master-bin.000001 17524 Table_map 1 17565 table_id: # (test.t1)
-master-bin.000001 17565 Write_rows 1 17599 table_id: # flags: STMT_END_F
-master-bin.000001 17599 Table_map 1 17640 table_id: # (test.t1)
-master-bin.000001 17640 Write_rows 1 17674 table_id: # flags: STMT_END_F
-master-bin.000001 17674 Table_map 1 17715 table_id: # (test.t1)
-master-bin.000001 17715 Write_rows 1 17749 table_id: # flags: STMT_END_F
-master-bin.000001 17749 Table_map 1 17790 table_id: # (test.t1)
-master-bin.000001 17790 Write_rows 1 17824 table_id: # flags: STMT_END_F
-master-bin.000001 17824 Table_map 1 17865 table_id: # (test.t1)
-master-bin.000001 17865 Write_rows 1 17899 table_id: # flags: STMT_END_F
-master-bin.000001 17899 Table_map 1 17940 table_id: # (test.t1)
-master-bin.000001 17940 Write_rows 1 17974 table_id: # flags: STMT_END_F
-master-bin.000001 17974 Table_map 1 18015 table_id: # (test.t1)
-master-bin.000001 18015 Write_rows 1 18049 table_id: # flags: STMT_END_F
-master-bin.000001 18049 Table_map 1 18090 table_id: # (test.t1)
-master-bin.000001 18090 Write_rows 1 18124 table_id: # flags: STMT_END_F
-master-bin.000001 18124 Table_map 1 18165 table_id: # (test.t1)
-master-bin.000001 18165 Write_rows 1 18199 table_id: # flags: STMT_END_F
-master-bin.000001 18199 Table_map 1 18240 table_id: # (test.t1)
-master-bin.000001 18240 Write_rows 1 18274 table_id: # flags: STMT_END_F
-master-bin.000001 18274 Table_map 1 18315 table_id: # (test.t1)
-master-bin.000001 18315 Write_rows 1 18349 table_id: # flags: STMT_END_F
-master-bin.000001 18349 Table_map 1 18390 table_id: # (test.t1)
-master-bin.000001 18390 Write_rows 1 18424 table_id: # flags: STMT_END_F
-master-bin.000001 18424 Table_map 1 18465 table_id: # (test.t1)
-master-bin.000001 18465 Write_rows 1 18499 table_id: # flags: STMT_END_F
-master-bin.000001 18499 Table_map 1 18540 table_id: # (test.t1)
-master-bin.000001 18540 Write_rows 1 18574 table_id: # flags: STMT_END_F
-master-bin.000001 18574 Table_map 1 18615 table_id: # (test.t1)
-master-bin.000001 18615 Write_rows 1 18649 table_id: # flags: STMT_END_F
-master-bin.000001 18649 Table_map 1 18690 table_id: # (test.t1)
-master-bin.000001 18690 Write_rows 1 18724 table_id: # flags: STMT_END_F
-master-bin.000001 18724 Table_map 1 18765 table_id: # (test.t1)
-master-bin.000001 18765 Write_rows 1 18799 table_id: # flags: STMT_END_F
-master-bin.000001 18799 Table_map 1 18840 table_id: # (test.t1)
-master-bin.000001 18840 Write_rows 1 18874 table_id: # flags: STMT_END_F
-master-bin.000001 18874 Table_map 1 18915 table_id: # (test.t1)
-master-bin.000001 18915 Write_rows 1 18949 table_id: # flags: STMT_END_F
-master-bin.000001 18949 Table_map 1 18990 table_id: # (test.t1)
-master-bin.000001 18990 Write_rows 1 19024 table_id: # flags: STMT_END_F
-master-bin.000001 19024 Table_map 1 19065 table_id: # (test.t1)
-master-bin.000001 19065 Write_rows 1 19099 table_id: # flags: STMT_END_F
-master-bin.000001 19099 Table_map 1 19140 table_id: # (test.t1)
-master-bin.000001 19140 Write_rows 1 19174 table_id: # flags: STMT_END_F
-master-bin.000001 19174 Table_map 1 19215 table_id: # (test.t1)
-master-bin.000001 19215 Write_rows 1 19249 table_id: # flags: STMT_END_F
-master-bin.000001 19249 Table_map 1 19290 table_id: # (test.t1)
-master-bin.000001 19290 Write_rows 1 19324 table_id: # flags: STMT_END_F
-master-bin.000001 19324 Table_map 1 19365 table_id: # (test.t1)
-master-bin.000001 19365 Write_rows 1 19399 table_id: # flags: STMT_END_F
-master-bin.000001 19399 Table_map 1 19440 table_id: # (test.t1)
-master-bin.000001 19440 Write_rows 1 19474 table_id: # flags: STMT_END_F
-master-bin.000001 19474 Table_map 1 19515 table_id: # (test.t1)
-master-bin.000001 19515 Write_rows 1 19549 table_id: # flags: STMT_END_F
-master-bin.000001 19549 Table_map 1 19590 table_id: # (test.t1)
-master-bin.000001 19590 Write_rows 1 19624 table_id: # flags: STMT_END_F
-master-bin.000001 19624 Table_map 1 19665 table_id: # (test.t1)
-master-bin.000001 19665 Write_rows 1 19699 table_id: # flags: STMT_END_F
-master-bin.000001 19699 Table_map 1 19740 table_id: # (test.t1)
-master-bin.000001 19740 Write_rows 1 19774 table_id: # flags: STMT_END_F
-master-bin.000001 19774 Table_map 1 19815 table_id: # (test.t1)
-master-bin.000001 19815 Write_rows 1 19849 table_id: # flags: STMT_END_F
-master-bin.000001 19849 Table_map 1 19890 table_id: # (test.t1)
-master-bin.000001 19890 Write_rows 1 19924 table_id: # flags: STMT_END_F
-master-bin.000001 19924 Table_map 1 19965 table_id: # (test.t1)
-master-bin.000001 19965 Write_rows 1 19999 table_id: # flags: STMT_END_F
-master-bin.000001 19999 Table_map 1 20040 table_id: # (test.t1)
-master-bin.000001 20040 Write_rows 1 20074 table_id: # flags: STMT_END_F
-master-bin.000001 20074 Table_map 1 20115 table_id: # (test.t1)
-master-bin.000001 20115 Write_rows 1 20149 table_id: # flags: STMT_END_F
-master-bin.000001 20149 Table_map 1 20190 table_id: # (test.t1)
-master-bin.000001 20190 Write_rows 1 20224 table_id: # flags: STMT_END_F
-master-bin.000001 20224 Table_map 1 20265 table_id: # (test.t1)
-master-bin.000001 20265 Write_rows 1 20299 table_id: # flags: STMT_END_F
-master-bin.000001 20299 Table_map 1 20340 table_id: # (test.t1)
-master-bin.000001 20340 Write_rows 1 20374 table_id: # flags: STMT_END_F
-master-bin.000001 20374 Table_map 1 20415 table_id: # (test.t1)
-master-bin.000001 20415 Write_rows 1 20449 table_id: # flags: STMT_END_F
-master-bin.000001 20449 Table_map 1 20490 table_id: # (test.t1)
-master-bin.000001 20490 Write_rows 1 20524 table_id: # flags: STMT_END_F
-master-bin.000001 20524 Table_map 1 20565 table_id: # (test.t1)
-master-bin.000001 20565 Write_rows 1 20599 table_id: # flags: STMT_END_F
-master-bin.000001 20599 Table_map 1 20640 table_id: # (test.t1)
-master-bin.000001 20640 Write_rows 1 20674 table_id: # flags: STMT_END_F
-master-bin.000001 20674 Table_map 1 20715 table_id: # (test.t1)
-master-bin.000001 20715 Write_rows 1 20749 table_id: # flags: STMT_END_F
-master-bin.000001 20749 Table_map 1 20790 table_id: # (test.t1)
-master-bin.000001 20790 Write_rows 1 20824 table_id: # flags: STMT_END_F
-master-bin.000001 20824 Table_map 1 20865 table_id: # (test.t1)
-master-bin.000001 20865 Write_rows 1 20899 table_id: # flags: STMT_END_F
-master-bin.000001 20899 Table_map 1 20940 table_id: # (test.t1)
-master-bin.000001 20940 Write_rows 1 20974 table_id: # flags: STMT_END_F
-master-bin.000001 20974 Table_map 1 21015 table_id: # (test.t1)
-master-bin.000001 21015 Write_rows 1 21049 table_id: # flags: STMT_END_F
-master-bin.000001 21049 Table_map 1 21090 table_id: # (test.t1)
-master-bin.000001 21090 Write_rows 1 21124 table_id: # flags: STMT_END_F
-master-bin.000001 21124 Table_map 1 21165 table_id: # (test.t1)
-master-bin.000001 21165 Write_rows 1 21199 table_id: # flags: STMT_END_F
-master-bin.000001 21199 Table_map 1 21240 table_id: # (test.t1)
-master-bin.000001 21240 Write_rows 1 21274 table_id: # flags: STMT_END_F
-master-bin.000001 21274 Table_map 1 21315 table_id: # (test.t1)
-master-bin.000001 21315 Write_rows 1 21349 table_id: # flags: STMT_END_F
-master-bin.000001 21349 Table_map 1 21390 table_id: # (test.t1)
-master-bin.000001 21390 Write_rows 1 21424 table_id: # flags: STMT_END_F
-master-bin.000001 21424 Table_map 1 21465 table_id: # (test.t1)
-master-bin.000001 21465 Write_rows 1 21499 table_id: # flags: STMT_END_F
-master-bin.000001 21499 Table_map 1 21540 table_id: # (test.t1)
-master-bin.000001 21540 Write_rows 1 21574 table_id: # flags: STMT_END_F
-master-bin.000001 21574 Table_map 1 21615 table_id: # (test.t1)
-master-bin.000001 21615 Write_rows 1 21649 table_id: # flags: STMT_END_F
-master-bin.000001 21649 Table_map 1 21690 table_id: # (test.t1)
-master-bin.000001 21690 Write_rows 1 21724 table_id: # flags: STMT_END_F
-master-bin.000001 21724 Table_map 1 21765 table_id: # (test.t1)
-master-bin.000001 21765 Write_rows 1 21799 table_id: # flags: STMT_END_F
-master-bin.000001 21799 Table_map 1 21840 table_id: # (test.t1)
-master-bin.000001 21840 Write_rows 1 21874 table_id: # flags: STMT_END_F
-master-bin.000001 21874 Table_map 1 21915 table_id: # (test.t1)
-master-bin.000001 21915 Write_rows 1 21949 table_id: # flags: STMT_END_F
-master-bin.000001 21949 Table_map 1 21990 table_id: # (test.t1)
-master-bin.000001 21990 Write_rows 1 22024 table_id: # flags: STMT_END_F
-master-bin.000001 22024 Table_map 1 22065 table_id: # (test.t1)
-master-bin.000001 22065 Write_rows 1 22099 table_id: # flags: STMT_END_F
-master-bin.000001 22099 Table_map 1 22140 table_id: # (test.t1)
-master-bin.000001 22140 Write_rows 1 22174 table_id: # flags: STMT_END_F
-master-bin.000001 22174 Table_map 1 22215 table_id: # (test.t1)
-master-bin.000001 22215 Write_rows 1 22249 table_id: # flags: STMT_END_F
-master-bin.000001 22249 Table_map 1 22290 table_id: # (test.t1)
-master-bin.000001 22290 Write_rows 1 22324 table_id: # flags: STMT_END_F
-master-bin.000001 22324 Table_map 1 22365 table_id: # (test.t1)
-master-bin.000001 22365 Write_rows 1 22399 table_id: # flags: STMT_END_F
-master-bin.000001 22399 Table_map 1 22440 table_id: # (test.t1)
-master-bin.000001 22440 Write_rows 1 22474 table_id: # flags: STMT_END_F
-master-bin.000001 22474 Table_map 1 22515 table_id: # (test.t1)
-master-bin.000001 22515 Write_rows 1 22549 table_id: # flags: STMT_END_F
-master-bin.000001 22549 Table_map 1 22590 table_id: # (test.t1)
-master-bin.000001 22590 Write_rows 1 22624 table_id: # flags: STMT_END_F
-master-bin.000001 22624 Table_map 1 22665 table_id: # (test.t1)
-master-bin.000001 22665 Write_rows 1 22699 table_id: # flags: STMT_END_F
-master-bin.000001 22699 Table_map 1 22740 table_id: # (test.t1)
-master-bin.000001 22740 Write_rows 1 22774 table_id: # flags: STMT_END_F
-master-bin.000001 22774 Table_map 1 22815 table_id: # (test.t1)
-master-bin.000001 22815 Write_rows 1 22849 table_id: # flags: STMT_END_F
-master-bin.000001 22849 Table_map 1 22890 table_id: # (test.t1)
-master-bin.000001 22890 Write_rows 1 22924 table_id: # flags: STMT_END_F
-master-bin.000001 22924 Table_map 1 22965 table_id: # (test.t1)
-master-bin.000001 22965 Write_rows 1 22999 table_id: # flags: STMT_END_F
-master-bin.000001 22999 Table_map 1 23040 table_id: # (test.t1)
-master-bin.000001 23040 Write_rows 1 23074 table_id: # flags: STMT_END_F
-master-bin.000001 23074 Table_map 1 23115 table_id: # (test.t1)
-master-bin.000001 23115 Write_rows 1 23149 table_id: # flags: STMT_END_F
-master-bin.000001 23149 Table_map 1 23190 table_id: # (test.t1)
-master-bin.000001 23190 Write_rows 1 23224 table_id: # flags: STMT_END_F
-master-bin.000001 23224 Table_map 1 23265 table_id: # (test.t1)
-master-bin.000001 23265 Write_rows 1 23299 table_id: # flags: STMT_END_F
-master-bin.000001 23299 Table_map 1 23340 table_id: # (test.t1)
-master-bin.000001 23340 Write_rows 1 23374 table_id: # flags: STMT_END_F
-master-bin.000001 23374 Table_map 1 23415 table_id: # (test.t1)
-master-bin.000001 23415 Write_rows 1 23449 table_id: # flags: STMT_END_F
-master-bin.000001 23449 Table_map 1 23490 table_id: # (test.t1)
-master-bin.000001 23490 Write_rows 1 23524 table_id: # flags: STMT_END_F
-master-bin.000001 23524 Table_map 1 23565 table_id: # (test.t1)
-master-bin.000001 23565 Write_rows 1 23599 table_id: # flags: STMT_END_F
-master-bin.000001 23599 Table_map 1 23640 table_id: # (test.t1)
-master-bin.000001 23640 Write_rows 1 23674 table_id: # flags: STMT_END_F
-master-bin.000001 23674 Table_map 1 23715 table_id: # (test.t1)
-master-bin.000001 23715 Write_rows 1 23749 table_id: # flags: STMT_END_F
-master-bin.000001 23749 Table_map 1 23790 table_id: # (test.t1)
-master-bin.000001 23790 Write_rows 1 23824 table_id: # flags: STMT_END_F
-master-bin.000001 23824 Table_map 1 23865 table_id: # (test.t1)
-master-bin.000001 23865 Write_rows 1 23899 table_id: # flags: STMT_END_F
-master-bin.000001 23899 Table_map 1 23940 table_id: # (test.t1)
-master-bin.000001 23940 Write_rows 1 23974 table_id: # flags: STMT_END_F
-master-bin.000001 23974 Table_map 1 24015 table_id: # (test.t1)
-master-bin.000001 24015 Write_rows 1 24049 table_id: # flags: STMT_END_F
-master-bin.000001 24049 Table_map 1 24090 table_id: # (test.t1)
-master-bin.000001 24090 Write_rows 1 24124 table_id: # flags: STMT_END_F
-master-bin.000001 24124 Table_map 1 24165 table_id: # (test.t1)
-master-bin.000001 24165 Write_rows 1 24199 table_id: # flags: STMT_END_F
-master-bin.000001 24199 Table_map 1 24240 table_id: # (test.t1)
-master-bin.000001 24240 Write_rows 1 24274 table_id: # flags: STMT_END_F
-master-bin.000001 24274 Table_map 1 24315 table_id: # (test.t1)
-master-bin.000001 24315 Write_rows 1 24349 table_id: # flags: STMT_END_F
-master-bin.000001 24349 Table_map 1 24390 table_id: # (test.t1)
-master-bin.000001 24390 Write_rows 1 24424 table_id: # flags: STMT_END_F
-master-bin.000001 24424 Table_map 1 24465 table_id: # (test.t1)
-master-bin.000001 24465 Write_rows 1 24499 table_id: # flags: STMT_END_F
-master-bin.000001 24499 Table_map 1 24540 table_id: # (test.t1)
-master-bin.000001 24540 Write_rows 1 24574 table_id: # flags: STMT_END_F
-master-bin.000001 24574 Table_map 1 24615 table_id: # (test.t1)
-master-bin.000001 24615 Write_rows 1 24649 table_id: # flags: STMT_END_F
-master-bin.000001 24649 Table_map 1 24690 table_id: # (test.t1)
-master-bin.000001 24690 Write_rows 1 24724 table_id: # flags: STMT_END_F
-master-bin.000001 24724 Table_map 1 24765 table_id: # (test.t1)
-master-bin.000001 24765 Write_rows 1 24799 table_id: # flags: STMT_END_F
-master-bin.000001 24799 Table_map 1 24840 table_id: # (test.t1)
-master-bin.000001 24840 Write_rows 1 24874 table_id: # flags: STMT_END_F
-master-bin.000001 24874 Table_map 1 24915 table_id: # (test.t1)
-master-bin.000001 24915 Write_rows 1 24949 table_id: # flags: STMT_END_F
-master-bin.000001 24949 Table_map 1 24990 table_id: # (test.t1)
-master-bin.000001 24990 Write_rows 1 25024 table_id: # flags: STMT_END_F
-master-bin.000001 25024 Table_map 1 25065 table_id: # (test.t1)
-master-bin.000001 25065 Write_rows 1 25099 table_id: # flags: STMT_END_F
-master-bin.000001 25099 Table_map 1 25140 table_id: # (test.t1)
-master-bin.000001 25140 Write_rows 1 25174 table_id: # flags: STMT_END_F
-master-bin.000001 25174 Table_map 1 25215 table_id: # (test.t1)
-master-bin.000001 25215 Write_rows 1 25249 table_id: # flags: STMT_END_F
-master-bin.000001 25249 Table_map 1 25290 table_id: # (test.t1)
-master-bin.000001 25290 Write_rows 1 25324 table_id: # flags: STMT_END_F
-master-bin.000001 25324 Table_map 1 25365 table_id: # (test.t1)
-master-bin.000001 25365 Write_rows 1 25399 table_id: # flags: STMT_END_F
-master-bin.000001 25399 Table_map 1 25440 table_id: # (test.t1)
-master-bin.000001 25440 Write_rows 1 25474 table_id: # flags: STMT_END_F
-master-bin.000001 25474 Table_map 1 25515 table_id: # (test.t1)
-master-bin.000001 25515 Write_rows 1 25549 table_id: # flags: STMT_END_F
-master-bin.000001 25549 Table_map 1 25590 table_id: # (test.t1)
-master-bin.000001 25590 Write_rows 1 25624 table_id: # flags: STMT_END_F
-master-bin.000001 25624 Table_map 1 25665 table_id: # (test.t1)
-master-bin.000001 25665 Write_rows 1 25699 table_id: # flags: STMT_END_F
-master-bin.000001 25699 Table_map 1 25740 table_id: # (test.t1)
-master-bin.000001 25740 Write_rows 1 25774 table_id: # flags: STMT_END_F
-master-bin.000001 25774 Table_map 1 25815 table_id: # (test.t1)
-master-bin.000001 25815 Write_rows 1 25849 table_id: # flags: STMT_END_F
-master-bin.000001 25849 Table_map 1 25890 table_id: # (test.t1)
-master-bin.000001 25890 Write_rows 1 25924 table_id: # flags: STMT_END_F
-master-bin.000001 25924 Table_map 1 25965 table_id: # (test.t1)
-master-bin.000001 25965 Write_rows 1 25999 table_id: # flags: STMT_END_F
-master-bin.000001 25999 Table_map 1 26040 table_id: # (test.t1)
-master-bin.000001 26040 Write_rows 1 26074 table_id: # flags: STMT_END_F
-master-bin.000001 26074 Table_map 1 26115 table_id: # (test.t1)
-master-bin.000001 26115 Write_rows 1 26149 table_id: # flags: STMT_END_F
-master-bin.000001 26149 Table_map 1 26190 table_id: # (test.t1)
-master-bin.000001 26190 Write_rows 1 26224 table_id: # flags: STMT_END_F
-master-bin.000001 26224 Table_map 1 26265 table_id: # (test.t1)
-master-bin.000001 26265 Write_rows 1 26299 table_id: # flags: STMT_END_F
-master-bin.000001 26299 Table_map 1 26340 table_id: # (test.t1)
-master-bin.000001 26340 Write_rows 1 26374 table_id: # flags: STMT_END_F
-master-bin.000001 26374 Table_map 1 26415 table_id: # (test.t1)
-master-bin.000001 26415 Write_rows 1 26449 table_id: # flags: STMT_END_F
-master-bin.000001 26449 Table_map 1 26490 table_id: # (test.t1)
-master-bin.000001 26490 Write_rows 1 26524 table_id: # flags: STMT_END_F
-master-bin.000001 26524 Table_map 1 26565 table_id: # (test.t1)
-master-bin.000001 26565 Write_rows 1 26599 table_id: # flags: STMT_END_F
-master-bin.000001 26599 Table_map 1 26640 table_id: # (test.t1)
-master-bin.000001 26640 Write_rows 1 26674 table_id: # flags: STMT_END_F
-master-bin.000001 26674 Table_map 1 26715 table_id: # (test.t1)
-master-bin.000001 26715 Write_rows 1 26749 table_id: # flags: STMT_END_F
-master-bin.000001 26749 Table_map 1 26790 table_id: # (test.t1)
-master-bin.000001 26790 Write_rows 1 26824 table_id: # flags: STMT_END_F
-master-bin.000001 26824 Table_map 1 26865 table_id: # (test.t1)
-master-bin.000001 26865 Write_rows 1 26899 table_id: # flags: STMT_END_F
-master-bin.000001 26899 Table_map 1 26940 table_id: # (test.t1)
-master-bin.000001 26940 Write_rows 1 26974 table_id: # flags: STMT_END_F
-master-bin.000001 26974 Table_map 1 27015 table_id: # (test.t1)
-master-bin.000001 27015 Write_rows 1 27049 table_id: # flags: STMT_END_F
-master-bin.000001 27049 Table_map 1 27090 table_id: # (test.t1)
-master-bin.000001 27090 Write_rows 1 27124 table_id: # flags: STMT_END_F
-master-bin.000001 27124 Table_map 1 27165 table_id: # (test.t1)
-master-bin.000001 27165 Write_rows 1 27199 table_id: # flags: STMT_END_F
-master-bin.000001 27199 Table_map 1 27240 table_id: # (test.t1)
-master-bin.000001 27240 Write_rows 1 27274 table_id: # flags: STMT_END_F
-master-bin.000001 27274 Table_map 1 27315 table_id: # (test.t1)
-master-bin.000001 27315 Write_rows 1 27349 table_id: # flags: STMT_END_F
-master-bin.000001 27349 Table_map 1 27390 table_id: # (test.t1)
-master-bin.000001 27390 Write_rows 1 27424 table_id: # flags: STMT_END_F
-master-bin.000001 27424 Table_map 1 27465 table_id: # (test.t1)
-master-bin.000001 27465 Write_rows 1 27499 table_id: # flags: STMT_END_F
-master-bin.000001 27499 Table_map 1 27540 table_id: # (test.t1)
-master-bin.000001 27540 Write_rows 1 27574 table_id: # flags: STMT_END_F
-master-bin.000001 27574 Table_map 1 27615 table_id: # (test.t1)
-master-bin.000001 27615 Write_rows 1 27649 table_id: # flags: STMT_END_F
-master-bin.000001 27649 Table_map 1 27690 table_id: # (test.t1)
-master-bin.000001 27690 Write_rows 1 27724 table_id: # flags: STMT_END_F
-master-bin.000001 27724 Table_map 1 27765 table_id: # (test.t1)
-master-bin.000001 27765 Write_rows 1 27799 table_id: # flags: STMT_END_F
-master-bin.000001 27799 Table_map 1 27840 table_id: # (test.t1)
-master-bin.000001 27840 Write_rows 1 27874 table_id: # flags: STMT_END_F
-master-bin.000001 27874 Table_map 1 27915 table_id: # (test.t1)
-master-bin.000001 27915 Write_rows 1 27949 table_id: # flags: STMT_END_F
-master-bin.000001 27949 Table_map 1 27990 table_id: # (test.t1)
-master-bin.000001 27990 Write_rows 1 28024 table_id: # flags: STMT_END_F
-master-bin.000001 28024 Table_map 1 28065 table_id: # (test.t1)
-master-bin.000001 28065 Write_rows 1 28099 table_id: # flags: STMT_END_F
-master-bin.000001 28099 Table_map 1 28140 table_id: # (test.t1)
-master-bin.000001 28140 Write_rows 1 28174 table_id: # flags: STMT_END_F
-master-bin.000001 28174 Table_map 1 28215 table_id: # (test.t1)
-master-bin.000001 28215 Write_rows 1 28249 table_id: # flags: STMT_END_F
-master-bin.000001 28249 Table_map 1 28290 table_id: # (test.t1)
-master-bin.000001 28290 Write_rows 1 28324 table_id: # flags: STMT_END_F
-master-bin.000001 28324 Table_map 1 28365 table_id: # (test.t1)
-master-bin.000001 28365 Write_rows 1 28399 table_id: # flags: STMT_END_F
-master-bin.000001 28399 Table_map 1 28440 table_id: # (test.t1)
-master-bin.000001 28440 Write_rows 1 28474 table_id: # flags: STMT_END_F
-master-bin.000001 28474 Table_map 1 28515 table_id: # (test.t1)
-master-bin.000001 28515 Write_rows 1 28549 table_id: # flags: STMT_END_F
-master-bin.000001 28549 Table_map 1 28590 table_id: # (test.t1)
-master-bin.000001 28590 Write_rows 1 28624 table_id: # flags: STMT_END_F
-master-bin.000001 28624 Table_map 1 28665 table_id: # (test.t1)
-master-bin.000001 28665 Write_rows 1 28699 table_id: # flags: STMT_END_F
-master-bin.000001 28699 Table_map 1 28740 table_id: # (test.t1)
-master-bin.000001 28740 Write_rows 1 28774 table_id: # flags: STMT_END_F
-master-bin.000001 28774 Table_map 1 28815 table_id: # (test.t1)
-master-bin.000001 28815 Write_rows 1 28849 table_id: # flags: STMT_END_F
-master-bin.000001 28849 Table_map 1 28890 table_id: # (test.t1)
-master-bin.000001 28890 Write_rows 1 28924 table_id: # flags: STMT_END_F
-master-bin.000001 28924 Table_map 1 28965 table_id: # (test.t1)
-master-bin.000001 28965 Write_rows 1 28999 table_id: # flags: STMT_END_F
-master-bin.000001 28999 Table_map 1 29040 table_id: # (test.t1)
-master-bin.000001 29040 Write_rows 1 29074 table_id: # flags: STMT_END_F
-master-bin.000001 29074 Table_map 1 29115 table_id: # (test.t1)
-master-bin.000001 29115 Write_rows 1 29149 table_id: # flags: STMT_END_F
-master-bin.000001 29149 Table_map 1 29190 table_id: # (test.t1)
-master-bin.000001 29190 Write_rows 1 29224 table_id: # flags: STMT_END_F
-master-bin.000001 29224 Table_map 1 29265 table_id: # (test.t1)
-master-bin.000001 29265 Write_rows 1 29299 table_id: # flags: STMT_END_F
-master-bin.000001 29299 Table_map 1 29340 table_id: # (test.t1)
-master-bin.000001 29340 Write_rows 1 29374 table_id: # flags: STMT_END_F
-master-bin.000001 29374 Table_map 1 29415 table_id: # (test.t1)
-master-bin.000001 29415 Write_rows 1 29449 table_id: # flags: STMT_END_F
-master-bin.000001 29449 Table_map 1 29490 table_id: # (test.t1)
-master-bin.000001 29490 Write_rows 1 29524 table_id: # flags: STMT_END_F
-master-bin.000001 29524 Table_map 1 29565 table_id: # (test.t1)
-master-bin.000001 29565 Write_rows 1 29599 table_id: # flags: STMT_END_F
-master-bin.000001 29599 Table_map 1 29640 table_id: # (test.t1)
-master-bin.000001 29640 Write_rows 1 29674 table_id: # flags: STMT_END_F
-master-bin.000001 29674 Table_map 1 29715 table_id: # (test.t1)
-master-bin.000001 29715 Write_rows 1 29749 table_id: # flags: STMT_END_F
-master-bin.000001 29749 Table_map 1 29790 table_id: # (test.t1)
-master-bin.000001 29790 Write_rows 1 29824 table_id: # flags: STMT_END_F
-master-bin.000001 29824 Table_map 1 29865 table_id: # (test.t1)
-master-bin.000001 29865 Write_rows 1 29899 table_id: # flags: STMT_END_F
-master-bin.000001 29899 Table_map 1 29940 table_id: # (test.t1)
-master-bin.000001 29940 Write_rows 1 29974 table_id: # flags: STMT_END_F
-master-bin.000001 29974 Table_map 1 30015 table_id: # (test.t1)
-master-bin.000001 30015 Write_rows 1 30049 table_id: # flags: STMT_END_F
-master-bin.000001 30049 Table_map 1 30090 table_id: # (test.t1)
-master-bin.000001 30090 Write_rows 1 30124 table_id: # flags: STMT_END_F
-master-bin.000001 30124 Table_map 1 30165 table_id: # (test.t1)
-master-bin.000001 30165 Write_rows 1 30199 table_id: # flags: STMT_END_F
-master-bin.000001 30199 Table_map 1 30240 table_id: # (test.t1)
-master-bin.000001 30240 Write_rows 1 30274 table_id: # flags: STMT_END_F
-master-bin.000001 30274 Xid 1 30301 COMMIT /* XID */
-master-bin.000001 30301 Rotate 1 30345 master-bin.000002;pos=4
+master-bin.000001 499 Xid 1 526 COMMIT /* XID */
+master-bin.000001 526 Query 1 602 use `test`; drop table t1
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+create table t1 (a int) engine=innodb;
+show binlog events from 0;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 207 use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 207 Query 1 275 BEGIN
+master-bin.000001 275 Table_map 1 316 table_id: # (test.t1)
+master-bin.000001 316 Write_rows 1 350 table_id: # flags: STMT_END_F
+master-bin.000001 350 Table_map 1 391 table_id: # (test.t1)
+master-bin.000001 391 Write_rows 1 425 table_id: # flags: STMT_END_F
+master-bin.000001 425 Table_map 1 466 table_id: # (test.t1)
+master-bin.000001 466 Write_rows 1 500 table_id: # flags: STMT_END_F
+master-bin.000001 500 Table_map 1 541 table_id: # (test.t1)
+master-bin.000001 541 Write_rows 1 575 table_id: # flags: STMT_END_F
+master-bin.000001 575 Table_map 1 616 table_id: # (test.t1)
+master-bin.000001 616 Write_rows 1 650 table_id: # flags: STMT_END_F
+master-bin.000001 650 Table_map 1 691 table_id: # (test.t1)
+master-bin.000001 691 Write_rows 1 725 table_id: # flags: STMT_END_F
+master-bin.000001 725 Table_map 1 766 table_id: # (test.t1)
+master-bin.000001 766 Write_rows 1 800 table_id: # flags: STMT_END_F
+master-bin.000001 800 Table_map 1 841 table_id: # (test.t1)
+master-bin.000001 841 Write_rows 1 875 table_id: # flags: STMT_END_F
+master-bin.000001 875 Table_map 1 916 table_id: # (test.t1)
+master-bin.000001 916 Write_rows 1 950 table_id: # flags: STMT_END_F
+master-bin.000001 950 Table_map 1 991 table_id: # (test.t1)
+master-bin.000001 991 Write_rows 1 1025 table_id: # flags: STMT_END_F
+master-bin.000001 1025 Table_map 1 1066 table_id: # (test.t1)
+master-bin.000001 1066 Write_rows 1 1100 table_id: # flags: STMT_END_F
+master-bin.000001 1100 Table_map 1 1141 table_id: # (test.t1)
+master-bin.000001 1141 Write_rows 1 1175 table_id: # flags: STMT_END_F
+master-bin.000001 1175 Table_map 1 1216 table_id: # (test.t1)
+master-bin.000001 1216 Write_rows 1 1250 table_id: # flags: STMT_END_F
+master-bin.000001 1250 Table_map 1 1291 table_id: # (test.t1)
+master-bin.000001 1291 Write_rows 1 1325 table_id: # flags: STMT_END_F
+master-bin.000001 1325 Table_map 1 1366 table_id: # (test.t1)
+master-bin.000001 1366 Write_rows 1 1400 table_id: # flags: STMT_END_F
+master-bin.000001 1400 Table_map 1 1441 table_id: # (test.t1)
+master-bin.000001 1441 Write_rows 1 1475 table_id: # flags: STMT_END_F
+master-bin.000001 1475 Table_map 1 1516 table_id: # (test.t1)
+master-bin.000001 1516 Write_rows 1 1550 table_id: # flags: STMT_END_F
+master-bin.000001 1550 Table_map 1 1591 table_id: # (test.t1)
+master-bin.000001 1591 Write_rows 1 1625 table_id: # flags: STMT_END_F
+master-bin.000001 1625 Table_map 1 1666 table_id: # (test.t1)
+master-bin.000001 1666 Write_rows 1 1700 table_id: # flags: STMT_END_F
+master-bin.000001 1700 Table_map 1 1741 table_id: # (test.t1)
+master-bin.000001 1741 Write_rows 1 1775 table_id: # flags: STMT_END_F
+master-bin.000001 1775 Table_map 1 1816 table_id: # (test.t1)
+master-bin.000001 1816 Write_rows 1 1850 table_id: # flags: STMT_END_F
+master-bin.000001 1850 Table_map 1 1891 table_id: # (test.t1)
+master-bin.000001 1891 Write_rows 1 1925 table_id: # flags: STMT_END_F
+master-bin.000001 1925 Table_map 1 1966 table_id: # (test.t1)
+master-bin.000001 1966 Write_rows 1 2000 table_id: # flags: STMT_END_F
+master-bin.000001 2000 Table_map 1 2041 table_id: # (test.t1)
+master-bin.000001 2041 Write_rows 1 2075 table_id: # flags: STMT_END_F
+master-bin.000001 2075 Table_map 1 2116 table_id: # (test.t1)
+master-bin.000001 2116 Write_rows 1 2150 table_id: # flags: STMT_END_F
+master-bin.000001 2150 Table_map 1 2191 table_id: # (test.t1)
+master-bin.000001 2191 Write_rows 1 2225 table_id: # flags: STMT_END_F
+master-bin.000001 2225 Table_map 1 2266 table_id: # (test.t1)
+master-bin.000001 2266 Write_rows 1 2300 table_id: # flags: STMT_END_F
+master-bin.000001 2300 Table_map 1 2341 table_id: # (test.t1)
+master-bin.000001 2341 Write_rows 1 2375 table_id: # flags: STMT_END_F
+master-bin.000001 2375 Table_map 1 2416 table_id: # (test.t1)
+master-bin.000001 2416 Write_rows 1 2450 table_id: # flags: STMT_END_F
+master-bin.000001 2450 Table_map 1 2491 table_id: # (test.t1)
+master-bin.000001 2491 Write_rows 1 2525 table_id: # flags: STMT_END_F
+master-bin.000001 2525 Table_map 1 2566 table_id: # (test.t1)
+master-bin.000001 2566 Write_rows 1 2600 table_id: # flags: STMT_END_F
+master-bin.000001 2600 Table_map 1 2641 table_id: # (test.t1)
+master-bin.000001 2641 Write_rows 1 2675 table_id: # flags: STMT_END_F
+master-bin.000001 2675 Table_map 1 2716 table_id: # (test.t1)
+master-bin.000001 2716 Write_rows 1 2750 table_id: # flags: STMT_END_F
+master-bin.000001 2750 Table_map 1 2791 table_id: # (test.t1)
+master-bin.000001 2791 Write_rows 1 2825 table_id: # flags: STMT_END_F
+master-bin.000001 2825 Table_map 1 2866 table_id: # (test.t1)
+master-bin.000001 2866 Write_rows 1 2900 table_id: # flags: STMT_END_F
+master-bin.000001 2900 Table_map 1 2941 table_id: # (test.t1)
+master-bin.000001 2941 Write_rows 1 2975 table_id: # flags: STMT_END_F
+master-bin.000001 2975 Table_map 1 3016 table_id: # (test.t1)
+master-bin.000001 3016 Write_rows 1 3050 table_id: # flags: STMT_END_F
+master-bin.000001 3050 Table_map 1 3091 table_id: # (test.t1)
+master-bin.000001 3091 Write_rows 1 3125 table_id: # flags: STMT_END_F
+master-bin.000001 3125 Table_map 1 3166 table_id: # (test.t1)
+master-bin.000001 3166 Write_rows 1 3200 table_id: # flags: STMT_END_F
+master-bin.000001 3200 Table_map 1 3241 table_id: # (test.t1)
+master-bin.000001 3241 Write_rows 1 3275 table_id: # flags: STMT_END_F
+master-bin.000001 3275 Table_map 1 3316 table_id: # (test.t1)
+master-bin.000001 3316 Write_rows 1 3350 table_id: # flags: STMT_END_F
+master-bin.000001 3350 Table_map 1 3391 table_id: # (test.t1)
+master-bin.000001 3391 Write_rows 1 3425 table_id: # flags: STMT_END_F
+master-bin.000001 3425 Table_map 1 3466 table_id: # (test.t1)
+master-bin.000001 3466 Write_rows 1 3500 table_id: # flags: STMT_END_F
+master-bin.000001 3500 Table_map 1 3541 table_id: # (test.t1)
+master-bin.000001 3541 Write_rows 1 3575 table_id: # flags: STMT_END_F
+master-bin.000001 3575 Table_map 1 3616 table_id: # (test.t1)
+master-bin.000001 3616 Write_rows 1 3650 table_id: # flags: STMT_END_F
+master-bin.000001 3650 Table_map 1 3691 table_id: # (test.t1)
+master-bin.000001 3691 Write_rows 1 3725 table_id: # flags: STMT_END_F
+master-bin.000001 3725 Table_map 1 3766 table_id: # (test.t1)
+master-bin.000001 3766 Write_rows 1 3800 table_id: # flags: STMT_END_F
+master-bin.000001 3800 Table_map 1 3841 table_id: # (test.t1)
+master-bin.000001 3841 Write_rows 1 3875 table_id: # flags: STMT_END_F
+master-bin.000001 3875 Table_map 1 3916 table_id: # (test.t1)
+master-bin.000001 3916 Write_rows 1 3950 table_id: # flags: STMT_END_F
+master-bin.000001 3950 Table_map 1 3991 table_id: # (test.t1)
+master-bin.000001 3991 Write_rows 1 4025 table_id: # flags: STMT_END_F
+master-bin.000001 4025 Table_map 1 4066 table_id: # (test.t1)
+master-bin.000001 4066 Write_rows 1 4100 table_id: # flags: STMT_END_F
+master-bin.000001 4100 Table_map 1 4141 table_id: # (test.t1)
+master-bin.000001 4141 Write_rows 1 4175 table_id: # flags: STMT_END_F
+master-bin.000001 4175 Table_map 1 4216 table_id: # (test.t1)
+master-bin.000001 4216 Write_rows 1 4250 table_id: # flags: STMT_END_F
+master-bin.000001 4250 Table_map 1 4291 table_id: # (test.t1)
+master-bin.000001 4291 Write_rows 1 4325 table_id: # flags: STMT_END_F
+master-bin.000001 4325 Table_map 1 4366 table_id: # (test.t1)
+master-bin.000001 4366 Write_rows 1 4400 table_id: # flags: STMT_END_F
+master-bin.000001 4400 Table_map 1 4441 table_id: # (test.t1)
+master-bin.000001 4441 Write_rows 1 4475 table_id: # flags: STMT_END_F
+master-bin.000001 4475 Table_map 1 4516 table_id: # (test.t1)
+master-bin.000001 4516 Write_rows 1 4550 table_id: # flags: STMT_END_F
+master-bin.000001 4550 Table_map 1 4591 table_id: # (test.t1)
+master-bin.000001 4591 Write_rows 1 4625 table_id: # flags: STMT_END_F
+master-bin.000001 4625 Table_map 1 4666 table_id: # (test.t1)
+master-bin.000001 4666 Write_rows 1 4700 table_id: # flags: STMT_END_F
+master-bin.000001 4700 Table_map 1 4741 table_id: # (test.t1)
+master-bin.000001 4741 Write_rows 1 4775 table_id: # flags: STMT_END_F
+master-bin.000001 4775 Table_map 1 4816 table_id: # (test.t1)
+master-bin.000001 4816 Write_rows 1 4850 table_id: # flags: STMT_END_F
+master-bin.000001 4850 Table_map 1 4891 table_id: # (test.t1)
+master-bin.000001 4891 Write_rows 1 4925 table_id: # flags: STMT_END_F
+master-bin.000001 4925 Table_map 1 4966 table_id: # (test.t1)
+master-bin.000001 4966 Write_rows 1 5000 table_id: # flags: STMT_END_F
+master-bin.000001 5000 Table_map 1 5041 table_id: # (test.t1)
+master-bin.000001 5041 Write_rows 1 5075 table_id: # flags: STMT_END_F
+master-bin.000001 5075 Table_map 1 5116 table_id: # (test.t1)
+master-bin.000001 5116 Write_rows 1 5150 table_id: # flags: STMT_END_F
+master-bin.000001 5150 Table_map 1 5191 table_id: # (test.t1)
+master-bin.000001 5191 Write_rows 1 5225 table_id: # flags: STMT_END_F
+master-bin.000001 5225 Table_map 1 5266 table_id: # (test.t1)
+master-bin.000001 5266 Write_rows 1 5300 table_id: # flags: STMT_END_F
+master-bin.000001 5300 Table_map 1 5341 table_id: # (test.t1)
+master-bin.000001 5341 Write_rows 1 5375 table_id: # flags: STMT_END_F
+master-bin.000001 5375 Table_map 1 5416 table_id: # (test.t1)
+master-bin.000001 5416 Write_rows 1 5450 table_id: # flags: STMT_END_F
+master-bin.000001 5450 Table_map 1 5491 table_id: # (test.t1)
+master-bin.000001 5491 Write_rows 1 5525 table_id: # flags: STMT_END_F
+master-bin.000001 5525 Table_map 1 5566 table_id: # (test.t1)
+master-bin.000001 5566 Write_rows 1 5600 table_id: # flags: STMT_END_F
+master-bin.000001 5600 Table_map 1 5641 table_id: # (test.t1)
+master-bin.000001 5641 Write_rows 1 5675 table_id: # flags: STMT_END_F
+master-bin.000001 5675 Table_map 1 5716 table_id: # (test.t1)
+master-bin.000001 5716 Write_rows 1 5750 table_id: # flags: STMT_END_F
+master-bin.000001 5750 Table_map 1 5791 table_id: # (test.t1)
+master-bin.000001 5791 Write_rows 1 5825 table_id: # flags: STMT_END_F
+master-bin.000001 5825 Table_map 1 5866 table_id: # (test.t1)
+master-bin.000001 5866 Write_rows 1 5900 table_id: # flags: STMT_END_F
+master-bin.000001 5900 Table_map 1 5941 table_id: # (test.t1)
+master-bin.000001 5941 Write_rows 1 5975 table_id: # flags: STMT_END_F
+master-bin.000001 5975 Table_map 1 6016 table_id: # (test.t1)
+master-bin.000001 6016 Write_rows 1 6050 table_id: # flags: STMT_END_F
+master-bin.000001 6050 Table_map 1 6091 table_id: # (test.t1)
+master-bin.000001 6091 Write_rows 1 6125 table_id: # flags: STMT_END_F
+master-bin.000001 6125 Table_map 1 6166 table_id: # (test.t1)
+master-bin.000001 6166 Write_rows 1 6200 table_id: # flags: STMT_END_F
+master-bin.000001 6200 Table_map 1 6241 table_id: # (test.t1)
+master-bin.000001 6241 Write_rows 1 6275 table_id: # flags: STMT_END_F
+master-bin.000001 6275 Table_map 1 6316 table_id: # (test.t1)
+master-bin.000001 6316 Write_rows 1 6350 table_id: # flags: STMT_END_F
+master-bin.000001 6350 Table_map 1 6391 table_id: # (test.t1)
+master-bin.000001 6391 Write_rows 1 6425 table_id: # flags: STMT_END_F
+master-bin.000001 6425 Table_map 1 6466 table_id: # (test.t1)
+master-bin.000001 6466 Write_rows 1 6500 table_id: # flags: STMT_END_F
+master-bin.000001 6500 Table_map 1 6541 table_id: # (test.t1)
+master-bin.000001 6541 Write_rows 1 6575 table_id: # flags: STMT_END_F
+master-bin.000001 6575 Table_map 1 6616 table_id: # (test.t1)
+master-bin.000001 6616 Write_rows 1 6650 table_id: # flags: STMT_END_F
+master-bin.000001 6650 Table_map 1 6691 table_id: # (test.t1)
+master-bin.000001 6691 Write_rows 1 6725 table_id: # flags: STMT_END_F
+master-bin.000001 6725 Table_map 1 6766 table_id: # (test.t1)
+master-bin.000001 6766 Write_rows 1 6800 table_id: # flags: STMT_END_F
+master-bin.000001 6800 Table_map 1 6841 table_id: # (test.t1)
+master-bin.000001 6841 Write_rows 1 6875 table_id: # flags: STMT_END_F
+master-bin.000001 6875 Table_map 1 6916 table_id: # (test.t1)
+master-bin.000001 6916 Write_rows 1 6950 table_id: # flags: STMT_END_F
+master-bin.000001 6950 Table_map 1 6991 table_id: # (test.t1)
+master-bin.000001 6991 Write_rows 1 7025 table_id: # flags: STMT_END_F
+master-bin.000001 7025 Table_map 1 7066 table_id: # (test.t1)
+master-bin.000001 7066 Write_rows 1 7100 table_id: # flags: STMT_END_F
+master-bin.000001 7100 Table_map 1 7141 table_id: # (test.t1)
+master-bin.000001 7141 Write_rows 1 7175 table_id: # flags: STMT_END_F
+master-bin.000001 7175 Table_map 1 7216 table_id: # (test.t1)
+master-bin.000001 7216 Write_rows 1 7250 table_id: # flags: STMT_END_F
+master-bin.000001 7250 Table_map 1 7291 table_id: # (test.t1)
+master-bin.000001 7291 Write_rows 1 7325 table_id: # flags: STMT_END_F
+master-bin.000001 7325 Table_map 1 7366 table_id: # (test.t1)
+master-bin.000001 7366 Write_rows 1 7400 table_id: # flags: STMT_END_F
+master-bin.000001 7400 Table_map 1 7441 table_id: # (test.t1)
+master-bin.000001 7441 Write_rows 1 7475 table_id: # flags: STMT_END_F
+master-bin.000001 7475 Table_map 1 7516 table_id: # (test.t1)
+master-bin.000001 7516 Write_rows 1 7550 table_id: # flags: STMT_END_F
+master-bin.000001 7550 Table_map 1 7591 table_id: # (test.t1)
+master-bin.000001 7591 Write_rows 1 7625 table_id: # flags: STMT_END_F
+master-bin.000001 7625 Table_map 1 7666 table_id: # (test.t1)
+master-bin.000001 7666 Write_rows 1 7700 table_id: # flags: STMT_END_F
+master-bin.000001 7700 Table_map 1 7741 table_id: # (test.t1)
+master-bin.000001 7741 Write_rows 1 7775 table_id: # flags: STMT_END_F
+master-bin.000001 7775 Table_map 1 7816 table_id: # (test.t1)
+master-bin.000001 7816 Write_rows 1 7850 table_id: # flags: STMT_END_F
+master-bin.000001 7850 Table_map 1 7891 table_id: # (test.t1)
+master-bin.000001 7891 Write_rows 1 7925 table_id: # flags: STMT_END_F
+master-bin.000001 7925 Table_map 1 7966 table_id: # (test.t1)
+master-bin.000001 7966 Write_rows 1 8000 table_id: # flags: STMT_END_F
+master-bin.000001 8000 Table_map 1 8041 table_id: # (test.t1)
+master-bin.000001 8041 Write_rows 1 8075 table_id: # flags: STMT_END_F
+master-bin.000001 8075 Table_map 1 8116 table_id: # (test.t1)
+master-bin.000001 8116 Write_rows 1 8150 table_id: # flags: STMT_END_F
+master-bin.000001 8150 Table_map 1 8191 table_id: # (test.t1)
+master-bin.000001 8191 Write_rows 1 8225 table_id: # flags: STMT_END_F
+master-bin.000001 8225 Table_map 1 8266 table_id: # (test.t1)
+master-bin.000001 8266 Write_rows 1 8300 table_id: # flags: STMT_END_F
+master-bin.000001 8300 Table_map 1 8341 table_id: # (test.t1)
+master-bin.000001 8341 Write_rows 1 8375 table_id: # flags: STMT_END_F
+master-bin.000001 8375 Table_map 1 8416 table_id: # (test.t1)
+master-bin.000001 8416 Write_rows 1 8450 table_id: # flags: STMT_END_F
+master-bin.000001 8450 Table_map 1 8491 table_id: # (test.t1)
+master-bin.000001 8491 Write_rows 1 8525 table_id: # flags: STMT_END_F
+master-bin.000001 8525 Table_map 1 8566 table_id: # (test.t1)
+master-bin.000001 8566 Write_rows 1 8600 table_id: # flags: STMT_END_F
+master-bin.000001 8600 Table_map 1 8641 table_id: # (test.t1)
+master-bin.000001 8641 Write_rows 1 8675 table_id: # flags: STMT_END_F
+master-bin.000001 8675 Table_map 1 8716 table_id: # (test.t1)
+master-bin.000001 8716 Write_rows 1 8750 table_id: # flags: STMT_END_F
+master-bin.000001 8750 Table_map 1 8791 table_id: # (test.t1)
+master-bin.000001 8791 Write_rows 1 8825 table_id: # flags: STMT_END_F
+master-bin.000001 8825 Table_map 1 8866 table_id: # (test.t1)
+master-bin.000001 8866 Write_rows 1 8900 table_id: # flags: STMT_END_F
+master-bin.000001 8900 Table_map 1 8941 table_id: # (test.t1)
+master-bin.000001 8941 Write_rows 1 8975 table_id: # flags: STMT_END_F
+master-bin.000001 8975 Table_map 1 9016 table_id: # (test.t1)
+master-bin.000001 9016 Write_rows 1 9050 table_id: # flags: STMT_END_F
+master-bin.000001 9050 Table_map 1 9091 table_id: # (test.t1)
+master-bin.000001 9091 Write_rows 1 9125 table_id: # flags: STMT_END_F
+master-bin.000001 9125 Table_map 1 9166 table_id: # (test.t1)
+master-bin.000001 9166 Write_rows 1 9200 table_id: # flags: STMT_END_F
+master-bin.000001 9200 Table_map 1 9241 table_id: # (test.t1)
+master-bin.000001 9241 Write_rows 1 9275 table_id: # flags: STMT_END_F
+master-bin.000001 9275 Table_map 1 9316 table_id: # (test.t1)
+master-bin.000001 9316 Write_rows 1 9350 table_id: # flags: STMT_END_F
+master-bin.000001 9350 Table_map 1 9391 table_id: # (test.t1)
+master-bin.000001 9391 Write_rows 1 9425 table_id: # flags: STMT_END_F
+master-bin.000001 9425 Table_map 1 9466 table_id: # (test.t1)
+master-bin.000001 9466 Write_rows 1 9500 table_id: # flags: STMT_END_F
+master-bin.000001 9500 Table_map 1 9541 table_id: # (test.t1)
+master-bin.000001 9541 Write_rows 1 9575 table_id: # flags: STMT_END_F
+master-bin.000001 9575 Table_map 1 9616 table_id: # (test.t1)
+master-bin.000001 9616 Write_rows 1 9650 table_id: # flags: STMT_END_F
+master-bin.000001 9650 Table_map 1 9691 table_id: # (test.t1)
+master-bin.000001 9691 Write_rows 1 9725 table_id: # flags: STMT_END_F
+master-bin.000001 9725 Table_map 1 9766 table_id: # (test.t1)
+master-bin.000001 9766 Write_rows 1 9800 table_id: # flags: STMT_END_F
+master-bin.000001 9800 Table_map 1 9841 table_id: # (test.t1)
+master-bin.000001 9841 Write_rows 1 9875 table_id: # flags: STMT_END_F
+master-bin.000001 9875 Table_map 1 9916 table_id: # (test.t1)
+master-bin.000001 9916 Write_rows 1 9950 table_id: # flags: STMT_END_F
+master-bin.000001 9950 Table_map 1 9991 table_id: # (test.t1)
+master-bin.000001 9991 Write_rows 1 10025 table_id: # flags: STMT_END_F
+master-bin.000001 10025 Table_map 1 10066 table_id: # (test.t1)
+master-bin.000001 10066 Write_rows 1 10100 table_id: # flags: STMT_END_F
+master-bin.000001 10100 Table_map 1 10141 table_id: # (test.t1)
+master-bin.000001 10141 Write_rows 1 10175 table_id: # flags: STMT_END_F
+master-bin.000001 10175 Table_map 1 10216 table_id: # (test.t1)
+master-bin.000001 10216 Write_rows 1 10250 table_id: # flags: STMT_END_F
+master-bin.000001 10250 Table_map 1 10291 table_id: # (test.t1)
+master-bin.000001 10291 Write_rows 1 10325 table_id: # flags: STMT_END_F
+master-bin.000001 10325 Table_map 1 10366 table_id: # (test.t1)
+master-bin.000001 10366 Write_rows 1 10400 table_id: # flags: STMT_END_F
+master-bin.000001 10400 Table_map 1 10441 table_id: # (test.t1)
+master-bin.000001 10441 Write_rows 1 10475 table_id: # flags: STMT_END_F
+master-bin.000001 10475 Table_map 1 10516 table_id: # (test.t1)
+master-bin.000001 10516 Write_rows 1 10550 table_id: # flags: STMT_END_F
+master-bin.000001 10550 Table_map 1 10591 table_id: # (test.t1)
+master-bin.000001 10591 Write_rows 1 10625 table_id: # flags: STMT_END_F
+master-bin.000001 10625 Table_map 1 10666 table_id: # (test.t1)
+master-bin.000001 10666 Write_rows 1 10700 table_id: # flags: STMT_END_F
+master-bin.000001 10700 Table_map 1 10741 table_id: # (test.t1)
+master-bin.000001 10741 Write_rows 1 10775 table_id: # flags: STMT_END_F
+master-bin.000001 10775 Table_map 1 10816 table_id: # (test.t1)
+master-bin.000001 10816 Write_rows 1 10850 table_id: # flags: STMT_END_F
+master-bin.000001 10850 Table_map 1 10891 table_id: # (test.t1)
+master-bin.000001 10891 Write_rows 1 10925 table_id: # flags: STMT_END_F
+master-bin.000001 10925 Table_map 1 10966 table_id: # (test.t1)
+master-bin.000001 10966 Write_rows 1 11000 table_id: # flags: STMT_END_F
+master-bin.000001 11000 Table_map 1 11041 table_id: # (test.t1)
+master-bin.000001 11041 Write_rows 1 11075 table_id: # flags: STMT_END_F
+master-bin.000001 11075 Table_map 1 11116 table_id: # (test.t1)
+master-bin.000001 11116 Write_rows 1 11150 table_id: # flags: STMT_END_F
+master-bin.000001 11150 Table_map 1 11191 table_id: # (test.t1)
+master-bin.000001 11191 Write_rows 1 11225 table_id: # flags: STMT_END_F
+master-bin.000001 11225 Table_map 1 11266 table_id: # (test.t1)
+master-bin.000001 11266 Write_rows 1 11300 table_id: # flags: STMT_END_F
+master-bin.000001 11300 Table_map 1 11341 table_id: # (test.t1)
+master-bin.000001 11341 Write_rows 1 11375 table_id: # flags: STMT_END_F
+master-bin.000001 11375 Table_map 1 11416 table_id: # (test.t1)
+master-bin.000001 11416 Write_rows 1 11450 table_id: # flags: STMT_END_F
+master-bin.000001 11450 Table_map 1 11491 table_id: # (test.t1)
+master-bin.000001 11491 Write_rows 1 11525 table_id: # flags: STMT_END_F
+master-bin.000001 11525 Table_map 1 11566 table_id: # (test.t1)
+master-bin.000001 11566 Write_rows 1 11600 table_id: # flags: STMT_END_F
+master-bin.000001 11600 Table_map 1 11641 table_id: # (test.t1)
+master-bin.000001 11641 Write_rows 1 11675 table_id: # flags: STMT_END_F
+master-bin.000001 11675 Table_map 1 11716 table_id: # (test.t1)
+master-bin.000001 11716 Write_rows 1 11750 table_id: # flags: STMT_END_F
+master-bin.000001 11750 Table_map 1 11791 table_id: # (test.t1)
+master-bin.000001 11791 Write_rows 1 11825 table_id: # flags: STMT_END_F
+master-bin.000001 11825 Table_map 1 11866 table_id: # (test.t1)
+master-bin.000001 11866 Write_rows 1 11900 table_id: # flags: STMT_END_F
+master-bin.000001 11900 Table_map 1 11941 table_id: # (test.t1)
+master-bin.000001 11941 Write_rows 1 11975 table_id: # flags: STMT_END_F
+master-bin.000001 11975 Table_map 1 12016 table_id: # (test.t1)
+master-bin.000001 12016 Write_rows 1 12050 table_id: # flags: STMT_END_F
+master-bin.000001 12050 Table_map 1 12091 table_id: # (test.t1)
+master-bin.000001 12091 Write_rows 1 12125 table_id: # flags: STMT_END_F
+master-bin.000001 12125 Table_map 1 12166 table_id: # (test.t1)
+master-bin.000001 12166 Write_rows 1 12200 table_id: # flags: STMT_END_F
+master-bin.000001 12200 Table_map 1 12241 table_id: # (test.t1)
+master-bin.000001 12241 Write_rows 1 12275 table_id: # flags: STMT_END_F
+master-bin.000001 12275 Table_map 1 12316 table_id: # (test.t1)
+master-bin.000001 12316 Write_rows 1 12350 table_id: # flags: STMT_END_F
+master-bin.000001 12350 Table_map 1 12391 table_id: # (test.t1)
+master-bin.000001 12391 Write_rows 1 12425 table_id: # flags: STMT_END_F
+master-bin.000001 12425 Table_map 1 12466 table_id: # (test.t1)
+master-bin.000001 12466 Write_rows 1 12500 table_id: # flags: STMT_END_F
+master-bin.000001 12500 Table_map 1 12541 table_id: # (test.t1)
+master-bin.000001 12541 Write_rows 1 12575 table_id: # flags: STMT_END_F
+master-bin.000001 12575 Table_map 1 12616 table_id: # (test.t1)
+master-bin.000001 12616 Write_rows 1 12650 table_id: # flags: STMT_END_F
+master-bin.000001 12650 Table_map 1 12691 table_id: # (test.t1)
+master-bin.000001 12691 Write_rows 1 12725 table_id: # flags: STMT_END_F
+master-bin.000001 12725 Table_map 1 12766 table_id: # (test.t1)
+master-bin.000001 12766 Write_rows 1 12800 table_id: # flags: STMT_END_F
+master-bin.000001 12800 Table_map 1 12841 table_id: # (test.t1)
+master-bin.000001 12841 Write_rows 1 12875 table_id: # flags: STMT_END_F
+master-bin.000001 12875 Table_map 1 12916 table_id: # (test.t1)
+master-bin.000001 12916 Write_rows 1 12950 table_id: # flags: STMT_END_F
+master-bin.000001 12950 Table_map 1 12991 table_id: # (test.t1)
+master-bin.000001 12991 Write_rows 1 13025 table_id: # flags: STMT_END_F
+master-bin.000001 13025 Table_map 1 13066 table_id: # (test.t1)
+master-bin.000001 13066 Write_rows 1 13100 table_id: # flags: STMT_END_F
+master-bin.000001 13100 Table_map 1 13141 table_id: # (test.t1)
+master-bin.000001 13141 Write_rows 1 13175 table_id: # flags: STMT_END_F
+master-bin.000001 13175 Table_map 1 13216 table_id: # (test.t1)
+master-bin.000001 13216 Write_rows 1 13250 table_id: # flags: STMT_END_F
+master-bin.000001 13250 Table_map 1 13291 table_id: # (test.t1)
+master-bin.000001 13291 Write_rows 1 13325 table_id: # flags: STMT_END_F
+master-bin.000001 13325 Table_map 1 13366 table_id: # (test.t1)
+master-bin.000001 13366 Write_rows 1 13400 table_id: # flags: STMT_END_F
+master-bin.000001 13400 Table_map 1 13441 table_id: # (test.t1)
+master-bin.000001 13441 Write_rows 1 13475 table_id: # flags: STMT_END_F
+master-bin.000001 13475 Table_map 1 13516 table_id: # (test.t1)
+master-bin.000001 13516 Write_rows 1 13550 table_id: # flags: STMT_END_F
+master-bin.000001 13550 Table_map 1 13591 table_id: # (test.t1)
+master-bin.000001 13591 Write_rows 1 13625 table_id: # flags: STMT_END_F
+master-bin.000001 13625 Table_map 1 13666 table_id: # (test.t1)
+master-bin.000001 13666 Write_rows 1 13700 table_id: # flags: STMT_END_F
+master-bin.000001 13700 Table_map 1 13741 table_id: # (test.t1)
+master-bin.000001 13741 Write_rows 1 13775 table_id: # flags: STMT_END_F
+master-bin.000001 13775 Table_map 1 13816 table_id: # (test.t1)
+master-bin.000001 13816 Write_rows 1 13850 table_id: # flags: STMT_END_F
+master-bin.000001 13850 Table_map 1 13891 table_id: # (test.t1)
+master-bin.000001 13891 Write_rows 1 13925 table_id: # flags: STMT_END_F
+master-bin.000001 13925 Table_map 1 13966 table_id: # (test.t1)
+master-bin.000001 13966 Write_rows 1 14000 table_id: # flags: STMT_END_F
+master-bin.000001 14000 Table_map 1 14041 table_id: # (test.t1)
+master-bin.000001 14041 Write_rows 1 14075 table_id: # flags: STMT_END_F
+master-bin.000001 14075 Table_map 1 14116 table_id: # (test.t1)
+master-bin.000001 14116 Write_rows 1 14150 table_id: # flags: STMT_END_F
+master-bin.000001 14150 Table_map 1 14191 table_id: # (test.t1)
+master-bin.000001 14191 Write_rows 1 14225 table_id: # flags: STMT_END_F
+master-bin.000001 14225 Table_map 1 14266 table_id: # (test.t1)
+master-bin.000001 14266 Write_rows 1 14300 table_id: # flags: STMT_END_F
+master-bin.000001 14300 Table_map 1 14341 table_id: # (test.t1)
+master-bin.000001 14341 Write_rows 1 14375 table_id: # flags: STMT_END_F
+master-bin.000001 14375 Table_map 1 14416 table_id: # (test.t1)
+master-bin.000001 14416 Write_rows 1 14450 table_id: # flags: STMT_END_F
+master-bin.000001 14450 Table_map 1 14491 table_id: # (test.t1)
+master-bin.000001 14491 Write_rows 1 14525 table_id: # flags: STMT_END_F
+master-bin.000001 14525 Table_map 1 14566 table_id: # (test.t1)
+master-bin.000001 14566 Write_rows 1 14600 table_id: # flags: STMT_END_F
+master-bin.000001 14600 Table_map 1 14641 table_id: # (test.t1)
+master-bin.000001 14641 Write_rows 1 14675 table_id: # flags: STMT_END_F
+master-bin.000001 14675 Table_map 1 14716 table_id: # (test.t1)
+master-bin.000001 14716 Write_rows 1 14750 table_id: # flags: STMT_END_F
+master-bin.000001 14750 Table_map 1 14791 table_id: # (test.t1)
+master-bin.000001 14791 Write_rows 1 14825 table_id: # flags: STMT_END_F
+master-bin.000001 14825 Table_map 1 14866 table_id: # (test.t1)
+master-bin.000001 14866 Write_rows 1 14900 table_id: # flags: STMT_END_F
+master-bin.000001 14900 Table_map 1 14941 table_id: # (test.t1)
+master-bin.000001 14941 Write_rows 1 14975 table_id: # flags: STMT_END_F
+master-bin.000001 14975 Table_map 1 15016 table_id: # (test.t1)
+master-bin.000001 15016 Write_rows 1 15050 table_id: # flags: STMT_END_F
+master-bin.000001 15050 Table_map 1 15091 table_id: # (test.t1)
+master-bin.000001 15091 Write_rows 1 15125 table_id: # flags: STMT_END_F
+master-bin.000001 15125 Table_map 1 15166 table_id: # (test.t1)
+master-bin.000001 15166 Write_rows 1 15200 table_id: # flags: STMT_END_F
+master-bin.000001 15200 Table_map 1 15241 table_id: # (test.t1)
+master-bin.000001 15241 Write_rows 1 15275 table_id: # flags: STMT_END_F
+master-bin.000001 15275 Table_map 1 15316 table_id: # (test.t1)
+master-bin.000001 15316 Write_rows 1 15350 table_id: # flags: STMT_END_F
+master-bin.000001 15350 Table_map 1 15391 table_id: # (test.t1)
+master-bin.000001 15391 Write_rows 1 15425 table_id: # flags: STMT_END_F
+master-bin.000001 15425 Table_map 1 15466 table_id: # (test.t1)
+master-bin.000001 15466 Write_rows 1 15500 table_id: # flags: STMT_END_F
+master-bin.000001 15500 Table_map 1 15541 table_id: # (test.t1)
+master-bin.000001 15541 Write_rows 1 15575 table_id: # flags: STMT_END_F
+master-bin.000001 15575 Table_map 1 15616 table_id: # (test.t1)
+master-bin.000001 15616 Write_rows 1 15650 table_id: # flags: STMT_END_F
+master-bin.000001 15650 Table_map 1 15691 table_id: # (test.t1)
+master-bin.000001 15691 Write_rows 1 15725 table_id: # flags: STMT_END_F
+master-bin.000001 15725 Table_map 1 15766 table_id: # (test.t1)
+master-bin.000001 15766 Write_rows 1 15800 table_id: # flags: STMT_END_F
+master-bin.000001 15800 Table_map 1 15841 table_id: # (test.t1)
+master-bin.000001 15841 Write_rows 1 15875 table_id: # flags: STMT_END_F
+master-bin.000001 15875 Table_map 1 15916 table_id: # (test.t1)
+master-bin.000001 15916 Write_rows 1 15950 table_id: # flags: STMT_END_F
+master-bin.000001 15950 Table_map 1 15991 table_id: # (test.t1)
+master-bin.000001 15991 Write_rows 1 16025 table_id: # flags: STMT_END_F
+master-bin.000001 16025 Table_map 1 16066 table_id: # (test.t1)
+master-bin.000001 16066 Write_rows 1 16100 table_id: # flags: STMT_END_F
+master-bin.000001 16100 Table_map 1 16141 table_id: # (test.t1)
+master-bin.000001 16141 Write_rows 1 16175 table_id: # flags: STMT_END_F
+master-bin.000001 16175 Table_map 1 16216 table_id: # (test.t1)
+master-bin.000001 16216 Write_rows 1 16250 table_id: # flags: STMT_END_F
+master-bin.000001 16250 Table_map 1 16291 table_id: # (test.t1)
+master-bin.000001 16291 Write_rows 1 16325 table_id: # flags: STMT_END_F
+master-bin.000001 16325 Table_map 1 16366 table_id: # (test.t1)
+master-bin.000001 16366 Write_rows 1 16400 table_id: # flags: STMT_END_F
+master-bin.000001 16400 Table_map 1 16441 table_id: # (test.t1)
+master-bin.000001 16441 Write_rows 1 16475 table_id: # flags: STMT_END_F
+master-bin.000001 16475 Table_map 1 16516 table_id: # (test.t1)
+master-bin.000001 16516 Write_rows 1 16550 table_id: # flags: STMT_END_F
+master-bin.000001 16550 Table_map 1 16591 table_id: # (test.t1)
+master-bin.000001 16591 Write_rows 1 16625 table_id: # flags: STMT_END_F
+master-bin.000001 16625 Table_map 1 16666 table_id: # (test.t1)
+master-bin.000001 16666 Write_rows 1 16700 table_id: # flags: STMT_END_F
+master-bin.000001 16700 Table_map 1 16741 table_id: # (test.t1)
+master-bin.000001 16741 Write_rows 1 16775 table_id: # flags: STMT_END_F
+master-bin.000001 16775 Table_map 1 16816 table_id: # (test.t1)
+master-bin.000001 16816 Write_rows 1 16850 table_id: # flags: STMT_END_F
+master-bin.000001 16850 Table_map 1 16891 table_id: # (test.t1)
+master-bin.000001 16891 Write_rows 1 16925 table_id: # flags: STMT_END_F
+master-bin.000001 16925 Table_map 1 16966 table_id: # (test.t1)
+master-bin.000001 16966 Write_rows 1 17000 table_id: # flags: STMT_END_F
+master-bin.000001 17000 Table_map 1 17041 table_id: # (test.t1)
+master-bin.000001 17041 Write_rows 1 17075 table_id: # flags: STMT_END_F
+master-bin.000001 17075 Table_map 1 17116 table_id: # (test.t1)
+master-bin.000001 17116 Write_rows 1 17150 table_id: # flags: STMT_END_F
+master-bin.000001 17150 Table_map 1 17191 table_id: # (test.t1)
+master-bin.000001 17191 Write_rows 1 17225 table_id: # flags: STMT_END_F
+master-bin.000001 17225 Table_map 1 17266 table_id: # (test.t1)
+master-bin.000001 17266 Write_rows 1 17300 table_id: # flags: STMT_END_F
+master-bin.000001 17300 Table_map 1 17341 table_id: # (test.t1)
+master-bin.000001 17341 Write_rows 1 17375 table_id: # flags: STMT_END_F
+master-bin.000001 17375 Table_map 1 17416 table_id: # (test.t1)
+master-bin.000001 17416 Write_rows 1 17450 table_id: # flags: STMT_END_F
+master-bin.000001 17450 Table_map 1 17491 table_id: # (test.t1)
+master-bin.000001 17491 Write_rows 1 17525 table_id: # flags: STMT_END_F
+master-bin.000001 17525 Table_map 1 17566 table_id: # (test.t1)
+master-bin.000001 17566 Write_rows 1 17600 table_id: # flags: STMT_END_F
+master-bin.000001 17600 Table_map 1 17641 table_id: # (test.t1)
+master-bin.000001 17641 Write_rows 1 17675 table_id: # flags: STMT_END_F
+master-bin.000001 17675 Table_map 1 17716 table_id: # (test.t1)
+master-bin.000001 17716 Write_rows 1 17750 table_id: # flags: STMT_END_F
+master-bin.000001 17750 Table_map 1 17791 table_id: # (test.t1)
+master-bin.000001 17791 Write_rows 1 17825 table_id: # flags: STMT_END_F
+master-bin.000001 17825 Table_map 1 17866 table_id: # (test.t1)
+master-bin.000001 17866 Write_rows 1 17900 table_id: # flags: STMT_END_F
+master-bin.000001 17900 Table_map 1 17941 table_id: # (test.t1)
+master-bin.000001 17941 Write_rows 1 17975 table_id: # flags: STMT_END_F
+master-bin.000001 17975 Table_map 1 18016 table_id: # (test.t1)
+master-bin.000001 18016 Write_rows 1 18050 table_id: # flags: STMT_END_F
+master-bin.000001 18050 Table_map 1 18091 table_id: # (test.t1)
+master-bin.000001 18091 Write_rows 1 18125 table_id: # flags: STMT_END_F
+master-bin.000001 18125 Table_map 1 18166 table_id: # (test.t1)
+master-bin.000001 18166 Write_rows 1 18200 table_id: # flags: STMT_END_F
+master-bin.000001 18200 Table_map 1 18241 table_id: # (test.t1)
+master-bin.000001 18241 Write_rows 1 18275 table_id: # flags: STMT_END_F
+master-bin.000001 18275 Table_map 1 18316 table_id: # (test.t1)
+master-bin.000001 18316 Write_rows 1 18350 table_id: # flags: STMT_END_F
+master-bin.000001 18350 Table_map 1 18391 table_id: # (test.t1)
+master-bin.000001 18391 Write_rows 1 18425 table_id: # flags: STMT_END_F
+master-bin.000001 18425 Table_map 1 18466 table_id: # (test.t1)
+master-bin.000001 18466 Write_rows 1 18500 table_id: # flags: STMT_END_F
+master-bin.000001 18500 Table_map 1 18541 table_id: # (test.t1)
+master-bin.000001 18541 Write_rows 1 18575 table_id: # flags: STMT_END_F
+master-bin.000001 18575 Table_map 1 18616 table_id: # (test.t1)
+master-bin.000001 18616 Write_rows 1 18650 table_id: # flags: STMT_END_F
+master-bin.000001 18650 Table_map 1 18691 table_id: # (test.t1)
+master-bin.000001 18691 Write_rows 1 18725 table_id: # flags: STMT_END_F
+master-bin.000001 18725 Table_map 1 18766 table_id: # (test.t1)
+master-bin.000001 18766 Write_rows 1 18800 table_id: # flags: STMT_END_F
+master-bin.000001 18800 Table_map 1 18841 table_id: # (test.t1)
+master-bin.000001 18841 Write_rows 1 18875 table_id: # flags: STMT_END_F
+master-bin.000001 18875 Table_map 1 18916 table_id: # (test.t1)
+master-bin.000001 18916 Write_rows 1 18950 table_id: # flags: STMT_END_F
+master-bin.000001 18950 Table_map 1 18991 table_id: # (test.t1)
+master-bin.000001 18991 Write_rows 1 19025 table_id: # flags: STMT_END_F
+master-bin.000001 19025 Table_map 1 19066 table_id: # (test.t1)
+master-bin.000001 19066 Write_rows 1 19100 table_id: # flags: STMT_END_F
+master-bin.000001 19100 Table_map 1 19141 table_id: # (test.t1)
+master-bin.000001 19141 Write_rows 1 19175 table_id: # flags: STMT_END_F
+master-bin.000001 19175 Table_map 1 19216 table_id: # (test.t1)
+master-bin.000001 19216 Write_rows 1 19250 table_id: # flags: STMT_END_F
+master-bin.000001 19250 Table_map 1 19291 table_id: # (test.t1)
+master-bin.000001 19291 Write_rows 1 19325 table_id: # flags: STMT_END_F
+master-bin.000001 19325 Table_map 1 19366 table_id: # (test.t1)
+master-bin.000001 19366 Write_rows 1 19400 table_id: # flags: STMT_END_F
+master-bin.000001 19400 Table_map 1 19441 table_id: # (test.t1)
+master-bin.000001 19441 Write_rows 1 19475 table_id: # flags: STMT_END_F
+master-bin.000001 19475 Table_map 1 19516 table_id: # (test.t1)
+master-bin.000001 19516 Write_rows 1 19550 table_id: # flags: STMT_END_F
+master-bin.000001 19550 Table_map 1 19591 table_id: # (test.t1)
+master-bin.000001 19591 Write_rows 1 19625 table_id: # flags: STMT_END_F
+master-bin.000001 19625 Table_map 1 19666 table_id: # (test.t1)
+master-bin.000001 19666 Write_rows 1 19700 table_id: # flags: STMT_END_F
+master-bin.000001 19700 Table_map 1 19741 table_id: # (test.t1)
+master-bin.000001 19741 Write_rows 1 19775 table_id: # flags: STMT_END_F
+master-bin.000001 19775 Table_map 1 19816 table_id: # (test.t1)
+master-bin.000001 19816 Write_rows 1 19850 table_id: # flags: STMT_END_F
+master-bin.000001 19850 Table_map 1 19891 table_id: # (test.t1)
+master-bin.000001 19891 Write_rows 1 19925 table_id: # flags: STMT_END_F
+master-bin.000001 19925 Table_map 1 19966 table_id: # (test.t1)
+master-bin.000001 19966 Write_rows 1 20000 table_id: # flags: STMT_END_F
+master-bin.000001 20000 Table_map 1 20041 table_id: # (test.t1)
+master-bin.000001 20041 Write_rows 1 20075 table_id: # flags: STMT_END_F
+master-bin.000001 20075 Table_map 1 20116 table_id: # (test.t1)
+master-bin.000001 20116 Write_rows 1 20150 table_id: # flags: STMT_END_F
+master-bin.000001 20150 Table_map 1 20191 table_id: # (test.t1)
+master-bin.000001 20191 Write_rows 1 20225 table_id: # flags: STMT_END_F
+master-bin.000001 20225 Table_map 1 20266 table_id: # (test.t1)
+master-bin.000001 20266 Write_rows 1 20300 table_id: # flags: STMT_END_F
+master-bin.000001 20300 Table_map 1 20341 table_id: # (test.t1)
+master-bin.000001 20341 Write_rows 1 20375 table_id: # flags: STMT_END_F
+master-bin.000001 20375 Table_map 1 20416 table_id: # (test.t1)
+master-bin.000001 20416 Write_rows 1 20450 table_id: # flags: STMT_END_F
+master-bin.000001 20450 Table_map 1 20491 table_id: # (test.t1)
+master-bin.000001 20491 Write_rows 1 20525 table_id: # flags: STMT_END_F
+master-bin.000001 20525 Table_map 1 20566 table_id: # (test.t1)
+master-bin.000001 20566 Write_rows 1 20600 table_id: # flags: STMT_END_F
+master-bin.000001 20600 Table_map 1 20641 table_id: # (test.t1)
+master-bin.000001 20641 Write_rows 1 20675 table_id: # flags: STMT_END_F
+master-bin.000001 20675 Table_map 1 20716 table_id: # (test.t1)
+master-bin.000001 20716 Write_rows 1 20750 table_id: # flags: STMT_END_F
+master-bin.000001 20750 Table_map 1 20791 table_id: # (test.t1)
+master-bin.000001 20791 Write_rows 1 20825 table_id: # flags: STMT_END_F
+master-bin.000001 20825 Table_map 1 20866 table_id: # (test.t1)
+master-bin.000001 20866 Write_rows 1 20900 table_id: # flags: STMT_END_F
+master-bin.000001 20900 Table_map 1 20941 table_id: # (test.t1)
+master-bin.000001 20941 Write_rows 1 20975 table_id: # flags: STMT_END_F
+master-bin.000001 20975 Table_map 1 21016 table_id: # (test.t1)
+master-bin.000001 21016 Write_rows 1 21050 table_id: # flags: STMT_END_F
+master-bin.000001 21050 Table_map 1 21091 table_id: # (test.t1)
+master-bin.000001 21091 Write_rows 1 21125 table_id: # flags: STMT_END_F
+master-bin.000001 21125 Table_map 1 21166 table_id: # (test.t1)
+master-bin.000001 21166 Write_rows 1 21200 table_id: # flags: STMT_END_F
+master-bin.000001 21200 Table_map 1 21241 table_id: # (test.t1)
+master-bin.000001 21241 Write_rows 1 21275 table_id: # flags: STMT_END_F
+master-bin.000001 21275 Table_map 1 21316 table_id: # (test.t1)
+master-bin.000001 21316 Write_rows 1 21350 table_id: # flags: STMT_END_F
+master-bin.000001 21350 Table_map 1 21391 table_id: # (test.t1)
+master-bin.000001 21391 Write_rows 1 21425 table_id: # flags: STMT_END_F
+master-bin.000001 21425 Table_map 1 21466 table_id: # (test.t1)
+master-bin.000001 21466 Write_rows 1 21500 table_id: # flags: STMT_END_F
+master-bin.000001 21500 Table_map 1 21541 table_id: # (test.t1)
+master-bin.000001 21541 Write_rows 1 21575 table_id: # flags: STMT_END_F
+master-bin.000001 21575 Table_map 1 21616 table_id: # (test.t1)
+master-bin.000001 21616 Write_rows 1 21650 table_id: # flags: STMT_END_F
+master-bin.000001 21650 Table_map 1 21691 table_id: # (test.t1)
+master-bin.000001 21691 Write_rows 1 21725 table_id: # flags: STMT_END_F
+master-bin.000001 21725 Table_map 1 21766 table_id: # (test.t1)
+master-bin.000001 21766 Write_rows 1 21800 table_id: # flags: STMT_END_F
+master-bin.000001 21800 Table_map 1 21841 table_id: # (test.t1)
+master-bin.000001 21841 Write_rows 1 21875 table_id: # flags: STMT_END_F
+master-bin.000001 21875 Table_map 1 21916 table_id: # (test.t1)
+master-bin.000001 21916 Write_rows 1 21950 table_id: # flags: STMT_END_F
+master-bin.000001 21950 Table_map 1 21991 table_id: # (test.t1)
+master-bin.000001 21991 Write_rows 1 22025 table_id: # flags: STMT_END_F
+master-bin.000001 22025 Table_map 1 22066 table_id: # (test.t1)
+master-bin.000001 22066 Write_rows 1 22100 table_id: # flags: STMT_END_F
+master-bin.000001 22100 Table_map 1 22141 table_id: # (test.t1)
+master-bin.000001 22141 Write_rows 1 22175 table_id: # flags: STMT_END_F
+master-bin.000001 22175 Table_map 1 22216 table_id: # (test.t1)
+master-bin.000001 22216 Write_rows 1 22250 table_id: # flags: STMT_END_F
+master-bin.000001 22250 Table_map 1 22291 table_id: # (test.t1)
+master-bin.000001 22291 Write_rows 1 22325 table_id: # flags: STMT_END_F
+master-bin.000001 22325 Table_map 1 22366 table_id: # (test.t1)
+master-bin.000001 22366 Write_rows 1 22400 table_id: # flags: STMT_END_F
+master-bin.000001 22400 Table_map 1 22441 table_id: # (test.t1)
+master-bin.000001 22441 Write_rows 1 22475 table_id: # flags: STMT_END_F
+master-bin.000001 22475 Table_map 1 22516 table_id: # (test.t1)
+master-bin.000001 22516 Write_rows 1 22550 table_id: # flags: STMT_END_F
+master-bin.000001 22550 Table_map 1 22591 table_id: # (test.t1)
+master-bin.000001 22591 Write_rows 1 22625 table_id: # flags: STMT_END_F
+master-bin.000001 22625 Table_map 1 22666 table_id: # (test.t1)
+master-bin.000001 22666 Write_rows 1 22700 table_id: # flags: STMT_END_F
+master-bin.000001 22700 Table_map 1 22741 table_id: # (test.t1)
+master-bin.000001 22741 Write_rows 1 22775 table_id: # flags: STMT_END_F
+master-bin.000001 22775 Table_map 1 22816 table_id: # (test.t1)
+master-bin.000001 22816 Write_rows 1 22850 table_id: # flags: STMT_END_F
+master-bin.000001 22850 Table_map 1 22891 table_id: # (test.t1)
+master-bin.000001 22891 Write_rows 1 22925 table_id: # flags: STMT_END_F
+master-bin.000001 22925 Table_map 1 22966 table_id: # (test.t1)
+master-bin.000001 22966 Write_rows 1 23000 table_id: # flags: STMT_END_F
+master-bin.000001 23000 Table_map 1 23041 table_id: # (test.t1)
+master-bin.000001 23041 Write_rows 1 23075 table_id: # flags: STMT_END_F
+master-bin.000001 23075 Table_map 1 23116 table_id: # (test.t1)
+master-bin.000001 23116 Write_rows 1 23150 table_id: # flags: STMT_END_F
+master-bin.000001 23150 Table_map 1 23191 table_id: # (test.t1)
+master-bin.000001 23191 Write_rows 1 23225 table_id: # flags: STMT_END_F
+master-bin.000001 23225 Table_map 1 23266 table_id: # (test.t1)
+master-bin.000001 23266 Write_rows 1 23300 table_id: # flags: STMT_END_F
+master-bin.000001 23300 Table_map 1 23341 table_id: # (test.t1)
+master-bin.000001 23341 Write_rows 1 23375 table_id: # flags: STMT_END_F
+master-bin.000001 23375 Table_map 1 23416 table_id: # (test.t1)
+master-bin.000001 23416 Write_rows 1 23450 table_id: # flags: STMT_END_F
+master-bin.000001 23450 Table_map 1 23491 table_id: # (test.t1)
+master-bin.000001 23491 Write_rows 1 23525 table_id: # flags: STMT_END_F
+master-bin.000001 23525 Table_map 1 23566 table_id: # (test.t1)
+master-bin.000001 23566 Write_rows 1 23600 table_id: # flags: STMT_END_F
+master-bin.000001 23600 Table_map 1 23641 table_id: # (test.t1)
+master-bin.000001 23641 Write_rows 1 23675 table_id: # flags: STMT_END_F
+master-bin.000001 23675 Table_map 1 23716 table_id: # (test.t1)
+master-bin.000001 23716 Write_rows 1 23750 table_id: # flags: STMT_END_F
+master-bin.000001 23750 Table_map 1 23791 table_id: # (test.t1)
+master-bin.000001 23791 Write_rows 1 23825 table_id: # flags: STMT_END_F
+master-bin.000001 23825 Table_map 1 23866 table_id: # (test.t1)
+master-bin.000001 23866 Write_rows 1 23900 table_id: # flags: STMT_END_F
+master-bin.000001 23900 Table_map 1 23941 table_id: # (test.t1)
+master-bin.000001 23941 Write_rows 1 23975 table_id: # flags: STMT_END_F
+master-bin.000001 23975 Table_map 1 24016 table_id: # (test.t1)
+master-bin.000001 24016 Write_rows 1 24050 table_id: # flags: STMT_END_F
+master-bin.000001 24050 Table_map 1 24091 table_id: # (test.t1)
+master-bin.000001 24091 Write_rows 1 24125 table_id: # flags: STMT_END_F
+master-bin.000001 24125 Table_map 1 24166 table_id: # (test.t1)
+master-bin.000001 24166 Write_rows 1 24200 table_id: # flags: STMT_END_F
+master-bin.000001 24200 Table_map 1 24241 table_id: # (test.t1)
+master-bin.000001 24241 Write_rows 1 24275 table_id: # flags: STMT_END_F
+master-bin.000001 24275 Table_map 1 24316 table_id: # (test.t1)
+master-bin.000001 24316 Write_rows 1 24350 table_id: # flags: STMT_END_F
+master-bin.000001 24350 Table_map 1 24391 table_id: # (test.t1)
+master-bin.000001 24391 Write_rows 1 24425 table_id: # flags: STMT_END_F
+master-bin.000001 24425 Table_map 1 24466 table_id: # (test.t1)
+master-bin.000001 24466 Write_rows 1 24500 table_id: # flags: STMT_END_F
+master-bin.000001 24500 Table_map 1 24541 table_id: # (test.t1)
+master-bin.000001 24541 Write_rows 1 24575 table_id: # flags: STMT_END_F
+master-bin.000001 24575 Table_map 1 24616 table_id: # (test.t1)
+master-bin.000001 24616 Write_rows 1 24650 table_id: # flags: STMT_END_F
+master-bin.000001 24650 Table_map 1 24691 table_id: # (test.t1)
+master-bin.000001 24691 Write_rows 1 24725 table_id: # flags: STMT_END_F
+master-bin.000001 24725 Table_map 1 24766 table_id: # (test.t1)
+master-bin.000001 24766 Write_rows 1 24800 table_id: # flags: STMT_END_F
+master-bin.000001 24800 Table_map 1 24841 table_id: # (test.t1)
+master-bin.000001 24841 Write_rows 1 24875 table_id: # flags: STMT_END_F
+master-bin.000001 24875 Table_map 1 24916 table_id: # (test.t1)
+master-bin.000001 24916 Write_rows 1 24950 table_id: # flags: STMT_END_F
+master-bin.000001 24950 Table_map 1 24991 table_id: # (test.t1)
+master-bin.000001 24991 Write_rows 1 25025 table_id: # flags: STMT_END_F
+master-bin.000001 25025 Table_map 1 25066 table_id: # (test.t1)
+master-bin.000001 25066 Write_rows 1 25100 table_id: # flags: STMT_END_F
+master-bin.000001 25100 Table_map 1 25141 table_id: # (test.t1)
+master-bin.000001 25141 Write_rows 1 25175 table_id: # flags: STMT_END_F
+master-bin.000001 25175 Table_map 1 25216 table_id: # (test.t1)
+master-bin.000001 25216 Write_rows 1 25250 table_id: # flags: STMT_END_F
+master-bin.000001 25250 Table_map 1 25291 table_id: # (test.t1)
+master-bin.000001 25291 Write_rows 1 25325 table_id: # flags: STMT_END_F
+master-bin.000001 25325 Table_map 1 25366 table_id: # (test.t1)
+master-bin.000001 25366 Write_rows 1 25400 table_id: # flags: STMT_END_F
+master-bin.000001 25400 Table_map 1 25441 table_id: # (test.t1)
+master-bin.000001 25441 Write_rows 1 25475 table_id: # flags: STMT_END_F
+master-bin.000001 25475 Table_map 1 25516 table_id: # (test.t1)
+master-bin.000001 25516 Write_rows 1 25550 table_id: # flags: STMT_END_F
+master-bin.000001 25550 Table_map 1 25591 table_id: # (test.t1)
+master-bin.000001 25591 Write_rows 1 25625 table_id: # flags: STMT_END_F
+master-bin.000001 25625 Table_map 1 25666 table_id: # (test.t1)
+master-bin.000001 25666 Write_rows 1 25700 table_id: # flags: STMT_END_F
+master-bin.000001 25700 Table_map 1 25741 table_id: # (test.t1)
+master-bin.000001 25741 Write_rows 1 25775 table_id: # flags: STMT_END_F
+master-bin.000001 25775 Table_map 1 25816 table_id: # (test.t1)
+master-bin.000001 25816 Write_rows 1 25850 table_id: # flags: STMT_END_F
+master-bin.000001 25850 Table_map 1 25891 table_id: # (test.t1)
+master-bin.000001 25891 Write_rows 1 25925 table_id: # flags: STMT_END_F
+master-bin.000001 25925 Table_map 1 25966 table_id: # (test.t1)
+master-bin.000001 25966 Write_rows 1 26000 table_id: # flags: STMT_END_F
+master-bin.000001 26000 Table_map 1 26041 table_id: # (test.t1)
+master-bin.000001 26041 Write_rows 1 26075 table_id: # flags: STMT_END_F
+master-bin.000001 26075 Table_map 1 26116 table_id: # (test.t1)
+master-bin.000001 26116 Write_rows 1 26150 table_id: # flags: STMT_END_F
+master-bin.000001 26150 Table_map 1 26191 table_id: # (test.t1)
+master-bin.000001 26191 Write_rows 1 26225 table_id: # flags: STMT_END_F
+master-bin.000001 26225 Table_map 1 26266 table_id: # (test.t1)
+master-bin.000001 26266 Write_rows 1 26300 table_id: # flags: STMT_END_F
+master-bin.000001 26300 Table_map 1 26341 table_id: # (test.t1)
+master-bin.000001 26341 Write_rows 1 26375 table_id: # flags: STMT_END_F
+master-bin.000001 26375 Table_map 1 26416 table_id: # (test.t1)
+master-bin.000001 26416 Write_rows 1 26450 table_id: # flags: STMT_END_F
+master-bin.000001 26450 Table_map 1 26491 table_id: # (test.t1)
+master-bin.000001 26491 Write_rows 1 26525 table_id: # flags: STMT_END_F
+master-bin.000001 26525 Table_map 1 26566 table_id: # (test.t1)
+master-bin.000001 26566 Write_rows 1 26600 table_id: # flags: STMT_END_F
+master-bin.000001 26600 Table_map 1 26641 table_id: # (test.t1)
+master-bin.000001 26641 Write_rows 1 26675 table_id: # flags: STMT_END_F
+master-bin.000001 26675 Table_map 1 26716 table_id: # (test.t1)
+master-bin.000001 26716 Write_rows 1 26750 table_id: # flags: STMT_END_F
+master-bin.000001 26750 Table_map 1 26791 table_id: # (test.t1)
+master-bin.000001 26791 Write_rows 1 26825 table_id: # flags: STMT_END_F
+master-bin.000001 26825 Table_map 1 26866 table_id: # (test.t1)
+master-bin.000001 26866 Write_rows 1 26900 table_id: # flags: STMT_END_F
+master-bin.000001 26900 Table_map 1 26941 table_id: # (test.t1)
+master-bin.000001 26941 Write_rows 1 26975 table_id: # flags: STMT_END_F
+master-bin.000001 26975 Table_map 1 27016 table_id: # (test.t1)
+master-bin.000001 27016 Write_rows 1 27050 table_id: # flags: STMT_END_F
+master-bin.000001 27050 Table_map 1 27091 table_id: # (test.t1)
+master-bin.000001 27091 Write_rows 1 27125 table_id: # flags: STMT_END_F
+master-bin.000001 27125 Table_map 1 27166 table_id: # (test.t1)
+master-bin.000001 27166 Write_rows 1 27200 table_id: # flags: STMT_END_F
+master-bin.000001 27200 Table_map 1 27241 table_id: # (test.t1)
+master-bin.000001 27241 Write_rows 1 27275 table_id: # flags: STMT_END_F
+master-bin.000001 27275 Table_map 1 27316 table_id: # (test.t1)
+master-bin.000001 27316 Write_rows 1 27350 table_id: # flags: STMT_END_F
+master-bin.000001 27350 Table_map 1 27391 table_id: # (test.t1)
+master-bin.000001 27391 Write_rows 1 27425 table_id: # flags: STMT_END_F
+master-bin.000001 27425 Table_map 1 27466 table_id: # (test.t1)
+master-bin.000001 27466 Write_rows 1 27500 table_id: # flags: STMT_END_F
+master-bin.000001 27500 Table_map 1 27541 table_id: # (test.t1)
+master-bin.000001 27541 Write_rows 1 27575 table_id: # flags: STMT_END_F
+master-bin.000001 27575 Table_map 1 27616 table_id: # (test.t1)
+master-bin.000001 27616 Write_rows 1 27650 table_id: # flags: STMT_END_F
+master-bin.000001 27650 Table_map 1 27691 table_id: # (test.t1)
+master-bin.000001 27691 Write_rows 1 27725 table_id: # flags: STMT_END_F
+master-bin.000001 27725 Table_map 1 27766 table_id: # (test.t1)
+master-bin.000001 27766 Write_rows 1 27800 table_id: # flags: STMT_END_F
+master-bin.000001 27800 Table_map 1 27841 table_id: # (test.t1)
+master-bin.000001 27841 Write_rows 1 27875 table_id: # flags: STMT_END_F
+master-bin.000001 27875 Table_map 1 27916 table_id: # (test.t1)
+master-bin.000001 27916 Write_rows 1 27950 table_id: # flags: STMT_END_F
+master-bin.000001 27950 Table_map 1 27991 table_id: # (test.t1)
+master-bin.000001 27991 Write_rows 1 28025 table_id: # flags: STMT_END_F
+master-bin.000001 28025 Table_map 1 28066 table_id: # (test.t1)
+master-bin.000001 28066 Write_rows 1 28100 table_id: # flags: STMT_END_F
+master-bin.000001 28100 Table_map 1 28141 table_id: # (test.t1)
+master-bin.000001 28141 Write_rows 1 28175 table_id: # flags: STMT_END_F
+master-bin.000001 28175 Table_map 1 28216 table_id: # (test.t1)
+master-bin.000001 28216 Write_rows 1 28250 table_id: # flags: STMT_END_F
+master-bin.000001 28250 Table_map 1 28291 table_id: # (test.t1)
+master-bin.000001 28291 Write_rows 1 28325 table_id: # flags: STMT_END_F
+master-bin.000001 28325 Table_map 1 28366 table_id: # (test.t1)
+master-bin.000001 28366 Write_rows 1 28400 table_id: # flags: STMT_END_F
+master-bin.000001 28400 Table_map 1 28441 table_id: # (test.t1)
+master-bin.000001 28441 Write_rows 1 28475 table_id: # flags: STMT_END_F
+master-bin.000001 28475 Table_map 1 28516 table_id: # (test.t1)
+master-bin.000001 28516 Write_rows 1 28550 table_id: # flags: STMT_END_F
+master-bin.000001 28550 Table_map 1 28591 table_id: # (test.t1)
+master-bin.000001 28591 Write_rows 1 28625 table_id: # flags: STMT_END_F
+master-bin.000001 28625 Table_map 1 28666 table_id: # (test.t1)
+master-bin.000001 28666 Write_rows 1 28700 table_id: # flags: STMT_END_F
+master-bin.000001 28700 Table_map 1 28741 table_id: # (test.t1)
+master-bin.000001 28741 Write_rows 1 28775 table_id: # flags: STMT_END_F
+master-bin.000001 28775 Table_map 1 28816 table_id: # (test.t1)
+master-bin.000001 28816 Write_rows 1 28850 table_id: # flags: STMT_END_F
+master-bin.000001 28850 Table_map 1 28891 table_id: # (test.t1)
+master-bin.000001 28891 Write_rows 1 28925 table_id: # flags: STMT_END_F
+master-bin.000001 28925 Table_map 1 28966 table_id: # (test.t1)
+master-bin.000001 28966 Write_rows 1 29000 table_id: # flags: STMT_END_F
+master-bin.000001 29000 Table_map 1 29041 table_id: # (test.t1)
+master-bin.000001 29041 Write_rows 1 29075 table_id: # flags: STMT_END_F
+master-bin.000001 29075 Table_map 1 29116 table_id: # (test.t1)
+master-bin.000001 29116 Write_rows 1 29150 table_id: # flags: STMT_END_F
+master-bin.000001 29150 Table_map 1 29191 table_id: # (test.t1)
+master-bin.000001 29191 Write_rows 1 29225 table_id: # flags: STMT_END_F
+master-bin.000001 29225 Table_map 1 29266 table_id: # (test.t1)
+master-bin.000001 29266 Write_rows 1 29300 table_id: # flags: STMT_END_F
+master-bin.000001 29300 Table_map 1 29341 table_id: # (test.t1)
+master-bin.000001 29341 Write_rows 1 29375 table_id: # flags: STMT_END_F
+master-bin.000001 29375 Table_map 1 29416 table_id: # (test.t1)
+master-bin.000001 29416 Write_rows 1 29450 table_id: # flags: STMT_END_F
+master-bin.000001 29450 Table_map 1 29491 table_id: # (test.t1)
+master-bin.000001 29491 Write_rows 1 29525 table_id: # flags: STMT_END_F
+master-bin.000001 29525 Table_map 1 29566 table_id: # (test.t1)
+master-bin.000001 29566 Write_rows 1 29600 table_id: # flags: STMT_END_F
+master-bin.000001 29600 Table_map 1 29641 table_id: # (test.t1)
+master-bin.000001 29641 Write_rows 1 29675 table_id: # flags: STMT_END_F
+master-bin.000001 29675 Table_map 1 29716 table_id: # (test.t1)
+master-bin.000001 29716 Write_rows 1 29750 table_id: # flags: STMT_END_F
+master-bin.000001 29750 Table_map 1 29791 table_id: # (test.t1)
+master-bin.000001 29791 Write_rows 1 29825 table_id: # flags: STMT_END_F
+master-bin.000001 29825 Table_map 1 29866 table_id: # (test.t1)
+master-bin.000001 29866 Write_rows 1 29900 table_id: # flags: STMT_END_F
+master-bin.000001 29900 Table_map 1 29941 table_id: # (test.t1)
+master-bin.000001 29941 Write_rows 1 29975 table_id: # flags: STMT_END_F
+master-bin.000001 29975 Table_map 1 30016 table_id: # (test.t1)
+master-bin.000001 30016 Write_rows 1 30050 table_id: # flags: STMT_END_F
+master-bin.000001 30050 Table_map 1 30091 table_id: # (test.t1)
+master-bin.000001 30091 Write_rows 1 30125 table_id: # flags: STMT_END_F
+master-bin.000001 30125 Table_map 1 30166 table_id: # (test.t1)
+master-bin.000001 30166 Write_rows 1 30200 table_id: # flags: STMT_END_F
+master-bin.000001 30200 Table_map 1 30241 table_id: # (test.t1)
+master-bin.000001 30241 Write_rows 1 30275 table_id: # flags: STMT_END_F
+master-bin.000001 30275 Xid 1 30302 COMMIT /* XID */
+master-bin.000001 30302 Rotate 1 30346 master-bin.000002;pos=4
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
@@ -1083,13 +1083,13 @@ deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
-master-bin.000001 227 Query 1 295 BEGIN
-master-bin.000001 295 Table_map 1 337 table_id: # (test.t1)
-master-bin.000001 337 Write_rows 1 383 table_id: # flags: STMT_END_F
-master-bin.000001 383 Query 1 452 COMMIT
-master-bin.000001 452 Query 1 528 use `test`; drop table t1
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 228 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
+master-bin.000001 228 Query 1 296 BEGIN
+master-bin.000001 296 Table_map 1 338 table_id: # (test.t1)
+master-bin.000001 338 Write_rows 1 384 table_id: # flags: STMT_END_F
+master-bin.000001 384 Query 1 453 COMMIT
+master-bin.000001 453 Query 1 529 use `test`; drop table t1
reset master;
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE bug39182;
@@ -1289,14 +1289,14 @@ drop table if exists t3;
create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 346
+master-bin.000001 347
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
show master status /* must show new binlog index after rotating */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 106
+master-bin.000002 107
drop table t3;
#
# Bug #45998: database crashes when running "create as select"
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index eebcfceaa25..c5ac0a726ba 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -4,11 +4,11 @@ insert into t1 values (1,2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: #
-master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb
-master-bin.000001 213 Query 1 281 BEGIN
-master-bin.000001 281 Query 1 371 use `test`; insert into t1 values (1,2)
-master-bin.000001 371 Xid 1 398 COMMIT /* XID */
+master-bin.000001 4 Format_desc 1 107 Server ver: #, Binlog ver: #
+master-bin.000001 107 Query 1 214 use `test`; create table t1 (a int, b int) engine=innodb
+master-bin.000001 214 Query 1 282 BEGIN
+master-bin.000001 282 Query 1 372 use `test`; insert into t1 values (1,2)
+master-bin.000001 372 Xid 1 399 COMMIT /* XID */
drop table t1;
drop table if exists t1, t2;
reset master;
@@ -36,7 +36,7 @@ create table t1 (n int) engine=innodb;
begin;
commit;
drop table t1;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events in 'master-bin.000001' from 107;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
master-bin.000001 # Query 1 # BEGIN
@@ -142,7 +142,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
+show binlog events in 'master-bin.000002' from 107;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query 1 # use `test`; drop table t1
set @ac = @@autocommit;
@@ -157,425 +157,425 @@ commit;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb
-master-bin.000001 205 Query 1 273 BEGIN
-master-bin.000001 273 Query 1 361 use `test`; insert into t1 values (1)
-master-bin.000001 361 Query 1 449 use `test`; insert into t1 values (2)
-master-bin.000001 449 Query 1 537 use `test`; insert into t1 values (3)
-master-bin.000001 537 Xid 1 564 COMMIT /* XID */
-master-bin.000001 564 Query 1 640 use `test`; drop table t1
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 206 use `test`; create table t1(n int) engine=innodb
+master-bin.000001 206 Query 1 274 BEGIN
+master-bin.000001 274 Query 1 362 use `test`; insert into t1 values (1)
+master-bin.000001 362 Query 1 450 use `test`; insert into t1 values (2)
+master-bin.000001 450 Query 1 538 use `test`; insert into t1 values (3)
+master-bin.000001 538 Xid 1 565 COMMIT /* XID */
+master-bin.000001 565 Query 1 641 use `test`; drop table t1
set @bcs = @@binlog_cache_size;
set global binlog_cache_size=4096;
reset master;
create table t1 (a int) engine=innodb;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb
-master-bin.000001 206 Query 1 274 BEGIN
-master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 )
-master-bin.000001 365 Query 1 456 use `test`; insert into t1 values( 399 )
-master-bin.000001 456 Query 1 547 use `test`; insert into t1 values( 398 )
-master-bin.000001 547 Query 1 638 use `test`; insert into t1 values( 397 )
-master-bin.000001 638 Query 1 729 use `test`; insert into t1 values( 396 )
-master-bin.000001 729 Query 1 820 use `test`; insert into t1 values( 395 )
-master-bin.000001 820 Query 1 911 use `test`; insert into t1 values( 394 )
-master-bin.000001 911 Query 1 1002 use `test`; insert into t1 values( 393 )
-master-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values( 392 )
-master-bin.000001 1093 Query 1 1184 use `test`; insert into t1 values( 391 )
-master-bin.000001 1184 Query 1 1275 use `test`; insert into t1 values( 390 )
-master-bin.000001 1275 Query 1 1366 use `test`; insert into t1 values( 389 )
-master-bin.000001 1366 Query 1 1457 use `test`; insert into t1 values( 388 )
-master-bin.000001 1457 Query 1 1548 use `test`; insert into t1 values( 387 )
-master-bin.000001 1548 Query 1 1639 use `test`; insert into t1 values( 386 )
-master-bin.000001 1639 Query 1 1730 use `test`; insert into t1 values( 385 )
-master-bin.000001 1730 Query 1 1821 use `test`; insert into t1 values( 384 )
-master-bin.000001 1821 Query 1 1912 use `test`; insert into t1 values( 383 )
-master-bin.000001 1912 Query 1 2003 use `test`; insert into t1 values( 382 )
-master-bin.000001 2003 Query 1 2094 use `test`; insert into t1 values( 381 )
-master-bin.000001 2094 Query 1 2185 use `test`; insert into t1 values( 380 )
-master-bin.000001 2185 Query 1 2276 use `test`; insert into t1 values( 379 )
-master-bin.000001 2276 Query 1 2367 use `test`; insert into t1 values( 378 )
-master-bin.000001 2367 Query 1 2458 use `test`; insert into t1 values( 377 )
-master-bin.000001 2458 Query 1 2549 use `test`; insert into t1 values( 376 )
-master-bin.000001 2549 Query 1 2640 use `test`; insert into t1 values( 375 )
-master-bin.000001 2640 Query 1 2731 use `test`; insert into t1 values( 374 )
-master-bin.000001 2731 Query 1 2822 use `test`; insert into t1 values( 373 )
-master-bin.000001 2822 Query 1 2913 use `test`; insert into t1 values( 372 )
-master-bin.000001 2913 Query 1 3004 use `test`; insert into t1 values( 371 )
-master-bin.000001 3004 Query 1 3095 use `test`; insert into t1 values( 370 )
-master-bin.000001 3095 Query 1 3186 use `test`; insert into t1 values( 369 )
-master-bin.000001 3186 Query 1 3277 use `test`; insert into t1 values( 368 )
-master-bin.000001 3277 Query 1 3368 use `test`; insert into t1 values( 367 )
-master-bin.000001 3368 Query 1 3459 use `test`; insert into t1 values( 366 )
-master-bin.000001 3459 Query 1 3550 use `test`; insert into t1 values( 365 )
-master-bin.000001 3550 Query 1 3641 use `test`; insert into t1 values( 364 )
-master-bin.000001 3641 Query 1 3732 use `test`; insert into t1 values( 363 )
-master-bin.000001 3732 Query 1 3823 use `test`; insert into t1 values( 362 )
-master-bin.000001 3823 Query 1 3914 use `test`; insert into t1 values( 361 )
-master-bin.000001 3914 Query 1 4005 use `test`; insert into t1 values( 360 )
-master-bin.000001 4005 Query 1 4096 use `test`; insert into t1 values( 359 )
-master-bin.000001 4096 Query 1 4187 use `test`; insert into t1 values( 358 )
-master-bin.000001 4187 Query 1 4278 use `test`; insert into t1 values( 357 )
-master-bin.000001 4278 Query 1 4369 use `test`; insert into t1 values( 356 )
-master-bin.000001 4369 Query 1 4460 use `test`; insert into t1 values( 355 )
-master-bin.000001 4460 Query 1 4551 use `test`; insert into t1 values( 354 )
-master-bin.000001 4551 Query 1 4642 use `test`; insert into t1 values( 353 )
-master-bin.000001 4642 Query 1 4733 use `test`; insert into t1 values( 352 )
-master-bin.000001 4733 Query 1 4824 use `test`; insert into t1 values( 351 )
-master-bin.000001 4824 Query 1 4915 use `test`; insert into t1 values( 350 )
-master-bin.000001 4915 Query 1 5006 use `test`; insert into t1 values( 349 )
-master-bin.000001 5006 Query 1 5097 use `test`; insert into t1 values( 348 )
-master-bin.000001 5097 Query 1 5188 use `test`; insert into t1 values( 347 )
-master-bin.000001 5188 Query 1 5279 use `test`; insert into t1 values( 346 )
-master-bin.000001 5279 Query 1 5370 use `test`; insert into t1 values( 345 )
-master-bin.000001 5370 Query 1 5461 use `test`; insert into t1 values( 344 )
-master-bin.000001 5461 Query 1 5552 use `test`; insert into t1 values( 343 )
-master-bin.000001 5552 Query 1 5643 use `test`; insert into t1 values( 342 )
-master-bin.000001 5643 Query 1 5734 use `test`; insert into t1 values( 341 )
-master-bin.000001 5734 Query 1 5825 use `test`; insert into t1 values( 340 )
-master-bin.000001 5825 Query 1 5916 use `test`; insert into t1 values( 339 )
-master-bin.000001 5916 Query 1 6007 use `test`; insert into t1 values( 338 )
-master-bin.000001 6007 Query 1 6098 use `test`; insert into t1 values( 337 )
-master-bin.000001 6098 Query 1 6189 use `test`; insert into t1 values( 336 )
-master-bin.000001 6189 Query 1 6280 use `test`; insert into t1 values( 335 )
-master-bin.000001 6280 Query 1 6371 use `test`; insert into t1 values( 334 )
-master-bin.000001 6371 Query 1 6462 use `test`; insert into t1 values( 333 )
-master-bin.000001 6462 Query 1 6553 use `test`; insert into t1 values( 332 )
-master-bin.000001 6553 Query 1 6644 use `test`; insert into t1 values( 331 )
-master-bin.000001 6644 Query 1 6735 use `test`; insert into t1 values( 330 )
-master-bin.000001 6735 Query 1 6826 use `test`; insert into t1 values( 329 )
-master-bin.000001 6826 Query 1 6917 use `test`; insert into t1 values( 328 )
-master-bin.000001 6917 Query 1 7008 use `test`; insert into t1 values( 327 )
-master-bin.000001 7008 Query 1 7099 use `test`; insert into t1 values( 326 )
-master-bin.000001 7099 Query 1 7190 use `test`; insert into t1 values( 325 )
-master-bin.000001 7190 Query 1 7281 use `test`; insert into t1 values( 324 )
-master-bin.000001 7281 Query 1 7372 use `test`; insert into t1 values( 323 )
-master-bin.000001 7372 Query 1 7463 use `test`; insert into t1 values( 322 )
-master-bin.000001 7463 Query 1 7554 use `test`; insert into t1 values( 321 )
-master-bin.000001 7554 Query 1 7645 use `test`; insert into t1 values( 320 )
-master-bin.000001 7645 Query 1 7736 use `test`; insert into t1 values( 319 )
-master-bin.000001 7736 Query 1 7827 use `test`; insert into t1 values( 318 )
-master-bin.000001 7827 Query 1 7918 use `test`; insert into t1 values( 317 )
-master-bin.000001 7918 Query 1 8009 use `test`; insert into t1 values( 316 )
-master-bin.000001 8009 Query 1 8100 use `test`; insert into t1 values( 315 )
-master-bin.000001 8100 Query 1 8191 use `test`; insert into t1 values( 314 )
-master-bin.000001 8191 Query 1 8282 use `test`; insert into t1 values( 313 )
-master-bin.000001 8282 Query 1 8373 use `test`; insert into t1 values( 312 )
-master-bin.000001 8373 Query 1 8464 use `test`; insert into t1 values( 311 )
-master-bin.000001 8464 Query 1 8555 use `test`; insert into t1 values( 310 )
-master-bin.000001 8555 Query 1 8646 use `test`; insert into t1 values( 309 )
-master-bin.000001 8646 Query 1 8737 use `test`; insert into t1 values( 308 )
-master-bin.000001 8737 Query 1 8828 use `test`; insert into t1 values( 307 )
-master-bin.000001 8828 Query 1 8919 use `test`; insert into t1 values( 306 )
-master-bin.000001 8919 Query 1 9010 use `test`; insert into t1 values( 305 )
-master-bin.000001 9010 Query 1 9101 use `test`; insert into t1 values( 304 )
-master-bin.000001 9101 Query 1 9192 use `test`; insert into t1 values( 303 )
-master-bin.000001 9192 Query 1 9283 use `test`; insert into t1 values( 302 )
-master-bin.000001 9283 Query 1 9374 use `test`; insert into t1 values( 301 )
-master-bin.000001 9374 Query 1 9465 use `test`; insert into t1 values( 300 )
-master-bin.000001 9465 Query 1 9556 use `test`; insert into t1 values( 299 )
-master-bin.000001 9556 Query 1 9647 use `test`; insert into t1 values( 298 )
-master-bin.000001 9647 Query 1 9738 use `test`; insert into t1 values( 297 )
-master-bin.000001 9738 Query 1 9829 use `test`; insert into t1 values( 296 )
-master-bin.000001 9829 Query 1 9920 use `test`; insert into t1 values( 295 )
-master-bin.000001 9920 Query 1 10011 use `test`; insert into t1 values( 294 )
-master-bin.000001 10011 Query 1 10102 use `test`; insert into t1 values( 293 )
-master-bin.000001 10102 Query 1 10193 use `test`; insert into t1 values( 292 )
-master-bin.000001 10193 Query 1 10284 use `test`; insert into t1 values( 291 )
-master-bin.000001 10284 Query 1 10375 use `test`; insert into t1 values( 290 )
-master-bin.000001 10375 Query 1 10466 use `test`; insert into t1 values( 289 )
-master-bin.000001 10466 Query 1 10557 use `test`; insert into t1 values( 288 )
-master-bin.000001 10557 Query 1 10648 use `test`; insert into t1 values( 287 )
-master-bin.000001 10648 Query 1 10739 use `test`; insert into t1 values( 286 )
-master-bin.000001 10739 Query 1 10830 use `test`; insert into t1 values( 285 )
-master-bin.000001 10830 Query 1 10921 use `test`; insert into t1 values( 284 )
-master-bin.000001 10921 Query 1 11012 use `test`; insert into t1 values( 283 )
-master-bin.000001 11012 Query 1 11103 use `test`; insert into t1 values( 282 )
-master-bin.000001 11103 Query 1 11194 use `test`; insert into t1 values( 281 )
-master-bin.000001 11194 Query 1 11285 use `test`; insert into t1 values( 280 )
-master-bin.000001 11285 Query 1 11376 use `test`; insert into t1 values( 279 )
-master-bin.000001 11376 Query 1 11467 use `test`; insert into t1 values( 278 )
-master-bin.000001 11467 Query 1 11558 use `test`; insert into t1 values( 277 )
-master-bin.000001 11558 Query 1 11649 use `test`; insert into t1 values( 276 )
-master-bin.000001 11649 Query 1 11740 use `test`; insert into t1 values( 275 )
-master-bin.000001 11740 Query 1 11831 use `test`; insert into t1 values( 274 )
-master-bin.000001 11831 Query 1 11922 use `test`; insert into t1 values( 273 )
-master-bin.000001 11922 Query 1 12013 use `test`; insert into t1 values( 272 )
-master-bin.000001 12013 Query 1 12104 use `test`; insert into t1 values( 271 )
-master-bin.000001 12104 Query 1 12195 use `test`; insert into t1 values( 270 )
-master-bin.000001 12195 Query 1 12286 use `test`; insert into t1 values( 269 )
-master-bin.000001 12286 Query 1 12377 use `test`; insert into t1 values( 268 )
-master-bin.000001 12377 Query 1 12468 use `test`; insert into t1 values( 267 )
-master-bin.000001 12468 Query 1 12559 use `test`; insert into t1 values( 266 )
-master-bin.000001 12559 Query 1 12650 use `test`; insert into t1 values( 265 )
-master-bin.000001 12650 Query 1 12741 use `test`; insert into t1 values( 264 )
-master-bin.000001 12741 Query 1 12832 use `test`; insert into t1 values( 263 )
-master-bin.000001 12832 Query 1 12923 use `test`; insert into t1 values( 262 )
-master-bin.000001 12923 Query 1 13014 use `test`; insert into t1 values( 261 )
-master-bin.000001 13014 Query 1 13105 use `test`; insert into t1 values( 260 )
-master-bin.000001 13105 Query 1 13196 use `test`; insert into t1 values( 259 )
-master-bin.000001 13196 Query 1 13287 use `test`; insert into t1 values( 258 )
-master-bin.000001 13287 Query 1 13378 use `test`; insert into t1 values( 257 )
-master-bin.000001 13378 Query 1 13469 use `test`; insert into t1 values( 256 )
-master-bin.000001 13469 Query 1 13560 use `test`; insert into t1 values( 255 )
-master-bin.000001 13560 Query 1 13651 use `test`; insert into t1 values( 254 )
-master-bin.000001 13651 Query 1 13742 use `test`; insert into t1 values( 253 )
-master-bin.000001 13742 Query 1 13833 use `test`; insert into t1 values( 252 )
-master-bin.000001 13833 Query 1 13924 use `test`; insert into t1 values( 251 )
-master-bin.000001 13924 Query 1 14015 use `test`; insert into t1 values( 250 )
-master-bin.000001 14015 Query 1 14106 use `test`; insert into t1 values( 249 )
-master-bin.000001 14106 Query 1 14197 use `test`; insert into t1 values( 248 )
-master-bin.000001 14197 Query 1 14288 use `test`; insert into t1 values( 247 )
-master-bin.000001 14288 Query 1 14379 use `test`; insert into t1 values( 246 )
-master-bin.000001 14379 Query 1 14470 use `test`; insert into t1 values( 245 )
-master-bin.000001 14470 Query 1 14561 use `test`; insert into t1 values( 244 )
-master-bin.000001 14561 Query 1 14652 use `test`; insert into t1 values( 243 )
-master-bin.000001 14652 Query 1 14743 use `test`; insert into t1 values( 242 )
-master-bin.000001 14743 Query 1 14834 use `test`; insert into t1 values( 241 )
-master-bin.000001 14834 Query 1 14925 use `test`; insert into t1 values( 240 )
-master-bin.000001 14925 Query 1 15016 use `test`; insert into t1 values( 239 )
-master-bin.000001 15016 Query 1 15107 use `test`; insert into t1 values( 238 )
-master-bin.000001 15107 Query 1 15198 use `test`; insert into t1 values( 237 )
-master-bin.000001 15198 Query 1 15289 use `test`; insert into t1 values( 236 )
-master-bin.000001 15289 Query 1 15380 use `test`; insert into t1 values( 235 )
-master-bin.000001 15380 Query 1 15471 use `test`; insert into t1 values( 234 )
-master-bin.000001 15471 Query 1 15562 use `test`; insert into t1 values( 233 )
-master-bin.000001 15562 Query 1 15653 use `test`; insert into t1 values( 232 )
-master-bin.000001 15653 Query 1 15744 use `test`; insert into t1 values( 231 )
-master-bin.000001 15744 Query 1 15835 use `test`; insert into t1 values( 230 )
-master-bin.000001 15835 Query 1 15926 use `test`; insert into t1 values( 229 )
-master-bin.000001 15926 Query 1 16017 use `test`; insert into t1 values( 228 )
-master-bin.000001 16017 Query 1 16108 use `test`; insert into t1 values( 227 )
-master-bin.000001 16108 Query 1 16199 use `test`; insert into t1 values( 226 )
-master-bin.000001 16199 Query 1 16290 use `test`; insert into t1 values( 225 )
-master-bin.000001 16290 Query 1 16381 use `test`; insert into t1 values( 224 )
-master-bin.000001 16381 Query 1 16472 use `test`; insert into t1 values( 223 )
-master-bin.000001 16472 Query 1 16563 use `test`; insert into t1 values( 222 )
-master-bin.000001 16563 Query 1 16654 use `test`; insert into t1 values( 221 )
-master-bin.000001 16654 Query 1 16745 use `test`; insert into t1 values( 220 )
-master-bin.000001 16745 Query 1 16836 use `test`; insert into t1 values( 219 )
-master-bin.000001 16836 Query 1 16927 use `test`; insert into t1 values( 218 )
-master-bin.000001 16927 Query 1 17018 use `test`; insert into t1 values( 217 )
-master-bin.000001 17018 Query 1 17109 use `test`; insert into t1 values( 216 )
-master-bin.000001 17109 Query 1 17200 use `test`; insert into t1 values( 215 )
-master-bin.000001 17200 Query 1 17291 use `test`; insert into t1 values( 214 )
-master-bin.000001 17291 Query 1 17382 use `test`; insert into t1 values( 213 )
-master-bin.000001 17382 Query 1 17473 use `test`; insert into t1 values( 212 )
-master-bin.000001 17473 Query 1 17564 use `test`; insert into t1 values( 211 )
-master-bin.000001 17564 Query 1 17655 use `test`; insert into t1 values( 210 )
-master-bin.000001 17655 Query 1 17746 use `test`; insert into t1 values( 209 )
-master-bin.000001 17746 Query 1 17837 use `test`; insert into t1 values( 208 )
-master-bin.000001 17837 Query 1 17928 use `test`; insert into t1 values( 207 )
-master-bin.000001 17928 Query 1 18019 use `test`; insert into t1 values( 206 )
-master-bin.000001 18019 Query 1 18110 use `test`; insert into t1 values( 205 )
-master-bin.000001 18110 Query 1 18201 use `test`; insert into t1 values( 204 )
-master-bin.000001 18201 Query 1 18292 use `test`; insert into t1 values( 203 )
-master-bin.000001 18292 Query 1 18383 use `test`; insert into t1 values( 202 )
-master-bin.000001 18383 Query 1 18474 use `test`; insert into t1 values( 201 )
-master-bin.000001 18474 Query 1 18565 use `test`; insert into t1 values( 200 )
-master-bin.000001 18565 Query 1 18656 use `test`; insert into t1 values( 199 )
-master-bin.000001 18656 Query 1 18747 use `test`; insert into t1 values( 198 )
-master-bin.000001 18747 Query 1 18838 use `test`; insert into t1 values( 197 )
-master-bin.000001 18838 Query 1 18929 use `test`; insert into t1 values( 196 )
-master-bin.000001 18929 Query 1 19020 use `test`; insert into t1 values( 195 )
-master-bin.000001 19020 Query 1 19111 use `test`; insert into t1 values( 194 )
-master-bin.000001 19111 Query 1 19202 use `test`; insert into t1 values( 193 )
-master-bin.000001 19202 Query 1 19293 use `test`; insert into t1 values( 192 )
-master-bin.000001 19293 Query 1 19384 use `test`; insert into t1 values( 191 )
-master-bin.000001 19384 Query 1 19475 use `test`; insert into t1 values( 190 )
-master-bin.000001 19475 Query 1 19566 use `test`; insert into t1 values( 189 )
-master-bin.000001 19566 Query 1 19657 use `test`; insert into t1 values( 188 )
-master-bin.000001 19657 Query 1 19748 use `test`; insert into t1 values( 187 )
-master-bin.000001 19748 Query 1 19839 use `test`; insert into t1 values( 186 )
-master-bin.000001 19839 Query 1 19930 use `test`; insert into t1 values( 185 )
-master-bin.000001 19930 Query 1 20021 use `test`; insert into t1 values( 184 )
-master-bin.000001 20021 Query 1 20112 use `test`; insert into t1 values( 183 )
-master-bin.000001 20112 Query 1 20203 use `test`; insert into t1 values( 182 )
-master-bin.000001 20203 Query 1 20294 use `test`; insert into t1 values( 181 )
-master-bin.000001 20294 Query 1 20385 use `test`; insert into t1 values( 180 )
-master-bin.000001 20385 Query 1 20476 use `test`; insert into t1 values( 179 )
-master-bin.000001 20476 Query 1 20567 use `test`; insert into t1 values( 178 )
-master-bin.000001 20567 Query 1 20658 use `test`; insert into t1 values( 177 )
-master-bin.000001 20658 Query 1 20749 use `test`; insert into t1 values( 176 )
-master-bin.000001 20749 Query 1 20840 use `test`; insert into t1 values( 175 )
-master-bin.000001 20840 Query 1 20931 use `test`; insert into t1 values( 174 )
-master-bin.000001 20931 Query 1 21022 use `test`; insert into t1 values( 173 )
-master-bin.000001 21022 Query 1 21113 use `test`; insert into t1 values( 172 )
-master-bin.000001 21113 Query 1 21204 use `test`; insert into t1 values( 171 )
-master-bin.000001 21204 Query 1 21295 use `test`; insert into t1 values( 170 )
-master-bin.000001 21295 Query 1 21386 use `test`; insert into t1 values( 169 )
-master-bin.000001 21386 Query 1 21477 use `test`; insert into t1 values( 168 )
-master-bin.000001 21477 Query 1 21568 use `test`; insert into t1 values( 167 )
-master-bin.000001 21568 Query 1 21659 use `test`; insert into t1 values( 166 )
-master-bin.000001 21659 Query 1 21750 use `test`; insert into t1 values( 165 )
-master-bin.000001 21750 Query 1 21841 use `test`; insert into t1 values( 164 )
-master-bin.000001 21841 Query 1 21932 use `test`; insert into t1 values( 163 )
-master-bin.000001 21932 Query 1 22023 use `test`; insert into t1 values( 162 )
-master-bin.000001 22023 Query 1 22114 use `test`; insert into t1 values( 161 )
-master-bin.000001 22114 Query 1 22205 use `test`; insert into t1 values( 160 )
-master-bin.000001 22205 Query 1 22296 use `test`; insert into t1 values( 159 )
-master-bin.000001 22296 Query 1 22387 use `test`; insert into t1 values( 158 )
-master-bin.000001 22387 Query 1 22478 use `test`; insert into t1 values( 157 )
-master-bin.000001 22478 Query 1 22569 use `test`; insert into t1 values( 156 )
-master-bin.000001 22569 Query 1 22660 use `test`; insert into t1 values( 155 )
-master-bin.000001 22660 Query 1 22751 use `test`; insert into t1 values( 154 )
-master-bin.000001 22751 Query 1 22842 use `test`; insert into t1 values( 153 )
-master-bin.000001 22842 Query 1 22933 use `test`; insert into t1 values( 152 )
-master-bin.000001 22933 Query 1 23024 use `test`; insert into t1 values( 151 )
-master-bin.000001 23024 Query 1 23115 use `test`; insert into t1 values( 150 )
-master-bin.000001 23115 Query 1 23206 use `test`; insert into t1 values( 149 )
-master-bin.000001 23206 Query 1 23297 use `test`; insert into t1 values( 148 )
-master-bin.000001 23297 Query 1 23388 use `test`; insert into t1 values( 147 )
-master-bin.000001 23388 Query 1 23479 use `test`; insert into t1 values( 146 )
-master-bin.000001 23479 Query 1 23570 use `test`; insert into t1 values( 145 )
-master-bin.000001 23570 Query 1 23661 use `test`; insert into t1 values( 144 )
-master-bin.000001 23661 Query 1 23752 use `test`; insert into t1 values( 143 )
-master-bin.000001 23752 Query 1 23843 use `test`; insert into t1 values( 142 )
-master-bin.000001 23843 Query 1 23934 use `test`; insert into t1 values( 141 )
-master-bin.000001 23934 Query 1 24025 use `test`; insert into t1 values( 140 )
-master-bin.000001 24025 Query 1 24116 use `test`; insert into t1 values( 139 )
-master-bin.000001 24116 Query 1 24207 use `test`; insert into t1 values( 138 )
-master-bin.000001 24207 Query 1 24298 use `test`; insert into t1 values( 137 )
-master-bin.000001 24298 Query 1 24389 use `test`; insert into t1 values( 136 )
-master-bin.000001 24389 Query 1 24480 use `test`; insert into t1 values( 135 )
-master-bin.000001 24480 Query 1 24571 use `test`; insert into t1 values( 134 )
-master-bin.000001 24571 Query 1 24662 use `test`; insert into t1 values( 133 )
-master-bin.000001 24662 Query 1 24753 use `test`; insert into t1 values( 132 )
-master-bin.000001 24753 Query 1 24844 use `test`; insert into t1 values( 131 )
-master-bin.000001 24844 Query 1 24935 use `test`; insert into t1 values( 130 )
-master-bin.000001 24935 Query 1 25026 use `test`; insert into t1 values( 129 )
-master-bin.000001 25026 Query 1 25117 use `test`; insert into t1 values( 128 )
-master-bin.000001 25117 Query 1 25208 use `test`; insert into t1 values( 127 )
-master-bin.000001 25208 Query 1 25299 use `test`; insert into t1 values( 126 )
-master-bin.000001 25299 Query 1 25390 use `test`; insert into t1 values( 125 )
-master-bin.000001 25390 Query 1 25481 use `test`; insert into t1 values( 124 )
-master-bin.000001 25481 Query 1 25572 use `test`; insert into t1 values( 123 )
-master-bin.000001 25572 Query 1 25663 use `test`; insert into t1 values( 122 )
-master-bin.000001 25663 Query 1 25754 use `test`; insert into t1 values( 121 )
-master-bin.000001 25754 Query 1 25845 use `test`; insert into t1 values( 120 )
-master-bin.000001 25845 Query 1 25936 use `test`; insert into t1 values( 119 )
-master-bin.000001 25936 Query 1 26027 use `test`; insert into t1 values( 118 )
-master-bin.000001 26027 Query 1 26118 use `test`; insert into t1 values( 117 )
-master-bin.000001 26118 Query 1 26209 use `test`; insert into t1 values( 116 )
-master-bin.000001 26209 Query 1 26300 use `test`; insert into t1 values( 115 )
-master-bin.000001 26300 Query 1 26391 use `test`; insert into t1 values( 114 )
-master-bin.000001 26391 Query 1 26482 use `test`; insert into t1 values( 113 )
-master-bin.000001 26482 Query 1 26573 use `test`; insert into t1 values( 112 )
-master-bin.000001 26573 Query 1 26664 use `test`; insert into t1 values( 111 )
-master-bin.000001 26664 Query 1 26755 use `test`; insert into t1 values( 110 )
-master-bin.000001 26755 Query 1 26846 use `test`; insert into t1 values( 109 )
-master-bin.000001 26846 Query 1 26937 use `test`; insert into t1 values( 108 )
-master-bin.000001 26937 Query 1 27028 use `test`; insert into t1 values( 107 )
-master-bin.000001 27028 Query 1 27119 use `test`; insert into t1 values( 106 )
-master-bin.000001 27119 Query 1 27210 use `test`; insert into t1 values( 105 )
-master-bin.000001 27210 Query 1 27301 use `test`; insert into t1 values( 104 )
-master-bin.000001 27301 Query 1 27392 use `test`; insert into t1 values( 103 )
-master-bin.000001 27392 Query 1 27483 use `test`; insert into t1 values( 102 )
-master-bin.000001 27483 Query 1 27574 use `test`; insert into t1 values( 101 )
-master-bin.000001 27574 Query 1 27665 use `test`; insert into t1 values( 100 )
-master-bin.000001 27665 Query 1 27755 use `test`; insert into t1 values( 99 )
-master-bin.000001 27755 Query 1 27845 use `test`; insert into t1 values( 98 )
-master-bin.000001 27845 Query 1 27935 use `test`; insert into t1 values( 97 )
-master-bin.000001 27935 Query 1 28025 use `test`; insert into t1 values( 96 )
-master-bin.000001 28025 Query 1 28115 use `test`; insert into t1 values( 95 )
-master-bin.000001 28115 Query 1 28205 use `test`; insert into t1 values( 94 )
-master-bin.000001 28205 Query 1 28295 use `test`; insert into t1 values( 93 )
-master-bin.000001 28295 Query 1 28385 use `test`; insert into t1 values( 92 )
-master-bin.000001 28385 Query 1 28475 use `test`; insert into t1 values( 91 )
-master-bin.000001 28475 Query 1 28565 use `test`; insert into t1 values( 90 )
-master-bin.000001 28565 Query 1 28655 use `test`; insert into t1 values( 89 )
-master-bin.000001 28655 Query 1 28745 use `test`; insert into t1 values( 88 )
-master-bin.000001 28745 Query 1 28835 use `test`; insert into t1 values( 87 )
-master-bin.000001 28835 Query 1 28925 use `test`; insert into t1 values( 86 )
-master-bin.000001 28925 Query 1 29015 use `test`; insert into t1 values( 85 )
-master-bin.000001 29015 Query 1 29105 use `test`; insert into t1 values( 84 )
-master-bin.000001 29105 Query 1 29195 use `test`; insert into t1 values( 83 )
-master-bin.000001 29195 Query 1 29285 use `test`; insert into t1 values( 82 )
-master-bin.000001 29285 Query 1 29375 use `test`; insert into t1 values( 81 )
-master-bin.000001 29375 Query 1 29465 use `test`; insert into t1 values( 80 )
-master-bin.000001 29465 Query 1 29555 use `test`; insert into t1 values( 79 )
-master-bin.000001 29555 Query 1 29645 use `test`; insert into t1 values( 78 )
-master-bin.000001 29645 Query 1 29735 use `test`; insert into t1 values( 77 )
-master-bin.000001 29735 Query 1 29825 use `test`; insert into t1 values( 76 )
-master-bin.000001 29825 Query 1 29915 use `test`; insert into t1 values( 75 )
-master-bin.000001 29915 Query 1 30005 use `test`; insert into t1 values( 74 )
-master-bin.000001 30005 Query 1 30095 use `test`; insert into t1 values( 73 )
-master-bin.000001 30095 Query 1 30185 use `test`; insert into t1 values( 72 )
-master-bin.000001 30185 Query 1 30275 use `test`; insert into t1 values( 71 )
-master-bin.000001 30275 Query 1 30365 use `test`; insert into t1 values( 70 )
-master-bin.000001 30365 Query 1 30455 use `test`; insert into t1 values( 69 )
-master-bin.000001 30455 Query 1 30545 use `test`; insert into t1 values( 68 )
-master-bin.000001 30545 Query 1 30635 use `test`; insert into t1 values( 67 )
-master-bin.000001 30635 Query 1 30725 use `test`; insert into t1 values( 66 )
-master-bin.000001 30725 Query 1 30815 use `test`; insert into t1 values( 65 )
-master-bin.000001 30815 Query 1 30905 use `test`; insert into t1 values( 64 )
-master-bin.000001 30905 Query 1 30995 use `test`; insert into t1 values( 63 )
-master-bin.000001 30995 Query 1 31085 use `test`; insert into t1 values( 62 )
-master-bin.000001 31085 Query 1 31175 use `test`; insert into t1 values( 61 )
-master-bin.000001 31175 Query 1 31265 use `test`; insert into t1 values( 60 )
-master-bin.000001 31265 Query 1 31355 use `test`; insert into t1 values( 59 )
-master-bin.000001 31355 Query 1 31445 use `test`; insert into t1 values( 58 )
-master-bin.000001 31445 Query 1 31535 use `test`; insert into t1 values( 57 )
-master-bin.000001 31535 Query 1 31625 use `test`; insert into t1 values( 56 )
-master-bin.000001 31625 Query 1 31715 use `test`; insert into t1 values( 55 )
-master-bin.000001 31715 Query 1 31805 use `test`; insert into t1 values( 54 )
-master-bin.000001 31805 Query 1 31895 use `test`; insert into t1 values( 53 )
-master-bin.000001 31895 Query 1 31985 use `test`; insert into t1 values( 52 )
-master-bin.000001 31985 Query 1 32075 use `test`; insert into t1 values( 51 )
-master-bin.000001 32075 Query 1 32165 use `test`; insert into t1 values( 50 )
-master-bin.000001 32165 Query 1 32255 use `test`; insert into t1 values( 49 )
-master-bin.000001 32255 Query 1 32345 use `test`; insert into t1 values( 48 )
-master-bin.000001 32345 Query 1 32435 use `test`; insert into t1 values( 47 )
-master-bin.000001 32435 Query 1 32525 use `test`; insert into t1 values( 46 )
-master-bin.000001 32525 Query 1 32615 use `test`; insert into t1 values( 45 )
-master-bin.000001 32615 Query 1 32705 use `test`; insert into t1 values( 44 )
-master-bin.000001 32705 Query 1 32795 use `test`; insert into t1 values( 43 )
-master-bin.000001 32795 Query 1 32885 use `test`; insert into t1 values( 42 )
-master-bin.000001 32885 Query 1 32975 use `test`; insert into t1 values( 41 )
-master-bin.000001 32975 Query 1 33065 use `test`; insert into t1 values( 40 )
-master-bin.000001 33065 Query 1 33155 use `test`; insert into t1 values( 39 )
-master-bin.000001 33155 Query 1 33245 use `test`; insert into t1 values( 38 )
-master-bin.000001 33245 Query 1 33335 use `test`; insert into t1 values( 37 )
-master-bin.000001 33335 Query 1 33425 use `test`; insert into t1 values( 36 )
-master-bin.000001 33425 Query 1 33515 use `test`; insert into t1 values( 35 )
-master-bin.000001 33515 Query 1 33605 use `test`; insert into t1 values( 34 )
-master-bin.000001 33605 Query 1 33695 use `test`; insert into t1 values( 33 )
-master-bin.000001 33695 Query 1 33785 use `test`; insert into t1 values( 32 )
-master-bin.000001 33785 Query 1 33875 use `test`; insert into t1 values( 31 )
-master-bin.000001 33875 Query 1 33965 use `test`; insert into t1 values( 30 )
-master-bin.000001 33965 Query 1 34055 use `test`; insert into t1 values( 29 )
-master-bin.000001 34055 Query 1 34145 use `test`; insert into t1 values( 28 )
-master-bin.000001 34145 Query 1 34235 use `test`; insert into t1 values( 27 )
-master-bin.000001 34235 Query 1 34325 use `test`; insert into t1 values( 26 )
-master-bin.000001 34325 Query 1 34415 use `test`; insert into t1 values( 25 )
-master-bin.000001 34415 Query 1 34505 use `test`; insert into t1 values( 24 )
-master-bin.000001 34505 Query 1 34595 use `test`; insert into t1 values( 23 )
-master-bin.000001 34595 Query 1 34685 use `test`; insert into t1 values( 22 )
-master-bin.000001 34685 Query 1 34775 use `test`; insert into t1 values( 21 )
-master-bin.000001 34775 Query 1 34865 use `test`; insert into t1 values( 20 )
-master-bin.000001 34865 Query 1 34955 use `test`; insert into t1 values( 19 )
-master-bin.000001 34955 Query 1 35045 use `test`; insert into t1 values( 18 )
-master-bin.000001 35045 Query 1 35135 use `test`; insert into t1 values( 17 )
-master-bin.000001 35135 Query 1 35225 use `test`; insert into t1 values( 16 )
-master-bin.000001 35225 Query 1 35315 use `test`; insert into t1 values( 15 )
-master-bin.000001 35315 Query 1 35405 use `test`; insert into t1 values( 14 )
-master-bin.000001 35405 Query 1 35495 use `test`; insert into t1 values( 13 )
-master-bin.000001 35495 Query 1 35585 use `test`; insert into t1 values( 12 )
-master-bin.000001 35585 Query 1 35675 use `test`; insert into t1 values( 11 )
-master-bin.000001 35675 Query 1 35765 use `test`; insert into t1 values( 10 )
-master-bin.000001 35765 Query 1 35854 use `test`; insert into t1 values( 9 )
-master-bin.000001 35854 Query 1 35943 use `test`; insert into t1 values( 8 )
-master-bin.000001 35943 Query 1 36032 use `test`; insert into t1 values( 7 )
-master-bin.000001 36032 Query 1 36121 use `test`; insert into t1 values( 6 )
-master-bin.000001 36121 Query 1 36210 use `test`; insert into t1 values( 5 )
-master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 )
-master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 )
-master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 )
-master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 )
-master-bin.000001 36566 Xid 1 36593 COMMIT /* XID */
-master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 207 use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 207 Query 1 275 BEGIN
+master-bin.000001 275 Query 1 366 use `test`; insert into t1 values( 400 )
+master-bin.000001 366 Query 1 457 use `test`; insert into t1 values( 399 )
+master-bin.000001 457 Query 1 548 use `test`; insert into t1 values( 398 )
+master-bin.000001 548 Query 1 639 use `test`; insert into t1 values( 397 )
+master-bin.000001 639 Query 1 730 use `test`; insert into t1 values( 396 )
+master-bin.000001 730 Query 1 821 use `test`; insert into t1 values( 395 )
+master-bin.000001 821 Query 1 912 use `test`; insert into t1 values( 394 )
+master-bin.000001 912 Query 1 1003 use `test`; insert into t1 values( 393 )
+master-bin.000001 1003 Query 1 1094 use `test`; insert into t1 values( 392 )
+master-bin.000001 1094 Query 1 1185 use `test`; insert into t1 values( 391 )
+master-bin.000001 1185 Query 1 1276 use `test`; insert into t1 values( 390 )
+master-bin.000001 1276 Query 1 1367 use `test`; insert into t1 values( 389 )
+master-bin.000001 1367 Query 1 1458 use `test`; insert into t1 values( 388 )
+master-bin.000001 1458 Query 1 1549 use `test`; insert into t1 values( 387 )
+master-bin.000001 1549 Query 1 1640 use `test`; insert into t1 values( 386 )
+master-bin.000001 1640 Query 1 1731 use `test`; insert into t1 values( 385 )
+master-bin.000001 1731 Query 1 1822 use `test`; insert into t1 values( 384 )
+master-bin.000001 1822 Query 1 1913 use `test`; insert into t1 values( 383 )
+master-bin.000001 1913 Query 1 2004 use `test`; insert into t1 values( 382 )
+master-bin.000001 2004 Query 1 2095 use `test`; insert into t1 values( 381 )
+master-bin.000001 2095 Query 1 2186 use `test`; insert into t1 values( 380 )
+master-bin.000001 2186 Query 1 2277 use `test`; insert into t1 values( 379 )
+master-bin.000001 2277 Query 1 2368 use `test`; insert into t1 values( 378 )
+master-bin.000001 2368 Query 1 2459 use `test`; insert into t1 values( 377 )
+master-bin.000001 2459 Query 1 2550 use `test`; insert into t1 values( 376 )
+master-bin.000001 2550 Query 1 2641 use `test`; insert into t1 values( 375 )
+master-bin.000001 2641 Query 1 2732 use `test`; insert into t1 values( 374 )
+master-bin.000001 2732 Query 1 2823 use `test`; insert into t1 values( 373 )
+master-bin.000001 2823 Query 1 2914 use `test`; insert into t1 values( 372 )
+master-bin.000001 2914 Query 1 3005 use `test`; insert into t1 values( 371 )
+master-bin.000001 3005 Query 1 3096 use `test`; insert into t1 values( 370 )
+master-bin.000001 3096 Query 1 3187 use `test`; insert into t1 values( 369 )
+master-bin.000001 3187 Query 1 3278 use `test`; insert into t1 values( 368 )
+master-bin.000001 3278 Query 1 3369 use `test`; insert into t1 values( 367 )
+master-bin.000001 3369 Query 1 3460 use `test`; insert into t1 values( 366 )
+master-bin.000001 3460 Query 1 3551 use `test`; insert into t1 values( 365 )
+master-bin.000001 3551 Query 1 3642 use `test`; insert into t1 values( 364 )
+master-bin.000001 3642 Query 1 3733 use `test`; insert into t1 values( 363 )
+master-bin.000001 3733 Query 1 3824 use `test`; insert into t1 values( 362 )
+master-bin.000001 3824 Query 1 3915 use `test`; insert into t1 values( 361 )
+master-bin.000001 3915 Query 1 4006 use `test`; insert into t1 values( 360 )
+master-bin.000001 4006 Query 1 4097 use `test`; insert into t1 values( 359 )
+master-bin.000001 4097 Query 1 4188 use `test`; insert into t1 values( 358 )
+master-bin.000001 4188 Query 1 4279 use `test`; insert into t1 values( 357 )
+master-bin.000001 4279 Query 1 4370 use `test`; insert into t1 values( 356 )
+master-bin.000001 4370 Query 1 4461 use `test`; insert into t1 values( 355 )
+master-bin.000001 4461 Query 1 4552 use `test`; insert into t1 values( 354 )
+master-bin.000001 4552 Query 1 4643 use `test`; insert into t1 values( 353 )
+master-bin.000001 4643 Query 1 4734 use `test`; insert into t1 values( 352 )
+master-bin.000001 4734 Query 1 4825 use `test`; insert into t1 values( 351 )
+master-bin.000001 4825 Query 1 4916 use `test`; insert into t1 values( 350 )
+master-bin.000001 4916 Query 1 5007 use `test`; insert into t1 values( 349 )
+master-bin.000001 5007 Query 1 5098 use `test`; insert into t1 values( 348 )
+master-bin.000001 5098 Query 1 5189 use `test`; insert into t1 values( 347 )
+master-bin.000001 5189 Query 1 5280 use `test`; insert into t1 values( 346 )
+master-bin.000001 5280 Query 1 5371 use `test`; insert into t1 values( 345 )
+master-bin.000001 5371 Query 1 5462 use `test`; insert into t1 values( 344 )
+master-bin.000001 5462 Query 1 5553 use `test`; insert into t1 values( 343 )
+master-bin.000001 5553 Query 1 5644 use `test`; insert into t1 values( 342 )
+master-bin.000001 5644 Query 1 5735 use `test`; insert into t1 values( 341 )
+master-bin.000001 5735 Query 1 5826 use `test`; insert into t1 values( 340 )
+master-bin.000001 5826 Query 1 5917 use `test`; insert into t1 values( 339 )
+master-bin.000001 5917 Query 1 6008 use `test`; insert into t1 values( 338 )
+master-bin.000001 6008 Query 1 6099 use `test`; insert into t1 values( 337 )
+master-bin.000001 6099 Query 1 6190 use `test`; insert into t1 values( 336 )
+master-bin.000001 6190 Query 1 6281 use `test`; insert into t1 values( 335 )
+master-bin.000001 6281 Query 1 6372 use `test`; insert into t1 values( 334 )
+master-bin.000001 6372 Query 1 6463 use `test`; insert into t1 values( 333 )
+master-bin.000001 6463 Query 1 6554 use `test`; insert into t1 values( 332 )
+master-bin.000001 6554 Query 1 6645 use `test`; insert into t1 values( 331 )
+master-bin.000001 6645 Query 1 6736 use `test`; insert into t1 values( 330 )
+master-bin.000001 6736 Query 1 6827 use `test`; insert into t1 values( 329 )
+master-bin.000001 6827 Query 1 6918 use `test`; insert into t1 values( 328 )
+master-bin.000001 6918 Query 1 7009 use `test`; insert into t1 values( 327 )
+master-bin.000001 7009 Query 1 7100 use `test`; insert into t1 values( 326 )
+master-bin.000001 7100 Query 1 7191 use `test`; insert into t1 values( 325 )
+master-bin.000001 7191 Query 1 7282 use `test`; insert into t1 values( 324 )
+master-bin.000001 7282 Query 1 7373 use `test`; insert into t1 values( 323 )
+master-bin.000001 7373 Query 1 7464 use `test`; insert into t1 values( 322 )
+master-bin.000001 7464 Query 1 7555 use `test`; insert into t1 values( 321 )
+master-bin.000001 7555 Query 1 7646 use `test`; insert into t1 values( 320 )
+master-bin.000001 7646 Query 1 7737 use `test`; insert into t1 values( 319 )
+master-bin.000001 7737 Query 1 7828 use `test`; insert into t1 values( 318 )
+master-bin.000001 7828 Query 1 7919 use `test`; insert into t1 values( 317 )
+master-bin.000001 7919 Query 1 8010 use `test`; insert into t1 values( 316 )
+master-bin.000001 8010 Query 1 8101 use `test`; insert into t1 values( 315 )
+master-bin.000001 8101 Query 1 8192 use `test`; insert into t1 values( 314 )
+master-bin.000001 8192 Query 1 8283 use `test`; insert into t1 values( 313 )
+master-bin.000001 8283 Query 1 8374 use `test`; insert into t1 values( 312 )
+master-bin.000001 8374 Query 1 8465 use `test`; insert into t1 values( 311 )
+master-bin.000001 8465 Query 1 8556 use `test`; insert into t1 values( 310 )
+master-bin.000001 8556 Query 1 8647 use `test`; insert into t1 values( 309 )
+master-bin.000001 8647 Query 1 8738 use `test`; insert into t1 values( 308 )
+master-bin.000001 8738 Query 1 8829 use `test`; insert into t1 values( 307 )
+master-bin.000001 8829 Query 1 8920 use `test`; insert into t1 values( 306 )
+master-bin.000001 8920 Query 1 9011 use `test`; insert into t1 values( 305 )
+master-bin.000001 9011 Query 1 9102 use `test`; insert into t1 values( 304 )
+master-bin.000001 9102 Query 1 9193 use `test`; insert into t1 values( 303 )
+master-bin.000001 9193 Query 1 9284 use `test`; insert into t1 values( 302 )
+master-bin.000001 9284 Query 1 9375 use `test`; insert into t1 values( 301 )
+master-bin.000001 9375 Query 1 9466 use `test`; insert into t1 values( 300 )
+master-bin.000001 9466 Query 1 9557 use `test`; insert into t1 values( 299 )
+master-bin.000001 9557 Query 1 9648 use `test`; insert into t1 values( 298 )
+master-bin.000001 9648 Query 1 9739 use `test`; insert into t1 values( 297 )
+master-bin.000001 9739 Query 1 9830 use `test`; insert into t1 values( 296 )
+master-bin.000001 9830 Query 1 9921 use `test`; insert into t1 values( 295 )
+master-bin.000001 9921 Query 1 10012 use `test`; insert into t1 values( 294 )
+master-bin.000001 10012 Query 1 10103 use `test`; insert into t1 values( 293 )
+master-bin.000001 10103 Query 1 10194 use `test`; insert into t1 values( 292 )
+master-bin.000001 10194 Query 1 10285 use `test`; insert into t1 values( 291 )
+master-bin.000001 10285 Query 1 10376 use `test`; insert into t1 values( 290 )
+master-bin.000001 10376 Query 1 10467 use `test`; insert into t1 values( 289 )
+master-bin.000001 10467 Query 1 10558 use `test`; insert into t1 values( 288 )
+master-bin.000001 10558 Query 1 10649 use `test`; insert into t1 values( 287 )
+master-bin.000001 10649 Query 1 10740 use `test`; insert into t1 values( 286 )
+master-bin.000001 10740 Query 1 10831 use `test`; insert into t1 values( 285 )
+master-bin.000001 10831 Query 1 10922 use `test`; insert into t1 values( 284 )
+master-bin.000001 10922 Query 1 11013 use `test`; insert into t1 values( 283 )
+master-bin.000001 11013 Query 1 11104 use `test`; insert into t1 values( 282 )
+master-bin.000001 11104 Query 1 11195 use `test`; insert into t1 values( 281 )
+master-bin.000001 11195 Query 1 11286 use `test`; insert into t1 values( 280 )
+master-bin.000001 11286 Query 1 11377 use `test`; insert into t1 values( 279 )
+master-bin.000001 11377 Query 1 11468 use `test`; insert into t1 values( 278 )
+master-bin.000001 11468 Query 1 11559 use `test`; insert into t1 values( 277 )
+master-bin.000001 11559 Query 1 11650 use `test`; insert into t1 values( 276 )
+master-bin.000001 11650 Query 1 11741 use `test`; insert into t1 values( 275 )
+master-bin.000001 11741 Query 1 11832 use `test`; insert into t1 values( 274 )
+master-bin.000001 11832 Query 1 11923 use `test`; insert into t1 values( 273 )
+master-bin.000001 11923 Query 1 12014 use `test`; insert into t1 values( 272 )
+master-bin.000001 12014 Query 1 12105 use `test`; insert into t1 values( 271 )
+master-bin.000001 12105 Query 1 12196 use `test`; insert into t1 values( 270 )
+master-bin.000001 12196 Query 1 12287 use `test`; insert into t1 values( 269 )
+master-bin.000001 12287 Query 1 12378 use `test`; insert into t1 values( 268 )
+master-bin.000001 12378 Query 1 12469 use `test`; insert into t1 values( 267 )
+master-bin.000001 12469 Query 1 12560 use `test`; insert into t1 values( 266 )
+master-bin.000001 12560 Query 1 12651 use `test`; insert into t1 values( 265 )
+master-bin.000001 12651 Query 1 12742 use `test`; insert into t1 values( 264 )
+master-bin.000001 12742 Query 1 12833 use `test`; insert into t1 values( 263 )
+master-bin.000001 12833 Query 1 12924 use `test`; insert into t1 values( 262 )
+master-bin.000001 12924 Query 1 13015 use `test`; insert into t1 values( 261 )
+master-bin.000001 13015 Query 1 13106 use `test`; insert into t1 values( 260 )
+master-bin.000001 13106 Query 1 13197 use `test`; insert into t1 values( 259 )
+master-bin.000001 13197 Query 1 13288 use `test`; insert into t1 values( 258 )
+master-bin.000001 13288 Query 1 13379 use `test`; insert into t1 values( 257 )
+master-bin.000001 13379 Query 1 13470 use `test`; insert into t1 values( 256 )
+master-bin.000001 13470 Query 1 13561 use `test`; insert into t1 values( 255 )
+master-bin.000001 13561 Query 1 13652 use `test`; insert into t1 values( 254 )
+master-bin.000001 13652 Query 1 13743 use `test`; insert into t1 values( 253 )
+master-bin.000001 13743 Query 1 13834 use `test`; insert into t1 values( 252 )
+master-bin.000001 13834 Query 1 13925 use `test`; insert into t1 values( 251 )
+master-bin.000001 13925 Query 1 14016 use `test`; insert into t1 values( 250 )
+master-bin.000001 14016 Query 1 14107 use `test`; insert into t1 values( 249 )
+master-bin.000001 14107 Query 1 14198 use `test`; insert into t1 values( 248 )
+master-bin.000001 14198 Query 1 14289 use `test`; insert into t1 values( 247 )
+master-bin.000001 14289 Query 1 14380 use `test`; insert into t1 values( 246 )
+master-bin.000001 14380 Query 1 14471 use `test`; insert into t1 values( 245 )
+master-bin.000001 14471 Query 1 14562 use `test`; insert into t1 values( 244 )
+master-bin.000001 14562 Query 1 14653 use `test`; insert into t1 values( 243 )
+master-bin.000001 14653 Query 1 14744 use `test`; insert into t1 values( 242 )
+master-bin.000001 14744 Query 1 14835 use `test`; insert into t1 values( 241 )
+master-bin.000001 14835 Query 1 14926 use `test`; insert into t1 values( 240 )
+master-bin.000001 14926 Query 1 15017 use `test`; insert into t1 values( 239 )
+master-bin.000001 15017 Query 1 15108 use `test`; insert into t1 values( 238 )
+master-bin.000001 15108 Query 1 15199 use `test`; insert into t1 values( 237 )
+master-bin.000001 15199 Query 1 15290 use `test`; insert into t1 values( 236 )
+master-bin.000001 15290 Query 1 15381 use `test`; insert into t1 values( 235 )
+master-bin.000001 15381 Query 1 15472 use `test`; insert into t1 values( 234 )
+master-bin.000001 15472 Query 1 15563 use `test`; insert into t1 values( 233 )
+master-bin.000001 15563 Query 1 15654 use `test`; insert into t1 values( 232 )
+master-bin.000001 15654 Query 1 15745 use `test`; insert into t1 values( 231 )
+master-bin.000001 15745 Query 1 15836 use `test`; insert into t1 values( 230 )
+master-bin.000001 15836 Query 1 15927 use `test`; insert into t1 values( 229 )
+master-bin.000001 15927 Query 1 16018 use `test`; insert into t1 values( 228 )
+master-bin.000001 16018 Query 1 16109 use `test`; insert into t1 values( 227 )
+master-bin.000001 16109 Query 1 16200 use `test`; insert into t1 values( 226 )
+master-bin.000001 16200 Query 1 16291 use `test`; insert into t1 values( 225 )
+master-bin.000001 16291 Query 1 16382 use `test`; insert into t1 values( 224 )
+master-bin.000001 16382 Query 1 16473 use `test`; insert into t1 values( 223 )
+master-bin.000001 16473 Query 1 16564 use `test`; insert into t1 values( 222 )
+master-bin.000001 16564 Query 1 16655 use `test`; insert into t1 values( 221 )
+master-bin.000001 16655 Query 1 16746 use `test`; insert into t1 values( 220 )
+master-bin.000001 16746 Query 1 16837 use `test`; insert into t1 values( 219 )
+master-bin.000001 16837 Query 1 16928 use `test`; insert into t1 values( 218 )
+master-bin.000001 16928 Query 1 17019 use `test`; insert into t1 values( 217 )
+master-bin.000001 17019 Query 1 17110 use `test`; insert into t1 values( 216 )
+master-bin.000001 17110 Query 1 17201 use `test`; insert into t1 values( 215 )
+master-bin.000001 17201 Query 1 17292 use `test`; insert into t1 values( 214 )
+master-bin.000001 17292 Query 1 17383 use `test`; insert into t1 values( 213 )
+master-bin.000001 17383 Query 1 17474 use `test`; insert into t1 values( 212 )
+master-bin.000001 17474 Query 1 17565 use `test`; insert into t1 values( 211 )
+master-bin.000001 17565 Query 1 17656 use `test`; insert into t1 values( 210 )
+master-bin.000001 17656 Query 1 17747 use `test`; insert into t1 values( 209 )
+master-bin.000001 17747 Query 1 17838 use `test`; insert into t1 values( 208 )
+master-bin.000001 17838 Query 1 17929 use `test`; insert into t1 values( 207 )
+master-bin.000001 17929 Query 1 18020 use `test`; insert into t1 values( 206 )
+master-bin.000001 18020 Query 1 18111 use `test`; insert into t1 values( 205 )
+master-bin.000001 18111 Query 1 18202 use `test`; insert into t1 values( 204 )
+master-bin.000001 18202 Query 1 18293 use `test`; insert into t1 values( 203 )
+master-bin.000001 18293 Query 1 18384 use `test`; insert into t1 values( 202 )
+master-bin.000001 18384 Query 1 18475 use `test`; insert into t1 values( 201 )
+master-bin.000001 18475 Query 1 18566 use `test`; insert into t1 values( 200 )
+master-bin.000001 18566 Query 1 18657 use `test`; insert into t1 values( 199 )
+master-bin.000001 18657 Query 1 18748 use `test`; insert into t1 values( 198 )
+master-bin.000001 18748 Query 1 18839 use `test`; insert into t1 values( 197 )
+master-bin.000001 18839 Query 1 18930 use `test`; insert into t1 values( 196 )
+master-bin.000001 18930 Query 1 19021 use `test`; insert into t1 values( 195 )
+master-bin.000001 19021 Query 1 19112 use `test`; insert into t1 values( 194 )
+master-bin.000001 19112 Query 1 19203 use `test`; insert into t1 values( 193 )
+master-bin.000001 19203 Query 1 19294 use `test`; insert into t1 values( 192 )
+master-bin.000001 19294 Query 1 19385 use `test`; insert into t1 values( 191 )
+master-bin.000001 19385 Query 1 19476 use `test`; insert into t1 values( 190 )
+master-bin.000001 19476 Query 1 19567 use `test`; insert into t1 values( 189 )
+master-bin.000001 19567 Query 1 19658 use `test`; insert into t1 values( 188 )
+master-bin.000001 19658 Query 1 19749 use `test`; insert into t1 values( 187 )
+master-bin.000001 19749 Query 1 19840 use `test`; insert into t1 values( 186 )
+master-bin.000001 19840 Query 1 19931 use `test`; insert into t1 values( 185 )
+master-bin.000001 19931 Query 1 20022 use `test`; insert into t1 values( 184 )
+master-bin.000001 20022 Query 1 20113 use `test`; insert into t1 values( 183 )
+master-bin.000001 20113 Query 1 20204 use `test`; insert into t1 values( 182 )
+master-bin.000001 20204 Query 1 20295 use `test`; insert into t1 values( 181 )
+master-bin.000001 20295 Query 1 20386 use `test`; insert into t1 values( 180 )
+master-bin.000001 20386 Query 1 20477 use `test`; insert into t1 values( 179 )
+master-bin.000001 20477 Query 1 20568 use `test`; insert into t1 values( 178 )
+master-bin.000001 20568 Query 1 20659 use `test`; insert into t1 values( 177 )
+master-bin.000001 20659 Query 1 20750 use `test`; insert into t1 values( 176 )
+master-bin.000001 20750 Query 1 20841 use `test`; insert into t1 values( 175 )
+master-bin.000001 20841 Query 1 20932 use `test`; insert into t1 values( 174 )
+master-bin.000001 20932 Query 1 21023 use `test`; insert into t1 values( 173 )
+master-bin.000001 21023 Query 1 21114 use `test`; insert into t1 values( 172 )
+master-bin.000001 21114 Query 1 21205 use `test`; insert into t1 values( 171 )
+master-bin.000001 21205 Query 1 21296 use `test`; insert into t1 values( 170 )
+master-bin.000001 21296 Query 1 21387 use `test`; insert into t1 values( 169 )
+master-bin.000001 21387 Query 1 21478 use `test`; insert into t1 values( 168 )
+master-bin.000001 21478 Query 1 21569 use `test`; insert into t1 values( 167 )
+master-bin.000001 21569 Query 1 21660 use `test`; insert into t1 values( 166 )
+master-bin.000001 21660 Query 1 21751 use `test`; insert into t1 values( 165 )
+master-bin.000001 21751 Query 1 21842 use `test`; insert into t1 values( 164 )
+master-bin.000001 21842 Query 1 21933 use `test`; insert into t1 values( 163 )
+master-bin.000001 21933 Query 1 22024 use `test`; insert into t1 values( 162 )
+master-bin.000001 22024 Query 1 22115 use `test`; insert into t1 values( 161 )
+master-bin.000001 22115 Query 1 22206 use `test`; insert into t1 values( 160 )
+master-bin.000001 22206 Query 1 22297 use `test`; insert into t1 values( 159 )
+master-bin.000001 22297 Query 1 22388 use `test`; insert into t1 values( 158 )
+master-bin.000001 22388 Query 1 22479 use `test`; insert into t1 values( 157 )
+master-bin.000001 22479 Query 1 22570 use `test`; insert into t1 values( 156 )
+master-bin.000001 22570 Query 1 22661 use `test`; insert into t1 values( 155 )
+master-bin.000001 22661 Query 1 22752 use `test`; insert into t1 values( 154 )
+master-bin.000001 22752 Query 1 22843 use `test`; insert into t1 values( 153 )
+master-bin.000001 22843 Query 1 22934 use `test`; insert into t1 values( 152 )
+master-bin.000001 22934 Query 1 23025 use `test`; insert into t1 values( 151 )
+master-bin.000001 23025 Query 1 23116 use `test`; insert into t1 values( 150 )
+master-bin.000001 23116 Query 1 23207 use `test`; insert into t1 values( 149 )
+master-bin.000001 23207 Query 1 23298 use `test`; insert into t1 values( 148 )
+master-bin.000001 23298 Query 1 23389 use `test`; insert into t1 values( 147 )
+master-bin.000001 23389 Query 1 23480 use `test`; insert into t1 values( 146 )
+master-bin.000001 23480 Query 1 23571 use `test`; insert into t1 values( 145 )
+master-bin.000001 23571 Query 1 23662 use `test`; insert into t1 values( 144 )
+master-bin.000001 23662 Query 1 23753 use `test`; insert into t1 values( 143 )
+master-bin.000001 23753 Query 1 23844 use `test`; insert into t1 values( 142 )
+master-bin.000001 23844 Query 1 23935 use `test`; insert into t1 values( 141 )
+master-bin.000001 23935 Query 1 24026 use `test`; insert into t1 values( 140 )
+master-bin.000001 24026 Query 1 24117 use `test`; insert into t1 values( 139 )
+master-bin.000001 24117 Query 1 24208 use `test`; insert into t1 values( 138 )
+master-bin.000001 24208 Query 1 24299 use `test`; insert into t1 values( 137 )
+master-bin.000001 24299 Query 1 24390 use `test`; insert into t1 values( 136 )
+master-bin.000001 24390 Query 1 24481 use `test`; insert into t1 values( 135 )
+master-bin.000001 24481 Query 1 24572 use `test`; insert into t1 values( 134 )
+master-bin.000001 24572 Query 1 24663 use `test`; insert into t1 values( 133 )
+master-bin.000001 24663 Query 1 24754 use `test`; insert into t1 values( 132 )
+master-bin.000001 24754 Query 1 24845 use `test`; insert into t1 values( 131 )
+master-bin.000001 24845 Query 1 24936 use `test`; insert into t1 values( 130 )
+master-bin.000001 24936 Query 1 25027 use `test`; insert into t1 values( 129 )
+master-bin.000001 25027 Query 1 25118 use `test`; insert into t1 values( 128 )
+master-bin.000001 25118 Query 1 25209 use `test`; insert into t1 values( 127 )
+master-bin.000001 25209 Query 1 25300 use `test`; insert into t1 values( 126 )
+master-bin.000001 25300 Query 1 25391 use `test`; insert into t1 values( 125 )
+master-bin.000001 25391 Query 1 25482 use `test`; insert into t1 values( 124 )
+master-bin.000001 25482 Query 1 25573 use `test`; insert into t1 values( 123 )
+master-bin.000001 25573 Query 1 25664 use `test`; insert into t1 values( 122 )
+master-bin.000001 25664 Query 1 25755 use `test`; insert into t1 values( 121 )
+master-bin.000001 25755 Query 1 25846 use `test`; insert into t1 values( 120 )
+master-bin.000001 25846 Query 1 25937 use `test`; insert into t1 values( 119 )
+master-bin.000001 25937 Query 1 26028 use `test`; insert into t1 values( 118 )
+master-bin.000001 26028 Query 1 26119 use `test`; insert into t1 values( 117 )
+master-bin.000001 26119 Query 1 26210 use `test`; insert into t1 values( 116 )
+master-bin.000001 26210 Query 1 26301 use `test`; insert into t1 values( 115 )
+master-bin.000001 26301 Query 1 26392 use `test`; insert into t1 values( 114 )
+master-bin.000001 26392 Query 1 26483 use `test`; insert into t1 values( 113 )
+master-bin.000001 26483 Query 1 26574 use `test`; insert into t1 values( 112 )
+master-bin.000001 26574 Query 1 26665 use `test`; insert into t1 values( 111 )
+master-bin.000001 26665 Query 1 26756 use `test`; insert into t1 values( 110 )
+master-bin.000001 26756 Query 1 26847 use `test`; insert into t1 values( 109 )
+master-bin.000001 26847 Query 1 26938 use `test`; insert into t1 values( 108 )
+master-bin.000001 26938 Query 1 27029 use `test`; insert into t1 values( 107 )
+master-bin.000001 27029 Query 1 27120 use `test`; insert into t1 values( 106 )
+master-bin.000001 27120 Query 1 27211 use `test`; insert into t1 values( 105 )
+master-bin.000001 27211 Query 1 27302 use `test`; insert into t1 values( 104 )
+master-bin.000001 27302 Query 1 27393 use `test`; insert into t1 values( 103 )
+master-bin.000001 27393 Query 1 27484 use `test`; insert into t1 values( 102 )
+master-bin.000001 27484 Query 1 27575 use `test`; insert into t1 values( 101 )
+master-bin.000001 27575 Query 1 27666 use `test`; insert into t1 values( 100 )
+master-bin.000001 27666 Query 1 27756 use `test`; insert into t1 values( 99 )
+master-bin.000001 27756 Query 1 27846 use `test`; insert into t1 values( 98 )
+master-bin.000001 27846 Query 1 27936 use `test`; insert into t1 values( 97 )
+master-bin.000001 27936 Query 1 28026 use `test`; insert into t1 values( 96 )
+master-bin.000001 28026 Query 1 28116 use `test`; insert into t1 values( 95 )
+master-bin.000001 28116 Query 1 28206 use `test`; insert into t1 values( 94 )
+master-bin.000001 28206 Query 1 28296 use `test`; insert into t1 values( 93 )
+master-bin.000001 28296 Query 1 28386 use `test`; insert into t1 values( 92 )
+master-bin.000001 28386 Query 1 28476 use `test`; insert into t1 values( 91 )
+master-bin.000001 28476 Query 1 28566 use `test`; insert into t1 values( 90 )
+master-bin.000001 28566 Query 1 28656 use `test`; insert into t1 values( 89 )
+master-bin.000001 28656 Query 1 28746 use `test`; insert into t1 values( 88 )
+master-bin.000001 28746 Query 1 28836 use `test`; insert into t1 values( 87 )
+master-bin.000001 28836 Query 1 28926 use `test`; insert into t1 values( 86 )
+master-bin.000001 28926 Query 1 29016 use `test`; insert into t1 values( 85 )
+master-bin.000001 29016 Query 1 29106 use `test`; insert into t1 values( 84 )
+master-bin.000001 29106 Query 1 29196 use `test`; insert into t1 values( 83 )
+master-bin.000001 29196 Query 1 29286 use `test`; insert into t1 values( 82 )
+master-bin.000001 29286 Query 1 29376 use `test`; insert into t1 values( 81 )
+master-bin.000001 29376 Query 1 29466 use `test`; insert into t1 values( 80 )
+master-bin.000001 29466 Query 1 29556 use `test`; insert into t1 values( 79 )
+master-bin.000001 29556 Query 1 29646 use `test`; insert into t1 values( 78 )
+master-bin.000001 29646 Query 1 29736 use `test`; insert into t1 values( 77 )
+master-bin.000001 29736 Query 1 29826 use `test`; insert into t1 values( 76 )
+master-bin.000001 29826 Query 1 29916 use `test`; insert into t1 values( 75 )
+master-bin.000001 29916 Query 1 30006 use `test`; insert into t1 values( 74 )
+master-bin.000001 30006 Query 1 30096 use `test`; insert into t1 values( 73 )
+master-bin.000001 30096 Query 1 30186 use `test`; insert into t1 values( 72 )
+master-bin.000001 30186 Query 1 30276 use `test`; insert into t1 values( 71 )
+master-bin.000001 30276 Query 1 30366 use `test`; insert into t1 values( 70 )
+master-bin.000001 30366 Query 1 30456 use `test`; insert into t1 values( 69 )
+master-bin.000001 30456 Query 1 30546 use `test`; insert into t1 values( 68 )
+master-bin.000001 30546 Query 1 30636 use `test`; insert into t1 values( 67 )
+master-bin.000001 30636 Query 1 30726 use `test`; insert into t1 values( 66 )
+master-bin.000001 30726 Query 1 30816 use `test`; insert into t1 values( 65 )
+master-bin.000001 30816 Query 1 30906 use `test`; insert into t1 values( 64 )
+master-bin.000001 30906 Query 1 30996 use `test`; insert into t1 values( 63 )
+master-bin.000001 30996 Query 1 31086 use `test`; insert into t1 values( 62 )
+master-bin.000001 31086 Query 1 31176 use `test`; insert into t1 values( 61 )
+master-bin.000001 31176 Query 1 31266 use `test`; insert into t1 values( 60 )
+master-bin.000001 31266 Query 1 31356 use `test`; insert into t1 values( 59 )
+master-bin.000001 31356 Query 1 31446 use `test`; insert into t1 values( 58 )
+master-bin.000001 31446 Query 1 31536 use `test`; insert into t1 values( 57 )
+master-bin.000001 31536 Query 1 31626 use `test`; insert into t1 values( 56 )
+master-bin.000001 31626 Query 1 31716 use `test`; insert into t1 values( 55 )
+master-bin.000001 31716 Query 1 31806 use `test`; insert into t1 values( 54 )
+master-bin.000001 31806 Query 1 31896 use `test`; insert into t1 values( 53 )
+master-bin.000001 31896 Query 1 31986 use `test`; insert into t1 values( 52 )
+master-bin.000001 31986 Query 1 32076 use `test`; insert into t1 values( 51 )
+master-bin.000001 32076 Query 1 32166 use `test`; insert into t1 values( 50 )
+master-bin.000001 32166 Query 1 32256 use `test`; insert into t1 values( 49 )
+master-bin.000001 32256 Query 1 32346 use `test`; insert into t1 values( 48 )
+master-bin.000001 32346 Query 1 32436 use `test`; insert into t1 values( 47 )
+master-bin.000001 32436 Query 1 32526 use `test`; insert into t1 values( 46 )
+master-bin.000001 32526 Query 1 32616 use `test`; insert into t1 values( 45 )
+master-bin.000001 32616 Query 1 32706 use `test`; insert into t1 values( 44 )
+master-bin.000001 32706 Query 1 32796 use `test`; insert into t1 values( 43 )
+master-bin.000001 32796 Query 1 32886 use `test`; insert into t1 values( 42 )
+master-bin.000001 32886 Query 1 32976 use `test`; insert into t1 values( 41 )
+master-bin.000001 32976 Query 1 33066 use `test`; insert into t1 values( 40 )
+master-bin.000001 33066 Query 1 33156 use `test`; insert into t1 values( 39 )
+master-bin.000001 33156 Query 1 33246 use `test`; insert into t1 values( 38 )
+master-bin.000001 33246 Query 1 33336 use `test`; insert into t1 values( 37 )
+master-bin.000001 33336 Query 1 33426 use `test`; insert into t1 values( 36 )
+master-bin.000001 33426 Query 1 33516 use `test`; insert into t1 values( 35 )
+master-bin.000001 33516 Query 1 33606 use `test`; insert into t1 values( 34 )
+master-bin.000001 33606 Query 1 33696 use `test`; insert into t1 values( 33 )
+master-bin.000001 33696 Query 1 33786 use `test`; insert into t1 values( 32 )
+master-bin.000001 33786 Query 1 33876 use `test`; insert into t1 values( 31 )
+master-bin.000001 33876 Query 1 33966 use `test`; insert into t1 values( 30 )
+master-bin.000001 33966 Query 1 34056 use `test`; insert into t1 values( 29 )
+master-bin.000001 34056 Query 1 34146 use `test`; insert into t1 values( 28 )
+master-bin.000001 34146 Query 1 34236 use `test`; insert into t1 values( 27 )
+master-bin.000001 34236 Query 1 34326 use `test`; insert into t1 values( 26 )
+master-bin.000001 34326 Query 1 34416 use `test`; insert into t1 values( 25 )
+master-bin.000001 34416 Query 1 34506 use `test`; insert into t1 values( 24 )
+master-bin.000001 34506 Query 1 34596 use `test`; insert into t1 values( 23 )
+master-bin.000001 34596 Query 1 34686 use `test`; insert into t1 values( 22 )
+master-bin.000001 34686 Query 1 34776 use `test`; insert into t1 values( 21 )
+master-bin.000001 34776 Query 1 34866 use `test`; insert into t1 values( 20 )
+master-bin.000001 34866 Query 1 34956 use `test`; insert into t1 values( 19 )
+master-bin.000001 34956 Query 1 35046 use `test`; insert into t1 values( 18 )
+master-bin.000001 35046 Query 1 35136 use `test`; insert into t1 values( 17 )
+master-bin.000001 35136 Query 1 35226 use `test`; insert into t1 values( 16 )
+master-bin.000001 35226 Query 1 35316 use `test`; insert into t1 values( 15 )
+master-bin.000001 35316 Query 1 35406 use `test`; insert into t1 values( 14 )
+master-bin.000001 35406 Query 1 35496 use `test`; insert into t1 values( 13 )
+master-bin.000001 35496 Query 1 35586 use `test`; insert into t1 values( 12 )
+master-bin.000001 35586 Query 1 35676 use `test`; insert into t1 values( 11 )
+master-bin.000001 35676 Query 1 35766 use `test`; insert into t1 values( 10 )
+master-bin.000001 35766 Query 1 35855 use `test`; insert into t1 values( 9 )
+master-bin.000001 35855 Query 1 35944 use `test`; insert into t1 values( 8 )
+master-bin.000001 35944 Query 1 36033 use `test`; insert into t1 values( 7 )
+master-bin.000001 36033 Query 1 36122 use `test`; insert into t1 values( 6 )
+master-bin.000001 36122 Query 1 36211 use `test`; insert into t1 values( 5 )
+master-bin.000001 36211 Query 1 36300 use `test`; insert into t1 values( 4 )
+master-bin.000001 36300 Query 1 36389 use `test`; insert into t1 values( 3 )
+master-bin.000001 36389 Query 1 36478 use `test`; insert into t1 values( 2 )
+master-bin.000001 36478 Query 1 36567 use `test`; insert into t1 values( 1 )
+master-bin.000001 36567 Xid 1 36594 COMMIT /* XID */
+master-bin.000001 36594 Rotate 1 36638 master-bin.000002;pos=4
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
@@ -590,10 +590,10 @@ deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
-master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
-master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
-master-bin.000001 351 Query 1 427 use `test`; drop table t1
+master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4
+master-bin.000001 107 Query 1 228 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
+master-bin.000001 228 Query 1 352 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
+master-bin.000001 352 Query 1 428 use `test`; drop table t1
reset master;
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE bug39182;
@@ -764,14 +764,14 @@ drop table if exists t3;
create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 346
+master-bin.000001 347
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
show master status /* must show new binlog index after rotating */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 106
+master-bin.000002 107
drop table t3;
#
# Bug #45998: database crashes when running "create as select"
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index 8bbf993a727..fd252424dc0 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -43,12 +43,6 @@ END|
CALL proc();
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
---- Insert from stored function ----
CREATE FUNCTION func()
RETURNS INT
@@ -67,12 +61,6 @@ func()
0
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
---- Insert from trigger ----
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
@@ -90,12 +78,6 @@ INSERT INTO trigger_table VALUES ('bye.');
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
---- Insert from prepared statement ----
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
@@ -155,12 +137,6 @@ func5()
0
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
==== Variables that should *not* be unsafe ====
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
@@ -215,9 +191,6 @@ END|
CALL p1();
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
-Note 1592 Statement may not be safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
index 5297767675c..19137066429 100644
--- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
+++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
@@ -25,9 +25,22 @@ let $MYSQLD_DATADIR= `select @@datadir`;
copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001;
-write_file $MYSQLD_DATADIR/slave-relay-bin.index;
-slave-relay-bin.000001
-EOF
+
+# After patch for BUG#12190, the filename used in CHANGE MASTER
+# RELAY_LOG_FILE will be automatically added the directory of the
+# relay log before comparison, thus we need to added the directory
+# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
+disable_query_log;
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
+{
+ eval select './slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
+}
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
+{
+ eval select '.\\\\slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
+}
+enable_query_log;
change master to
MASTER_HOST='dummy.localdomain',
diff --git a/mysql-test/suite/binlog/t/binlog_implicit_commit.test b/mysql-test/suite/binlog/t/binlog_implicit_commit.test
new file mode 100644
index 00000000000..a682ab95e3d
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_implicit_commit.test
@@ -0,0 +1,63 @@
+# The purpose of this test is to test that setting autocommit does a
+# commit of outstanding transactions and nothing is left pending in
+# the transaction cache.
+
+source include/have_log_bin.inc;
+source include/have_innodb.inc;
+
+# We need a transactional engine, so let's use InnoDB
+CREATE TABLE t1 (id INT) ENGINE = InnoDB;
+
+# Testing SET AUTOCOMMIT
+SET BINLOG_FORMAT = STATEMENT;
+
+let $cleanup = COMMIT;
+
+let $prepare = SET AUTOCOMMIT = 0;
+let $statement = SET AUTOCOMMIT = 1;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 1;
+let $statement = SET AUTOCOMMIT = 1;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 0;
+let $statement = SET AUTOCOMMIT = 0;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 1;
+let $statement = SET AUTOCOMMIT = 0;
+source extra/binlog_tests/implicit.test;
+
+SET BINLOG_FORMAT = ROW;
+let $prepare = SET AUTOCOMMIT = 0;
+let $statement = SET AUTOCOMMIT = 1;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 1;
+let $statement = SET AUTOCOMMIT = 1;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 0;
+let $statement = SET AUTOCOMMIT = 0;
+source extra/binlog_tests/implicit.test;
+
+let $prepare = SET AUTOCOMMIT = 1;
+let $statement = SET AUTOCOMMIT = 0;
+source extra/binlog_tests/implicit.test;
+
+RESET MASTER;
+SET AUTOCOMMIT = 0;
+INSERT INTO t1 VALUES (1);
+source include/show_binlog_events.inc;
+LOCK TABLES t1 WRITE;
+source include/show_binlog_events.inc;
+INSERT INTO t1 VALUES (2);
+source include/show_binlog_events.inc;
+UNLOCK TABLES;
+source include/show_binlog_events.inc;
+COMMIT;
+source include/show_binlog_events.inc;
+
+# Cleaning up
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_incident.test b/mysql-test/suite/binlog/t/binlog_incident.test
index 901ac49ea24..88e7332e88e 100644
--- a/mysql-test/suite/binlog/t/binlog_incident.test
+++ b/mysql-test/suite/binlog/t/binlog_incident.test
@@ -20,7 +20,7 @@ REPLACE INTO t1 VALUES (4);
DROP TABLE t1;
FLUSH LOGS;
-exec $MYSQL_BINLOG --start-position=106 $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
+exec $MYSQL_BINLOG --start-position=107 $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
--disable_query_log
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
--enable_query_log
diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test
index f84fd65226a..4469fa6224c 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
@@ -155,7 +155,8 @@ reset master;
UPDATE t2,t1 SET t2.a=t1.a+2;
# check
select * from t2 /* must be (3,1), (4,4) */;
-show master status /* there must no UPDATE in binlog */;
+--echo there must no UPDATE in binlog
+source include/show_master_status.inc;
# B. testing multi_update::send_error() execution branch
delete from t1;
@@ -165,7 +166,8 @@ insert into t2 values (1,2),(3,4),(4,4);
reset master;
--error ER_DUP_ENTRY
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
-show master status /* there must be no UPDATE query event */;
+--echo there must no UPDATE in binlog
+source include/show_master_status.inc;
# cleanup bug#27716
drop table t1, t2;
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index e2db326129d..2e261f6fafd 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -51,7 +51,7 @@ reap;
let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=135 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
index ec61271ae88..f9240291dba 100644
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
@@ -24,7 +24,7 @@ update t1 set a=2 /* will be "killed" after work has been done */;
# for some constants like the offset of the first real event
# that is different between severs versions.
let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=107 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
@@ -52,7 +52,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil
source include/show_binlog_events.inc;
---exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--exec $MYSQL_BINLOG --force-if-open --start-position=107 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
diff --git a/mysql-test/suite/federated/federated_debug.test b/mysql-test/suite/federated/federated_debug.test
index 4152d2975b3..2183def4610 100644
--- a/mysql-test/suite/federated/federated_debug.test
+++ b/mysql-test/suite/federated/federated_debug.test
@@ -19,7 +19,7 @@ eval CREATE TABLE t1(a INT) ENGINE=FEDERATED
SELECT * FROM t1;
--echo # Start a asynchronous reload
---exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1
+--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1
--echo # Wait for tables to be closed
let $show_statement= SHOW STATUS LIKE 'Open_tables';
diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result
index 2c20d1c1d57..5079a4dcfa0 100644
--- a/mysql-test/suite/federated/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -197,13 +197,13 @@ select * from federated.t1;
id name
1 this is legitimate
alter server s1 options (database 'db_bogus');
-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
flush tables;
select * from federated.t1;
id name
1 this is legitimate
alter server s1 options (database 'db_bogus');
-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
flush tables;
select * from federated.t1;
id name
@@ -214,7 +214,7 @@ select * from federated.t1;
id name
2 this is bogus
drop server if exists 's1';
-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 server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
@@ -223,7 +223,7 @@ PASSWORD '',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
-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 server 's1';
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf
index 82600949712..67ac440f0df 100644
--- a/mysql-test/suite/federated/my.cnf
+++ b/mysql-test/suite/federated/my.cnf
@@ -1,5 +1,6 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
+!include include/default_client.cnf
[mysqld.1]
log-bin= master-bin
diff --git a/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc b/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
index 2cb9cbc700b..ba51bfce57b 100644
--- a/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
+++ b/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
@@ -15,8 +15,7 @@ let $message= root: create a table with a name of an IS table directly in IS;
let $dd_part1= CREATE TABLE;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/basics_mixed2.inc
-# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
#
# 1.2 CREATE VIEW
@@ -26,8 +25,7 @@ CREATE VIEW tables AS SELECT 'garbage';
--error ER_DBACCESS_DENIED_ERROR
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
# 1.2.2 New view
-# ER_DBACCESS_DENIED_ERROR would be better.
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT 'garbage';
# 2 Attempt to create tables and views when residing in information_schema
@@ -37,8 +35,7 @@ let $message= root: create a table with a name of an IS table from other db;
let $dd_part1= CREATE TABLE information_schema.;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/basics_mixed2.inc
-# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
#
# Hit on existing INFORMATION_SCHEMA table
@@ -48,6 +45,5 @@ CREATE VIEW information_schema.tables AS SELECT 'garbage';
CREATE VIEW information_schema.tables AS
SELECT * FROM information_schema.tables;
# New table
-# ER_DBACCESS_DENIED_ERROR would be better.
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_priv.inc b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
index 8256b51949e..013d9957812 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
@@ -88,13 +88,13 @@ eval ALTER TABLE $table DROP COLUMN $drop_column;
--error ER_DBACCESS_DENIED_ERROR
eval ALTER TABLE $table ADD COLUMN (my_column INT);
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
eval RENAME TABLE $table TO new_$table;
--error ER_DBACCESS_DENIED_ERROR
eval RENAME TABLE $table TO files;
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
eval CREATE TABLE new_$table AS SELECT * FROM $table;
#----------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/datadict/is_tables.inc b/mysql-test/suite/funcs_1/datadict/is_tables.inc
index d1e4608a572..0177ca05e50 100644
--- a/mysql-test/suite/funcs_1/datadict/is_tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_tables.inc
@@ -43,7 +43,7 @@ eval SHOW TABLES FROM information_schema LIKE '$is_table';
# Ensure that the INFORMATION_SCHEMA.TABLES table has the following columns,
# in the following order:
#
-# TABLE_CATALOG (always shows NULL),
+# TABLE_CATALOG (always shows 'def'),
# TABLE_SCHEMA (shows the name of the database, or schema, in which an
# accessible table resides),
# TABLE_NAME (shows the name of a table which the current user may access),
@@ -81,9 +81,9 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
# Note: Retrieval of information within information_schema.columns about
# information_schema.tables is in is_columns_is.test.
-# Show that TABLE_CATALOG is always NULL.
+# Show that TABLE_CATALOG is always 'def'.
SELECT table_catalog, table_schema, table_name
-FROM information_schema.tables WHERE table_catalog IS NOT NULL;
+FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
--echo ################################################################################
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index 4beb0c8aaf2..b19252e4dd7 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -945,8 +945,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
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 left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -960,8 +960,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2096,6 +2096,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2108,6 +2111,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2123,10 +2129,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 if(`t1_values`.`my_binary_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2140,10 +2146,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$--
IS TRUE -1
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -2158,6 +2164,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2170,6 +2179,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2186,7 +2198,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2201,7 +2213,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2587,9 +2599,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2603,9 +2615,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2955,8 +2967,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2970,8 +2982,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -3282,10 +3294,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
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 cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3300,10 +3312,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@@ -3372,9 +3384,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3389,9 +3404,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3408,14 +3426,14 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 cast(`t1_values`.`my_binary_30` as decimal(37,2)) AS `CAST(my_binary_30 AS DECIMAL(37,2))`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3430,14 +3448,14 @@ NULL NULL 1
-1.00 -1
-3333.33 -3333.3333
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -3454,9 +3472,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3471,9 +3492,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3490,12 +3514,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3510,12 +3534,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
index 65fc5b5afc9..3e2d084aa0c 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
@@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
index 5a2c0bb6bdf..a520bdfac36 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
@@ -80,7 +80,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
set @@sql_mode='traditional';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp1()
BEGIN
declare a tinyint;
@@ -97,7 +97,7 @@ END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
+sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
BEGIN
declare a tinyint;
declare count_ int default 1;
@@ -117,10 +117,10 @@ Variable_name Value
sql_mode
CALL sp1();
Variable_name Value
-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
+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
SELECT * from result;
f1 f2
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
+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 value restored
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
sql_mode
@@ -142,7 +142,7 @@ DROP PROCEDURE IF EXISTS sp2;
... show initial value
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp2()
BEGIN
SET @@sql_mode='MAXDB';
@@ -150,7 +150,7 @@ SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
+sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
@@ -158,7 +158,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
... call procedure that changes sql_mode
CALL sp2();
Variable_name Value
@@ -166,7 +166,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
... check whether old value is re-set
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
DROP PROCEDURE sp2;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
index 2e504af6ed4..8b87e583c60 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
@@ -105,7 +105,7 @@ END//
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -132,7 +132,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -159,7 +159,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -184,7 +184,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -323,7 +323,7 @@ ALTER FUNCTION fn_2 MODIFIES SQL DATA;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -350,7 +350,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -377,7 +377,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -402,7 +402,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -534,7 +534,7 @@ ALTER FUNCTION fn_2 CONTAINS SQL;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -561,7 +561,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -588,7 +588,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -613,7 +613,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index b02fba0f38d..012977ae4a3 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -77,7 +77,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -155,7 +155,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -169,7 +169,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -401,7 +401,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -415,7 +415,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
index 476ccc6ebd8..bc3f7daf5bc 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -562,7 +562,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
@@ -609,7 +609,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
@@ -1251,7 +1251,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-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=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1284,7 +1284,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-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 current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index a335e135a4f..eb9713e4bdd 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -22843,6 +22843,9 @@ SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT SQRT('DEF');
SQRT('DEF')
0
@@ -22863,7 +22866,12 @@ SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22871,6 +22879,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22878,6 +22888,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
diff --git a/mysql-test/suite/funcs_1/r/is_basics_mixed.result b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
index 2ae4f96c400..ce0bb69e5ee 100644
--- a/mysql-test/suite/funcs_1/r/is_basics_mixed.result
+++ b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
@@ -73,13 +73,13 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
CREATE TABLE triggers ( c1 INT );
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW tables AS SELECT 'garbage';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW v1 AS SELECT 'garbage';
-ERROR 42S02: Unknown table 'v1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
USE test;
CREATE TABLE information_schema. schemata ( c1 INT );
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -114,14 +114,14 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
CREATE TABLE information_schema. triggers ( c1 INT );
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.tables AS SELECT 'garbage';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.tables AS
SELECT * FROM information_schema.tables;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
-ERROR 42S02: Unknown table 'v1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
GRANT ALL ON *.* TO testuser1@localhost;
@@ -163,13 +163,13 @@ ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'informa
CREATE TABLE triggers ( c1 INT );
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW tables AS SELECT 'garbage';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW v1 AS SELECT 'garbage';
-ERROR 42S02: Unknown table 'v1' in information_schema
+ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
USE test;
CREATE TABLE information_schema. schemata ( c1 INT );
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
@@ -204,14 +204,14 @@ ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'informa
CREATE TABLE information_schema. triggers ( c1 INT );
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.tables AS SELECT 'garbage';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.tables AS
SELECT * FROM information_schema.tables;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
-ERROR 42S02: Unknown table 'v1' in information_schema
+ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
# Switch to connection default (user=root) and close connection testuser1
DROP USER 'testuser1'@'localhost';
###############################################################################
@@ -584,9 +584,7 @@ DROP PROCEDURE IF EXISTS test.p1;
CREATE PROCEDURE test.p1()
INSERT INTO information_schema.tables
SELECT * FROM information_schema.tables LIMIT 1;
-CALL test.p1();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
-DROP PROCEDURE test.p1;
CREATE PROCEDURE test.p1()
UPDATE information_schema.columns SET table_schema = 'garbage';
CALL test.p1();
@@ -594,9 +592,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
DROP PROCEDURE test.p1;
CREATE PROCEDURE test.p1()
DELETE FROM information_schema.schemata;
-CALL test.p1();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
-DROP PROCEDURE test.p1;
#########################################################################
# Testcase 3.2.17.1+3.2.17.2: To be implemented outside of this script
#########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_innodb.result b/mysql-test/suite/funcs_1/r/is_cml_innodb.result
index 7c214cb770f..59b802d7c8b 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_innodb.result
@@ -17,16 +17,16 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
-NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
-NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
-NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
-NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
-NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
-NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
-NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
-NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
-NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
+def test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
+def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
+def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
+def test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
+def test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
+def test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
+def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_memory.result b/mysql-test/suite/funcs_1/r/is_cml_memory.result
index fe4b018cec3..6a4abb1f0b9 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_memory.result
@@ -14,12 +14,12 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
-NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
-NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
-NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
-NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
-NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
+def test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
+def test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
+def test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_myisam.result b/mysql-test/suite/funcs_1/r/is_cml_myisam.result
index 9808b1c1793..e876f108ed8 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_myisam.result
@@ -18,16 +18,16 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
-NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
-NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
-NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
-NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
-NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
-NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
-NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
-NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
-NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
+def test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
+def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
+def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
+def test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
+def test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
+def test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
+def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_ndb.result b/mysql-test/suite/funcs_1/r/is_cml_ndb.result
index b6ccc766d69..22f90433acf 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_ndb.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_ndb.result
@@ -18,16 +18,16 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NO char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) PRI select,insert,update,references
-NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
-NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
-NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
-NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
-NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
-NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
-NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
-NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
-NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
+def test t1 f1 1 NO char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) PRI select,insert,update,references
+def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
+def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
+def test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
+def test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
+def test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
+def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result
index 7b12cf8142d..edf0a401697 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result
@@ -29,7 +29,7 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.COLUMN_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -39,7 +39,7 @@ SHOW CREATE TABLE information_schema.COLUMN_PRIVILEGES;
Table Create Table
COLUMN_PRIVILEGES CREATE TEMPORARY TABLE `COLUMN_PRIVILEGES` (
`GRANTEE` varchar(81) NOT NULL DEFAULT '',
- `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 '',
`COLUMN_NAME` varchar(64) NOT NULL DEFAULT '',
@@ -49,7 +49,7 @@ COLUMN_PRIVILEGES CREATE TEMPORARY TABLE `COLUMN_PRIVILEGES` (
SHOW COLUMNS FROM information_schema.COLUMN_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -86,91 +86,91 @@ SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT NO
-'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT NO
-'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
-'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f1 INSERT NO
+'testuser1'@'localhost' def db_datadict t1 f1 SELECT NO
+'testuser1'@'localhost' def db_datadict t1 f2 UPDATE NO
+'testuser1'@'localhost' def db_datadict t1 f3 SELECT NO
+'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
+'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
GRANT UPDATE(f3) ON db_datadict.t1 TO 'testuser1'@'localhost'
WITH GRANT OPTION;
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT YES
-'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT YES
-'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE YES
-'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT YES
-'testuser1'@'localhost' NULL db_datadict t1 f3 UPDATE YES
-'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
-'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f1 INSERT YES
+'testuser1'@'localhost' def db_datadict t1 f1 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f2 UPDATE YES
+'testuser1'@'localhost' def db_datadict t1 f3 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f3 UPDATE YES
+'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
+'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT YES
-'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT YES
-'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE YES
-'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT YES
-'testuser1'@'localhost' NULL db_datadict t1 f3 UPDATE YES
+'testuser1'@'localhost' def db_datadict t1 f1 INSERT YES
+'testuser1'@'localhost' def db_datadict t1 f1 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f2 UPDATE YES
+'testuser1'@'localhost' def db_datadict t1 f3 SELECT YES
+'testuser1'@'localhost' def db_datadict t1 f3 UPDATE YES
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
+'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
# Establish connection testuser3 (user=testuser3)
# FIXME: Is it correct that granted TABLES do not occur in COLUMN_PRIVILEGES?
SELECT * FROM information_schema.table_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee,table_schema,table_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL db_datadict t1 INSERT YES
-'testuser3'@'localhost' NULL db_datadict t1 SELECT YES
+'testuser3'@'localhost' def db_datadict t1 INSERT YES
+'testuser3'@'localhost' def db_datadict t1 SELECT YES
SELECT * FROM information_schema.schema_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL db_datadict ALTER NO
-'testuser3'@'localhost' NULL db_datadict ALTER ROUTINE NO
-'testuser3'@'localhost' NULL db_datadict CREATE NO
-'testuser3'@'localhost' NULL db_datadict CREATE ROUTINE NO
-'testuser3'@'localhost' NULL db_datadict CREATE TEMPORARY TABLES NO
-'testuser3'@'localhost' NULL db_datadict CREATE VIEW NO
-'testuser3'@'localhost' NULL db_datadict DELETE NO
-'testuser3'@'localhost' NULL db_datadict DROP NO
-'testuser3'@'localhost' NULL db_datadict EVENT NO
-'testuser3'@'localhost' NULL db_datadict EXECUTE NO
-'testuser3'@'localhost' NULL db_datadict INDEX NO
-'testuser3'@'localhost' NULL db_datadict INSERT NO
-'testuser3'@'localhost' NULL db_datadict LOCK TABLES NO
-'testuser3'@'localhost' NULL db_datadict REFERENCES NO
-'testuser3'@'localhost' NULL db_datadict SELECT NO
-'testuser3'@'localhost' NULL db_datadict SHOW VIEW NO
-'testuser3'@'localhost' NULL db_datadict TRIGGER NO
-'testuser3'@'localhost' NULL db_datadict UPDATE NO
+'testuser3'@'localhost' def db_datadict ALTER NO
+'testuser3'@'localhost' def db_datadict ALTER ROUTINE NO
+'testuser3'@'localhost' def db_datadict CREATE NO
+'testuser3'@'localhost' def db_datadict CREATE ROUTINE NO
+'testuser3'@'localhost' def db_datadict CREATE TEMPORARY TABLES NO
+'testuser3'@'localhost' def db_datadict CREATE VIEW NO
+'testuser3'@'localhost' def db_datadict DELETE NO
+'testuser3'@'localhost' def db_datadict DROP NO
+'testuser3'@'localhost' def db_datadict EVENT NO
+'testuser3'@'localhost' def db_datadict EXECUTE NO
+'testuser3'@'localhost' def db_datadict INDEX NO
+'testuser3'@'localhost' def db_datadict INSERT NO
+'testuser3'@'localhost' def db_datadict LOCK TABLES NO
+'testuser3'@'localhost' def db_datadict REFERENCES NO
+'testuser3'@'localhost' def db_datadict SELECT NO
+'testuser3'@'localhost' def db_datadict SHOW VIEW NO
+'testuser3'@'localhost' def db_datadict TRIGGER NO
+'testuser3'@'localhost' def db_datadict UPDATE NO
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
+'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
GRANT SELECT(f1, f3) ON db_datadict.t1 TO 'testuser2'@'localhost';
# FIXME: Is it intended that *my* grants to others are *NOT* shown here?
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
+'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
# Switch to connection testuser2 (user=testuser2)
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' NULL db_datadict t1 f1 SELECT NO
-'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
-'testuser2'@'localhost' NULL db_datadict t1 f3 SELECT NO
+'testuser2'@'localhost' def db_datadict t1 f1 SELECT NO
+'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
+'testuser2'@'localhost' def db_datadict t1 f3 SELECT NO
# Switch to connection default and close connections testuser1,testuser2,testuser3
DROP DATABASE db_datadict;
DROP USER 'testuser1'@'localhost';
@@ -209,8 +209,8 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -221,8 +221,8 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -235,9 +235,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -248,9 +248,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -264,9 +264,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -277,9 +277,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -291,9 +291,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -304,9 +304,9 @@ SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
-'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
-'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 SELECT NO
+'testuser1'@'localhost' def db_datadict my_table f1 UPDATE NO
+'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index e0780a60e2e..479bc0a647a 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.COLUMNS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -50,7 +50,7 @@ COLUMN_COMMENT varchar(255) NO
SHOW CREATE TABLE information_schema.COLUMNS;
Table Create Table
COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
- `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 '',
`COLUMN_NAME` varchar(64) NOT NULL DEFAULT '',
@@ -72,7 +72,7 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLUMNS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -92,7 +92,7 @@ EXTRA varchar(27) NO
PRIVILEGES varchar(80) NO
COLUMN_COMMENT varchar(255) NO
SELECT table_catalog, table_schema, table_name, column_name
-FROM information_schema.columns WHERE table_catalog IS NOT NULL;
+FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name column_name
###############################################################################
# Testcase 3.2.6.2 + 3.2.6.3: INFORMATION_SCHEMA.COLUMNS accessible information
@@ -118,16 +118,16 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
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 db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references
-NULL db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL int(11) PRI auto_increment select,insert,update,references
-NULL db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
-NULL db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL db_datadict t2 f4 4 0 NO int NULL NULL 10 0 NULL NULL int(11) PRI select,insert,update,references
-NULL db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
-NULL db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
+def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references
+def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL int(11) PRI auto_increment select,insert,update,references
+def db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
+def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def db_datadict t2 f4 4 0 NO int NULL NULL 10 0 NULL NULL int(11) PRI select,insert,update,references
+def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
+def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
@@ -149,9 +149,9 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
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 db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select
-NULL db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select
-NULL db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select
+def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select
+def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select
+def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
@@ -166,8 +166,8 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
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 db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
-NULL db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text insert
+def db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
+def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text insert
SHOW COLUMNS FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 't1'
SHOW COLUMNS FROM db_datadict.t2;
@@ -194,7 +194,7 @@ DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
ENGINE = <engine_type>;
SELECT * FROM information_schema.columns
WHERE table_name = 't1_my_table';
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
COLUMN_NAME f1
@@ -399,7 +399,7 @@ AS SELECT 1 AS "col1", 'A' collate latin1_german1_ci AS "col2";
SELECT * FROM information_schema.columns
WHERE table_name = 't1_my_tablex'
ORDER BY table_name, column_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
COLUMN_NAME col1
@@ -418,7 +418,7 @@ COLUMN_KEY
EXTRA
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
COLUMN_NAME col2
diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
index 73a74e4d7a2..1fac7ca83db 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -383,332 +383,332 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f1 1 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
-NULL test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
-NULL test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f2 2 NULL YES char 0 0 NULL NULL latin1 latin1_bin char(0) select,insert,update,references
-NULL test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb1 f3 3 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
-NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
-NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
-NULL test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
-NULL test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
-NULL test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
-NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
-NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
-NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
-NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
-NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
-NULL test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
-NULL test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references
-NULL test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
-NULL test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references
-NULL test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references
-NULL test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references
-NULL test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
-NULL test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f1 1 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f2 2 NULL YES char 0 0 NULL NULL latin1 latin1_bin char(0) select,insert,update,references
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb1 f3 3 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
+def test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
+def test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
+def test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references
+def test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
+def test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references
+def test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references
+def test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references
+def test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index fe2d5e7e5e5..e10c775c227 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -3,303 +3,303 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60) select
-NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) select
-NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
-NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) select
-NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
-NULL information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema EVENTS EVENT_CATALOG 1 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
-NULL information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
-NULL information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256) select
-NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
-NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
-NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
-NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
-NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
-NULL information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
-NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
-NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
-NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
-NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10) select
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
-NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
-NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
-NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
-NULL information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
-NULL information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7) select
-NULL information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema ROUTINES COLLATION_CONNECTION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
-NULL information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
-NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
-NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
-NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
-NULL information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
-NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
-NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) select
-NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
-NULL information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
-NULL information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) select
-NULL information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
-NULL information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2) select
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3) select
-NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
-NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
-NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
-NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
-NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
-NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
-NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
-NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
-NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
-NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
-NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60) select
+def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
+def information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) select
+def information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) select
+def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema COLUMNS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
+def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
+def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
+def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
+def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256) select
+def information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
+def information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
+def information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
+def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
+def information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
+def information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES TABLE_CATALOG 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
+def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10) select
+def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
+def information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
+def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
+def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+def information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
+def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+def information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7) select
+def information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema ROUTINES COLLATION_CONNECTION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema ROUTINES DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
+def information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
+def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema ROUTINES ROUTINE_COMMENT 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
+def information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
+def information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
+def information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SCHEMATA CATALOG_NAME 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
+def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
+def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) select
+def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+def information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+def information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) select
+def information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
+def information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2) select
+def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3) select
+def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
+def information_schema TABLES TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+def information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
+def information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+def information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
+def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
+def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
+def information_schema TRIGGERS TRIGGER_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
+def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
+def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
+def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
+def information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -487,7 +487,7 @@ NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NU
3.0000 information_schema PARTITIONS SUBPARTITION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema PARTITIONS PARTITION_METHOD varchar 12 36 utf8 utf8_general_ci varchar(12)
+3.0000 information_schema PARTITIONS PARTITION_METHOD varchar 18 54 utf8 utf8_general_ci varchar(18)
3.0000 information_schema PARTITIONS SUBPARTITION_METHOD varchar 12 36 utf8 utf8_general_ci varchar(12)
1.0000 information_schema PARTITIONS PARTITION_EXPRESSION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
1.0000 information_schema PARTITIONS SUBPARTITION_EXPRESSION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
@@ -552,7 +552,7 @@ NULL information_schema PROCESSLIST TIME int NULL NULL NULL NULL int(7)
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
-3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
+1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 0ac5e58d855..52d0ac3eef5 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -3,303 +3,303 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60)
-NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11)
-NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
-NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27)
-NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
-NULL information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
-NULL information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema EVENTS EVENT_CATALOG 1 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
-NULL information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
-NULL information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256)
-NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
-NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
-NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
-NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
-NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
-NULL information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
-NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
-NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
-NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
-NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
-NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
-NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10)
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
-NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
-NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
-NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
-NULL information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
-NULL information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
-NULL information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
-NULL information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
-NULL information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7)
-NULL information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema ROUTINES COLLATION_CONNECTION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema ROUTINES DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
-NULL information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
-NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
-NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
-NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
-NULL information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
-NULL information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
-NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21)
-NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1)
-NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
-NULL information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
-NULL information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1)
-NULL information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
-NULL information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2)
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3)
-NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
-NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
-NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
-NULL information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
-NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
-NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
-NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
-NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
-NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
-NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
-NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
-NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
-NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
-NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
-NULL information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
-NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60)
+def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11)
+def information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27)
+def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema COLUMNS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
+def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256)
+def information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
+def information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_CATALOG 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7)
+def information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES COLLATION_CONNECTION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema ROUTINES DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
+def information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMATA CATALOG_NAME 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21)
+def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1)
+def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1)
+def information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2)
+def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema TABLES TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
+def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
+def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema TRIGGERS TRIGGER_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
+def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result
index 513d7bdfac6..b2a798c938c 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -372,317 +372,317 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb1 f12 4 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb1 f13 5 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb1 f14 6 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb1 f15 7 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f16 8 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f17 9 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb1 f18 10 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb1 f19 11 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
-NULL test tb1 f20 12 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f21 13 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb1 f22 14 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb1 f23 15 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f24 16 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f25 17 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f26 18 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb1 f30 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb1 f31 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f32 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f36 28 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f37 29 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f38 30 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb1 f39 31 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f40 32 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb1 f41 33 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f42 34 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f43 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f44 36 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f45 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f46 38 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb1 f47 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f48 40 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb1 f49 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f50 42 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f51 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f52 44 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f53 45 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f54 46 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f55 47 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f56 48 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f57 49 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f58 50 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
-NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f121 4 NULL YES char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references
-NULL test tb3 f122 5 NULL YES char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references
-NULL test tb3 f129 6  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb3 f130 7 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb3 f131 8 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb3 f132 9 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f133 10 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f134 11 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb3 f135 12 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb3 f136 13 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f137 14 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f138 15 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb3 f139 16 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb3 f140 17 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f141 18 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f142 19 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb3 f147 24 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f153 30 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f154 31 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f155 32 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb3 f156 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f157 34 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb3 f158 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f159 36 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f160 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f161 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f162 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f163 40 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb3 f164 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f165 42 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb3 f166 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f167 44 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f168 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f169 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f170 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f171 48 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f172 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f173 50 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f174 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f175 52 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references
-NULL test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references
-NULL test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references
-NULL test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references
-NULL test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references
-NULL test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
-NULL test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb1 f12 4 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb1 f13 5 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb1 f14 6 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb1 f15 7 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f16 8 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f17 9 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb1 f18 10 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb1 f19 11 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
+def test tb1 f20 12 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f21 13 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb1 f22 14 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb1 f23 15 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f24 16 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f25 17 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f26 18 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb1 f30 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb1 f31 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f32 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f36 28 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f37 29 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f38 30 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb1 f39 31 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f40 32 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb1 f41 33 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f42 34 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f43 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f44 36 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f45 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f46 38 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb1 f47 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f48 40 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb1 f49 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f50 42 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f51 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f52 44 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f53 45 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f54 46 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f55 47 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f56 48 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f57 49 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f58 50 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
+def test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f121 4 NULL YES char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references
+def test tb3 f122 5 NULL YES char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references
+def test tb3 f129 6  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb3 f130 7 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb3 f131 8 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb3 f132 9 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f133 10 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f134 11 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb3 f135 12 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb3 f136 13 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f137 14 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f138 15 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb3 f139 16 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb3 f140 17 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f141 18 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f142 19 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb3 f147 24 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f153 30 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f154 31 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f155 32 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb3 f156 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f157 34 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb3 f158 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f159 36 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f160 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f161 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f162 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f163 40 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb3 f164 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f165 42 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb3 f166 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f167 44 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f168 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f169 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f170 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f171 48 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f172 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f173 50 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f174 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f175 52 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references
+def test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references
+def test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references
+def test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references
+def test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references
+def test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
index a95ca4f0ebf..b7c972c7238 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -412,357 +412,357 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
-NULL test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
-NULL test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
-NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
-NULL test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
-NULL test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
-NULL test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
-NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
-NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
-NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
-NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
-NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
-NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
-NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
-NULL test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
-NULL test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
-NULL test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
-NULL test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
-NULL test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
-NULL test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
-NULL test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
-NULL test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
-NULL test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
-NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
-NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
-NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
-NULL test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
-NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references
-NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references
-NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references
-NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references
-NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references
-NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
-NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references
-NULL test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
-NULL test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
-NULL test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
-NULL test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
-NULL test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
-NULL test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
-NULL test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
-NULL test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
-NULL test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
-NULL test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
-NULL test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
-NULL test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
-NULL test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
-NULL test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
-NULL test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
-NULL test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
-NULL test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
-NULL test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
-NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) select,insert,update,references
+def test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1) select,insert,update,references
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) select,insert,update,references
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill select,insert,update,references
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) select,insert,update,references
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill select,insert,update,references
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) select,insert,update,references
+def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned select,insert,update,references
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill select,insert,update,references
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
+def test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
+def test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references
+def test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references
+def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references
+def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references
+def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references
+def test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
+def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
+def test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
+def test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
+def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
+def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
+def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) select,insert,update,references
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned select,insert,update,references
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float select,insert,update,references
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double select,insert,update,references
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned select,insert,update,references
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned select,insert,update,references
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill select,insert,update,references
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index 2721dcf3c6e..55f7ebf91ae 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -412,357 +412,357 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
-NULL test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob
-NULL test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1)
-NULL test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4)
-NULL test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
-NULL test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
-NULL test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
-NULL test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6)
-NULL test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
-NULL test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
-NULL test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1)
-NULL test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
-NULL test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9)
-NULL test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned
-NULL test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
-NULL test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
-NULL test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
-NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
-NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20)
-NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
-NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0)
-NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext
-NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
-NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30)
-NULL test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
-NULL test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text
-NULL test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0)
-NULL test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext
-NULL test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext
-NULL test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob
-NULL test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob
-NULL test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date
-NULL test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time
-NULL test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
-NULL test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
-NULL test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
-NULL test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
-NULL test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
-NULL test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
-NULL test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double
-NULL test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double
-NULL test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double
-NULL test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
-NULL test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1)
-NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
-NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext
-NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text
-NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext
-NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext
-NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob
-NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob
-NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob
-NULL test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1)
-NULL test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4)
-NULL test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
-NULL test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
-NULL test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
-NULL test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6)
-NULL test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
-NULL test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
-NULL test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
-NULL test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9)
-NULL test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned
-NULL test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
-NULL test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
-NULL test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11)
-NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
-NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
-NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20)
-NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0)
-NULL test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
-NULL test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
-NULL test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
-NULL test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0)
-NULL test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
-NULL test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30)
-NULL test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
-NULL test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double
-NULL test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double
-NULL test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float
-NULL test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float
-NULL test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float
-NULL test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float
-NULL test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double
-NULL test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time
-NULL test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
-NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
-NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
-NULL test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255)
-NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60)
-NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255)
-NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0)
-NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000)
-NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120)
-NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100)
-NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30)
-NULL test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date
-NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time
-NULL test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
-NULL test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
-NULL test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
-NULL test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
-NULL test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
-NULL test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
-NULL test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
-NULL test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
-NULL test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
-NULL test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
-NULL test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
-NULL test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
-NULL test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
-NULL test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
-NULL test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
-NULL test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
-NULL test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double
-NULL test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double
-NULL test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float
-NULL test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double
-NULL test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
-NULL test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
-NULL test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
-NULL test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
-NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
-NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
-NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
-NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1)
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4)
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6)
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1)
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9)
+def test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned
+def test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
+def test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20)
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
+def test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0)
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30)
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0)
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date
+def test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time
+def test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
+def test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
+def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
+def test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1)
+def test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1)
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4)
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6)
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9)
+def test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11)
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20)
+def test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0)
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0)
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30)
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4)
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
+def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255)
+def test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60)
+def test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255)
+def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0)
+def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000)
+def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120)
+def test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100)
+def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30)
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date
+def test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time
+def test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4)
+def test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum')
+def test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set')
+def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27)
+def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64)
+def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192)
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0)
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30)
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL double unsigned
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL float unsigned
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL double unsigned
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL double unsigned zerofill
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL float unsigned zerofill
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20)
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25)
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index 98eeacdb74c..bd548ac0a25 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -2,219 +2,220 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, column_name;
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 mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
-NULL mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
-NULL mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Event_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Trigger_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
-NULL mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL mysql event character_set_client 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql event collation_connection 20 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
-NULL mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql event db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql event db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql event definer 4 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
-NULL mysql event ends 12 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL mysql event interval_field 7 NULL YES enum 18 54 NULL NULL utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') select,insert,update,references
-NULL mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
-NULL mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE') select,insert,update,references
-NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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') select,insert,update,references
-NULL mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
-NULL mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references
-NULL mysql event time_zone 18 SYSTEM NO char 64 64 NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references
-NULL mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
-NULL mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) select,insert,update,references
-NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate') select,insert,update,references
-NULL mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
-NULL mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
-NULL mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
-NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references
-NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
-NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
-NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
-NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
-NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
-NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
-NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
-NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
-NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI select,insert,update,references
-NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) select,insert,update,references
-NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
-NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
-NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
-NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
-NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
-NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
-NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL') select,insert,update,references
-NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
-NULL mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
-NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
-NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
-NULL mysql proc sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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') select,insert,update,references
-NULL mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
-NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
-NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references
-NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
-NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
-NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
-NULL mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Password 5 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL int(4) select,insert,update,references
-NULL mysql servers Server_name 1 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
-NULL mysql servers Socket 7 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Username 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql servers Wrapper 8 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
-NULL mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
-NULL mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
-NULL mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
-NULL mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
-NULL mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
-NULL mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
-NULL mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references
-NULL mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
-NULL mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
-NULL mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references
-NULL mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N') select,insert,update,references
-NULL mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
-NULL mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
-NULL mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
-NULL mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
-NULL mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8) select,insert,update,references
-NULL mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
-NULL mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
-NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Event_priv 30 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
-NULL mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user max_connections 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
-NULL mysql user max_questions 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
-NULL mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
-NULL mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
-NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
-NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user ssl_cipher 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL mysql user ssl_type 32 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references
-NULL mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
-NULL mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
-NULL mysql user x509_issuer 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
-NULL mysql user x509_subject 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
+def mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Event_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Trigger_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
+def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql event db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql event db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql event definer 4 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
+def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') select,insert,update,references
+def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
+def mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE') select,insert,update,references
+def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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') select,insert,update,references
+def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select,insert,update,references
+def mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references
+def mysql event time_zone 18 SYSTEM NO char 64 64 NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references
+def mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
+def mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) select,insert,update,references
+def mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate') select,insert,update,references
+def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
+def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
+def mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
+def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references
+def mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
+def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
+def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
+def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
+def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
+def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
+def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
+def mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
+def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI select,insert,update,references
+def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) select,insert,update,references
+def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references
+def mysql plugin dl 2 NO varchar 128 384 NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references
+def mysql plugin name 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) PRI select,insert,update,references
+def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references
+def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
+def mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
+def mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
+def mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL') select,insert,update,references
+def mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
+def mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
+def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+def mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
+def mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
+def mysql proc sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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') select,insert,update,references
+def mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
+def mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
+def mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references
+def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
+def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
+def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Password 5 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL int(4) select,insert,update,references
+def mysql servers Server_name 1 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
+def mysql servers Socket 7 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Username 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql servers Wrapper 8 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
+def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references
+def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
+def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
+def mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
+def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
+def mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
+def mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
+def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references
+def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references
+def mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N') select,insert,update,references
+def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
+def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
+def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
+def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
+def mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8) select,insert,update,references
+def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
+def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
+def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Event_priv 30 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
+def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
+def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
+def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
+def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
+def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user ssl_cipher 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def mysql user ssl_type 33 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references
+def mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -233,6 +234,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 char latin1 latin1_bin
1.0000 char latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
+1.0000 text utf8 utf8_bin
1.0000 mediumtext utf8 utf8_general_ci
1.0000 text utf8 utf8_general_ci
SELECT DISTINCT
@@ -386,8 +388,8 @@ NULL mysql ndb_binlog_index inserts bigint NULL NULL NULL NULL bigint(20) unsign
NULL mysql ndb_binlog_index updates bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql ndb_binlog_index deletes bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql ndb_binlog_index schemaops bigint NULL NULL NULL NULL bigint(20) unsigned
-3.0000 mysql plugin name char 64 192 utf8 utf8_bin char(64)
-3.0000 mysql plugin dl char 128 384 utf8 utf8_bin char(128)
+3.0000 mysql plugin name varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
@@ -403,7 +405,7 @@ NULL mysql ndb_binlog_index schemaops bigint NULL NULL NULL NULL bigint(20) unsi
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
3.0000 mysql proc sql_mode set 478 1434 utf8 utf8_general_ci 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')
-3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
+1.0000 mysql proc comment text 65535 65535 utf8 utf8_bin text
3.0000 mysql proc character_set_client char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc collation_connection char 32 96 utf8 utf8_bin char(32)
3.0000 mysql proc db_collation char 32 96 utf8 utf8_bin char(32)
@@ -489,6 +491,7 @@ NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(
3.0000 mysql user Create_user_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
+3.0000 mysql user Create_tablespace_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index 9c9d3cd26de..d8322ed1660 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -2,219 +2,219 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, column_name;
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 mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
-NULL mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
-NULL mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Event_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Trigger_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
-NULL mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL mysql event character_set_client 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql event collation_connection 20 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
-NULL mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql event db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql event db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql event definer 4 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
-NULL mysql event ends 12 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL mysql event interval_field 7 NULL YES enum 18 54 NULL NULL utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
-NULL mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
-NULL mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
-NULL mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE')
-NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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')
-NULL mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
-NULL mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
-NULL mysql event time_zone 18 SYSTEM NO char 64 64 NULL NULL latin1 latin1_swedish_ci char(64)
-NULL mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128)
-NULL mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1)
-NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate')
-NULL mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
-NULL mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
-NULL mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
-NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI
-NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
-NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
-NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
-NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
-NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
-NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
-NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
-NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
-NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
-NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI
-NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255)
-NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128)
-NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
-NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
-NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
-NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO')
-NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL')
-NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
-NULL mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
-NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
-NULL mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
-NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER')
-NULL mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
-NULL mysql proc sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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')
-NULL mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI
-NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
-NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
-NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI
-NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
-NULL mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Password 5 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL int(4)
-NULL mysql servers Server_name 1 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
-NULL mysql servers Socket 7 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Username 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql servers Wrapper 8 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
-NULL mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
-NULL mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time
-NULL mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time
-NULL mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
-NULL mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
-NULL mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
-NULL mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
-NULL mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
-NULL mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
-NULL mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
-NULL mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
-NULL mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment
-NULL mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N')
-NULL mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
-NULL mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
-NULL mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
-NULL mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
-NULL mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8)
-NULL mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
-NULL mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11)
-NULL mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
-NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Event_priv 30 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-NULL mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user max_connections 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
-NULL mysql user max_questions 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
-NULL mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
-NULL mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
-NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41)
-NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user ssl_cipher 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
-NULL mysql user ssl_type 32 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
-NULL mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-NULL mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
-NULL mysql user x509_issuer 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
-NULL mysql user x509_subject 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
+def mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
+def mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Event_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Trigger_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
+def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql event db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql event db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql event definer 4 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
+def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
+def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
+def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
+def mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
+def mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE')
+def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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')
+def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
+def mysql event time_zone 18 SYSTEM NO char 64 64 NULL NULL latin1 latin1_swedish_ci char(64)
+def mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128)
+def mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1)
+def mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate')
+def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
+def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
+def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI
+def mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
+def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
+def mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
+def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
+def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
+def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
+def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
+def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
+def mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
+def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI
+def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255)
+def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql plugin dl 2 NO varchar 128 384 NULL NULL utf8 utf8_general_ci varchar(128)
+def mysql plugin name 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) PRI
+def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
+def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
+def mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
+def mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO')
+def mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL')
+def mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
+def mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
+def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
+def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
+def mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER')
+def mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
+def mysql proc sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci 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')
+def mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI
+def mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
+def mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
+def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI
+def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Password 5 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL int(4)
+def mysql servers Server_name 1 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
+def mysql servers Socket 7 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Username 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql servers Wrapper 8 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
+def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time
+def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time
+def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
+def mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
+def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
+def mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
+def mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
+def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
+def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment
+def mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N')
+def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
+def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
+def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
+def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
+def mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8)
+def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
+def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11)
+def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
+def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Event_priv 30 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user max_connections 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
+def mysql user max_questions 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
+def mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
+def mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
+def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41)
+def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user ssl_cipher 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
+def mysql user ssl_type 32 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
+def mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql user x509_issuer 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
+def mysql user x509_subject 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -386,8 +386,8 @@ NULL mysql ndb_binlog_index inserts bigint NULL NULL NULL NULL bigint(20) unsign
NULL mysql ndb_binlog_index updates bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql ndb_binlog_index deletes bigint NULL NULL NULL NULL bigint(20) unsigned
NULL mysql ndb_binlog_index schemaops bigint NULL NULL NULL NULL bigint(20) unsigned
-3.0000 mysql plugin name char 64 192 utf8 utf8_bin char(64)
-3.0000 mysql plugin dl char 128 384 utf8 utf8_bin char(128)
+3.0000 mysql plugin name varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
diff --git a/mysql-test/suite/funcs_1/r/is_columns_ndb.result b/mysql-test/suite/funcs_1/r/is_columns_ndb.result
index dcaceec337e..8a1691ec7d2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_ndb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_ndb.result
@@ -63,56 +63,56 @@ SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
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 test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result
index 6dfe5899bf4..1efab272919 100644
--- a/mysql-test/suite/funcs_1/r/is_events.result
+++ b/mysql-test/suite/funcs_1/r/is_events.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.EVENTS;
Field Type Null Key Default Extra
-EVENT_CATALOG varchar(64) YES NULL
+EVENT_CATALOG varchar(64) NO
EVENT_SCHEMA varchar(64) NO
EVENT_NAME varchar(64) NO
DEFINER varchar(77) NO
@@ -55,7 +55,7 @@ DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE information_schema.EVENTS;
Table Create Table
EVENTS CREATE TEMPORARY TABLE `EVENTS` (
- `EVENT_CATALOG` varchar(64) DEFAULT NULL,
+ `EVENT_CATALOG` varchar(64) NOT NULL DEFAULT '',
`EVENT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`EVENT_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
@@ -82,7 +82,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.EVENTS;
Field Type Null Key Default Extra
-EVENT_CATALOG varchar(64) YES NULL
+EVENT_CATALOG varchar(64) NO
EVENT_SCHEMA varchar(64) NO
EVENT_NAME varchar(64) NO
DEFINER varchar(77) NO
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index 2b223d9b34f..a81452b7927 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -28,10 +28,10 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.KEY_COLUMN_USAGE;
Field Type Null Key Default Extra
-CONSTRAINT_CATALOG varchar(512) YES NULL
+CONSTRAINT_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -43,10 +43,10 @@ REFERENCED_COLUMN_NAME varchar(64) YES NULL
SHOW CREATE TABLE information_schema.KEY_COLUMN_USAGE;
Table Create Table
KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` (
- `CONSTRAINT_CATALOG` varchar(512) DEFAULT NULL,
+ `CONSTRAINT_CATALOG` varchar(512) NOT NULL DEFAULT '',
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '',
- `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 '',
`COLUMN_NAME` varchar(64) NOT NULL DEFAULT '',
@@ -58,10 +58,10 @@ KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE;
Field Type Null Key Default Extra
-CONSTRAINT_CATALOG varchar(512) YES NULL
+CONSTRAINT_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@@ -75,6 +75,51 @@ table_schema, table_name, column_name
FROM information_schema.key_column_usage
WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
+def mysql PRIMARY def mysql columns_priv Host
+def mysql PRIMARY def mysql columns_priv Db
+def mysql PRIMARY def mysql columns_priv User
+def mysql PRIMARY def mysql columns_priv Table_name
+def mysql PRIMARY def mysql columns_priv Column_name
+def mysql PRIMARY def mysql db Host
+def mysql PRIMARY def mysql db Db
+def mysql PRIMARY def mysql db User
+def mysql PRIMARY def mysql event db
+def mysql PRIMARY def mysql event name
+def mysql PRIMARY def mysql func name
+def mysql PRIMARY def mysql help_category help_category_id
+def mysql name def mysql help_category name
+def mysql PRIMARY def mysql help_keyword help_keyword_id
+def mysql name def mysql help_keyword name
+def mysql PRIMARY def mysql help_relation help_keyword_id
+def mysql PRIMARY def mysql help_relation help_topic_id
+def mysql PRIMARY def mysql help_topic help_topic_id
+def mysql name def mysql help_topic name
+def mysql PRIMARY def mysql host Host
+def mysql PRIMARY def mysql host Db
+def mysql PRIMARY def mysql ndb_binlog_index epoch
+def mysql PRIMARY def mysql plugin name
+def mysql PRIMARY def mysql proc db
+def mysql PRIMARY def mysql proc name
+def mysql PRIMARY def mysql proc type
+def mysql PRIMARY def mysql procs_priv Host
+def mysql PRIMARY def mysql procs_priv Db
+def mysql PRIMARY def mysql procs_priv User
+def mysql PRIMARY def mysql procs_priv Routine_name
+def mysql PRIMARY def mysql procs_priv Routine_type
+def mysql PRIMARY def mysql servers Server_name
+def mysql PRIMARY def mysql tables_priv Host
+def mysql PRIMARY def mysql tables_priv Db
+def mysql PRIMARY def mysql tables_priv User
+def mysql PRIMARY def mysql tables_priv Table_name
+def mysql PRIMARY def mysql time_zone Time_zone_id
+def mysql PRIMARY def mysql time_zone_leap_second Transition_time
+def mysql PRIMARY def mysql time_zone_name Name
+def mysql PRIMARY def mysql time_zone_transition Time_zone_id
+def mysql PRIMARY def mysql time_zone_transition Transition_time
+def mysql PRIMARY def mysql time_zone_transition_type Time_zone_id
+def mysql PRIMARY def mysql time_zone_transition_type Transition_type_id
+def mysql PRIMARY def mysql user Host
+def mysql PRIMARY def mysql user User
########################################################################################
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information
########################################################################################
@@ -100,22 +145,22 @@ WHERE table_name LIKE 't1_%'
ORDER BY constraint_catalog, constraint_schema, constraint_name,
table_catalog, table_schema, table_name, ordinal_position;
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 db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
-NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
+def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
+def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.key_column_usage
WHERE table_name LIKE 't1_%'
ORDER BY constraint_catalog, constraint_schema, constraint_name,
table_catalog, table_schema, table_name, ordinal_position;
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 db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
+def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.key_column_usage
WHERE table_name LIKE 't1_%'
ORDER BY constraint_catalog, constraint_schema, constraint_name,
table_catalog, table_schema, table_name, ordinal_position;
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 db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
+def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
# Switch to connection default and close connections testuser1, testuser2
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
@@ -137,10 +182,10 @@ DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
ENGINE = <engine_type>;
SELECT * FROM information_schema.key_column_usage
WHERE table_name = 't1_my_table';
-CONSTRAINT_CATALOG NULL
+CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME PRIMARY
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
COLUMN_NAME f1
@@ -149,10 +194,10 @@ POSITION_IN_UNIQUE_CONSTRAINT NULL
REFERENCED_TABLE_SCHEMA NULL
REFERENCED_TABLE_NAME NULL
REFERENCED_COLUMN_NAME NULL
-CONSTRAINT_CATALOG NULL
+CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME PRIMARY
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
COLUMN_NAME f2
diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index 14a7107778c..8e37b995322 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -29,7 +29,7 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.ROUTINES;
Field Type Null Key Default Extra
SPECIFIC_NAME varchar(64) NO
-ROUTINE_CATALOG varchar(512) YES NULL
+ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
ROUTINE_TYPE varchar(9) NO
@@ -46,7 +46,7 @@ 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 varchar(64) NO
+ROUTINE_COMMENT longtext NO NULL
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
@@ -55,7 +55,7 @@ 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) DEFAULT NULL,
+ `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 '',
@@ -72,7 +72,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`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` varchar(64) 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 '',
@@ -81,7 +81,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
SHOW COLUMNS FROM information_schema.ROUTINES;
Field Type Null Key Default Extra
SPECIFIC_NAME varchar(64) NO
-ROUTINE_CATALOG varchar(512) YES NULL
+ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
ROUTINE_TYPE varchar(9) NO
@@ -98,7 +98,7 @@ 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 varchar(64) NO
+ROUTINE_COMMENT longtext NO NULL
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
@@ -117,6 +117,8 @@ OR external_language IS NOT NULL OR sql_path IS NOT NULL
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
OR specific_name <> routine_name);
specific_name routine_catalog routine_schema routine_name routine_type routine_body external_name external_language parameter_style sql_path
+function_for_routines def test function_for_routines FUNCTION SQL NULL NULL SQL NULL
+sp_for_routines def test sp_for_routines PROCEDURE SQL NULL NULL SQL NULL
DROP PROCEDURE sp_for_routines;
DROP FUNCTION function_for_routines;
################################################################################
@@ -163,12 +165,12 @@ FLUSH PRIVILEGES;
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.routines;
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
-sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+sp_6_408002_1 def db_datadict sp_6_408002_1 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.routines;
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
-sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
# Establish connection testuser3 (user=testuser3)
SELECT * FROM information_schema.routines;
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
@@ -192,7 +194,7 @@ CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
ORDER BY routine_name;
SPECIFIC_NAME function_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
@@ -215,7 +217,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
@@ -242,7 +244,7 @@ ALTER FUNCTION function_for_routines COMMENT 'updated comments';
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
ORDER BY routine_name;
SPECIFIC_NAME function_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
@@ -265,7 +267,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
@@ -296,7 +298,7 @@ CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
ORDER BY routine_name;
SPECIFIC_NAME function_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
@@ -319,7 +321,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
@@ -484,7 +486,7 @@ abc 98765 99999999 98765 2010
SELECT *, LENGTH(routine_definition) FROM information_schema.routines
WHERE routine_schema = 'db_datadict';
SPECIFIC_NAME sp_6_408004
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_6_408004
ROUTINE_TYPE PROCEDURE
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges.result b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
index 64cc887f18f..40e9b8d8bd7 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
@@ -29,7 +29,7 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.SCHEMA_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
PRIVILEGE_TYPE varchar(64) NO
IS_GRANTABLE varchar(3) NO
@@ -37,7 +37,7 @@ SHOW CREATE TABLE information_schema.SCHEMA_PRIVILEGES;
Table Create Table
SCHEMA_PRIVILEGES CREATE TEMPORARY TABLE `SCHEMA_PRIVILEGES` (
`GRANTEE` varchar(81) NOT NULL DEFAULT '',
- `TABLE_CATALOG` varchar(512) DEFAULT NULL,
+ `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '',
`IS_GRANTABLE` varchar(3) NOT NULL DEFAULT ''
@@ -45,13 +45,45 @@ SCHEMA_PRIVILEGES CREATE TEMPORARY TABLE `SCHEMA_PRIVILEGES` (
SHOW COLUMNS FROM information_schema.SCHEMA_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
PRIVILEGE_TYPE varchar(64) NO
IS_GRANTABLE varchar(3) NO
SELECT GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, PRIVILEGE_TYPE
FROM information_schema.schema_privileges WHERE table_catalog IS NOT NULL;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE
+''@'%' def test SELECT
+''@'%' def test INSERT
+''@'%' def test UPDATE
+''@'%' def test DELETE
+''@'%' def test CREATE
+''@'%' def test DROP
+''@'%' def test REFERENCES
+''@'%' def test INDEX
+''@'%' def test ALTER
+''@'%' def test CREATE TEMPORARY TABLES
+''@'%' def test LOCK TABLES
+''@'%' def test CREATE VIEW
+''@'%' def test SHOW VIEW
+''@'%' def test CREATE ROUTINE
+''@'%' def test EVENT
+''@'%' def test TRIGGER
+''@'%' def test\_% SELECT
+''@'%' def test\_% INSERT
+''@'%' def test\_% UPDATE
+''@'%' def test\_% DELETE
+''@'%' def test\_% CREATE
+''@'%' def test\_% DROP
+''@'%' def test\_% REFERENCES
+''@'%' def test\_% INDEX
+''@'%' def test\_% ALTER
+''@'%' def test\_% CREATE TEMPORARY TABLES
+''@'%' def test\_% LOCK TABLES
+''@'%' def test\_% CREATE VIEW
+''@'%' def test\_% SHOW VIEW
+''@'%' def test\_% CREATE ROUTINE
+''@'%' def test\_% EVENT
+''@'%' def test\_% TRIGGER
###############################################################################
# Testcase 3.2.15.2-3.2.15.4 INFORMATION_SCHEMA.SCHEMA_PRIVILEGES accessibility
###############################################################################
@@ -86,8 +118,8 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema LIKE 'db_datadict%'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict_1 INSERT NO
-'testuser1'@'localhost' NULL db_datadict_4 SELECT YES
+'testuser1'@'localhost' def db_datadict_1 INSERT NO
+'testuser1'@'localhost' def db_datadict_4 SELECT YES
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -106,9 +138,9 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema LIKE 'db_datadict%'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' NULL db_datadict_1 SELECT NO
-'testuser2'@'localhost' NULL db_datadict_3 SELECT NO
-'testuser2'@'localhost' NULL db_datadict_4 SELECT NO
+'testuser2'@'localhost' def db_datadict_1 SELECT NO
+'testuser2'@'localhost' def db_datadict_3 SELECT NO
+'testuser2'@'localhost' def db_datadict_4 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
@@ -122,11 +154,11 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema LIKE 'db_datadict%'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict_1 INSERT NO
-'testuser1'@'localhost' NULL db_datadict_4 SELECT YES
-'testuser2'@'localhost' NULL db_datadict_1 SELECT NO
-'testuser2'@'localhost' NULL db_datadict_3 SELECT NO
-'testuser2'@'localhost' NULL db_datadict_4 SELECT NO
+'testuser1'@'localhost' def db_datadict_1 INSERT NO
+'testuser1'@'localhost' def db_datadict_4 SELECT YES
+'testuser2'@'localhost' def db_datadict_1 SELECT NO
+'testuser2'@'localhost' def db_datadict_3 SELECT NO
+'testuser2'@'localhost' def db_datadict_4 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -168,98 +200,98 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict UPDATE NO
+'testuser1'@'localhost' def db_datadict UPDATE NO
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict UPDATE NO
+'testuser1'@'localhost' def db_datadict UPDATE NO
# Switch to connection default
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT NO
-'testuser1'@'localhost' NULL db_datadict UPDATE NO
+'testuser1'@'localhost' def db_datadict SELECT NO
+'testuser1'@'localhost' def db_datadict UPDATE NO
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT NO
-'testuser1'@'localhost' NULL db_datadict UPDATE NO
+'testuser1'@'localhost' def db_datadict SELECT NO
+'testuser1'@'localhost' def db_datadict UPDATE NO
# Switch to connection default
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
-'testuser1'@'localhost' NULL db_datadict UPDATE YES
+'testuser1'@'localhost' def db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict UPDATE YES
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
-'testuser1'@'localhost' NULL db_datadict UPDATE YES
+'testuser1'@'localhost' def db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict UPDATE YES
# Switch to connection default
DROP SCHEMA db_datadict;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
-'testuser1'@'localhost' NULL db_datadict UPDATE YES
+'testuser1'@'localhost' def db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict UPDATE YES
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
-'testuser1'@'localhost' NULL db_datadict UPDATE YES
+'testuser1'@'localhost' def db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict UPDATE YES
# Switch to connection default
REVOKE UPDATE ON db_datadict.* FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict SELECT YES
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict SELECT YES
+'testuser1'@'localhost' def db_datadict SELECT YES
# Switch to connection default
RENAME USER 'testuser1'@'localhost' TO 'the_user'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'the_user'@'localhost' NULL db_datadict SELECT YES
+'the_user'@'localhost' def db_datadict SELECT YES
# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'the_user'@'localhost' NULL db_datadict SELECT YES
+'the_user'@'localhost' def db_datadict SELECT YES
# Close connection testuser1
# Establish connection the_user (user=the_user)
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'the_user'@'localhost' NULL db_datadict SELECT YES
+'the_user'@'localhost' def db_datadict SELECT YES
# Close connection the_user
# Switch to connection default
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'the_user'@'localhost' NULL db_datadict SELECT YES
+'the_user'@'localhost' def db_datadict SELECT YES
DROP USER 'the_user'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
index 9e2a835d45b..a55d3ea8e4d 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
@@ -10,22 +10,22 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema IN ('information_schema','mysql','test')
ORDER BY grantee, table_schema, privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-''@'%' NULL test ALTER NO
-''@'%' NULL test CREATE NO
-''@'%' NULL test CREATE ROUTINE NO
-''@'%' NULL test CREATE TEMPORARY TABLES NO
-''@'%' NULL test CREATE VIEW NO
-''@'%' NULL test DELETE NO
-''@'%' NULL test DROP NO
-''@'%' NULL test EVENT NO
-''@'%' NULL test INDEX NO
-''@'%' NULL test INSERT NO
-''@'%' NULL test LOCK TABLES NO
-''@'%' NULL test REFERENCES NO
-''@'%' NULL test SELECT NO
-''@'%' NULL test SHOW VIEW NO
-''@'%' NULL test TRIGGER NO
-''@'%' NULL test UPDATE NO
+''@'%' def test ALTER NO
+''@'%' def test CREATE NO
+''@'%' def test CREATE ROUTINE NO
+''@'%' def test CREATE TEMPORARY TABLES NO
+''@'%' def test CREATE VIEW NO
+''@'%' def test DELETE NO
+''@'%' def test DROP NO
+''@'%' def test EVENT NO
+''@'%' def test INDEX NO
+''@'%' def test INSERT NO
+''@'%' def test LOCK TABLES NO
+''@'%' def test REFERENCES NO
+''@'%' def test SELECT NO
+''@'%' def test SHOW VIEW NO
+''@'%' def test TRIGGER NO
+''@'%' def test UPDATE NO
SHOW DATABASES LIKE 'information_schema';
Database (information_schema)
information_schema
diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result
index 2850655148e..d96ad497da0 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
-CATALOG_NAME varchar(512) YES NULL
+CATALOG_NAME varchar(512) NO
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) NO
@@ -36,7 +36,7 @@ SQL_PATH varchar(512) YES NULL
SHOW CREATE TABLE information_schema.SCHEMATA;
Table Create Table
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
- `CATALOG_NAME` varchar(512) DEFAULT NULL,
+ `CATALOG_NAME` varchar(512) NOT NULL DEFAULT '',
`SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
@@ -44,7 +44,7 @@ SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.SCHEMATA;
Field Type Null Key Default Extra
-CATALOG_NAME varchar(512) YES NULL
+CATALOG_NAME varchar(512) NO
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) NO
@@ -53,6 +53,10 @@ SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
catalog_name schema_name sql_path
+def information_schema NULL
+def mtr NULL
+def mysql NULL
+def test NULL
###############################################################################
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
###############################################################################
@@ -72,8 +76,8 @@ GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL db_datadict_1 latin1 latin1_swedish_ci NULL
-NULL db_datadict_2 latin1 latin1_swedish_ci NULL
+def db_datadict_1 latin1 latin1_swedish_ci NULL
+def db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
@@ -82,7 +86,7 @@ db_datadict_2
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL db_datadict_1 latin1 latin1_swedish_ci NULL
+def db_datadict_1 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
@@ -90,8 +94,8 @@ db_datadict_1
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL db_datadict_1 latin1 latin1_swedish_ci NULL
-NULL db_datadict_2 latin1 latin1_swedish_ci NULL
+def db_datadict_1 latin1 latin1_swedish_ci NULL
+def db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
@@ -117,7 +121,7 @@ CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_P
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL db_datadict latin1 latin1_swedish_ci NULL
+def db_datadict latin1 latin1_swedish_ci NULL
SELECT schema_name, default_character_set_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name default_character_set_name
diff --git a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
index 05ea3a79aa3..b4c8e465c71 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
@@ -10,9 +10,9 @@ SELECT * FROM information_schema.schemata
WHERE schema_name IN ('information_schema','mysql','test')
ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL information_schema utf8 utf8_general_ci NULL
-NULL mysql latin1 latin1_swedish_ci NULL
-NULL test latin1 latin1_swedish_ci NULL
+def information_schema utf8 utf8_general_ci NULL
+def mysql latin1 latin1_swedish_ci NULL
+def test latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'information_schema';
Database (information_schema)
information_schema
@@ -27,8 +27,8 @@ SELECT * FROM information_schema.schemata
WHERE schema_name IN ('information_schema','mysql','test')
ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL information_schema utf8 utf8_general_ci NULL
-NULL test latin1 latin1_swedish_ci NULL
+def information_schema utf8 utf8_general_ci NULL
+def test latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'information_schema';
Database (information_schema)
information_schema
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index 8452536d4ed..cbb794a9a91 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.STATISTICS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
NON_UNIQUE bigint(1) NO 0
@@ -46,7 +46,7 @@ COMMENT varchar(16) YES NULL
SHOW CREATE TABLE information_schema.STATISTICS;
Table Create Table
STATISTICS CREATE TEMPORARY TABLE `STATISTICS` (
- `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 '',
`NON_UNIQUE` bigint(1) NOT NULL DEFAULT '0',
@@ -64,7 +64,7 @@ STATISTICS CREATE TEMPORARY TABLE `STATISTICS` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.STATISTICS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
NON_UNIQUE bigint(1) NO 0
@@ -82,6 +82,54 @@ COMMENT varchar(16) YES NULL
SELECT table_catalog, table_schema, table_name, index_schema, index_name
FROM information_schema.statistics WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name index_schema index_name
+def mysql columns_priv mysql PRIMARY
+def mysql columns_priv mysql PRIMARY
+def mysql columns_priv mysql PRIMARY
+def mysql columns_priv mysql PRIMARY
+def mysql columns_priv mysql PRIMARY
+def mysql db mysql PRIMARY
+def mysql db mysql PRIMARY
+def mysql db mysql PRIMARY
+def mysql db mysql User
+def mysql event mysql PRIMARY
+def mysql event mysql PRIMARY
+def mysql func mysql PRIMARY
+def mysql help_category mysql PRIMARY
+def mysql help_category mysql name
+def mysql help_keyword mysql PRIMARY
+def mysql help_keyword mysql name
+def mysql help_relation mysql PRIMARY
+def mysql help_relation mysql PRIMARY
+def mysql help_topic mysql PRIMARY
+def mysql help_topic mysql name
+def mysql host mysql PRIMARY
+def mysql host mysql PRIMARY
+def mysql ndb_binlog_index mysql PRIMARY
+def mysql plugin mysql PRIMARY
+def mysql proc mysql PRIMARY
+def mysql proc mysql PRIMARY
+def mysql proc mysql PRIMARY
+def mysql procs_priv mysql PRIMARY
+def mysql procs_priv mysql PRIMARY
+def mysql procs_priv mysql PRIMARY
+def mysql procs_priv mysql PRIMARY
+def mysql procs_priv mysql PRIMARY
+def mysql procs_priv mysql Grantor
+def mysql servers mysql PRIMARY
+def mysql tables_priv mysql PRIMARY
+def mysql tables_priv mysql PRIMARY
+def mysql tables_priv mysql PRIMARY
+def mysql tables_priv mysql PRIMARY
+def mysql tables_priv mysql Grantor
+def mysql time_zone mysql PRIMARY
+def mysql time_zone_leap_second mysql PRIMARY
+def mysql time_zone_name mysql PRIMARY
+def mysql time_zone_transition mysql PRIMARY
+def mysql time_zone_transition mysql PRIMARY
+def mysql time_zone_transition_type mysql PRIMARY
+def mysql time_zone_transition_type mysql PRIMARY
+def mysql user mysql PRIMARY
+def mysql user mysql PRIMARY
####################################################################################
# Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information
####################################################################################
@@ -110,16 +158,16 @@ SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -153,16 +201,16 @@ SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -176,12 +224,12 @@ SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
-NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
+def db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -210,10 +258,10 @@ SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
-NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
-NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
-NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
+def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
+def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
+def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -244,8 +292,8 @@ SELECT * FROM information_schema.statistics
WHERE table_name LIKE 't1_%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 test t1_1 0 test PRIMARY 1 f1 A NULL NULL NULL BTREE
-NULL test t1_1 0 test PRIMARY 2 f3 A 0 NULL NULL BTREE
+def test t1_1 0 test PRIMARY 1 f1 A NULL NULL NULL BTREE
+def test t1_1 0 test PRIMARY 2 f3 A 0 NULL NULL BTREE
ALTER TABLE test.t1_1 DROP PRIMARY KEY;
SELECT table_name FROM information_schema.statistics
WHERE table_name LIKE 't1_%';
@@ -254,7 +302,7 @@ ALTER TABLE test.t1_1 ADD PRIMARY KEY (f1);
SELECT * FROM information_schema.statistics
WHERE table_name LIKE 't1_%';
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 test t1_1 0 test PRIMARY 1 f1 A 0 NULL NULL BTREE
+def test t1_1 0 test PRIMARY 1 f1 A 0 NULL NULL BTREE
ALTER TABLE test.t1_1 ADD INDEX (f4);
CREATE INDEX f3_f1 ON test.t1_1 (f3,f1);
CREATE UNIQUE INDEX f4x_uni ON test.t1_1 (f4x);
@@ -267,13 +315,13 @@ SELECT * FROM information_schema.statistics
WHERE table_name LIKE 't1_%' AND index_name <> 'PRIMARY'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
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 test t1_1 1 test f2_prefix 1 f2 A NULL 20 NULL YES BTREE
-NULL test t1_1 1 test f3_f1 1 f3 A NULL NULL NULL BTREE
-NULL test t1_1 1 test f3_f1 2 f1 A NULL NULL NULL BTREE
-NULL test t1_1 1 test f4 1 f4 A NULL NULL NULL YES BTREE
-NULL test t1_1 0 test f4x_uni 1 f4x A NULL NULL NULL YES BTREE
-NULL test t1_1 1 test not_null 1 f3x A NULL NULL NULL YES BTREE
-NULL test t1_2 1 test f2_hash 1 f2 NULL 0 NULL NULL YES HASH
+def test t1_1 1 test f2_prefix 1 f2 A NULL 20 NULL YES BTREE
+def test t1_1 1 test f3_f1 1 f3 A NULL NULL NULL BTREE
+def test t1_1 1 test f3_f1 2 f1 A NULL NULL NULL BTREE
+def test t1_1 1 test f4 1 f4 A NULL NULL NULL YES BTREE
+def test t1_1 0 test f4x_uni 1 f4x A NULL NULL NULL YES BTREE
+def test t1_1 1 test not_null 1 f3x A NULL NULL NULL YES BTREE
+def test t1_2 1 test f2_hash 1 f2 NULL 0 NULL NULL YES HASH
DROP TABLE test.t1_2;
SELECT DISTINCT table_name FROM information_schema.statistics
WHERE table_name = 't1_1';
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index ee37f6ef222..24cf07939b5 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -7,54 +7,54 @@ SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
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 mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
-NULL mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
-NULL mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
+def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
+def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
+def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
index 5b363cebd0b..ea28427d0f5 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
@@ -7,107 +7,107 @@ SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
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 mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
-NULL mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
-NULL mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
+def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
+def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
+def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
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 mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
-NULL mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
-NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
-NULL mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
+def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
+def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
+def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index 56c2f6ff076..154b72cb862 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.TABLE_CONSTRAINTS;
Field Type Null Key Default Extra
-CONSTRAINT_CATALOG varchar(512) YES NULL
+CONSTRAINT_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
TABLE_SCHEMA varchar(64) NO
@@ -37,7 +37,7 @@ CONSTRAINT_TYPE varchar(64) NO
SHOW CREATE TABLE information_schema.TABLE_CONSTRAINTS;
Table Create Table
TABLE_CONSTRAINTS CREATE TEMPORARY TABLE `TABLE_CONSTRAINTS` (
- `CONSTRAINT_CATALOG` varchar(512) DEFAULT NULL,
+ `CONSTRAINT_CATALOG` varchar(512) NOT NULL DEFAULT '',
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '',
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
@@ -46,7 +46,7 @@ TABLE_CONSTRAINTS CREATE TEMPORARY TABLE `TABLE_CONSTRAINTS` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLE_CONSTRAINTS;
Field Type Null Key Default Extra
-CONSTRAINT_CATALOG varchar(512) YES NULL
+CONSTRAINT_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
TABLE_SCHEMA varchar(64) NO
@@ -57,6 +57,30 @@ table_schema, table_name
FROM information_schema.table_constraints
WHERE constraint_catalog IS NOT NULL;
constraint_catalog constraint_schema constraint_name table_schema table_name
+def mysql PRIMARY mysql columns_priv
+def mysql PRIMARY mysql db
+def mysql PRIMARY mysql event
+def mysql PRIMARY mysql func
+def mysql PRIMARY mysql help_category
+def mysql name mysql help_category
+def mysql PRIMARY mysql help_keyword
+def mysql name mysql help_keyword
+def mysql PRIMARY mysql help_relation
+def mysql PRIMARY mysql help_topic
+def mysql name mysql help_topic
+def mysql PRIMARY mysql host
+def mysql PRIMARY mysql ndb_binlog_index
+def mysql PRIMARY mysql plugin
+def mysql PRIMARY mysql proc
+def mysql PRIMARY mysql procs_priv
+def mysql PRIMARY mysql servers
+def mysql PRIMARY mysql tables_priv
+def mysql PRIMARY mysql time_zone
+def mysql PRIMARY mysql time_zone_leap_second
+def mysql PRIMARY mysql time_zone_name
+def mysql PRIMARY mysql time_zone_transition
+def mysql PRIMARY mysql time_zone_transition_type
+def mysql PRIMARY mysql user
#########################################################################################
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.TABLE_CONSTRAINTS accessible information
#########################################################################################
@@ -81,10 +105,10 @@ SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL db_datadict my_idx1 db_datadict t1 UNIQUE
-NULL db_datadict my_idx2 db_datadict t1 UNIQUE
-NULL db_datadict PRIMARY db_datadict t1 PRIMARY KEY
-NULL db_datadict PRIMARY db_datadict t2 PRIMARY KEY
+def db_datadict my_idx1 db_datadict t1 UNIQUE
+def db_datadict my_idx2 db_datadict t1 UNIQUE
+def db_datadict PRIMARY db_datadict t1 PRIMARY KEY
+def db_datadict PRIMARY db_datadict t2 PRIMARY KEY
SHOW INDEXES FROM db_datadict.t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
@@ -105,9 +129,9 @@ SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL db_datadict my_idx1 db_datadict t1 UNIQUE
-NULL db_datadict my_idx2 db_datadict t1 UNIQUE
-NULL db_datadict PRIMARY db_datadict t1 PRIMARY KEY
+def db_datadict my_idx1 db_datadict t1 UNIQUE
+def db_datadict my_idx2 db_datadict t1 UNIQUE
+def db_datadict PRIMARY db_datadict t1 PRIMARY KEY
SHOW INDEXES FROM db_datadict.t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index ba5da23f069..8b7ac6994c1 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -7,30 +7,30 @@ SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
-NULL mysql PRIMARY mysql db PRIMARY KEY
-NULL mysql PRIMARY mysql event PRIMARY KEY
-NULL mysql PRIMARY mysql func PRIMARY KEY
-NULL mysql name mysql help_category UNIQUE
-NULL mysql PRIMARY mysql help_category PRIMARY KEY
-NULL mysql name mysql help_keyword UNIQUE
-NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
-NULL mysql PRIMARY mysql help_relation PRIMARY KEY
-NULL mysql name mysql help_topic UNIQUE
-NULL mysql PRIMARY mysql help_topic PRIMARY KEY
-NULL mysql PRIMARY mysql host PRIMARY KEY
-NULL mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
-NULL mysql PRIMARY mysql plugin PRIMARY KEY
-NULL mysql PRIMARY mysql proc PRIMARY KEY
-NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
-NULL mysql PRIMARY mysql servers PRIMARY KEY
-NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
-NULL mysql PRIMARY mysql user PRIMARY KEY
+def mysql PRIMARY mysql columns_priv PRIMARY KEY
+def mysql PRIMARY mysql db PRIMARY KEY
+def mysql PRIMARY mysql event PRIMARY KEY
+def mysql PRIMARY mysql func PRIMARY KEY
+def mysql name mysql help_category UNIQUE
+def mysql PRIMARY mysql help_category PRIMARY KEY
+def mysql name mysql help_keyword UNIQUE
+def mysql PRIMARY mysql help_keyword PRIMARY KEY
+def mysql PRIMARY mysql help_relation PRIMARY KEY
+def mysql name mysql help_topic UNIQUE
+def mysql PRIMARY mysql help_topic PRIMARY KEY
+def mysql PRIMARY mysql host PRIMARY KEY
+def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
+def mysql PRIMARY mysql plugin PRIMARY KEY
+def mysql PRIMARY mysql proc PRIMARY KEY
+def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql servers PRIMARY KEY
+def mysql PRIMARY mysql tables_priv PRIMARY KEY
+def mysql PRIMARY mysql time_zone PRIMARY KEY
+def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
+def mysql PRIMARY mysql time_zone_name PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql PRIMARY mysql user PRIMARY KEY
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
index 6e31953d297..e0ea412e83a 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
@@ -7,59 +7,59 @@ SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
-NULL mysql PRIMARY mysql db PRIMARY KEY
-NULL mysql PRIMARY mysql event PRIMARY KEY
-NULL mysql PRIMARY mysql func PRIMARY KEY
-NULL mysql name mysql help_category UNIQUE
-NULL mysql PRIMARY mysql help_category PRIMARY KEY
-NULL mysql name mysql help_keyword UNIQUE
-NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
-NULL mysql PRIMARY mysql help_relation PRIMARY KEY
-NULL mysql name mysql help_topic UNIQUE
-NULL mysql PRIMARY mysql help_topic PRIMARY KEY
-NULL mysql PRIMARY mysql host PRIMARY KEY
-NULL mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
-NULL mysql PRIMARY mysql plugin PRIMARY KEY
-NULL mysql PRIMARY mysql proc PRIMARY KEY
-NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
-NULL mysql PRIMARY mysql servers PRIMARY KEY
-NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
-NULL mysql PRIMARY mysql user PRIMARY KEY
+def mysql PRIMARY mysql columns_priv PRIMARY KEY
+def mysql PRIMARY mysql db PRIMARY KEY
+def mysql PRIMARY mysql event PRIMARY KEY
+def mysql PRIMARY mysql func PRIMARY KEY
+def mysql name mysql help_category UNIQUE
+def mysql PRIMARY mysql help_category PRIMARY KEY
+def mysql name mysql help_keyword UNIQUE
+def mysql PRIMARY mysql help_keyword PRIMARY KEY
+def mysql PRIMARY mysql help_relation PRIMARY KEY
+def mysql name mysql help_topic UNIQUE
+def mysql PRIMARY mysql help_topic PRIMARY KEY
+def mysql PRIMARY mysql host PRIMARY KEY
+def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
+def mysql PRIMARY mysql plugin PRIMARY KEY
+def mysql PRIMARY mysql proc PRIMARY KEY
+def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql servers PRIMARY KEY
+def mysql PRIMARY mysql tables_priv PRIMARY KEY
+def mysql PRIMARY mysql time_zone PRIMARY KEY
+def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
+def mysql PRIMARY mysql time_zone_name PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql PRIMARY mysql user PRIMARY KEY
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
-NULL mysql PRIMARY mysql db PRIMARY KEY
-NULL mysql PRIMARY mysql event PRIMARY KEY
-NULL mysql PRIMARY mysql func PRIMARY KEY
-NULL mysql name mysql help_category UNIQUE
-NULL mysql PRIMARY mysql help_category PRIMARY KEY
-NULL mysql name mysql help_keyword UNIQUE
-NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
-NULL mysql PRIMARY mysql help_relation PRIMARY KEY
-NULL mysql name mysql help_topic UNIQUE
-NULL mysql PRIMARY mysql help_topic PRIMARY KEY
-NULL mysql PRIMARY mysql host PRIMARY KEY
-NULL mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
-NULL mysql PRIMARY mysql plugin PRIMARY KEY
-NULL mysql PRIMARY mysql proc PRIMARY KEY
-NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
-NULL mysql PRIMARY mysql servers PRIMARY KEY
-NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
-NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
-NULL mysql PRIMARY mysql user PRIMARY KEY
+def mysql PRIMARY mysql columns_priv PRIMARY KEY
+def mysql PRIMARY mysql db PRIMARY KEY
+def mysql PRIMARY mysql event PRIMARY KEY
+def mysql PRIMARY mysql func PRIMARY KEY
+def mysql name mysql help_category UNIQUE
+def mysql PRIMARY mysql help_category PRIMARY KEY
+def mysql name mysql help_keyword UNIQUE
+def mysql PRIMARY mysql help_keyword PRIMARY KEY
+def mysql PRIMARY mysql help_relation PRIMARY KEY
+def mysql name mysql help_topic UNIQUE
+def mysql PRIMARY mysql help_topic PRIMARY KEY
+def mysql PRIMARY mysql host PRIMARY KEY
+def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
+def mysql PRIMARY mysql plugin PRIMARY KEY
+def mysql PRIMARY mysql proc PRIMARY KEY
+def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql servers PRIMARY KEY
+def mysql PRIMARY mysql tables_priv PRIMARY KEY
+def mysql PRIMARY mysql time_zone PRIMARY KEY
+def mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
+def mysql PRIMARY mysql time_zone_name PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
+def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
+def mysql PRIMARY mysql user PRIMARY KEY
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result
index c7b8e2630aa..8f51d99b6db 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -29,7 +29,7 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.TABLE_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
PRIVILEGE_TYPE varchar(64) NO
@@ -38,7 +38,7 @@ SHOW CREATE TABLE information_schema.TABLE_PRIVILEGES;
Table Create Table
TABLE_PRIVILEGES CREATE TEMPORARY TABLE `TABLE_PRIVILEGES` (
`GRANTEE` varchar(81) NOT NULL DEFAULT '',
- `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 '',
`PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '',
@@ -47,7 +47,7 @@ TABLE_PRIVILEGES CREATE TEMPORARY TABLE `TABLE_PRIVILEGES` (
SHOW COLUMNS FROM information_schema.TABLE_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
PRIVILEGE_TYPE varchar(64) NO
@@ -81,7 +81,7 @@ SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict tb1 SELECT NO
+'testuser1'@'localhost' def db_datadict tb1 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -92,18 +92,18 @@ SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' NULL db_datadict tb1 ALTER YES
-'testuser2'@'localhost' NULL db_datadict tb1 CREATE YES
-'testuser2'@'localhost' NULL db_datadict tb1 CREATE VIEW YES
-'testuser2'@'localhost' NULL db_datadict tb1 DELETE YES
-'testuser2'@'localhost' NULL db_datadict tb1 DROP YES
-'testuser2'@'localhost' NULL db_datadict tb1 INDEX YES
-'testuser2'@'localhost' NULL db_datadict tb1 INSERT YES
-'testuser2'@'localhost' NULL db_datadict tb1 REFERENCES YES
-'testuser2'@'localhost' NULL db_datadict tb1 SELECT YES
-'testuser2'@'localhost' NULL db_datadict tb1 SHOW VIEW YES
-'testuser2'@'localhost' NULL db_datadict tb1 TRIGGER YES
-'testuser2'@'localhost' NULL db_datadict tb1 UPDATE YES
+'testuser2'@'localhost' def db_datadict tb1 ALTER YES
+'testuser2'@'localhost' def db_datadict tb1 CREATE YES
+'testuser2'@'localhost' def db_datadict tb1 CREATE VIEW YES
+'testuser2'@'localhost' def db_datadict tb1 DELETE YES
+'testuser2'@'localhost' def db_datadict tb1 DROP YES
+'testuser2'@'localhost' def db_datadict tb1 INDEX YES
+'testuser2'@'localhost' def db_datadict tb1 INSERT YES
+'testuser2'@'localhost' def db_datadict tb1 REFERENCES YES
+'testuser2'@'localhost' def db_datadict tb1 SELECT YES
+'testuser2'@'localhost' def db_datadict tb1 SHOW VIEW YES
+'testuser2'@'localhost' def db_datadict tb1 TRIGGER YES
+'testuser2'@'localhost' def db_datadict tb1 UPDATE YES
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
@@ -113,7 +113,7 @@ SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL db_datadict tb3 SELECT NO
+'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
@@ -123,20 +123,20 @@ SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL db_datadict tb1 SELECT NO
-'testuser2'@'localhost' NULL db_datadict tb1 ALTER YES
-'testuser2'@'localhost' NULL db_datadict tb1 CREATE YES
-'testuser2'@'localhost' NULL db_datadict tb1 CREATE VIEW YES
-'testuser2'@'localhost' NULL db_datadict tb1 DELETE YES
-'testuser2'@'localhost' NULL db_datadict tb1 DROP YES
-'testuser2'@'localhost' NULL db_datadict tb1 INDEX YES
-'testuser2'@'localhost' NULL db_datadict tb1 INSERT YES
-'testuser2'@'localhost' NULL db_datadict tb1 REFERENCES YES
-'testuser2'@'localhost' NULL db_datadict tb1 SELECT YES
-'testuser2'@'localhost' NULL db_datadict tb1 SHOW VIEW YES
-'testuser2'@'localhost' NULL db_datadict tb1 TRIGGER YES
-'testuser2'@'localhost' NULL db_datadict tb1 UPDATE YES
-'testuser3'@'localhost' NULL db_datadict tb3 SELECT NO
+'testuser1'@'localhost' def db_datadict tb1 SELECT NO
+'testuser2'@'localhost' def db_datadict tb1 ALTER YES
+'testuser2'@'localhost' def db_datadict tb1 CREATE YES
+'testuser2'@'localhost' def db_datadict tb1 CREATE VIEW YES
+'testuser2'@'localhost' def db_datadict tb1 DELETE YES
+'testuser2'@'localhost' def db_datadict tb1 DROP YES
+'testuser2'@'localhost' def db_datadict tb1 INDEX YES
+'testuser2'@'localhost' def db_datadict tb1 INSERT YES
+'testuser2'@'localhost' def db_datadict tb1 REFERENCES YES
+'testuser2'@'localhost' def db_datadict tb1 SELECT YES
+'testuser2'@'localhost' def db_datadict tb1 SHOW VIEW YES
+'testuser2'@'localhost' def db_datadict tb1 TRIGGER YES
+'testuser2'@'localhost' def db_datadict tb1 UPDATE YES
+'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -177,30 +177,30 @@ SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%'
ORDER BY grantee, table_schema, table_name, privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL test t1_table ALTER NO
-'testuser1'@'localhost' NULL test t1_table CREATE NO
-'testuser1'@'localhost' NULL test t1_table CREATE VIEW NO
-'testuser1'@'localhost' NULL test t1_table DELETE NO
-'testuser1'@'localhost' NULL test t1_table DROP NO
-'testuser1'@'localhost' NULL test t1_table INDEX NO
-'testuser1'@'localhost' NULL test t1_table INSERT NO
-'testuser1'@'localhost' NULL test t1_table REFERENCES NO
-'testuser1'@'localhost' NULL test t1_table SELECT NO
-'testuser1'@'localhost' NULL test t1_table SHOW VIEW NO
-'testuser1'@'localhost' NULL test t1_table TRIGGER NO
-'testuser1'@'localhost' NULL test t1_table UPDATE NO
-'testuser1'@'localhost' NULL test t1_view ALTER NO
-'testuser1'@'localhost' NULL test t1_view CREATE NO
-'testuser1'@'localhost' NULL test t1_view CREATE VIEW NO
-'testuser1'@'localhost' NULL test t1_view DELETE NO
-'testuser1'@'localhost' NULL test t1_view DROP NO
-'testuser1'@'localhost' NULL test t1_view INDEX NO
-'testuser1'@'localhost' NULL test t1_view INSERT NO
-'testuser1'@'localhost' NULL test t1_view REFERENCES NO
-'testuser1'@'localhost' NULL test t1_view SELECT NO
-'testuser1'@'localhost' NULL test t1_view SHOW VIEW NO
-'testuser1'@'localhost' NULL test t1_view TRIGGER NO
-'testuser1'@'localhost' NULL test t1_view UPDATE NO
+'testuser1'@'localhost' def test t1_table ALTER NO
+'testuser1'@'localhost' def test t1_table CREATE NO
+'testuser1'@'localhost' def test t1_table CREATE VIEW NO
+'testuser1'@'localhost' def test t1_table DELETE NO
+'testuser1'@'localhost' def test t1_table DROP NO
+'testuser1'@'localhost' def test t1_table INDEX NO
+'testuser1'@'localhost' def test t1_table INSERT NO
+'testuser1'@'localhost' def test t1_table REFERENCES NO
+'testuser1'@'localhost' def test t1_table SELECT NO
+'testuser1'@'localhost' def test t1_table SHOW VIEW NO
+'testuser1'@'localhost' def test t1_table TRIGGER NO
+'testuser1'@'localhost' def test t1_table UPDATE NO
+'testuser1'@'localhost' def test t1_view ALTER NO
+'testuser1'@'localhost' def test t1_view CREATE NO
+'testuser1'@'localhost' def test t1_view CREATE VIEW NO
+'testuser1'@'localhost' def test t1_view DELETE NO
+'testuser1'@'localhost' def test t1_view DROP NO
+'testuser1'@'localhost' def test t1_view INDEX NO
+'testuser1'@'localhost' def test t1_view INSERT NO
+'testuser1'@'localhost' def test t1_view REFERENCES NO
+'testuser1'@'localhost' def test t1_view SELECT NO
+'testuser1'@'localhost' def test t1_view SHOW VIEW NO
+'testuser1'@'localhost' def test t1_view TRIGGER NO
+'testuser1'@'localhost' def test t1_view UPDATE NO
SELECT DISTINCT grantee, table_name FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%'
ORDER BY grantee, table_name;
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 1ab863b9b7d..3974d684942 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.TABLES;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
TABLE_TYPE varchar(64) NO
@@ -52,7 +52,7 @@ TABLE_COMMENT varchar(80) NO
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
TABLES 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 '',
@@ -76,7 +76,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
TABLE_TYPE varchar(64) NO
@@ -98,7 +98,7 @@ CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(255) YES NULL
TABLE_COMMENT varchar(80) NO
SELECT table_catalog, table_schema, table_name
-FROM information_schema.tables WHERE table_catalog IS NOT NULL;
+FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name
################################################################################
# Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information
@@ -129,10 +129,10 @@ GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
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 db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -143,8 +143,8 @@ v3
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
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 db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -153,8 +153,8 @@ tb3
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
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 db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb3
@@ -163,10 +163,10 @@ v3
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
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 db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
-NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
+def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
+def db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
@@ -192,7 +192,7 @@ DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
COMMENT = 'Initial Comment' ENGINE = <engine_type>;
SELECT * FROM information_schema.tables
WHERE table_name = 't1_my_table';
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
TABLE_TYPE BASE TABLE
@@ -345,7 +345,7 @@ DROP TABLE test.t1_my_tablex;
CREATE VIEW test.t1_my_tablex AS SELECT 1;
SELECT * FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
TABLE_TYPE VIEW
diff --git a/mysql-test/suite/funcs_1/r/is_tables_innodb.result b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
index f2d2e0a912a..bc984b1b6fe 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
@@ -17,7 +17,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -40,7 +40,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -63,7 +63,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -109,7 +109,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -132,7 +132,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index 95d56c2d41d..552ac560741 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -13,7 +13,7 @@ FROM information_schema.tables
WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
@@ -36,7 +36,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLLATIONS
TABLE_TYPE SYSTEM VIEW
@@ -59,7 +59,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY
TABLE_TYPE SYSTEM VIEW
@@ -82,7 +82,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLUMNS
TABLE_TYPE SYSTEM VIEW
@@ -105,7 +105,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLUMN_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -128,7 +128,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ENGINES
TABLE_TYPE SYSTEM VIEW
@@ -151,7 +151,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME EVENTS
TABLE_TYPE SYSTEM VIEW
@@ -174,7 +174,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME FILES
TABLE_TYPE SYSTEM VIEW
@@ -197,7 +197,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
@@ -220,7 +220,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
@@ -243,7 +243,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME KEY_COLUMN_USAGE
TABLE_TYPE SYSTEM VIEW
@@ -266,7 +266,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARTITIONS
TABLE_TYPE SYSTEM VIEW
@@ -289,7 +289,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
@@ -312,7 +312,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PROCESSLIST
TABLE_TYPE SYSTEM VIEW
@@ -335,7 +335,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME REFERENTIAL_CONSTRAINTS
TABLE_TYPE SYSTEM VIEW
@@ -358,7 +358,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
TABLE_TYPE SYSTEM VIEW
@@ -381,7 +381,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SCHEMATA
TABLE_TYPE SYSTEM VIEW
@@ -404,7 +404,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SCHEMA_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -427,7 +427,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_STATUS
TABLE_TYPE SYSTEM VIEW
@@ -450,7 +450,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
@@ -473,7 +473,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
@@ -496,7 +496,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
@@ -519,7 +519,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLE_CONSTRAINTS
TABLE_TYPE SYSTEM VIEW
@@ -542,7 +542,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLE_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -565,7 +565,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TRIGGERS
TABLE_TYPE SYSTEM VIEW
@@ -588,7 +588,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME USER_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -611,7 +611,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME VIEWS
TABLE_TYPE SYSTEM VIEW
@@ -651,7 +651,7 @@ FROM information_schema.tables
WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
@@ -674,7 +674,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLLATIONS
TABLE_TYPE SYSTEM VIEW
@@ -697,7 +697,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY
TABLE_TYPE SYSTEM VIEW
@@ -720,7 +720,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLUMNS
TABLE_TYPE SYSTEM VIEW
@@ -743,7 +743,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME COLUMN_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -766,7 +766,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ENGINES
TABLE_TYPE SYSTEM VIEW
@@ -789,7 +789,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME EVENTS
TABLE_TYPE SYSTEM VIEW
@@ -812,7 +812,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME FILES
TABLE_TYPE SYSTEM VIEW
@@ -835,7 +835,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_STATUS
TABLE_TYPE SYSTEM VIEW
@@ -858,7 +858,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
@@ -881,7 +881,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME KEY_COLUMN_USAGE
TABLE_TYPE SYSTEM VIEW
@@ -904,7 +904,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARTITIONS
TABLE_TYPE SYSTEM VIEW
@@ -927,7 +927,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
@@ -950,7 +950,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PROCESSLIST
TABLE_TYPE SYSTEM VIEW
@@ -973,7 +973,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME REFERENTIAL_CONSTRAINTS
TABLE_TYPE SYSTEM VIEW
@@ -996,7 +996,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
TABLE_TYPE SYSTEM VIEW
@@ -1019,7 +1019,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SCHEMATA
TABLE_TYPE SYSTEM VIEW
@@ -1042,7 +1042,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SCHEMA_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -1065,7 +1065,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_STATUS
TABLE_TYPE SYSTEM VIEW
@@ -1088,7 +1088,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
@@ -1111,7 +1111,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
@@ -1134,7 +1134,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
@@ -1157,7 +1157,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLE_CONSTRAINTS
TABLE_TYPE SYSTEM VIEW
@@ -1180,7 +1180,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLE_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -1203,7 +1203,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TRIGGERS
TABLE_TYPE SYSTEM VIEW
@@ -1226,7 +1226,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME USER_PRIVILEGES
TABLE_TYPE SYSTEM VIEW
@@ -1249,7 +1249,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME VIEWS
TABLE_TYPE SYSTEM VIEW
diff --git a/mysql-test/suite/funcs_1/r/is_tables_memory.result b/mysql-test/suite/funcs_1/r/is_tables_memory.result
index 561bf6e569f..961fb98d573 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_memory.result
@@ -18,7 +18,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -41,7 +41,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -64,7 +64,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -110,7 +110,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -133,7 +133,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam.result b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
index 0f476309303..ab49a05321f 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
@@ -18,7 +18,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -41,7 +41,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -64,7 +64,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -110,7 +110,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -133,7 +133,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
index 25c482bb73c..7da84788559 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
@@ -18,7 +18,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -41,7 +41,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -64,7 +64,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -110,7 +110,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -133,7 +133,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -156,7 +156,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 4b33009904f..0945401ba43 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -12,7 +12,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME columns_priv
TABLE_TYPE BASE TABLE
@@ -35,7 +35,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Column privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME db
TABLE_TYPE BASE TABLE
@@ -58,7 +58,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME event
TABLE_TYPE BASE TABLE
@@ -81,7 +81,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Events
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME func
TABLE_TYPE BASE TABLE
@@ -104,7 +104,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment User defined functions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME general_log
TABLE_TYPE BASE TABLE
@@ -127,7 +127,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment General log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
@@ -150,7 +150,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help categories
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_keyword
TABLE_TYPE BASE TABLE
@@ -173,7 +173,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help keywords
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_relation
TABLE_TYPE BASE TABLE
@@ -196,7 +196,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment keyword-topic relation
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_topic
TABLE_TYPE BASE TABLE
@@ -219,7 +219,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help topics
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME host
TABLE_TYPE BASE TABLE
@@ -242,7 +242,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME ndb_binlog_index
TABLE_TYPE BASE TABLE
@@ -265,13 +265,13 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME plugin
TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT Dynamic
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -282,13 +282,13 @@ AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
-TABLE_COLLATION utf8_bin
+TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL plugins
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME proc
TABLE_TYPE BASE TABLE
@@ -311,7 +311,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Stored Procedures
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME procs_priv
TABLE_TYPE BASE TABLE
@@ -334,7 +334,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Procedure privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
@@ -357,7 +357,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME slow_log
TABLE_TYPE BASE TABLE
@@ -380,7 +380,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Slow log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME tables_priv
TABLE_TYPE BASE TABLE
@@ -403,7 +403,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Table privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone
TABLE_TYPE BASE TABLE
@@ -426,7 +426,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_leap_second
TABLE_TYPE BASE TABLE
@@ -449,7 +449,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_name
TABLE_TYPE BASE TABLE
@@ -472,7 +472,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone names
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition
TABLE_TYPE BASE TABLE
@@ -495,7 +495,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transitions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition_type
TABLE_TYPE BASE TABLE
@@ -518,7 +518,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transition types
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index 393a588288d..ba30f6415bb 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -12,7 +12,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME columns_priv
TABLE_TYPE BASE TABLE
@@ -35,7 +35,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Column privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME db
TABLE_TYPE BASE TABLE
@@ -58,7 +58,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME event
TABLE_TYPE BASE TABLE
@@ -81,7 +81,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Events
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME func
TABLE_TYPE BASE TABLE
@@ -104,7 +104,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment User defined functions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME general_log
TABLE_TYPE BASE TABLE
@@ -127,7 +127,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment General log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
@@ -150,7 +150,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help categories
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_keyword
TABLE_TYPE BASE TABLE
@@ -173,7 +173,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help keywords
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_relation
TABLE_TYPE BASE TABLE
@@ -196,7 +196,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment keyword-topic relation
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_topic
TABLE_TYPE BASE TABLE
@@ -219,7 +219,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help topics
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME host
TABLE_TYPE BASE TABLE
@@ -242,7 +242,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME ndb_binlog_index
TABLE_TYPE BASE TABLE
@@ -265,13 +265,13 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME plugin
TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT Dynamic
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -282,13 +282,13 @@ AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
-TABLE_COLLATION utf8_bin
+TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL plugins
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME proc
TABLE_TYPE BASE TABLE
@@ -311,7 +311,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Stored Procedures
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME procs_priv
TABLE_TYPE BASE TABLE
@@ -334,7 +334,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Procedure privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
@@ -357,7 +357,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME slow_log
TABLE_TYPE BASE TABLE
@@ -380,7 +380,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Slow log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME tables_priv
TABLE_TYPE BASE TABLE
@@ -403,7 +403,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Table privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone
TABLE_TYPE BASE TABLE
@@ -426,7 +426,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_leap_second
TABLE_TYPE BASE TABLE
@@ -449,7 +449,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_name
TABLE_TYPE BASE TABLE
@@ -472,7 +472,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone names
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition
TABLE_TYPE BASE TABLE
@@ -495,7 +495,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transitions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition_type
TABLE_TYPE BASE TABLE
@@ -518,7 +518,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transition types
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
@@ -557,7 +557,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME columns_priv
TABLE_TYPE BASE TABLE
@@ -580,7 +580,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Column privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME db
TABLE_TYPE BASE TABLE
@@ -603,7 +603,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME event
TABLE_TYPE BASE TABLE
@@ -626,7 +626,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Events
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME func
TABLE_TYPE BASE TABLE
@@ -649,7 +649,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment User defined functions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME general_log
TABLE_TYPE BASE TABLE
@@ -672,7 +672,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment General log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_category
TABLE_TYPE BASE TABLE
@@ -695,7 +695,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help categories
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_keyword
TABLE_TYPE BASE TABLE
@@ -718,7 +718,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help keywords
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_relation
TABLE_TYPE BASE TABLE
@@ -741,7 +741,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment keyword-topic relation
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME help_topic
TABLE_TYPE BASE TABLE
@@ -764,7 +764,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment help topics
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME host
TABLE_TYPE BASE TABLE
@@ -787,7 +787,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Host privileges; Merged with database privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME ndb_binlog_index
TABLE_TYPE BASE TABLE
@@ -810,13 +810,13 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME plugin
TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
-ROW_FORMAT Fixed
+ROW_FORMAT Dynamic
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -827,13 +827,13 @@ AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
-TABLE_COLLATION utf8_bin
+TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL plugins
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME proc
TABLE_TYPE BASE TABLE
@@ -856,7 +856,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Stored Procedures
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME procs_priv
TABLE_TYPE BASE TABLE
@@ -879,7 +879,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Procedure privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
@@ -902,7 +902,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment MySQL Foreign Servers table
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME slow_log
TABLE_TYPE BASE TABLE
@@ -925,7 +925,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Slow log
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME tables_priv
TABLE_TYPE BASE TABLE
@@ -948,7 +948,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Table privileges
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone
TABLE_TYPE BASE TABLE
@@ -971,7 +971,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_leap_second
TABLE_TYPE BASE TABLE
@@ -994,7 +994,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Leap seconds information for time zones
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_name
TABLE_TYPE BASE TABLE
@@ -1017,7 +1017,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone names
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition
TABLE_TYPE BASE TABLE
@@ -1040,7 +1040,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transitions
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME time_zone_transition_type
TABLE_TYPE BASE TABLE
@@ -1063,7 +1063,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Time zone transition types
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA mysql
TABLE_NAME user
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_tables_ndb.result b/mysql-test/suite/funcs_1/r/is_tables_ndb.result
index 4ce150353c1..fe737a676ad 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_ndb.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_ndb.result
@@ -17,7 +17,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -40,7 +40,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
@@ -63,7 +63,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test2
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -109,7 +109,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
ORDER BY table_schema,table_name;
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t1
TABLE_TYPE BASE TABLE
@@ -132,7 +132,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-TABLE_CATALOG NULL
+TABLE_CATALOG def
TABLE_SCHEMA test1
TABLE_NAME t2
TABLE_TYPE BASE TABLE
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index edf4a9e5032..7d84f786db5 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -28,11 +28,11 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.TRIGGERS;
Field Type Null Key Default Extra
-TRIGGER_CATALOG varchar(512) YES NULL
+TRIGGER_CATALOG varchar(512) NO
TRIGGER_SCHEMA varchar(64) NO
TRIGGER_NAME varchar(64) NO
EVENT_MANIPULATION varchar(6) NO
-EVENT_OBJECT_CATALOG varchar(512) YES NULL
+EVENT_OBJECT_CATALOG varchar(512) NO
EVENT_OBJECT_SCHEMA varchar(64) NO
EVENT_OBJECT_TABLE varchar(64) NO
ACTION_ORDER bigint(4) NO 0
@@ -53,11 +53,11 @@ DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE information_schema.TRIGGERS;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
- `TRIGGER_CATALOG` varchar(512) DEFAULT NULL,
+ `TRIGGER_CATALOG` varchar(512) NOT NULL DEFAULT '',
`TRIGGER_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`TRIGGER_NAME` varchar(64) NOT NULL DEFAULT '',
`EVENT_MANIPULATION` varchar(6) NOT NULL DEFAULT '',
- `EVENT_OBJECT_CATALOG` varchar(512) DEFAULT NULL,
+ `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL DEFAULT '',
`EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`EVENT_OBJECT_TABLE` varchar(64) NOT NULL DEFAULT '',
`ACTION_ORDER` bigint(4) NOT NULL DEFAULT '0',
@@ -78,11 +78,11 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TRIGGERS;
Field Type Null Key Default Extra
-TRIGGER_CATALOG varchar(512) YES NULL
+TRIGGER_CATALOG varchar(512) NO
TRIGGER_SCHEMA varchar(64) NO
TRIGGER_NAME varchar(64) NO
EVENT_MANIPULATION varchar(6) NO
-EVENT_OBJECT_CATALOG varchar(512) YES NULL
+EVENT_OBJECT_CATALOG varchar(512) NO
EVENT_OBJECT_SCHEMA varchar(64) NO
EVENT_OBJECT_TABLE varchar(64) NO
ACTION_ORDER bigint(4) NO 0
@@ -105,6 +105,8 @@ WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
OR action_reference_new_table IS NOT NULL;
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
+def mtr gs_insert INSERT def mtr global_suppressions 0 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def mtr ts_insert INSERT def mtr test_suppressions 0 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
##################################################################################
# Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information
##################################################################################
@@ -133,7 +135,7 @@ GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
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 db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -157,7 +159,7 @@ GRANT SELECT ON `db_datadict`.`t1` TO 'testuser3'@'localhost'
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 db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -173,7 +175,7 @@ ERROR 42000: SELECT command denied to user 'testuser4'@'localhost' for table 't1
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 db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -181,7 +183,7 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser
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 db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result
index 03865f59c2c..8f68f8c802d 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -29,26 +29,26 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.USER_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
PRIVILEGE_TYPE varchar(64) NO
IS_GRANTABLE varchar(3) NO
SHOW CREATE TABLE information_schema.USER_PRIVILEGES;
Table Create Table
USER_PRIVILEGES CREATE TEMPORARY TABLE `USER_PRIVILEGES` (
`GRANTEE` varchar(81) NOT NULL DEFAULT '',
- `TABLE_CATALOG` varchar(512) DEFAULT NULL,
+ `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '',
`IS_GRANTABLE` varchar(3) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.USER_PRIVILEGES;
Field Type Null Key Default Extra
GRANTEE varchar(81) NO
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
PRIVILEGE_TYPE varchar(64) NO
IS_GRANTABLE varchar(3) NO
SELECT grantee, table_catalog, privilege_type
FROM information_schema.user_privileges
-WHERE table_catalog IS NOT NULL;
+WHERE table_catalog IS NULL OR table_catalog <> 'def';
grantee table_catalog privilege_type
##########################################################################
# Testcases 3.2.16.2+3.2.16.3+3.2.16.4: INFORMATION_SCHEMA.USER_PRIVILEGES
@@ -70,16 +70,16 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
#
# Add GRANT OPTION db_datadict.* to testuser1;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
@@ -87,28 +87,28 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -124,16 +124,16 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL SELECT NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def SELECT NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 Y 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 Y 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
#
# Here <SELECT YES> is shown correctly for testuser1;
@@ -141,28 +141,28 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL SELECT YES
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def SELECT YES
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL SELECT YES
+'testuser1'@'localhost' def SELECT YES
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
SHOW GRANTS;
Grants for testuser1@localhost
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
@@ -173,8 +173,8 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
@@ -186,7 +186,7 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' NULL USAGE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
@@ -201,22 +201,22 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -229,7 +229,7 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -247,28 +247,28 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -281,13 +281,13 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -303,22 +303,22 @@ SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
-'testuser2'@'localhost' NULL INSERT NO
-'testuser2'@'localhost' NULL UPDATE NO
-'testuser3'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
+'testuser2'@'localhost' def INSERT NO
+'testuser2'@'localhost' def UPDATE NO
+'testuser3'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-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 testuser1 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 0 0 0 0
-localhost testuser2 N Y Y 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 0 0 0 0
-localhost testuser3 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 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 testuser1 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 0 0 0 0
+localhost testuser2 N Y Y 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 0 0 0 0
+localhost testuser3 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 0 0 0 0
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -349,7 +349,7 @@ CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL USAGE NO
+'testuser1'@'localhost' def USAGE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -357,8 +357,8 @@ GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' NULL SELECT NO
-'testuser1'@'localhost' NULL FILE NO
+'testuser1'@'localhost' def SELECT NO
+'testuser1'@'localhost' def FILE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result
index f960c26b21d..59597fbc3b9 100644
--- a/mysql-test/suite/funcs_1/r/is_views.result
+++ b/mysql-test/suite/funcs_1/r/is_views.result
@@ -28,7 +28,7 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.VIEWS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
@@ -41,7 +41,7 @@ COLLATION_CONNECTION varchar(32) NO
SHOW CREATE TABLE information_schema.VIEWS;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
- `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 '',
`VIEW_DEFINITION` longtext NOT NULL,
@@ -54,7 +54,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.VIEWS;
Field Type Null Key Default Extra
-TABLE_CATALOG varchar(512) YES NULL
+TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
@@ -88,19 +88,19 @@ GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost';
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL db_datadict v_granted_to_1 select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def db_datadict v_granted_to_1 select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
# Establish connection test_no_views (user=test_no_views)
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
@@ -128,7 +128,7 @@ CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
SELECT * FROM information_schema.views
WHERE table_name LIKE 't1_%';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test t1_view select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test t1_view select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
SELECT table_name,definer FROM information_schema.views
WHERE table_name = 't1_view';
table_name definer
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index 4e48d9412d1..eb3d326808f 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
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 left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2097,6 +2097,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2109,6 +2112,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2124,10 +2130,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 if(`t1_values`.`my_binary_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2141,10 +2147,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$--
IS TRUE -1
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -2159,6 +2165,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2171,6 +2180,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2187,7 +2199,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2202,7 +2214,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2588,9 +2600,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2604,9 +2616,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2956,8 +2968,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2971,8 +2983,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -3283,10 +3295,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
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 cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3301,10 +3313,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@@ -3373,9 +3385,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3390,9 +3405,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3409,14 +3427,14 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 cast(`t1_values`.`my_binary_30` as decimal(37,2)) AS `CAST(my_binary_30 AS DECIMAL(37,2))`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3431,14 +3449,14 @@ NULL NULL 1
-1.00 -1
-3333.33 -3333.3333
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -3455,9 +3473,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3472,9 +3493,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3491,12 +3515,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3511,12 +3535,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
index 6b474621685..16dde71400e 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
@@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_07.result b/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
index 596b63316ce..2b8d41f963e 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
@@ -81,7 +81,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
set @@sql_mode='traditional';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp1()
BEGIN
declare a tinyint;
@@ -98,7 +98,7 @@ END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
+sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
BEGIN
declare a tinyint;
declare count_ int default 1;
@@ -118,10 +118,10 @@ Variable_name Value
sql_mode
CALL sp1();
Variable_name Value
-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
+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
SELECT * from result;
f1 f2
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
+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 value restored
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
sql_mode
@@ -143,7 +143,7 @@ DROP PROCEDURE IF EXISTS sp2;
... show initial value
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp2()
BEGIN
SET @@sql_mode='MAXDB';
@@ -151,7 +151,7 @@ SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
+sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
@@ -159,7 +159,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
... call procedure that changes sql_mode
CALL sp2();
Variable_name Value
@@ -167,7 +167,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
... check whether old value is re-set
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
DROP PROCEDURE sp2;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
index 7f08a77ef09..44af7800b8f 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
@@ -106,7 +106,7 @@ END//
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -133,7 +133,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -160,7 +160,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -185,7 +185,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -324,7 +324,7 @@ ALTER FUNCTION fn_2 MODIFIES SQL DATA;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -351,7 +351,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -378,7 +378,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -403,7 +403,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -535,7 +535,7 @@ ALTER FUNCTION fn_2 CONTAINS SQL;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -562,7 +562,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -589,7 +589,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -614,7 +614,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index 7f38fd1f182..65bc7deef8c 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -156,7 +156,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -170,7 +170,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -402,7 +402,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -416,7 +416,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
index bbee7d47e7e..cfbee5f27b7 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -563,7 +563,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
@@ -610,7 +610,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
@@ -1252,7 +1252,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-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=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1285,7 +1285,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-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 current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index ccbd086b71f..b018a5ad863 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -22845,6 +22845,9 @@ SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT SQRT('DEF');
SQRT('DEF')
0
@@ -22865,7 +22868,12 @@ SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22873,6 +22881,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22880,6 +22890,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index 4e48d9412d1..eb3d326808f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
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 left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2097,6 +2097,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2109,6 +2112,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2124,10 +2130,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 if(`t1_values`.`my_binary_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2141,10 +2147,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$--
IS TRUE -1
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -2159,6 +2165,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2171,6 +2180,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2187,7 +2199,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2202,7 +2214,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2588,9 +2600,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2604,9 +2616,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2956,8 +2968,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2971,8 +2983,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -3283,10 +3295,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
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 cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3301,10 +3313,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@@ -3373,9 +3385,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3390,9 +3405,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3409,14 +3427,14 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 cast(`t1_values`.`my_binary_30` as decimal(37,2)) AS `CAST(my_binary_30 AS DECIMAL(37,2))`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3431,14 +3449,14 @@ NULL NULL 1
-1.00 -1
-3333.33 -3333.3333
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -3455,9 +3473,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3472,9 +3493,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3491,12 +3515,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3511,12 +3535,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
index 6b474621685..16dde71400e 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
@@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
index 596b63316ce..2b8d41f963e 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
@@ -81,7 +81,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
set @@sql_mode='traditional';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp1()
BEGIN
declare a tinyint;
@@ -98,7 +98,7 @@ END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
+sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
BEGIN
declare a tinyint;
declare count_ int default 1;
@@ -118,10 +118,10 @@ Variable_name Value
sql_mode
CALL sp1();
Variable_name Value
-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
+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
SELECT * from result;
f1 f2
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
+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 value restored
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
sql_mode
@@ -143,7 +143,7 @@ DROP PROCEDURE IF EXISTS sp2;
... show initial value
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp2()
BEGIN
SET @@sql_mode='MAXDB';
@@ -151,7 +151,7 @@ SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
+sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
@@ -159,7 +159,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
... call procedure that changes sql_mode
CALL sp2();
Variable_name Value
@@ -167,7 +167,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
... check whether old value is re-set
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
DROP PROCEDURE sp2;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
index 7f08a77ef09..44af7800b8f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
@@ -106,7 +106,7 @@ END//
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -133,7 +133,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -160,7 +160,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -185,7 +185,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -324,7 +324,7 @@ ALTER FUNCTION fn_2 MODIFIES SQL DATA;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -351,7 +351,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -378,7 +378,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -403,7 +403,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -535,7 +535,7 @@ ALTER FUNCTION fn_2 CONTAINS SQL;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -562,7 +562,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -589,7 +589,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -614,7 +614,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index 7f38fd1f182..65bc7deef8c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -156,7 +156,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -170,7 +170,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -402,7 +402,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -416,7 +416,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
index e4dc67098ad..d21bd176810 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -563,7 +563,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
@@ -610,7 +610,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
@@ -1252,7 +1252,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-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=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1285,7 +1285,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-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 current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result
index 9b07a0ae45b..a228245483e 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views.result
@@ -24547,6 +24547,9 @@ SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT SQRT('DEF');
SQRT('DEF')
0
@@ -24567,7 +24570,12 @@ SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -24575,6 +24583,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -24582,6 +24592,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
diff --git a/mysql-test/suite/funcs_1/r/ndb_func_view.result b/mysql-test/suite/funcs_1/r/ndb_func_view.result
index 4beb0c8aaf2..b19252e4dd7 100644
--- a/mysql-test/suite/funcs_1/r/ndb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/ndb_func_view.result
@@ -945,8 +945,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
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 left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -960,8 +960,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2096,6 +2096,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2108,6 +2111,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2123,10 +2129,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 if(`t1_values`.`my_binary_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2140,10 +2146,10 @@ IS NOT TRUE <--------30 characters-------> 3
IS NOT TRUE ---äÖüß@µ*$--
IS TRUE -1
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DOUBLE value: '-1'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -2158,6 +2164,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2170,6 +2179,9 @@ IS NOT TRUE 2
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2186,7 +2198,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
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 if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2201,7 +2213,7 @@ IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
+Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -2587,9 +2599,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2603,9 +2615,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -2955,8 +2967,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
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 cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -2970,8 +2982,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
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: ''
DROP VIEW v1;
@@ -3282,10 +3294,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
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 cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3300,10 +3312,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@@ -3372,9 +3384,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3389,9 +3404,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3408,14 +3426,14 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
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 cast(`t1_values`.`my_binary_30` as decimal(37,2)) AS `CAST(my_binary_30 AS DECIMAL(37,2))`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3430,14 +3448,14 @@ NULL NULL 1
-1.00 -1
-3333.33 -3333.3333
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect DECIMAL value: '-1'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DROP VIEW v1;
@@ -3454,9 +3472,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3471,9 +3492,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
@@ -3490,12 +3514,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
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 cast(`t1_values`.`my_char_30` as decimal(37,2)) AS `CAST(my_char_30 AS DECIMAL(37,2))`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@@ -3510,12 +3534,12 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
index 65fc5b5afc9..3e2d084aa0c 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
@@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
index 5a2c0bb6bdf..a520bdfac36 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
@@ -80,7 +80,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
set @@sql_mode='traditional';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp1()
BEGIN
declare a tinyint;
@@ -97,7 +97,7 @@ END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
+sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
BEGIN
declare a tinyint;
declare count_ int default 1;
@@ -117,10 +117,10 @@ Variable_name Value
sql_mode
CALL sp1();
Variable_name Value
-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
+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
SELECT * from result;
f1 f2
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
+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 value restored
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
sql_mode
@@ -142,7 +142,7 @@ DROP PROCEDURE IF EXISTS sp2;
... show initial value
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
CREATE PROCEDURE sp2()
BEGIN
SET @@sql_mode='MAXDB';
@@ -150,7 +150,7 @@ SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
+sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
@@ -158,7 +158,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
... call procedure that changes sql_mode
CALL sp2();
Variable_name Value
@@ -166,7 +166,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
... check whether old value is re-set
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
-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
+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
DROP PROCEDURE sp2;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
index 2e504af6ed4..8b87e583c60 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
@@ -105,7 +105,7 @@ END//
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -132,7 +132,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -159,7 +159,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -184,7 +184,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -323,7 +323,7 @@ ALTER FUNCTION fn_2 MODIFIES SQL DATA;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -350,7 +350,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -377,7 +377,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -402,7 +402,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
@@ -534,7 +534,7 @@ ALTER FUNCTION fn_2 CONTAINS SQL;
-----------------------------
SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
SPECIFIC_NAME fn_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_1
ROUTINE_TYPE FUNCTION
@@ -561,7 +561,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME fn_2
ROUTINE_TYPE FUNCTION
@@ -588,7 +588,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_1
ROUTINE_TYPE PROCEDURE
@@ -613,7 +613,7 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
-ROUTINE_CATALOG NULL
+ROUTINE_CATALOG def
ROUTINE_SCHEMA db_storedproc
ROUTINE_NAME sp_2
ROUTINE_TYPE PROCEDURE
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03.result b/mysql-test/suite/funcs_1/r/ndb_trig_03.result
index b02fba0f38d..012977ae4a3 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_03.result
@@ -77,7 +77,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -155,7 +155,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -169,7 +169,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -401,7 +401,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -415,7 +415,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
index 84260822edf..eea8df9a1fd 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
@@ -562,7 +562,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
@@ -609,7 +609,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
@@ -1251,7 +1251,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-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=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1284,7 +1284,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-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 current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result
index b75f4955986..0f35649b393 100644
--- a/mysql-test/suite/funcs_1/r/ndb_views.result
+++ b/mysql-test/suite/funcs_1/r/ndb_views.result
@@ -22843,6 +22843,9 @@ SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT SQRT('DEF');
SQRT('DEF')
0
@@ -22863,7 +22866,12 @@ SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.73205080756888
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22871,6 +22879,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
@@ -22878,6 +22888,8 @@ f1 ABC
my_sqrt 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
SELECT * FROM t2 order by 2;
f1 ABC
my_sqrt 0
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 3d341292be1..ed9e9cce054 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -74,11 +74,11 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
ALTER TABLE processlist ADD COLUMN (my_column INT);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO new_processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO files;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE TABLE new_processlist AS SELECT * FROM processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP DATABASE information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME DATABASE information_schema TO info_schema;
@@ -141,11 +141,11 @@ ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'in
ALTER TABLE processlist ADD COLUMN (my_column INT);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO new_processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO files;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
CREATE TABLE new_processlist AS SELECT * FROM processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP DATABASE information_schema;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME DATABASE information_schema TO info_schema;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 2932467be2a..db1b385513c 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -74,11 +74,11 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
ALTER TABLE processlist ADD COLUMN (my_column INT);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO new_processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO files;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE TABLE new_processlist AS SELECT * FROM processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP DATABASE information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
RENAME DATABASE information_schema TO info_schema;
@@ -141,11 +141,11 @@ ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'in
ALTER TABLE processlist ADD COLUMN (my_column INT);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO new_processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME TABLE processlist TO files;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
CREATE TABLE new_processlist AS SELECT * FROM processlist;
-ERROR 42S02: Unknown table 'new_processlist' in information_schema
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP DATABASE information_schema;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
RENAME DATABASE information_schema TO info_schema;
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 3efb361dc82..fc05dbc889f 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -7128,8 +7128,6 @@ CALL sp1();
x y z
000 000 000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7168,8 +7166,6 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7208,8 +7204,6 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7248,8 +7242,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7288,8 +7280,6 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7310,8 +7300,6 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7323,8 +7311,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7336,8 +7322,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7349,8 +7333,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7362,8 +7344,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7375,8 +7355,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7388,8 +7366,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -7401,8 +7377,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -13782,9 +13756,6 @@ END//
CALL sp1();
x y @x
NULL a 3
-Warnings:
-Warning 1265 Data truncated for column 'y' at row 3
-Warning 1265 Data truncated for column 'y' at row 1
SELECT @v1, @v2;
@v1 @v2
4 a
@@ -15465,14 +15436,6 @@ count done
10 1
Warnings:
Warning 1265 Data truncated for column 'name' at row 1
-Warning 1265 Data truncated for column 'name' at row 2
-Warning 1265 Data truncated for column 'name' at row 3
-Warning 1265 Data truncated for column 'name' at row 4
-Warning 1265 Data truncated for column 'name' at row 5
-Warning 1265 Data truncated for column 'name' at row 6
-Warning 1265 Data truncated for column 'name' at row 7
-Warning 1265 Data truncated for column 'name' at row 8
-Warning 1265 Data truncated for column 'name' at row 9
DROP PROCEDURE sp3;
drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
@@ -16387,7 +16350,6 @@ fn7(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn8;
CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
@@ -16432,7 +16394,6 @@ fn11(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn12;
CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
@@ -16533,7 +16494,6 @@ SELECT fn21_d_z(1.00e+00);
fn21_d_z(1.00e+00)
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn22;
CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
@@ -16545,7 +16505,6 @@ SELECT fn22(1.00e+00);
fn22(1.00e+00)
10
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn23;
CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
@@ -16557,7 +16516,6 @@ SELECT fn23(1.00e+00);
fn23(1.00e+00)
0000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn24;
CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
@@ -16903,7 +16861,6 @@ fn56(-8388601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn57;
CREATE FUNCTION fn57( f1 numeric) returns numeric
BEGIN
@@ -16936,7 +16893,6 @@ SELECT fn59(9999999999);
fn59(9999999999)
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn60;
CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
@@ -16982,7 +16938,6 @@ SELECT fn63(9999999999);
fn63(9999999999)
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn64;
CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
@@ -17018,8 +16973,6 @@ fn66(-1e+36)
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn67;
CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
@@ -17032,7 +16985,6 @@ fn67(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn68;
CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
@@ -17045,7 +16997,6 @@ fn68(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn69;
CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
@@ -17213,7 +17164,6 @@ fn84(-32601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn85;
CREATE FUNCTION fn85( f1 tinyint) returns tinyint
BEGIN
@@ -17253,7 +17203,6 @@ fn88(-101)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn89;
CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
BEGIN
@@ -17511,7 +17460,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp8;
CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
@@ -17556,7 +17504,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp12;
CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
@@ -17678,7 +17625,6 @@ CALL sp21(1.00e+00);
f1
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp22;
CREATE PROCEDURE sp22( f1 decimal unsigned)
@@ -17690,7 +17636,6 @@ CALL sp22(1.00e+00);
f1
10
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp23;
CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
@@ -17702,7 +17647,6 @@ CALL sp23(1.00e+00);
f1
0000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp24;
CREATE PROCEDURE sp24( f1 decimal zerofill)
@@ -18048,7 +17992,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp57;
CREATE PROCEDURE sp57( f1 numeric)
BEGIN
@@ -18081,7 +18024,6 @@ CALL sp59(9999999999);
f1
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp60;
CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
@@ -18127,7 +18069,6 @@ CALL sp63(9999999999);
f1
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp64;
CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
@@ -18163,16 +18104,12 @@ f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp66_n( -1000000000000000000000000000000000000 );
f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp67_nu;
CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
@@ -18185,14 +18122,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp67_nu( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp68_nuz;
CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
@@ -18205,14 +18140,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp68_nuz( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp69_n_z;
CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
@@ -18395,7 +18328,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp85;
CREATE PROCEDURE sp85( f1 tinyint)
BEGIN
@@ -18435,7 +18367,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp89;
CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
BEGIN
@@ -22184,7 +22115,7 @@ f1
2005-03-14 01:01:02
SELECT @@sql_mode;
@@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
+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 PROCEDURE sp2;
drop table temp_table;
@@ -22263,9 +22194,9 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
CALL sp4();
Level Code Message
-Error 1365 Division by 0
+Warning 1365 Division by 0
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
DROP PROCEDURE sp4;
set @@sql_mode='';
diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
index 235b91c67d0..ee4e009ab0d 100644
--- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test
+++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
@@ -468,25 +468,20 @@ DROP DATABASE db_datadict;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
--enable_warnings
+--error ER_DBACCESS_DENIED_ERROR
CREATE PROCEDURE test.p1()
INSERT INTO information_schema.tables
SELECT * FROM information_schema.tables LIMIT 1;
---error ER_DBACCESS_DENIED_ERROR
-CALL test.p1();
-DROP PROCEDURE test.p1;
CREATE PROCEDURE test.p1()
UPDATE information_schema.columns SET table_schema = 'garbage';
--error ER_DBACCESS_DENIED_ERROR
CALL test.p1();
DROP PROCEDURE test.p1;
+--error ER_DBACCESS_DENIED_ERROR
CREATE PROCEDURE test.p1()
DELETE FROM information_schema.schemata;
---error ER_DBACCESS_DENIED_ERROR
-CALL test.p1();
-
-DROP PROCEDURE test.p1;
--echo #########################################################################
diff --git a/mysql-test/suite/funcs_1/t/is_columns.test b/mysql-test/suite/funcs_1/t/is_columns.test
index efb52acd48c..efac7494e58 100644
--- a/mysql-test/suite/funcs_1/t/is_columns.test
+++ b/mysql-test/suite/funcs_1/t/is_columns.test
@@ -85,9 +85,9 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
# Note: Retrieval of information within information_schema.columns about
# information_schema.columns is in is_columns_is.test.
-# Show that TABLE_CATALOG is always NULL.
+# Show that TABLE_CATALOG is always 'def'.
SELECT table_catalog, table_schema, table_name, column_name
-FROM information_schema.columns WHERE table_catalog IS NOT NULL;
+FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def';
--echo ###############################################################################
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test
index 1d0d3e51aae..253323af9a7 100644
--- a/mysql-test/suite/funcs_1/t/is_user_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test
@@ -58,10 +58,10 @@ eval SHOW COLUMNS FROM information_schema.$is_table;
# Note: Retrieval of information within information_schema.columns about
# information_schema.user_privileges is in is_columns_is.test.
-# Show that TABLE_CATALOG is always NULL.
+# Show that TABLE_CATALOG is always 'def'.
SELECT grantee, table_catalog, privilege_type
FROM information_schema.user_privileges
-WHERE table_catalog IS NOT NULL;
+WHERE table_catalog IS NULL OR table_catalog <> 'def';
--echo ##########################################################################
diff --git a/mysql-test/suite/im/r/im_cmd_line.result b/mysql-test/suite/im/r/im_cmd_line.result
deleted file mode 100644
index a862d465904..00000000000
--- a/mysql-test/suite/im/r/im_cmd_line.result
+++ /dev/null
@@ -1,47 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
---> Listing users...
-im_admin
-
-==> Adding user 'testuser'...
-
---> IM password file:
-testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E
-im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295
---> EOF
-
---> Printing out line for 'testuser'...
-testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E
-
---> Listing users...
-im_admin
-testuser
-
-==> Changing the password of 'testuser'...
-
---> IM password file:
-im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295
-testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2
---> EOF
-
---> Printing out line for 'testuser'...
-testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2
-
---> Listing users...
-testuser
-im_admin
-
-==> Dropping user 'testuser'...
-
---> IM password file:
-im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295
---> EOF
-
---> Listing users...
-im_admin
-
diff --git a/mysql-test/suite/im/r/im_daemon_life_cycle.result b/mysql-test/suite/im/r/im_daemon_life_cycle.result
deleted file mode 100644
index b3afb15f207..00000000000
--- a/mysql-test/suite/im/r/im_daemon_life_cycle.result
+++ /dev/null
@@ -1,26 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
-Killing the process...
-Waiting...
-Success: the process was restarted.
-Success: server is ready to accept connection on socket.
-
---------------------------------------------------------------------
--- Test for BUG#12751
---------------------------------------------------------------------
-START INSTANCE mysqld2;
-Success: the process has been started.
-Killing the process...
-Waiting...
-Success: the process was restarted.
-Success: server is ready to accept connection on socket.
-SHOW INSTANCE STATUS mysqld1;
-instance_name state version_number version mysqld_compatible
-mysqld1 STATE VERSION_NUMBER VERSION no
-STOP INSTANCE mysqld2;
-Success: the process has been stopped.
diff --git a/mysql-test/suite/im/r/im_instance_conf.result b/mysql-test/suite/im/r/im_instance_conf.result
deleted file mode 100644
index d04ae0270ab..00000000000
--- a/mysql-test/suite/im/r/im_instance_conf.result
+++ /dev/null
@@ -1,225 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
---------------------------------------------------------------------
-server_id = 1
-server_id = 2
---------------------------------------------------------------------
-CREATE INSTANCE mysqld3
-server_id = 3,
-socket = "$MYSQL_TMP_DIR/mysqld_3.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld3 offline
-mysqld2 offline
-mysqld1 online
---------------------------------------------------------------------
-server_id = 1
-server_id = 2
-server_id=3
---------------------------------------------------------------------
-CREATE INSTANCE mysqld1;
-ERROR HY000: Instance already exists
-CREATE INSTANCE mysqld2;
-ERROR HY000: Instance already exists
-CREATE INSTANCE mysqld3;
-ERROR HY000: Instance already exists
---------------------------------------------------------------------
-nonguarded
---------------------------------------------------------------------
-CREATE INSTANCE mysqld4
-nonguarded,
-server_id = 4,
-socket = "$MYSQL_TMP_DIR/mysqld_4.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld3 offline
-mysqld4 offline
-mysqld1 online
-mysqld2 offline
---------------------------------------------------------------------
-nonguarded
-nonguarded
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-CREATE INSTANCE mysqld5
-test-A = 000,
-test-B = test,
-server_id = 5,
-socket = "$MYSQL_TMP_DIR/mysqld_5.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld4 offline
-mysqld5 offline
-mysqld2 offline
-mysqld3 offline
---------------------------------------------------------------------
-test-A=000
---------------------------------------------------------------------
-test-B=test
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-CREATE INSTANCE mysqld6
-test-C1 = 10 ,
-test-C2 = 02 ,
-server_id = 6,
-socket = "$MYSQL_TMP_DIR/mysqld_6.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
---------------------------------------------------------------------
-test-C1=10
---------------------------------------------------------------------
-test-C2=02
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-CREATE INSTANCE mysqld7 test-D = test-D-value ;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-CREATE INSTANCE mysqld8 test-E 0 ;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-CREATE INSTANCE mysqld8 test-F = ;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-CREATE INSTANCE mysqld9
-test-1=" hello world ",
-test-2=' ',
-server_id = 9,
-socket = "$MYSQL_TMP_DIR/mysqld_9.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-mysqld9 offline
-CREATE INSTANCE mysqld10
-test-3='\b\babc\sdef',
-server_id = 10,
-socket = "$MYSQL_TMP_DIR/mysqld_10.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld9 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-mysqld10 offline
-mysqld2 offline
-CREATE INSTANCE mysqld11
-test-4='abc\tdef',
-test-5='abc\ndef',
-server_id = 11,
-socket = "$MYSQL_TMP_DIR/mysqld_11.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld11 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-mysqld10 offline
-mysqld2 offline
-mysqld9 offline
-CREATE INSTANCE mysqld12
-test-6="abc\rdef",
-test-7="abc\\def",
-server_id = 12,
-socket = "$MYSQL_TMP_DIR/mysqld_12.sock";
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld9 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-mysqld10 offline
-mysqld2 offline
-mysqld12 offline
-mysqld11 offline
-CREATE INSTANCE mysqld13 test-bad=' \ ';
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld9 offline
-mysqld5 offline
-mysqld6 offline
-mysqld3 offline
-mysqld4 offline
-mysqld10 offline
-mysqld2 offline
-mysqld12 offline
-mysqld11 offline
---------------------------------------------------------------------
-test-1= hello world
---------------------------------------------------------------------
-test-2=
---------------------------------------------------------------------
-test-3=abc def
---------------------------------------------------------------------
-test-4=abc def
---------------------------------------------------------------------
-test-5=abc
---------------------------------------------------------------------
-test-6=abc def
---------------------------------------------------------------------
-test-7=abc\def
---------------------------------------------------------------------
---------------------------------------------------------------------
-CREATE INSTANCE qqq1;
-ERROR HY000: Malformed instance name.
diff --git a/mysql-test/suite/im/r/im_life_cycle.result b/mysql-test/suite/im/r/im_life_cycle.result
deleted file mode 100644
index dcabc8cf4f3..00000000000
--- a/mysql-test/suite/im/r/im_life_cycle.result
+++ /dev/null
@@ -1,73 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
-
---------------------------------------------------------------------
--- 1.1.2.
---------------------------------------------------------------------
-START INSTANCE mysqld2;
-Success: the process has been started.
-SHOW VARIABLES LIKE 'port';
-Variable_name Value
-port IM_MYSQLD2_PORT
-
---------------------------------------------------------------------
--- 1.1.3.
---------------------------------------------------------------------
-STOP INSTANCE mysqld2;
-Success: the process has been stopped.
-
---------------------------------------------------------------------
--- 1.1.4.
---------------------------------------------------------------------
-START INSTANCE mysqld3;
-ERROR HY000: Unknown instance name
-START INSTANCE mysqld1;
-ERROR HY000: The instance is already started
-
---------------------------------------------------------------------
--- 1.1.5.
---------------------------------------------------------------------
-STOP INSTANCE mysqld3;
-ERROR HY000: Unknown instance name
-
---------------------------------------------------------------------
--- 1.1.6.
---------------------------------------------------------------------
-Killing the process...
-Waiting...
-Success: the process was restarted.
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-
---------------------------------------------------------------------
--- 1.1.7.
---------------------------------------------------------------------
-START INSTANCE mysqld2;
-Success: the process has been started.
-Killing the process...
-Waiting...
-Success: the process was killed.
-
---------------------------------------------------------------------
--- 1.1.8.
---------------------------------------------------------------------
-SHOW INSTANCE STATUS;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-
---------------------------------------------------------------------
--- BUG#12813
---------------------------------------------------------------------
-START INSTANCE mysqld1,mysqld2,mysqld3;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-STOP INSTANCE mysqld1,mysqld2,mysqld3;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-STOP INSTANCE mysqld2;
-ERROR HY000: Cannot stop instance. Perhaps the instance is not started, or was started manually, so IM cannot find the pidfile.
-End of 5.0 tests
diff --git a/mysql-test/suite/im/r/im_options.result b/mysql-test/suite/im/r/im_options.result
deleted file mode 100644
index 22bd5d5bdf6..00000000000
--- a/mysql-test/suite/im/r/im_options.result
+++ /dev/null
@@ -1,151 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
-UNSET mysqld1.server_id;
-ERROR HY000: The instance is active. Stop the instance first
-SET mysqld1.server_id = 11;
-ERROR HY000: The instance is active. Stop the instance first
-CREATE INSTANCE mysqld3
-datadir = '/',
-server_id = 3,
-socket = "$MYSQL_TMP_DIR/mysqld_3.sock";
-START INSTANCE mysqld3;
-UNSET mysqld3.server_id;
-ERROR HY000: The instance is active. Stop the instance first
-SET mysqld3.server_id = 11;
-ERROR HY000: The instance is active. Stop the instance first
-STOP INSTANCE mysqld3;
-SHOW INSTANCE STATUS mysqld3;
-instance_name state version_number version mysqld_compatible
-mysqld3 offline VERSION_NUMBER VERSION no
-UNSET mysqld2.server_id;
-UNSET mysqld2.server_id;
-SHOW INSTANCE OPTIONS mysqld2;
-option_name value
-instance_name option_value
-socket option_value
-pid-file option_value
-port option_value
-datadir option_value
-log option_value
-log-error option_value
-log-slow-queries option_value
-language option_value
-character-sets-dir option_value
-basedir option_value
-shutdown-delay option_value
-skip-stack-trace option_value
-loose-skip-innodb option_value
-loose-skip-ndbcluster option_value
-nonguarded option_value
-log-output option_value
-SET mysqld2.server_id = 2;
-SET mysqld2.server_id = 2;
-SHOW INSTANCE OPTIONS mysqld2;
-option_name value
-instance_name option_value
-socket option_value
-pid-file option_value
-port option_value
-datadir option_value
-log option_value
-log-error option_value
-log-slow-queries option_value
-language option_value
-character-sets-dir option_value
-basedir option_value
-shutdown-delay option_value
-skip-stack-trace option_value
-loose-skip-innodb option_value
-loose-skip-ndbcluster option_value
-nonguarded option_value
-log-output option_value
-server_id option_value
-UNSET mysqld2.server_id = 11;
-ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-SET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc = 0010, mysqld3.ddd = 0020;
---------------------------------------------------------------------
-aaa
---------------------------------------------------------------------
-bbb
---------------------------------------------------------------------
-ccc=0010
---------------------------------------------------------------------
-ddd=0020
---------------------------------------------------------------------
-UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd;
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-SET mysqld2.aaa, mysqld3.bbb, mysqld.ccc = 0010;
-ERROR HY000: Unknown instance name
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010;
-ERROR HY000: The instance is active. Stop the instance first
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc;
-ERROR HY000: Unknown instance name
---------------------------------------------------------------------
-server_id = 1
-server_id=2
-server_id=3
---------------------------------------------------------------------
-UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc;
-ERROR HY000: The instance is active. Stop the instance first
---------------------------------------------------------------------
-server_id = 1
-server_id=2
-server_id=3
---------------------------------------------------------------------
-DROP INSTANCE mysqld3;
-SET mysqld2.server_id=222;
-SET mysqld2.server_id = 222;
-SET mysqld2.server_id = 222 ;
-SET mysqld2 . server_id = 222 ;
-SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ;
---------------------------------------------------------------------
-server_id = 1
-server_id=222
---------------------------------------------------------------------
-aaa
---------------------------------------------------------------------
-bbb
---------------------------------------------------------------------
-UNSET mysqld2 . aaa , mysqld2 . bbb ;
---------------------------------------------------------------------
-server_id = 1
-server_id=222
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-server_id = 1
-server_id=222
---------------------------------------------------------------------
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 online
-mysqld2 offline
-FLUSH INSTANCES;
-ERROR HY000: At least one instance is active. Stop all instances first
-STOP INSTANCE mysqld1;
-SHOW INSTANCES;
-instance_name state
-mysqld1 offline
-mysqld2 offline
-FLUSH INSTANCES;
diff --git a/mysql-test/suite/im/r/im_utils.result b/mysql-test/suite/im/r/im_utils.result
deleted file mode 100644
index 586a5ab6a8d..00000000000
--- a/mysql-test/suite/im/r/im_utils.result
+++ /dev/null
@@ -1,96 +0,0 @@
-SHOW VARIABLES LIKE 'server_id';
-Variable_name Value
-server_id 1
-SHOW INSTANCES;
-instance_name state
-mysqld1 XXXXX
-mysqld2 offline
-SHOW INSTANCE OPTIONS mysqld1;
-option_name value
-instance_name VALUE
-socket VALUE
-pid-file VALUE
-port VALUE
-datadir VALUE
-log VALUE
-log-error VALUE
-log-slow-queries VALUE
-language VALUE
-character-sets-dir VALUE
-basedir VALUE
-server_id VALUE
-shutdown-delay VALUE
-skip-stack-trace VALUE
-loose-skip-innodb VALUE
-loose-skip-ndbcluster VALUE
-log-output VALUE
-SHOW INSTANCE OPTIONS mysqld2;
-option_name value
-instance_name VALUE
-socket VALUE
-pid-file VALUE
-port VALUE
-datadir VALUE
-log VALUE
-log-error VALUE
-log-slow-queries VALUE
-language VALUE
-character-sets-dir VALUE
-basedir VALUE
-server_id VALUE
-shutdown-delay VALUE
-skip-stack-trace VALUE
-loose-skip-innodb VALUE
-loose-skip-ndbcluster VALUE
-nonguarded VALUE
-log-output VALUE
-START INSTANCE mysqld2;
-Success: the process has been started.
-STOP INSTANCE mysqld2;
-Success: the process has been stopped.
-SHOW mysqld1 LOG FILES;
-Logfile Path File size
-ERROR LOG PATH FILE_SIZE
-GENERAL LOG PATH FILE_SIZE
-SLOW LOG PATH FILE_SIZE
-SHOW mysqld2 LOG FILES;
-Logfile Path File size
-ERROR LOG PATH FILE_SIZE
-GENERAL LOG PATH FILE_SIZE
-SLOW LOG PATH FILE_SIZE
-SHOW mysqld1 LOG ERROR 10;
-Log
-LOG_DATA
-SHOW mysqld1 LOG SLOW 10;
-Log
-LOG_DATA
-SHOW mysqld1 LOG GENERAL 10;
-Log
-LOG_DATA
-SHOW mysqld1 LOG ERROR 10, 2;
-Log
-LOG_DATA
-SHOW mysqld1 LOG SLOW 10, 2;
-Log
-LOG_DATA
-SHOW mysqld1 LOG GENERAL 10, 2;
-Log
-LOG_DATA
-SHOW mysqld2 LOG ERROR 10;
-Log
-LOG_DATA
-SHOW mysqld2 LOG SLOW 10;
-Log
-LOG_DATA
-SHOW mysqld2 LOG GENERAL 10;
-Log
-LOG_DATA
-SHOW mysqld2 LOG ERROR 10, 2;
-Log
-LOG_DATA
-SHOW mysqld2 LOG SLOW 10, 2;
-Log
-LOG_DATA
-SHOW mysqld2 LOG GENERAL 10, 2;
-Log
-LOG_DATA
diff --git a/mysql-test/suite/im/t/disabled.def b/mysql-test/suite/im/t/disabled.def
deleted file mode 100644
index 56828810bf1..00000000000
--- a/mysql-test/suite/im/t/disabled.def
+++ /dev/null
@@ -1,20 +0,0 @@
-##############################################################################
-#
-# List the test cases that are to be disabled temporarily.
-#
-# Separate the test case name and the comment with ':'.
-#
-# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
-#
-# Do not use any TAB characters for whitespace.
-#
-##############################################################################
-im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly
-im_daemon_life_cycle : Bug#20294 2007-05-14 alik Instance manager tests fail randomly
-im_cmd_line : Bug#20294 2007-05-14 alik Instance manager tests fail randomly
-im_utils : Bug#20294 2007-05-30 alik Instance manager tests fail randomly
-im_instance_conf : Bug#20294 2007-05-30 alik Instance manager tests fail randomly
-im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance.
-im_instance_conf : BUG#28743 Instance manager generates warnings in test suite
-im_utils : BUG#28743 Instance manager generates warnings in test suite
-
diff --git a/mysql-test/suite/im/t/im_check_env.inc b/mysql-test/suite/im/t/im_check_env.inc
deleted file mode 100644
index 883e5d00fe4..00000000000
--- a/mysql-test/suite/im/t/im_check_env.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file is intended to be used in each IM-test. It contains stamements,
-# that ensure that starting conditions (environment) for the IM-test are as
-# expected.
-
-# Check the running instances.
-
---connect (mysql1_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
-
---connection mysql1_con
-
-SHOW VARIABLES LIKE 'server_id';
-
---source include/not_windows.inc
-
---connection default
-
-# Let IM detect that mysqld1 is online. This delay should be longer than
-# monitoring interval.
-
---sleep 2
-
-# Check that IM understands that mysqld1 is online, while mysqld2 is
-# offline.
-
---replace_result starting XXXXX online XXXXX
-SHOW INSTANCES;
diff --git a/mysql-test/suite/im/t/im_cmd_line.imtest b/mysql-test/suite/im/t/im_cmd_line.imtest
deleted file mode 100644
index e8264b5bb8a..00000000000
--- a/mysql-test/suite/im/t/im_cmd_line.imtest
+++ /dev/null
@@ -1,68 +0,0 @@
-###########################################################################
-#
-# Tests for user-management command-line options.
-#
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-###########################################################################
-
-# List users so we are sure about starting conditions.
-
---echo --> Listing users...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --list-users 2>&1 >/dev/null
---echo
-
-# Add a new user.
-
---echo ==> Adding user 'testuser'...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --add-user --username=testuser --password=abc 2>&1 >/dev/null
---echo
-
---echo --> IM password file:
---exec cat $IM_PASSWORD_PATH
---echo --> EOF
---echo
-
---echo --> Printing out line for 'testuser'...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=abc | tail -2 | head -1
---echo
-
---echo --> Listing users...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --list-users 2>&1 >/dev/null
---echo
-
-# Edit user's attributes.
-
---echo ==> Changing the password of 'testuser'...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --edit-user --username=testuser --password=xyz 2>&1 >/dev/null
---echo
-
---echo --> IM password file:
---exec cat $IM_PASSWORD_PATH
---echo --> EOF
---echo
-
---echo --> Printing out line for 'testuser'...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=xyz | tail -2 | head -1
---echo
-
---echo --> Listing users...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --list-users 2>&1 >/dev/null
---echo
-
-# Drop user.
-
---echo ==> Dropping user 'testuser'...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --drop-user --username=testuser 2>&1 >/dev/null
---echo
-
---echo --> IM password file:
---exec cat $IM_PASSWORD_PATH
---echo --> EOF
---echo
-
---echo --> Listing users...
---exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --list-users 2>&1 >/dev/null
---echo
diff --git a/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt b/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt
deleted file mode 100644
index 3a45c7a41f7..00000000000
--- a/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt
+++ /dev/null
@@ -1,3 +0,0 @@
---run-as-service
---log=$MYSQLTEST_VARDIR/log/im.log
---monitoring-interval=1
diff --git a/mysql-test/suite/im/t/im_daemon_life_cycle.imtest b/mysql-test/suite/im/t/im_daemon_life_cycle.imtest
deleted file mode 100644
index c42ab89cc49..00000000000
--- a/mysql-test/suite/im/t/im_daemon_life_cycle.imtest
+++ /dev/null
@@ -1,100 +0,0 @@
-let $UTIL=$MYSQL_TEST_DIR/suite/im/t;
-
-###########################################################################
-#
-# This file contains test for (1.2) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---exec $UTIL/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started.
-
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-# Turn on reconnect, not on by default anymore.
---enable_reconnect
-
-###########################################################################
-#
-# The main daemon-life-cycle test case -- check that IM-angel will restart
-# IM-main if it got killed:
-# - kill IM-main and check that IM-angel will restart it;
-# - wait for IM-main to start accepting connections before continue test
-# case;
-#
-# NOTE: timeout is 55 seconds. Timeout should be more than shutdown-delay
-# specified for managed MySQL instance. Now shutdown-delay is 10 seconds
-# (set in mysql-test-run.pl). So, 55 seconds should be enough to make 5
-# attempts.
-#
-###########################################################################
-
---exec $UTIL/log.sh im_daemon_life_cycle Main-test: starting...
-
---exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main...
---exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
-
---exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
---exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
-
---exec $UTIL/log.sh im_daemon_life_cycle Main-test: done.
-
-###########################################################################
-#
-# BUG#12751: Instance Manager: client hangs
-# - start nonguarded instance (mysqld2);
-# - kill IM-main and get it restarted by IM-angel;
-# - check that guarded instance (mysqld1) is accepting connections.
-# - check that non-guarded instance (mysqld2) were not stopped.
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- Test for BUG#12751
---echo --------------------------------------------------------------------
-
---exec $UTIL/log.sh im_daemon_life_cycle BUG12751: starting...
-
-# 1. Start mysqld;
-
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: starting...
-START INSTANCE mysqld2;
-
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to start...
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle
-
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: started.
-
-# 2. Restart IM-main;
-
---exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main...
---exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
-
---exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
---exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
-
-# 3. Issue some statement -- connection should be re-established.
-
---exec $UTIL/log.sh im_daemon_life_cycle Checking that IM-main processing commands...
-
---replace_column 2 STATE 3 VERSION_NUMBER 4 VERSION
-SHOW INSTANCE STATUS mysqld1;
-
-# 4. Stop mysqld2, because it will not be stopped by IM, as it is nonguarded.
-# So, if it we do not stop it, it will be stopped by mysql-test-run.pl with
-# warning.
-
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopping...
-STOP INSTANCE mysqld2;
-
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to stop...
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle
---exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopped.
-
-###########################################################################
-
---exec $UTIL/log.sh im_daemon_life_cycle BUG12751: done.
diff --git a/mysql-test/suite/im/t/im_instance_conf-im.opt b/mysql-test/suite/im/t/im_instance_conf-im.opt
deleted file mode 100644
index 34b74ce0c95..00000000000
--- a/mysql-test/suite/im/t/im_instance_conf-im.opt
+++ /dev/null
@@ -1 +0,0 @@
---monitoring-interval=1
diff --git a/mysql-test/suite/im/t/im_instance_conf.imtest b/mysql-test/suite/im/t/im_instance_conf.imtest
deleted file mode 100644
index b667df41f98..00000000000
--- a/mysql-test/suite/im/t/im_instance_conf.imtest
+++ /dev/null
@@ -1,244 +0,0 @@
-###########################################################################
-#
-# This test suite checks the following statements:
-# - CREATE INSTANCE <instance_name> [option1[=option1_value], ...];
-# - DROP INSTANCE <instance_name>;
-#
-# For CREATE INSTANCE we check that:
-# - CREATE INSTANCE succeeds for non-existing instance;
-# - CREATE INSTANCE fails for existing instance;
-# - CREATE INSTANCE can get additional options with and w/o values;
-# - CREATE INSTANCE parses options and handles grammar errors correctly.
-# Check that strings with spaces are handled correctly, unknown (for
-# mysqld) options should also be handled;
-# - CREATE INSTANCE updates both config file and internal configuration cache;
-# - CREATE INSTANCE allows to create instances only with properly formed
-# names (mysqld*);
-#
-# For DROP INSTANCE we check that:
-# - DROP INSTANCE succeeds for existing instance;
-# - DROP INSTANCE fails for non-existing instance;
-# - DROP INSTANCE fails for active instance.
-# - DROP INSTANCE updates both config file and internal configuration cache;
-#
-# NOTE: each CREATE INSTANCE statement must specify socket-file-name, otherwise
-# this results of the test can be affected by another running test suite.
-#
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-###########################################################################
-#
-# Check starting conditions.
-#
-###########################################################################
-
-# Check that the configuration file contains only instances that we expect.
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_\-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-###########################################################################
-#
-# CREATE INSTANCE tests.
-#
-###########################################################################
-
-# Check that CREATE INSTANCE succeeds for non-existing instance and also check
-# that both config file and internal configuration cache have been updated.
-
-CREATE INSTANCE mysqld3
- server_id = 3,
- socket = "$MYSQL_TMP_DIR/mysqld_3.sock";
-
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-# Check that CREATE INSTANCE fails for existing instance. Let's all three
-# existing instances (running one, stopped one and just created one). Just in
-# case...
-
---error 3012 # ER_CREATE_EXISTING_INSTANCE
-CREATE INSTANCE mysqld1;
-
---error 3012 # ER_CREATE_EXISTING_INSTANCE
-CREATE INSTANCE mysqld2;
-
---error 3012 # ER_CREATE_EXISTING_INSTANCE
-CREATE INSTANCE mysqld3;
-
-# Check that CREATE INSTANCE can get additional options with and w/o values.
-# Ensure that config file is updated properly.
-
-# - without values;
-
---echo --------------------------------------------------------------------
---exec grep "^nonguarded\$" $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-CREATE INSTANCE mysqld4
- nonguarded,
- server_id = 4,
- socket = "$MYSQL_TMP_DIR/mysqld_4.sock";
-
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep "^nonguarded\$" $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-# - with value;
-
---echo --------------------------------------------------------------------
---exec grep '^test-A[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-B[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-CREATE INSTANCE mysqld5
- test-A = 000,
- test-B = test,
- server_id = 5,
- socket = "$MYSQL_TMP_DIR/mysqld_5.sock";
-
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep '^test-A[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-B[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-# Check that CREATE INSTANCE parses options and handles grammar errors
-# correctly. Check that strings with spaces are handled correctly,
-# unknown (for mysqld) options should also be handled.
-
-# - check handling of extra spaces;
-
---echo --------------------------------------------------------------------
---exec grep '^test-C1[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-C2[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-CREATE INSTANCE mysqld6
- test-C1 = 10 ,
- test-C2 = 02 ,
- server_id = 6,
- socket = "$MYSQL_TMP_DIR/mysqld_6.sock";
-
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep '^test-C1[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-C2[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-# - check handling of grammar error;
-
---echo --------------------------------------------------------------------
---exec grep '^test-D[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-E[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
---error ER_SYNTAX_ERROR
-CREATE INSTANCE mysqld7 test-D = test-D-value ;
-SHOW INSTANCES;
-
---error ER_SYNTAX_ERROR
-CREATE INSTANCE mysqld8 test-E 0 ;
-SHOW INSTANCES;
-
---error ER_SYNTAX_ERROR
-CREATE INSTANCE mysqld8 test-F = ;
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep '^test-D[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-E[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-# - check parsing of string option values
-
---echo --------------------------------------------------------------------
---exec grep '^test-1[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-2[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-3[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-4[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-5[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-6[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^test-7[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-CREATE INSTANCE mysqld9
- test-1=" hello world ",
- test-2=' ',
- server_id = 9,
- socket = "$MYSQL_TMP_DIR/mysqld_9.sock";
-SHOW INSTANCES;
-
-CREATE INSTANCE mysqld10
- test-3='\b\babc\sdef',
- server_id = 10,
- socket = "$MYSQL_TMP_DIR/mysqld_10.sock";
-# test-3='abc def'
-SHOW INSTANCES;
-
-CREATE INSTANCE mysqld11
- test-4='abc\tdef',
- test-5='abc\ndef',
- server_id = 11,
- socket = "$MYSQL_TMP_DIR/mysqld_11.sock";
-SHOW INSTANCES;
-
-CREATE INSTANCE mysqld12
- test-6="abc\rdef",
- test-7="abc\\def",
- server_id = 12,
- socket = "$MYSQL_TMP_DIR/mysqld_12.sock";
-# test-6=abc
-SHOW INSTANCES;
-
---error ER_SYNTAX_ERROR
-CREATE INSTANCE mysqld13 test-bad=' \ ';
-SHOW INSTANCES;
-
---echo --------------------------------------------------------------------
---exec grep '^test-1[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-2[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-3[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-4[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-5[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-6[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-7[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
---exec grep '^test-bad' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-
-# Check that CREATE INSTANCE allows to create instances only with properly
-# formed names (mysqld*).
-
---error 3014 # ER_MALFORMED_INSTANCE_NAME
-CREATE INSTANCE qqq1;
-
diff --git a/mysql-test/suite/im/t/im_life_cycle-im.opt b/mysql-test/suite/im/t/im_life_cycle-im.opt
deleted file mode 100644
index 34b74ce0c95..00000000000
--- a/mysql-test/suite/im/t/im_life_cycle-im.opt
+++ /dev/null
@@ -1 +0,0 @@
---monitoring-interval=1
diff --git a/mysql-test/suite/im/t/im_life_cycle.imtest b/mysql-test/suite/im/t/im_life_cycle.imtest
deleted file mode 100644
index 31f63d82505..00000000000
--- a/mysql-test/suite/im/t/im_life_cycle.imtest
+++ /dev/null
@@ -1,205 +0,0 @@
-let $UTIL=$MYSQL_TEST_DIR/suite/im/t;
-
-###########################################################################
-#
-# This file contains test for (1.1) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-###########################################################################
-#
-# 1.1.2. Check 'START INSTANCE' command:
-# - start the second instance;
-# - check that it is reported as online;
-# - execute some SQL-statement on mysqld2 to ensure that it is really up and
-# running;
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.2.
---echo --------------------------------------------------------------------
-
-START INSTANCE mysqld2;
-# FIXME: START INSTANCE should be synchronous.
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
-
-# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
-# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
-# its pid file is not enough, because it is unknown when IM detects that
-# mysqld has started.
-# SHOW INSTANCES;
-
---connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD2_PORT,$IM_MYSQLD2_SOCK)
---connection mysql_con
-
---replace_result $IM_MYSQLD2_PORT IM_MYSQLD2_PORT
-SHOW VARIABLES LIKE 'port';
-
---connection default
---disconnect mysql_con
-
-###########################################################################
-#
-# 1.1.3. Check 'STOP INSTANCE' command:
-# - stop the second instance;
-# - check that it is reported as offline;
-# - TODO: try to execute some SQL-statement to ensure that it is really down;
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.3.
---echo --------------------------------------------------------------------
-
-STOP INSTANCE mysqld2;
-# FIXME: STOP INSTANCE should be synchronous.
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_life_cycle
-
-# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
-# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
-# its pid file is not enough, because it is unknown when IM detects that
-# mysqld has started.
-# SHOW INSTANCES;
-
-###########################################################################
-#
-# 1.1.4. Check that Instance Manager reports correct errors for 'START
-# INSTANCE' command:
-# - if the client tries to start unregistered instance;
-# - if the client tries to start already started instance;
-# - if the client submits invalid arguments;
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.4.
---echo --------------------------------------------------------------------
-
---error 3000 # ER_BAD_INSTANCE_NAME
-START INSTANCE mysqld3;
-
---error 3002 # ER_INSTANCE_ALREADY_STARTED
-START INSTANCE mysqld1;
-
-###########################################################################
-#
-# 1.1.5. Check that Instance Manager reports correct errors for
-# 'STOP INSTANCE' command:
-# - if the client tries to start unregistered instance;
-# - if the client tries to start already stopped instance;
-# - if the client submits invalid arguments;
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.5.
---echo --------------------------------------------------------------------
-
---error 3000 # ER_BAD_INSTANCE_NAME
-STOP INSTANCE mysqld3;
-
-# TODO: IM should be fixed.
-# BUG#12673: Instance Manager allows to stop the instance many times
-# --error 3002 # ER_INSTANCE_ALREADY_STARTED
-# STOP INSTANCE mysqld2;
-
-###########################################################################
-#
-# 1.1.6. Check that Instance Manager is able to restart guarded instances.
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.6.
---echo --------------------------------------------------------------------
-
---exec $UTIL/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30 im_life_cycle
-
-# Give some time to IM to detect that mysqld was restarted. It should be
-# longer than monitoring interval.
-
---sleep 3
-
-SHOW INSTANCES;
-
-###########################################################################
-#
-# 1.1.7. Check that Instance Manager does not restart non-guarded instance.
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.7.
---echo --------------------------------------------------------------------
-
-START INSTANCE mysqld2;
-# FIXME: START INSTANCE should be synchronous.
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
-
-# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
-# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
-# its pid file is not enough, because it is unknown when IM detects that
-# mysqld has started.
-# SHOW INSTANCES;
-
---exec $UTIL/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10 im_life_cycle
-
-# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
-# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
-# its pid file is not enough, because it is unknown when IM detects that
-# mysqld has started.
-# SHOW INSTANCES;
-
-###########################################################################
-#
-# 1.1.8. Check that Instance Manager returns an error on
-# incomplete SHOW INSTANCE STATUS command.
-#
-###########################################################################
-
---echo
---echo --------------------------------------------------------------------
---echo -- 1.1.8.
---echo --------------------------------------------------------------------
-
---error ER_SYNTAX_ERROR
-SHOW INSTANCE STATUS;
-
-#
-# Tests for bug fixes
-#
-
-#
-# Bug #12813 Instance Manager: START/STOP INSTANCE commands accept
-# a list as argument.
-#
-
---echo
---echo --------------------------------------------------------------------
---echo -- BUG#12813
---echo --------------------------------------------------------------------
-
---error ER_SYNTAX_ERROR
-START INSTANCE mysqld1,mysqld2,mysqld3;
-
---error ER_SYNTAX_ERROR
-STOP INSTANCE mysqld1,mysqld2,mysqld3;
-
-#
-# Bug #12673: Instance Manager: allows to stop the instance many times
-#
---error 3001
-STOP INSTANCE mysqld2;
-
---echo End of 5.0 tests
diff --git a/mysql-test/suite/im/t/im_options-im.opt b/mysql-test/suite/im/t/im_options-im.opt
deleted file mode 100644
index 34b74ce0c95..00000000000
--- a/mysql-test/suite/im/t/im_options-im.opt
+++ /dev/null
@@ -1 +0,0 @@
---monitoring-interval=1
diff --git a/mysql-test/suite/im/t/im_options.imtest b/mysql-test/suite/im/t/im_options.imtest
deleted file mode 100644
index d251b97d8e7..00000000000
--- a/mysql-test/suite/im/t/im_options.imtest
+++ /dev/null
@@ -1,248 +0,0 @@
-###########################################################################
-#
-# This test suite checks the following statements:
-# - SET <instance id>.<option name> = <option value>;
-# - UNSET <instance id>.<option name> = <option value>;
-# - FLUSH INSTANCES;
-#
-# For SET/UNSET we check that:
-# - SET ignores spaces correctly;
-# - UNSET does not allow option-value part (= <option value>);
-# - SET/UNSET can be applied several times w/o error;
-# - SET/UNSET is allowed only for stopped instances;
-# - SET/UNSET updates both the configuration cache in IM and
-# the configuration file;
-#
-# For FLUSH INSTANCES we check that:
-# - FLUSH INSTANCES is allowed only when all instances are stopped;
-#
-# According to the IM implementation details, we should play at least with the
-# following options:
-# - server_id
-# - port
-# - nonguarded
-#
-# Let's test SET statement on the option 'server_id'. It's expected that
-# originally the instances have the following server ids and states:
-# - mysqld1: server_id: 1; running (online)
-# - mysqld2: server_id: 2; stopped (offline)
-#
-# NOTE: each CREATE INSTANCE statement must specify socket-file-name, otherwise
-# this results of the test can be affected by another running test suite.
-#
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-###########################################################################
-#
-# Check that SET/UNSET is allowed only for stopped instances.
-#
-###########################################################################
-
-# - check that SET/UNSET is denied for running instances;
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-UNSET mysqld1.server_id;
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-SET mysqld1.server_id = 11;
-
-# - check that SET/UNSET is denied for active instances:
-# - create dummy misconfigured instance;
-# - start it;
-# - try to set/unset options;
-
-CREATE INSTANCE mysqld3
- datadir = '/',
- server_id = 3,
- socket = "$MYSQL_TMP_DIR/mysqld_3.sock";
-START INSTANCE mysqld3;
-
-# FIXME: START INSTANCE should be synchronous.
---sleep 3
-# should be longer than monitoring interval and enough to start instance.
-
-# NOTE: We can not analyze state of the instance here -- it can be Failed or
-# Starting because Instance Manager is trying to start the misconfigured
-# instance several times.
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-UNSET mysqld3.server_id;
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-SET mysqld3.server_id = 11;
-
-STOP INSTANCE mysqld3;
-
-# FIXME: STOP INSTANCE should be synchronous.
---sleep 3
-# should be longer than monitoring interval and enough to stop instance.
-
---replace_column 3 VERSION_NUMBER 4 VERSION
-SHOW INSTANCE STATUS mysqld3;
-
-# - check that SET/UNSET succeed for stopped instances;
-# - check that SET/UNSET can be applied multiple times;
-
-UNSET mysqld2.server_id;
-UNSET mysqld2.server_id;
-
---replace_column 2 option_value
-SHOW INSTANCE OPTIONS mysqld2;
-
-SET mysqld2.server_id = 2;
-SET mysqld2.server_id = 2;
-
---replace_column 2 option_value
-SHOW INSTANCE OPTIONS mysqld2;
-
-# - check that UNSET does not allow option-value part (= <option value>);
-
---error ER_SYNTAX_ERROR
-UNSET mysqld2.server_id = 11;
-
-# - check that SET/UNSET working properly with multiple options;
-
-SET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc = 0010, mysqld3.ddd = 0020;
-
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep '^ccc[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep '^ddd[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
-
-UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd;
-
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^ccc[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^ddd[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-# - check that if some instance name is invalid or the active is active,
-# whole SET-statement will not be executed;
-
---error 3000 # ER_BAD_INSTANCE_NAME
-SET mysqld2.aaa, mysqld3.bbb, mysqld.ccc = 0010;
-
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^ccc[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010;
-
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep '^ccc[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-# - check that if some instance name is invalid or the active is active,
-# whole UNSET-statement will not be executed;
-
---error 3000 # ER_BAD_INSTANCE_NAME
-UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc;
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
---error 3015 # ER_INSTANCE_IS_ACTIVE
-UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc;
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf;
---echo --------------------------------------------------------------------
-
-DROP INSTANCE mysqld3;
-
-# - check that spaces are handled correctly;
-
-SET mysqld2.server_id=222;
-SET mysqld2.server_id = 222;
-SET mysqld2.server_id = 222 ;
-SET mysqld2 . server_id = 222 ;
-SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ;
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
-
-UNSET mysqld2 . aaa , mysqld2 . bbb ;
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
---exec grep "^aaa\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
---exec grep "^bbb\$" $MYSQLTEST_VARDIR/im.cnf || true;
---echo --------------------------------------------------------------------
-
-###########################################################################
-#
-# Check that SET/UNSET updates both the configuration cache in IM and
-# the configuration file.
-#
-###########################################################################
-
-# - check that the configuration file has been updated (i.e. contains
-# server_id=SERVER_ID for mysqld2);
-
---echo --------------------------------------------------------------------
---exec grep '^server_id[^a-zA-Z0-9_-]' $MYSQLTEST_VARDIR/im.cnf ;
---echo --------------------------------------------------------------------
-
-# - (for mysqld1) check that the running instance has not been affected:
-# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id''
-# returns zero;
-
---connection mysql1_con
-
-SHOW VARIABLES LIKE 'server_id';
-
---connection default
-
-# - check that internal cache of Instance Manager has been affected;
-# TODO: we should check only server_id option here.
-
-# SHOW INSTANCE OPTIONS mysqld2;
-
-###########################################################################
-#
-# Check that FLUSH INSTANCES is allowed only when all instances are stopped.
-#
-###########################################################################
-
-SHOW INSTANCES;
-
---error 3016 # ER_THERE_IS_ACTIVE_INSTACE
-FLUSH INSTANCES;
-
-STOP INSTANCE mysqld1;
-# FIXME: STOP INSTANCE should be synchronous.
---sleep 3
-# should be longer than monitoring interval and enough to stop instance.
-
-SHOW INSTANCES;
-
-FLUSH INSTANCES;
diff --git a/mysql-test/suite/im/t/im_utils-im.opt b/mysql-test/suite/im/t/im_utils-im.opt
deleted file mode 100644
index 34b74ce0c95..00000000000
--- a/mysql-test/suite/im/t/im_utils-im.opt
+++ /dev/null
@@ -1 +0,0 @@
---monitoring-interval=1
diff --git a/mysql-test/suite/im/t/im_utils.imtest b/mysql-test/suite/im/t/im_utils.imtest
deleted file mode 100644
index b935634e96c..00000000000
--- a/mysql-test/suite/im/t/im_utils.imtest
+++ /dev/null
@@ -1,107 +0,0 @@
-###########################################################################
-#
-# This file contains test for (2) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---source suite/im/t/im_check_env.inc
-
-let $UTIL=$MYSQL_TEST_DIR/suite/im/t;
-
-###########################################################################
-
-#
-# Check 'SHOW INSTANCE OPTIONS' command.
-#
-# Since configuration of an mysqld-instance contains directories, we should
-# completely ignore the second column (values) in order to make the test
-# case produce the same results on different installations;
-# TODO: ignore values of only directory-specific options.
-#
-
---replace_column 2 VALUE
-SHOW INSTANCE OPTIONS mysqld1;
-
---replace_column 2 VALUE
-SHOW INSTANCE OPTIONS mysqld2;
-
-#
-# Before checking log files, we should start the second instance (mysqld2) to
-# give it a chance to create log files.
-#
-
-START INSTANCE mysqld2;
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_utils
-
-STOP INSTANCE mysqld2;
---exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_utils
-
-#
-# Check 'SHOW LOG FILES' command:
-# - check that log files of both offline and online instances are accessible;
-# - since placement of the log files is installation-specific, we should
-# ignore it in comparisson;
-# - also, we should ignore log file size, since it may depend on the version
-# being tested;
-#
-
---replace_column 2 PATH 3 FILE_SIZE
-SHOW mysqld1 LOG FILES;
-
---replace_column 2 PATH 3 FILE_SIZE
-SHOW mysqld2 LOG FILES;
-
-#
-# Check 'SHOW LOG' command:
-# - check that all three kinds of logs are available for both offline and
-# online instances;
-# - we should ignore the value, because it is very specific and depends on
-# many factors; we only check that Instance Manager is able to provide log
-# files.
-#
-
-# mysqld1 (online) w/o the optional argument.
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG ERROR 10;
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG SLOW 10;
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG GENERAL 10;
-
-# mysqld1 (online) with the optional argument.
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG ERROR 10, 2;
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG SLOW 10, 2;
-
---replace_column 1 LOG_DATA
-SHOW mysqld1 LOG GENERAL 10, 2;
-
-# mysqld2 (offline) w/o the optional argument.
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG ERROR 10;
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG SLOW 10;
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG GENERAL 10;
-
-# mysqld2 (offline) with the optional argument.
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG ERROR 10, 2;
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG SLOW 10, 2;
-
---replace_column 1 LOG_DATA
-SHOW mysqld2 LOG GENERAL 10, 2;
diff --git a/mysql-test/suite/im/t/kill_n_check.sh b/mysql-test/suite/im/t/kill_n_check.sh
deleted file mode 100755
index 6f2a0825dcd..00000000000
--- a/mysql-test/suite/im/t/kill_n_check.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/sh
-
-###########################################################################
-
-# NOTE: this script returns 0 (success) even in case of failure (except for
-# usage-error). This is because this script is executed under
-# mysql-test-run[.pl] and it's better to examine particular problem in log
-# file, than just having said that the test case has failed.
-
-###########################################################################
-
-basename=`basename "$0"`
-dirname=`dirname "$0"`
-
-###########################################################################
-
-. "$dirname/utils.sh"
-
-###########################################################################
-
-check_restart()
-{
- if [ ! -r "$pid_path" ]; then
- log_debug "No '$pid_path' found."
- user_msg='the process was killed'
- return 1
- fi
-
- new_pid=`cat "$pid_path" 2>/dev/null`
- err_code=$?
-
- log_debug "err_code: $err_code; original_pid: $original_pid; new_pid: $new_pid."
-
- if [ $err_code -eq 0 -a "$original_pid" = "$new_pid" ]; then
- log_debug "The process was not restarted."
- user_msg='the process was not restarted'
- return 1
- fi
-
- log_debug "The process was restarted."
- user_msg='the process was restarted'
- return 0
-}
-
-###########################################################################
-
-if [ $# -ne 4 ]; then
- echo "Usage: $basename <pid file path> killed|restarted <timeout> <test id>"
- exit 1
-fi
-
-pid_path="$1"
-expected_result="$2"
-total_timeout="$3"
-test_id="$4"
-log_file="$MYSQLTEST_VARDIR/log/$test_id.script.log"
-
-log_debug "-- $basename: starting --"
-log_debug "pid_path: '$pid_path'"
-log_debug "expected_result: '$expected_result'"
-log_debug "total_timeout: '$total_timeout'"
-log_debug "test_id: '$test_id'"
-log_debug "log_file: '$log_file'"
-
-###########################################################################
-
-if [ "$expected_result" != 'killed' -a \
- "$expected_result" != 'restarted' ]; then
- log_error "Invalid second argument ($expected_result): 'killed' or 'restarted' expected."
- quit 0
-fi
-
-if [ -z "$pid_path" ]; then
- log_error "Invalid PID path ($pid_path)."
- quit 0
-fi
-
-if [ ! -r "$pid_path" ]; then
- log_error "PID file ($pid_path) does not exist."
- quit 0
-fi
-
-if [ -z "$total_timeout" ]; then
- log_error "Timeout is not specified."
- quit 0
-fi
-
-###########################################################################
-
-original_pid=`cat "$pid_path"`
-log_debug "original_pid: $original_pid."
-
-log_info "Killing the process..."
-
-kill -9 $original_pid
-
-###########################################################################
-
-log_info "Waiting..."
-
-if [ "$expected_result" = "restarted" ]; then
-
- # Wait for the process to restart.
-
- cur_attempt=1
-
- while true; do
-
- log_debug "cur_attempt: $cur_attempt."
-
- if check_restart; then
- log_info "Success: $user_msg."
- quit 0
- fi
-
- [ $cur_attempt -ge $total_timeout ] && break
-
- log_debug "Sleeping for 1 second..."
- sleep 1
-
- cur_attempt=`expr $cur_attempt + 1`
-
- done
-
- log_error "$user_msg."
- quit 0
-
-else # $expected_result == killed
-
- # Here we have to sleep for some long time to ensure that the process will
- # not be restarted.
-
- log_debug "Sleeping for $total_timeout seconds..."
- sleep $total_timeout
-
- new_pid=`cat "$pid_path" 2>/dev/null`
- log_debug "new_pid: $new_pid."
-
- if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then
- log_error "The process was restarted."
- else
- log_info "Success: the process was killed."
- fi
-
- quit 0
-
-fi
diff --git a/mysql-test/suite/im/t/log.sh b/mysql-test/suite/im/t/log.sh
deleted file mode 100755
index 33ef6d6701f..00000000000
--- a/mysql-test/suite/im/t/log.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-###########################################################################
-
-basename=`basename "$0"`
-dirname=`dirname "$0"`
-
-###########################################################################
-
-. "$dirname/utils.sh"
-
-###########################################################################
-
-if [ $# -lt 2 ]; then
- echo "Usage: $basename <test id> log message ..."
- exit 1
-fi
-
-test_id="$1"
-log_file="$MYSQLTEST_VARDIR/log/$test_id.script.log"
-
-shift
-
-log_debug "$*"
diff --git a/mysql-test/suite/im/t/utils.sh b/mysql-test/suite/im/t/utils.sh
deleted file mode 100644
index b3f4744947d..00000000000
--- a/mysql-test/suite/im/t/utils.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-###########################################################################
-#
-# This file provides utility functions and is included by other scripts.
-#
-# The following global variables must be set before calling functions from this
-# file:
-# - basename -- base name of the calling script (main application);
-# - log_file -- where to store log records;
-#
-###########################################################################
-
-log()
-{
- [ -z "$log_file" ] && return;
-
- log_level="$1"
- log_msg="$2"
- ts=`date`
-
- echo "[$ts] [$basename] [$log_level] $log_msg" >> "$log_file";
-}
-
-###########################################################################
-
-log_debug()
-{
- log 'DEBUG' "$1"
-}
-
-###########################################################################
-
-log_info()
-{
- log 'INFO' "$1"
- echo "$1"
-}
-
-###########################################################################
-
-log_error()
-{
- log 'ERROR' "$1"
- echo "Error: $1"
-}
-
-###########################################################################
-
-quit()
-{
- exit_status="$1"
-
- log_debug "-- $basename: finished (exit_status: $exit_status) --"
-
- exit $exit_status
-}
diff --git a/mysql-test/suite/im/t/wait_for_process.sh b/mysql-test/suite/im/t/wait_for_process.sh
deleted file mode 100755
index 2143ab2002f..00000000000
--- a/mysql-test/suite/im/t/wait_for_process.sh
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-
-###########################################################################
-
-# NOTE: this script returns 0 (success) even in case of failure (except for
-# usage-error). This is because this script is executed under
-# mysql-test-run[.pl] and it's better to examine particular problem in log
-# file, than just having said that the test case has failed.
-
-###########################################################################
-
-basename=`basename "$0"`
-dirname=`dirname "$0"`
-
-###########################################################################
-
-. "$dirname/utils.sh"
-
-###########################################################################
-
-check_started()
-{
- if [ ! -r "$pid_path" ]; then
- log_debug "No PID-file ($pid_path) found -- not started."
- return 1
- fi
-
- new_pid=`cat "$pid_path" 2>/dev/null`
- err_code=$?
-
- log_debug "err_code: $err_code; new_pid: $new_pid."
-
- if [ $? -ne 0 -o -z "$new_pid" ]; then
- log_debug "The process was not started."
- return 1
- fi
-
- log_debug "The process was started."
- return 0
-}
-
-###########################################################################
-
-check_stopped()
-{
- if [ -r "$pid_path" ]; then
- log_debug "PID-file '$pid_path' exists -- not stopped."
- return 1
- fi
-
- log_debug "No PID-file ($pid_path) found -- stopped."
- return 0
-}
-
-###########################################################################
-
-if [ $# -ne 4 ]; then
- echo "Usage: $basename <pid file path> <total attempts> started|stopped <test id>"
- exit 1
-fi
-
-pid_path="$1"
-total_attempts="$2"
-event="$3"
-test_id="$4"
-log_file="$MYSQLTEST_VARDIR/log/$test_id.script.log"
-
-log_debug "-- $basename: starting --"
-log_debug "pid_path: '$pid_path'"
-log_debug "total_attempts: '$total_attempts'"
-log_debug "event: '$event'"
-log_debug "test_id: '$test_id'"
-log_debug "log_file: '$log_file'"
-
-###########################################################################
-
-case "$event" in
- started)
- check_fn='check_started';
- ;;
-
- stopped)
- check_fn='check_stopped';
- ;;
-
- *)
- log_error "Invalid third argument ('started' or 'stopped' expected)."
- quit 0
-esac
-
-###########################################################################
-
-cur_attempt=1
-
-while true; do
-
- log_debug "cur_attempt: $cur_attempt."
-
- if ( eval $check_fn ); then
- log_info "Success: the process has been $event."
- quit 0
- fi
-
- [ $cur_attempt -ge $total_attempts ] && break
-
- log_debug "Sleeping for 1 second..."
- sleep 1
-
- cur_attempt=`expr $cur_attempt + 1`
-
-done
-
-log_error "The process has not been $event in $total_attempts secs."
-quit 0
diff --git a/mysql-test/suite/im/t/wait_for_socket.sh b/mysql-test/suite/im/t/wait_for_socket.sh
deleted file mode 100755
index 2fa7d5c5b7e..00000000000
--- a/mysql-test/suite/im/t/wait_for_socket.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/sh
-
-###########################################################################
-
-# NOTE: this script returns 0 (success) even in case of failure (except for
-# usage-error). This is because this script is executed under
-# mysql-test-run[.pl] and it's better to examine particular problem in log
-# file, than just having said that the test case has failed.
-
-###########################################################################
-
-basename=`basename "$0"`
-dirname=`dirname "$0"`
-
-###########################################################################
-
-. "$dirname/utils.sh"
-
-###########################################################################
-
-if [ $# -ne 7 ]; then
- echo "Usage: wait_for_socket.sh <executable path> <socket path> <username> <password> <db> <timeout> <test id>"
- exit 1
-fi
-
-client_exe="$1"
-socket_path="$2"
-username="$3"
-password="$4"
-db="$5"
-total_timeout="$6"
-test_id="$7"
-log_file="$MYSQLTEST_VARDIR/log/$test_id.script.log"
-
-log_debug "-- $basename: starting --"
-log_debug "client_exe: '$client_exe'"
-log_debug "socket_path: '$socket_path'"
-log_debug "username: '$username'"
-log_debug "password: '$password'"
-log_debug "db: '$db'"
-log_debug "total_timeout: '$total_timeout'"
-log_debug "test_id: '$test_id'"
-log_debug "log_file: '$log_file'"
-
-###########################################################################
-
-if [ -z "$client_exe" ]; then
- log_error "Invalid path to client executable ($client_exe)."
- quit 0;
-fi
-
-if [ ! -x "$client_exe" ]; then
- log_error "Client by path '$client_exe' is not available."
- quit 0;
-fi
-
-if [ -z "$socket_path" ]; then
- log_error "Invalid socket patch ($socket_path)."
- quit 0
-fi
-
-###########################################################################
-
-client_args="--no-defaults --silent --socket=$socket_path --connect_timeout=1 "
-
-[ -n "$username" ] && client_args="$client_args --user=$username "
-[ -n "$password" ] && client_args="$client_args --password=$password "
-[ -n "$db" ] && client_args="$client_args $db"
-
-log_debug "client_args: '$client_args'"
-
-###########################################################################
-
-cur_attempt=1
-
-while true; do
-
- log_debug "cur_attempt: $cur_attempt."
-
- if ( echo 'quit' | "$client_exe" $client_args >/dev/null 2>&1 ); then
- log_info "Success: server is ready to accept connection on socket."
- quit 0
- fi
-
- [ $cur_attempt -ge $total_timeout ] && break
-
- sleep 1
-
- cur_attempt=`expr $cur_attempt + 1`
-
-done
-
-log_error "Server does not accept connections after $total_timeout seconds."
-quit 0
diff --git a/mysql-test/suite/large_tests/r/lock_tables_big.result b/mysql-test/suite/large_tests/r/lock_tables_big.result
new file mode 100644
index 00000000000..de639143055
--- /dev/null
+++ b/mysql-test/suite/large_tests/r/lock_tables_big.result
@@ -0,0 +1 @@
+all done
diff --git a/mysql-test/suite/large_tests/t/lock_tables_big.test b/mysql-test/suite/large_tests/t/lock_tables_big.test
new file mode 100644
index 00000000000..41dcff3577c
--- /dev/null
+++ b/mysql-test/suite/large_tests/t/lock_tables_big.test
@@ -0,0 +1,32 @@
+#
+# Bug#24509 cannot use more than 2048 file descriptors on windows
+#
+--disable_query_log
+create database many_tables;
+use many_tables;
+let $max_tables=3000;
+let $i=$max_tables;
+
+--disable_warnings
+create table t (i int);
+let $table_list=t READ;
+
+while ($i)
+{
+ eval create table t$i (i int);
+ let $table_list= $table_list ,t$i READ;
+ dec $i;
+}
+
+#lock all tables we just created (resembles mysqldump startup is doing with --all-databases operation)
+#There will be 3 descriptors for each table (table.FRM, table.MYI and table.MYD files) means 9000 files
+#descriptors altogether. For Microsoft C runtime, this is way too many.
+
+eval LOCK TABLES $table_list;
+unlock tables;
+
+drop database many_tables;
+--disable_query_log
+--echo all done
+
+
diff --git a/mysql-test/suite/ndb/my.cnf b/mysql-test/suite/ndb/my.cnf
index a19fdeee302..37dfc3945ce 100644
--- a/mysql-test/suite/ndb/my.cnf
+++ b/mysql-test/suite/ndb/my.cnf
@@ -1,5 +1,6 @@
!include include/default_mysqld.cnf
!include include/default_ndbd.cnf
+!include include/default_client.cnf
[cluster_config.1]
NoOfReplicas= 2
diff --git a/mysql-test/suite/ndb/r/ndb_bitfield.result b/mysql-test/suite/ndb/r/ndb_bitfield.result
index 59c4d420b22..826f3a98348 100644
--- a/mysql-test/suite/ndb/r/ndb_bitfield.result
+++ b/mysql-test/suite/ndb/r/ndb_bitfield.result
@@ -204,7 +204,7 @@ b int
ERROR HY000: Can't create table 'test.t1' (errno: 906)
show warnings;
Level Code Message
-Error 1296 Got error 906 'Unsupported attribute type in index' from NDB
+Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
Error 1005 Can't create table 'test.t1' (errno: 906)
create table t1 (
pk1 int not null primary key,
@@ -214,7 +214,7 @@ key(b)
ERROR HY000: Can't create table 'test.t1' (errno: 906)
show warnings;
Level Code Message
-Error 1296 Got error 906 'Unsupported attribute type in index' from NDB
+Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
Error 1005 Can't create table 'test.t1' (errno: 906)
create table t1 (
pk1 int primary key,
diff --git a/mysql-test/suite/ndb/r/ndb_dd_alter.result b/mysql-test/suite/ndb/r/ndb_dd_alter.result
index 94426546115..7ebbb24c84f 100644
--- a/mysql-test/suite/ndb/r/ndb_dd_alter.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_alter.result
@@ -314,11 +314,11 @@ a1
20
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
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 KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
+def test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
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 KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
+def test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
SELECT * FROM test.t1 ORDER BY a1;
a1 a2 a3
1 2.2345 20000001
diff --git a/mysql-test/suite/ndb/r/ndb_dd_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result
index 41e3d10fe5b..b956d3b0047 100644
--- a/mysql-test/suite/ndb/r/ndb_dd_basic.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_basic.result
@@ -8,20 +8,20 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Warning 1286 Unknown table engine 'XYZ'
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
diff --git a/mysql-test/suite/ndb/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
index d8d9e8631d5..9714a89c2ab 100644
--- a/mysql-test/suite/ndb/r/ndb_dd_ddl.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
@@ -15,7 +15,7 @@ ENGINE NDB;
ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
-Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
+Warning 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Error 1528 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
@@ -236,3 +236,79 @@ engine ndb;
ERROR HY000: Failed to drop TABLESPACE
drop logfile group lg1
engine ndb;
+
+# -----------------------------------------------------------------
+# End 5.1 test
+# -----------------------------------------------------------------
+
+# --
+# -- WL#4300: Define privileges for tablespaces.
+# --
+GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
+
+DROP DATABASE IF EXISTS mysqltest2;
+CREATE DATABASE mysqltest2;
+GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
+
+# -- Connection: mysqltest_u1@localhost
+
+# -- Grants for mysqltest_u1@localhost:
+SHOW GRANTS;
+Grants for mysqltest_u1@localhost
+GRANT CREATE TABLESPACE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# -- Check CREATE LOGFILE GROUP...
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE = NDB;
+
+# -- Check ALTER LOGFILE GROUP...
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+# -- Check CREATE TABLESPACE...
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+# -- Check ALTER TABLESPACE...
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+# -- Connection: mysqltest_u2@localhost
+
+# -- Grants for mysqltest_u2@localhost:
+SHOW GRANTS;
+Grants for mysqltest_u2@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u2'@'localhost'
+GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'mysqltest_u2'@'localhost'
+CREATE TABLE t1(c INT) TABLESPACE ts1;
+DROP TABLE t1;
+
+# -- Connection: mysqltest_u1@localhost
+
+
+# -- Check DROP TABLESPACE...
+DROP TABLESPACE ts1
+ENGINE = NDB;
+
+# -- Check DROP LOGFILE GROUP...
+DROP LOGFILE GROUP lg1
+ENGINE = NDB;
+
+# -- Connection: root@localhost
+
+DROP USER mysqltest_u1@localhost;
+DROP USER mysqltest_u2@localhost;
+
+# -----------------------------------------------------------------
+# End 6.0 test
+# -----------------------------------------------------------------
diff --git a/mysql-test/suite/ndb/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result
index 374d702c408..61d15b7cb98 100644
--- a/mysql-test/suite/ndb/r/ndb_gis.result
+++ b/mysql-test/suite/ndb/r/ndb_gis.result
@@ -463,7 +463,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
@@ -1013,7 +1013,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
diff --git a/mysql-test/suite/ndb/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result
index bfc0c5a2e56..1fe02d4b5c7 100644
--- a/mysql-test/suite/ndb/r/ndb_index_unique.result
+++ b/mysql-test/suite/ndb/r/ndb_index_unique.result
@@ -682,7 +682,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b))
engine=ndb charset=utf8;
insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200));
insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
-ERROR 23000: Duplicate entry '∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫d' for key 'b'
+ERROR 23000: Duplicate entry '\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bd' for key 'b'
select a, sha1(b) from t1;
a sha1(b)
1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d
diff --git a/mysql-test/suite/ndb/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result
index 3d34b16a1a8..96986490d23 100644
--- a/mysql-test/suite/ndb/r/ndb_multi_row.result
+++ b/mysql-test/suite/ndb/r/ndb_multi_row.result
@@ -63,6 +63,6 @@ t4
drop table t1, t2, t3, t4;
drop table if exists t1, t3, t4;
Warnings:
-Error 155 Table 'test.t1' doesn't exist
-Error 155 Table 'test.t3' doesn't exist
-Error 155 Table 'test.t4' doesn't exist
+Warning 155 Table 'test.t1' doesn't exist
+Warning 155 Table 'test.t3' doesn't exist
+Warning 155 Table 'test.t4' doesn't exist
diff --git a/mysql-test/suite/ndb/r/ndb_partition_error.result b/mysql-test/suite/ndb/r/ndb_partition_error.result
index d86dc382185..df2db5c5f06 100644
--- a/mysql-test/suite/ndb/r/ndb_partition_error.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_error.result
@@ -14,7 +14,7 @@ partition x3 values less than (20) nodegroup 14);
ERROR HY000: Can't create table 'test.t1' (errno: 140)
show warnings;
Level Code Message
-Error 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB
+Warning 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB
Error 1005 Can't create table 'test.t1' (errno: 140)
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/suite/ndb/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result
index 83eff9ea2ee..fbaec81984d 100644
--- a/mysql-test/suite/ndb/r/ndb_partition_range.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_range.result
@@ -17,9 +17,9 @@ INSERT into t1 values (10, 1, 1);
INSERT into t1 values (15, 1, 1);
select * from information_schema.partitions where 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 RANGE NULL a NULL 5 0 0 0 # 0 0 # # NULL NULL default NULL
-NULL test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default NULL
-NULL test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default NULL
+def test t1 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 0 0 # # NULL NULL default NULL
+def test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default NULL
+def test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default NULL
select * from t1 order by a;
a b c
1 1 1
diff --git a/mysql-test/suite/ndb/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result
index f6b50a1dfdc..186cbb71f5e 100644
--- a/mysql-test/suite/ndb/r/ndb_restore.result
+++ b/mysql-test/suite/ndb/r/ndb_restore.result
@@ -140,9 +140,9 @@ ForceVarPart: 0
ForceVarPart: 1
select * from information_schema.columns where table_name = "t1_c";
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 test t1_c capgoaledatta 1 NULL NO mediumint NULL NULL 7 0 NULL NULL mediumint(5) unsigned PRI auto_increment select,insert,update,references
-NULL test t1_c goaledatta 2 NO char 2 2 NULL NULL latin1 latin1_swedish_ci char(2) PRI select,insert,update,references
-NULL test t1_c maturegarbagefa 3 NO varchar 32 32 NULL NULL latin1 latin1_swedish_ci varchar(32) PRI select,insert,update,references
+def test t1_c capgoaledatta 1 NULL NO mediumint NULL NULL 7 0 NULL NULL mediumint(5) unsigned PRI auto_increment select,insert,update,references
+def test t1_c goaledatta 2 NO char 2 2 NULL NULL latin1 latin1_swedish_ci char(2) PRI select,insert,update,references
+def test t1_c maturegarbagefa 3 NO varchar 32 32 NULL NULL latin1 latin1_swedish_ci varchar(32) PRI select,insert,update,references
select count(*) from t1;
count(*)
5
diff --git a/mysql-test/suite/ndb/r/ndb_row_format.result b/mysql-test/suite/ndb/r/ndb_row_format.result
index eea0692dd92..48a314c2fe9 100644
--- a/mysql-test/suite/ndb/r/ndb_row_format.result
+++ b/mysql-test/suite/ndb/r/ndb_row_format.result
@@ -8,7 +8,7 @@ ENGINE=NDB;
ERROR HY000: Can't create table 'test.t1' (errno: 138)
SHOW WARNINGS;
Level Code Message
-Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
+Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Error 1005 Can't create table 'test.t1' (errno: 138)
CREATE TABLE t1
( a INT KEY,
diff --git a/mysql-test/suite/ndb/r/ndb_single_user.result b/mysql-test/suite/ndb/r/ndb_single_user.result
index 8133e540d71..1d5f3041adb 100644
--- a/mysql-test/suite/ndb/r/ndb_single_user.result
+++ b/mysql-test/suite/ndb/r/ndb_single_user.result
@@ -9,7 +9,7 @@ ENGINE=NDB;
ERROR HY000: Failed to create LOGFILE GROUP
show warnings;
Level Code Message
-Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
+Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to create LOGFILE GROUP
create table t1 (a int key, b int unique, c int) engine ndb;
CREATE LOGFILE GROUP lg1
@@ -25,14 +25,14 @@ ENGINE NDB;
ERROR HY000: Failed to create TABLESPACE
show warnings;
Level Code Message
-Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
+Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to create TABLESPACE
DROP LOGFILE GROUP lg1
ENGINE =NDB;
ERROR HY000: Failed to drop LOGFILE GROUP
show warnings;
Level Code Message
-Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
+Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1529 Failed to drop LOGFILE GROUP
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
@@ -45,7 +45,7 @@ ENGINE NDB;
ERROR HY000: Failed to alter: DROP DATAFILE
show warnings;
Level Code Message
-Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
+Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1533 Failed to alter: DROP DATAFILE
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
@@ -55,7 +55,7 @@ ENGINE NDB;
ERROR HY000: Failed to drop TABLESPACE
show warnings;
Level Code Message
-Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
+Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1529 Failed to drop TABLESPACE
DROP TABLESPACE ts1
ENGINE NDB;
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
index 73a2e0c1dda..e57fdcb6df6 100644
--- a/mysql-test/suite/ndb/r/ps_7ndb.result
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1790,8 +1790,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1812,7 +1812,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1910,8 +1910,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/suite/ndb/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
index d6de7c45326..e8db0730687 100644
--- a/mysql-test/suite/ndb/t/ndb_dd_ddl.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
@@ -367,4 +367,103 @@ engine ndb;
--exec rm $MYSQLTEST_VARDIR/tmp/t1.frm
-# End 5.1 test
+--echo
+--echo # -----------------------------------------------------------------
+--echo # End 5.1 test
+--echo # -----------------------------------------------------------------
+
+--echo
+--echo # --
+--echo # -- WL#4300: Define privileges for tablespaces.
+--echo # --
+
+GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
+
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest2;
+--enable_warnings
+
+CREATE DATABASE mysqltest2;
+
+GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
+
+--echo
+--echo # -- Connection: mysqltest_u1@localhost
+--echo
+--connect(con1, localhost, mysqltest_u1,,)
+
+--echo # -- Grants for mysqltest_u1@localhost:
+SHOW GRANTS;
+
+--echo
+--echo # -- Check CREATE LOGFILE GROUP...
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE = NDB;
+
+--echo
+--echo # -- Check ALTER LOGFILE GROUP...
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+--echo
+--echo # -- Check CREATE TABLESPACE...
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+--echo
+--echo # -- Check ALTER TABLESPACE...
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+INITIAL_SIZE 1M
+ENGINE = NDB;
+
+--echo
+--echo # -- Connection: mysqltest_u2@localhost
+--echo
+--connect(con2, localhost, mysqltest_u2,,mysqltest2)
+
+--echo # -- Grants for mysqltest_u2@localhost:
+SHOW GRANTS;
+
+CREATE TABLE t1(c INT) TABLESPACE ts1;
+
+DROP TABLE t1;
+
+--echo
+--echo # -- Connection: mysqltest_u1@localhost
+--echo
+--connection con1
+
+--echo
+--echo # -- Check DROP TABLESPACE...
+DROP TABLESPACE ts1
+ENGINE = NDB;
+
+--echo
+--echo # -- Check DROP LOGFILE GROUP...
+DROP LOGFILE GROUP lg1
+ENGINE = NDB;
+
+--echo
+--echo # -- Connection: root@localhost
+--echo
+--connection default
+--disconnect con1
+
+DROP USER mysqltest_u1@localhost;
+DROP USER mysqltest_u2@localhost;
+
+--echo
+--echo # -----------------------------------------------------------------
+--echo # End 6.0 test
+--echo # -----------------------------------------------------------------
diff --git a/mysql-test/suite/parts/inc/partition_key_32col.inc b/mysql-test/suite/parts/inc/partition_key_32col.inc
index 74016d9b556..b0635ca0e9c 100644
--- a/mysql-test/suite/parts/inc/partition_key_32col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_32col.inc
@@ -1,4 +1,4 @@
---error ER_TOO_MANY_KEY_PARTS
+--error ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR
eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine=$engine
partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) (
partition pa1 max_rows=20 min_rows=2,
diff --git a/mysql-test/suite/parts/inc/partition_mgm.inc b/mysql-test/suite/parts/inc/partition_mgm.inc
index 1ab548222a8..9dfa2b2ffb3 100644
--- a/mysql-test/suite/parts/inc/partition_mgm.inc
+++ b/mysql-test/suite/parts/inc/partition_mgm.inc
@@ -13,6 +13,7 @@
# part_optA-D Extra partitioning options (E.g. INDEX/DATA DIR) #
# #
# have_bug33158 NDB case insensitive create, but case sensitive rename #
+# no_truncate No support for truncate partition #
#------------------------------------------------------------------------------#
# Original Author: mattiasj #
# Original Date: 2008-06-27 #
@@ -518,6 +519,95 @@ DROP TABLE TableA;
}
# End of $can_only_key
+if ($no_truncate)
+{
+--echo # Verify that TRUNCATE PARTITION gives error
+eval CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+ b VARCHAR(255))
+ENGINE = $engine
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+ PARTITION LT2000,
+ PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED, ER_ILLEGAL_HA
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+}
+if (!$no_truncate)
+{
+--echo # Testing TRUNCATE PARTITION
+eval CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+ b VARCHAR(255))
+ENGINE = $engine
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+ PARTITION LT2000 VALUES LESS THAN (2000),
+ PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY a;
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+--echo # Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+--echo # Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+--echo # Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+--echo # Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+--echo # Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+--echo # Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+}
--echo # Cleaning up before exit
eval USE $old_db;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/inc/partition_syntax.inc b/mysql-test/suite/parts/inc/partition_syntax.inc
index e72aad80f0a..e7eea73325a 100644
--- a/mysql-test/suite/parts/inc/partition_syntax.inc
+++ b/mysql-test/suite/parts/inc/partition_syntax.inc
@@ -312,7 +312,7 @@ PARTITION BY RANGE(f_int1)
--echo #------------------------------------------------------------------------
--echo # 3.5.1 NULL in RANGE partitioning clause
--echo # 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
---error ER_PARSE_ERROR
+--error ER_NULL_IN_VALUES_LESS_THAN
eval CREATE TABLE t1 (
$column_list
)
@@ -320,7 +320,7 @@ PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
---error ER_PARSE_ERROR
+--error ER_NULL_IN_VALUES_LESS_THAN
eval CREATE TABLE t1 (
$column_list
)
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
index 30ff27df298..4f623813386 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
@@ -915,6 +915,18 @@ TableA CREATE TABLE `TableA` (
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Archive'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
index cd55ffbad03..19f16780d13 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
@@ -915,6 +915,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'InnoDB'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+MySQL_Test_DB.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
index faf776e03a3..69a43b64d87 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
@@ -915,6 +915,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Memory'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+MySQL_Test_DB.t1 analyze note The storage engine for the table doesn't support analyze
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
index 827f7a15c24..9b4e85be9d0 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
@@ -915,6 +915,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'MyISAM'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+MySQL_Test_DB.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
index 45b674638e7..15b3f424527 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
@@ -181,6 +181,18 @@ TableA CREATE TABLE `TableA` (
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
# Cleaning up after KEY PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'NDBCluster'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
index 443453a2d70..4cd8cafa3ee 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
@@ -882,6 +882,18 @@ TableA CREATE TABLE `tablea` (
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Archive'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
index 49ccc7b1808..952f4136cb6 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `tablea` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'InnoDB'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
index 6f34054428c..435a0d8313e 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `tablea` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Memory'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze note The storage engine for the table doesn't support analyze
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
index ac230e29c66..3a90ce4d73c 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `tablea` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'MyISAM'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
index 0a53e1b4a9b..1d221caa163 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
@@ -219,6 +219,18 @@ TableA CREATE TABLE `tablea` (
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
# Cleaning up after KEY PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'NDBCluster'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
index fc0390c238d..6e8abfef06d 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
@@ -882,6 +882,18 @@ TableA CREATE TABLE `TableA` (
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Archive'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
index da111137068..8e42bc9eb62 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'InnoDB'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
index a1716ea36c8..24047912ab1 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'Memory'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze note The storage engine for the table doesn't support analyze
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
index 6bdfa149de0..7a61a811ea3 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
@@ -882,6 +882,170 @@ TableA CREATE TABLE `TableA` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
# Cleaning up after LIST PARTITIONING test
DROP TABLE TableA;
+# Testing TRUNCATE PARTITION
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'MyISAM'
+PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000),
+PARTITION LT2000 VALUES LESS THAN (2000),
+PARTITION MAX VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL AUTO_INCREMENT,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (a)
+(PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM,
+ PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM,
+ PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+SELECT * FROM t1 ORDER BY a;
+a b
+1 First
+2 Second
+999 Last in LT1000
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First in MAX
+2001 Second in MAX
+ALTER TABLE t1 ANALYZE PARTITION MAX;
+Table Op Msg_type Msg_text
+mysql_test_db.t1 analyze status OK
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (1)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (2)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (3)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE MAX (4)");
+SELECT * FROM t1 WHERE a >= 2000;
+a b
+2000 First after TRUNCATE MAX (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT1000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT1000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+1000 First in LT2000
+1001 Second in LT2000
+1999 Last in LT2000
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+# Truncate without FLUSH
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (1)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+# Truncate with FLUSH after
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+FLUSH TABLES;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (2)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+# Truncate with FLUSH before
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (3)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+# Truncate with FLUSH after INSERT
+FLUSH TABLES;
+ALTER TABLE t1 TRUNCATE PARTITION LT2000;
+INSERT INTO t1 VALUES (NULL, "First after TRUNCATE LT2000 (4)");
+SELECT * FROM t1 ORDER BY a;
+a b
+2000 First after TRUNCATE MAX (4)
+2001 First after TRUNCATE LT1000 (1)
+2002 First after TRUNCATE LT1000 (2)
+2003 First after TRUNCATE LT1000 (3)
+2004 First after TRUNCATE LT1000 (4)
+2005 First after TRUNCATE LT2000 (1)
+2006 First after TRUNCATE LT2000 (2)
+2007 First after TRUNCATE LT2000 (3)
+2008 First after TRUNCATE LT2000 (4)
+DROP TABLE t1;
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
index 8b9c5be1fb6..2f5dfe5e08e 100644
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
@@ -219,6 +219,18 @@ TableA CREATE TABLE `TableA` (
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
# Cleaning up after KEY PARTITIONING test
DROP TABLE TableA;
+# Verify that TRUNCATE PARTITION gives error
+CREATE TABLE t1
+(a BIGINT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(255))
+ENGINE = 'NDBCluster'
+PARTITION BY KEY (a)
+(PARTITION LT1000,
+PARTITION LT2000,
+PARTITION MAX);
+INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
+ALTER TABLE t1 TRUNCATE PARTITION MAX;
+Got one of the listed errors
# Cleaning up before exit
USE test;
DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 8869f6d450c..26c1ac9356c 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -133,7 +133,7 @@ partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR 42000: Too many key parts specified; max 16 parts allowed
+ERROR HY000: Too many fields in 'list of partition fields'
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='InnoDB'
partition by key(a,b,c,d,e,f,g,h) (
partition pa1 max_rows=20 min_rows=2,
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index 7167d6af39e..60c9f9666cd 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -133,7 +133,7 @@ partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR 42000: Too many key parts specified; max 16 parts allowed
+ERROR HY000: Too many fields in 'list of partition fields'
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='MyISAM'
partition by key(a,b,c,d,e,f,g,h) (
partition pa1 max_rows=20 min_rows=2,
diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result
index c27a1386409..848a30a13df 100644
--- a/mysql-test/suite/parts/r/partition_syntax_innodb.result
+++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result
@@ -610,8 +610,7 @@ f_charbig VARCHAR(1000)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
-PARTITION part2 VALUES LESS THAN (1000))' at line 9
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -623,8 +622,7 @@ f_charbig VARCHAR(1000)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
-PARTITION part2 VALUES LESS THAN (1000))' at line 9
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.2 NULL in LIST partitioning clause
# 3.5.2.1 VALUE IN (NULL)
CREATE TABLE t1 (
diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result
index 0cf98765797..f3b7f5b3025 100644
--- a/mysql-test/suite/parts/r/partition_syntax_myisam.result
+++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result
@@ -610,8 +610,7 @@ f_charbig VARCHAR(1000)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
-PARTITION part2 VALUES LESS THAN (1000))' at line 9
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
@@ -623,8 +622,7 @@ f_charbig VARCHAR(1000)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
-PARTITION part2 VALUES LESS THAN (1000))' at line 9
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
# 3.5.2 NULL in LIST partitioning clause
# 3.5.2.1 VALUE IN (NULL)
CREATE TABLE t1 (
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index c2537815631..dfce1c3cdfa 100644
--- a/mysql-test/suite/parts/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -177,6 +177,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT count(*) "Slave norm" FROM t1;
Slave norm 500
SELECT count(*) "Slave bykey" FROM t2;
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
index 5b4f2568d46..313da329a9f 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test
@@ -35,6 +35,7 @@
##### Storage engine to be tested
--source include/have_archive.inc
let $engine= 'Archive';
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test
index 686c69cca25..736e45067bc 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test
@@ -41,6 +41,8 @@ let $can_only_key= 1;
# Allow hash/list/range partitioning with ndb
#SET new=on;
let $engine= 'NDBCluster';
+# NDB does not yet support TRUNCATE PARTITION
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test
index 2bc643db75f..58eef828f06 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test
@@ -32,6 +32,7 @@
##### Storage engine to be tested
--source include/have_archive.inc
let $engine= 'Archive';
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test
index a70b9b5c41c..ac425eb84ff 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test
@@ -38,6 +38,8 @@ let $can_only_key= 1;
# Allow hash/list/range partitioning with ndb
#SET new=on;
let $engine= 'NDBCluster';
+# NDB does not yet support TRUNCATE PARTITION
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test
index d0e2591804d..92036178e59 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test
@@ -32,6 +32,7 @@
##### Storage engine to be tested
--source include/have_archive.inc
let $engine= 'Archive';
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test
index 67fdfdde70b..725ba3b5e74 100644
--- a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test
+++ b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test
@@ -37,6 +37,8 @@ let $can_only_key= 1;
# Allow hash/list/range partitioning with ndb
#SET new=on;
let $engine= 'NDBCluster';
+# NDB does not yet support TRUNCATE PARTITION
+let $no_truncate= 1;
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf
index ea4caeb2ddd..4d0e5e51664 100644
--- a/mysql-test/suite/rpl/my.cnf
+++ b/mysql-test/suite/rpl/my.cnf
@@ -1,6 +1,7 @@
# Use settings from rpl_1slave_base.cnf
# add setting to connect the slave to the master by default
!include rpl_1slave_base.cnf
+!include include/default_client.cnf
[mysqld.2]
# Hardcode the host to 127.0.0.1 until running on more
diff --git a/mysql-test/suite/rpl/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result
index 03b96d5870b..d6cb544df7c 100644
--- a/mysql-test/suite/rpl/r/rpl_000015.result
+++ b/mysql-test/suite/rpl/r/rpl_000015.result
@@ -44,6 +44,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 0
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
SHOW SLAVE STATUS;
@@ -85,6 +87,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 0
start slave;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -125,6 +129,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
diff --git a/mysql-test/suite/rpl/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index 16fa931e303..8c1277445b2 100644
--- a/mysql-test/suite/rpl/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
@@ -8,4 +8,4 @@ create table t1 (a int) engine=myisam;
flush tables;
drop table if exists t1;
Warnings:
-Error 2 Can't find file: 't1' (errno: 2)
+Warning 2 Can't find file: 't1' (errno: 2)
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index 4a789f361c6..2a7e4401500 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -17,16 +17,15 @@ show grants for x@y;
Grants for x@y
GRANT USAGE ON *.* TO 'x'@'y'
GRANT SELECT ON `d1`.`t` TO 'x'@'y'
-show binlog events;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 193 drop database if exists d1
-master-bin.000001 193 Query 1 272 create database d1
-master-bin.000001 272 Query 1 370 use `d1`; create table t (s1 int) engine=innodb
-master-bin.000001 370 Query 1 436 BEGIN
-master-bin.000001 436 Query 1 521 use `d1`; insert into t values (1)
-master-bin.000001 521 Xid 1 548 COMMIT /* XID */
-master-bin.000001 548 Query 1 633 use `d1`; grant select on t to x@y
+master-bin.000001 # Query # # drop database if exists d1
+master-bin.000001 # Query # # create database d1
+master-bin.000001 # Query # # use `d1`; create table t (s1 int) engine=innodb
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `d1`; insert into t values (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `d1`; grant select on t to x@y
start transaction;
insert into t values (2);
revoke select on t from x@y;
@@ -38,19 +37,18 @@ s1
show grants for x@y;
Grants for x@y
GRANT USAGE ON *.* TO 'x'@'y'
-show binlog events;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 193 drop database if exists d1
-master-bin.000001 193 Query 1 272 create database d1
-master-bin.000001 272 Query 1 370 use `d1`; create table t (s1 int) engine=innodb
-master-bin.000001 370 Query 1 436 BEGIN
-master-bin.000001 436 Query 1 521 use `d1`; insert into t values (1)
-master-bin.000001 521 Xid 1 548 COMMIT /* XID */
-master-bin.000001 548 Query 1 633 use `d1`; grant select on t to x@y
-master-bin.000001 633 Query 1 699 BEGIN
-master-bin.000001 699 Query 1 784 use `d1`; insert into t values (2)
-master-bin.000001 784 Xid 1 811 COMMIT /* XID */
-master-bin.000001 811 Query 1 899 use `d1`; revoke select on t from x@y
+master-bin.000001 # Query # # drop database if exists d1
+master-bin.000001 # Query # # create database d1
+master-bin.000001 # Query # # use `d1`; create table t (s1 int) engine=innodb
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `d1`; insert into t values (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `d1`; grant select on t to x@y
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `d1`; insert into t values (2)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `d1`; revoke select on t from x@y
drop user x@y;
drop database d1;
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index a17941f6ba9..ba3c3ebafe6 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -43,4 +43,6 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno #
Last_SQL_Error Failed during slave thread initialization
+Replicate_Ignore_Server_Ids
+Master_Server_Id 0
SET GLOBAL debug="";
diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
index c06c1201e3d..a51ba50475b 100644
--- a/mysql-test/suite/rpl/r/rpl_change_master.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
@@ -50,6 +50,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
change master to master_user='root';
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -90,9 +92,28 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
select * from t1;
n
1
2
drop table t1;
+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;
+create table t1 (a int);
+insert into t1 values (1);
+flush logs;
+insert into t1 values (2);
+include/stop_slave.inc
+delete from t1 where a=2;
+CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
+start slave sql_thread;
+start slave io_thread;
+set global relay_log_purge=1;
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 6c8d35619e5..25c31675b53 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -89,6 +89,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
*** Test lock wait timeout ***
include/stop_slave.inc
@@ -151,13 +153,15 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
*** Test lock wait timeout and purged relay logs ***
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
include/stop_slave.inc
DELETE FROM t2;
-CHANGE MASTER TO MASTER_LOG_POS=440;
+CHANGE MASTER TO MASTER_LOG_POS=441;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
@@ -218,6 +222,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
*** Clean up ***
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_host.result b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
new file mode 100644
index 00000000000..46ef32d415b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
@@ -0,0 +1,16 @@
+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;
+STOP SLAVE;
+Master_Host = '127.0.0.1' (expected '127.0.0.1')
+CHANGE MASTER TO MASTER_HOST="";
+ERROR HY000: Incorrect arguments to MASTER_HOST
+Master_Host = '127.0.0.1' (expected '127.0.0.1')
+CHANGE MASTER TO MASTER_HOST="foo";
+Master_Host = 'foo' (expected 'foo')
+CHANGE MASTER TO MASTER_HOST="127.0.0.1";
+Master_Host = '127.0.0.1' (expected '127.0.0.1')
+START SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
index 63154383e8c..21d9fc5a919 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
@@ -93,6 +93,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@@ -160,6 +162,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t3 ***
@@ -222,6 +226,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t4 ***
@@ -284,6 +290,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t5 ***
@@ -345,6 +353,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
DROP TABLE t6;
@@ -481,6 +491,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t10 ***
@@ -542,6 +554,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t11 ***
@@ -792,6 +806,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1060
Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
*** Try to insert in master ****
@@ -932,6 +948,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
** DROP table t17 ***
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
index d80ac5eea2c..053dee9067b 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
@@ -93,6 +93,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@@ -160,6 +162,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t3 ***
@@ -222,6 +226,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t4 ***
@@ -284,6 +290,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t5 ***
@@ -345,6 +353,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
DROP TABLE t6;
@@ -481,6 +491,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t10 ***
@@ -542,6 +554,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t11 ***
@@ -792,6 +806,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1060
Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
*** Try to insert in master ****
@@ -932,6 +948,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
** DROP table t17 ***
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
index ad67f96db71..ffc42c852be 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
@@ -133,6 +133,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -509,6 +511,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -583,6 +587,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -658,6 +664,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -809,6 +817,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -895,6 +905,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -981,6 +993,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -1274,6 +1288,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -1650,6 +1666,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -1724,6 +1742,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -1799,6 +1819,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -1950,6 +1972,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2036,6 +2060,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2122,6 +2148,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2415,6 +2443,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -2791,6 +2821,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -2865,6 +2897,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -2940,6 +2974,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -3091,6 +3127,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -3177,6 +3215,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -3263,6 +3303,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
index 8859a8e24e3..0c3dd7ed21d 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
@@ -133,6 +133,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -509,6 +511,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -583,6 +587,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -658,6 +664,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -809,6 +817,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -895,6 +905,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -981,6 +993,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -1274,6 +1288,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -1650,6 +1666,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -1724,6 +1742,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -1799,6 +1819,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -1950,6 +1972,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2036,6 +2060,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2122,6 +2148,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -2415,6 +2443,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
***** Testing Altering table def scenario *****
@@ -2791,6 +2821,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
****************************************
* columns in master at middle of table *
@@ -2865,6 +2897,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -2940,6 +2974,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -3091,6 +3127,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1091
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -3177,6 +3215,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1054
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
@@ -3263,6 +3303,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1072
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 600ac44fc86..5e74a4eb999 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -10,6 +10,7 @@ relay_log MYSQLD_DATADIR/relay-log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
+relay_log_recovery OFF
relay_log_space_limit 0
stop slave;
change master to master_host='127.0.0.1',master_user='root',
@@ -59,3 +60,5 @@ Last_IO_Errno #
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 2
diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
index 1bed6101e3c..fc32dcefec7 100644
--- a/mysql-test/suite/rpl/r/rpl_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
@@ -80,3 +80,5 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
new file mode 100644
index 00000000000..b79545b8336
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -0,0 +1,145 @@
+reset master;
+set @restore_slave_net_timeout= @@global.slave_net_timeout;
+set @@global.slave_net_timeout= 10;
+Warnings:
+Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 5.000
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294968;
+ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 5.000
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
+Warnings:
+Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 0.000
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294967;
+Warnings:
+Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 4294967.000
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.001;
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 0.001
+reset slave;
+set @@global.slave_net_timeout= 5;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 5.001;
+Warnings:
+Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 5.001
+reset slave;
+set @@global.slave_net_timeout= 5;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4;
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 4.000
+set @@global.slave_net_timeout= 3 /* must be a warning */;
+Warnings:
+Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+reset slave;
+drop table if exists t1;
+set @@global.slave_net_timeout= 10;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.5;
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 0.500
+start slave;
+create table t1 (f1 int);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 280
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table #
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 280
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 280
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table #
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 280
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+show status like 'Slave_heartbeat_period';;
+Variable_name Slave_heartbeat_period
+Value 0.500
+A heartbeat has been received by the slave
+drop table t1;
+set @@global.slave_net_timeout= @restore_slave_net_timeout;
+End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
new file mode 100644
index 00000000000..ecb7c62c488
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
@@ -0,0 +1,55 @@
+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;
+
+*** Preparing ***
+[on slave]
+include/stop_slave.inc
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='MASTER_BINLOG';
+include/start_slave.inc
+[on slave1]
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='MASTER_BINLOG';
+include/start_slave.inc
+
+*** 2 slaves ***
+Slave has received heartbeat event
+Slave1 has received heartbeat event
+Slave has received more heartbeats than Slave1 (1 means 'yes'): 1
+
+*** Master->data->Slave1->heartbeat->Slave: ***
+[on slave1]
+RESET MASTER;
+[on slave]
+include/stop_slave.inc
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE1_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='SLAVE1_BINLOG';
+include/start_slave.inc
+Slave has received heartbeat event
+[on master]
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
+INSERT INTO t1 VALUES (1, 'on master', '');
+SHOW TABLES;
+Tables_in_test
+t1
+[on slave1]
+SHOW TABLES;
+Tables_in_test
+t1
+[on slave]
+SHOW TABLES;
+Tables_in_test
+[on master]
+creating updates on master and send to slave1 during 5 second
+[on slave]
+Slave has received heartbeats (1 means 'yes'): 1
+
+*** Clean up ***
+DROP TABLE t1;
+
+End of 6.0 test
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
new file mode 100644
index 00000000000..d229e1260dd
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -0,0 +1,299 @@
+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;
+
+*** Preparing ***
+include/stop_slave.inc
+RESET SLAVE;
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+RESET MASTER;
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+SET @restore_event_scheduler=@@global.event_scheduler;
+
+*** Default value ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+slave_net_timeout/slave_heartbeat_timeout=2.0000
+RESET SLAVE;
+
+*** Reset slave affect ***
+SET @@global.slave_net_timeout=30;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+RESET SLAVE;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 15.000
+
+*** Default value if slave_net_timeout changed ***
+SET @@global.slave_net_timeout=50;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 25.000
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+
+*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
+SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
+Warnings:
+Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+
+*** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
+Warnings:
+Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+RESET SLAVE;
+
+*** CHANGE MASTER statement only updates slave_heartbeat_period ***
+SET @@global.slave_net_timeout=20;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+SHOW VARIABLES LIKE 'slave_net_timeout';
+Variable_name Value
+slave_net_timeout 20
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 5.000
+SET @@global.slave_net_timeout=2*@@global.slave_net_timeout;
+SHOW VARIABLES LIKE 'slave_net_timeout';
+Variable_name Value
+slave_net_timeout 40
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 5.000
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+
+*** Update slave_net_timeout on master ***
+SET @@global.slave_net_timeout=500;
+SET @@global.slave_net_timeout=200;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+include/start_slave.inc
+SHOW VARIABLES LIKE 'slave_net_timeout';
+Variable_name Value
+slave_net_timeout 200
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 100.000
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+include/stop_slave.inc
+RESET SLAVE;
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+
+*** Start/stop slave ***
+SET @@global.slave_net_timeout=100;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+include/start_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 20.000
+include/stop_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 20.000
+
+*** Reload slave ***
+SET @@global.slave_net_timeout=50;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
+Reload slave
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 30.000
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+
+*** Disable heartbeat ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 0.000
+SHOW STATUS LIKE 'slave_received_heartbeats';
+Variable_name Value
+Slave_received_heartbeats 0
+include/start_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 0.000
+SHOW STATUS LIKE 'slave_received_heartbeats';
+Variable_name Value
+Slave_received_heartbeats 0
+include/stop_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 0.000
+SHOW STATUS LIKE 'slave_received_heartbeats';
+Variable_name Value
+Slave_received_heartbeats 0
+RESET SLAVE;
+SELECT SLAVE_HEARTBEAT_TIMEOUT = 0 AS Result;
+Result
+0
+
+*** Min slave_heartbeat_timeout ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 0.001
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+Warnings:
+Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 0.000
+RESET SLAVE;
+
+*** Max slave_heartbeat_timeout ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+Warnings:
+Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+Variable_name Value
+Slave_heartbeat_period 4294967.000
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
+ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
+ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
+ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+RESET SLAVE;
+
+*** Misc incorrect values ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-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
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+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 ''123abc'' at line 1
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+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
+RESET SLAVE;
+
+*** Running slave ***
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+include/start_slave.inc
+Heartbeat event received
+
+*** Stopped slave ***
+include/stop_slave.inc
+Number of received heartbeat events while slave stopped: 0
+
+*** Started slave ***
+include/start_slave.inc
+Heartbeat event received
+
+*** Stopped IO thread ***
+STOP SLAVE IO_THREAD;
+Number of received heartbeat events while io thread stopped: 0
+
+*** Started IO thread ***
+START SLAVE IO_THREAD;
+Heartbeat event received
+
+*** Stopped SQL thread ***
+STOP SLAVE SQL_THREAD;
+Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
+
+*** Started SQL thread ***
+START SLAVE SQL_THREAD;
+Heartbeat event received
+
+*** Stopped SQL thread by error ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
+INSERT INTO t1 VALUES (1, 'on slave', NULL);
+INSERT INTO t1 VALUES (1, 'on master', NULL);
+Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
+include/stop_slave.inc
+DROP TABLE t1;
+
+*** Master send to slave ***
+CREATE EVENT e1
+ON SCHEDULE EVERY 1 SECOND
+DO
+BEGIN
+UPDATE test.t1 SET a = a + 1 WHERE a < 10;
+END|
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+include/start_slave.inc
+SET @@global.event_scheduler=1;
+Number of received heartbeat events: 0
+DELETE FROM t1;
+DROP EVENT e1;
+
+*** Flush logs on slave ***
+STOP SLAVE;
+RESET SLAVE;
+DROP TABLE t1;
+DROP TABLE t1;
+RESET MASTER;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+include/start_slave.inc
+Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1
+
+*** Compressed protocol ***
+SET @@global.slave_compressed_protocol=1;
+include/stop_slave.inc
+RESET SLAVE;
+SET @@global.slave_compressed_protocol=1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+include/start_slave.inc
+Heartbeat event received
+SET @@global.slave_compressed_protocol=0;
+SET @@global.slave_compressed_protocol=0;
+
+*** Reset master ***
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+include/start_slave.inc
+RESET MASTER;
+Heartbeat events are received after reset of master (1 means 'yes'): 1
+
+*** Reload master ***
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+include/start_slave.inc
+Heartbeat event received
+Reload master
+Heartbeat event received
+
+*** Circular replication ***
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='MASTER_BINLOG';
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='SLAVE_BINLOG';
+include/start_slave.inc
+INSERT INTO t1 VALUES(1, 'on master');
+include/start_slave.inc
+INSERT INTO t1 VALUES(2, 'on slave');
+SELECT * FROM t1 ORDER BY a;
+a b
+1 on master
+2 on slave
+SELECT * FROM t1 ORDER BY a;
+a b
+1 on master
+2 on slave
+Heartbeat event received on master
+Heartbeat event received on slave
+Slave has received more events than master (1 means 'yes'): 1
+
+*** Clean up ***
+include/stop_slave.inc
+DROP TABLE t1;
+include/stop_slave.inc
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+
+End of 6.0 test
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
new file mode 100644
index 00000000000..42de3c459cb
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
@@ -0,0 +1,27 @@
+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;
+
+*** Heartbeat over SSL ***
+include/stop_slave.inc
+RESET SLAVE;
+CHANGE MASTER TO
+MASTER_HOST='127.0.0.1',
+MASTER_PORT=MASTER_PORT,
+MASTER_USER='root',
+MASTER_HEARTBEAT_PERIOD=0.1,
+MASTER_LOG_FILE='MASTER_BINLOG',
+MASTER_SSL=1,
+MASTER_SSL_CA='MYSQL_TEST_DIR/std_data/cacert.pem',
+MASTER_SSL_CERT='MYSQL_TEST_DIR/std_data/client-cert.pem',
+MASTER_SSL_KEY='MYSQL_TEST_DIR/std_data/client-key.pem';
+include/start_slave.inc
+Master_SSL_Allowed: Yes
+Heartbeat event has received
+
+*** Clean up ***
+
+End of 6.0 test
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index c3baabbdbc3..a9b641b243b 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -64,6 +64,8 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1590
Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
SELECT * FROM t1;
@@ -111,4 +113,6 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index 75180334c28..7f346070290 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 1105
Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
Skip_Counter 0
-Exec_Master_Log_Pos 246
+Exec_Master_Log_Pos 247
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -50,6 +50,8 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1105
Last_SQL_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT * FROM t1;
a b
stop slave;
@@ -120,7 +122,7 @@ FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c'
Skip_Counter 0
-Exec_Master_Log_Pos 1278
+Exec_Master_Log_Pos 1279
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -141,6 +143,8 @@ SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT * FROM t1;
id field_1 field_2 field_3
drop table t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index ca9c14691b0..4e81d90a970 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -34,9 +34,47 @@ insert into t1 values(1,10);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
set global sql_slave_skip_counter=1;
start slave;
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 2009 # # master-bin.000001 Yes Yes # 0 0 2009 # None 0 No # No 0 0
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 2010
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table #
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 2010
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
@@ -44,9 +82,47 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
stop slave;
change master to master_user='test';
change master to master_user='root';
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 2044 # # master-bin.000001 No No # 0 0 2044 # None 0 No # No 0 0
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 2045
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running No
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table #
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 2045
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
@@ -55,9 +131,47 @@ set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
stop slave;
reset slave;
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No 0 0
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File
+Read_Master_Log_Pos 4
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File
+Slave_IO_Running No
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table #
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 0
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index 35696615b5a..a4d6e419d83 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -13,7 +13,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 290
+Read_Master_Log_Pos 291
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -28,7 +28,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 290
+Exec_Master_Log_Pos 291
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -45,6 +45,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -53,7 +55,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 556
+Read_Master_Log_Pos 557
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -68,7 +70,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 1593
Last_Error Fatal error: Not enough memory
Skip_Counter 0
-Exec_Master_Log_Pos 325
+Exec_Master_Log_Pos 326
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -85,6 +87,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1593
Last_SQL_Error Fatal error: Not enough memory
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 85fa4c10eac..433351b41f7 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -49,6 +49,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
include/stop_slave.inc
SHOW SLAVE STATUS;
@@ -90,6 +92,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index 2e707fb62c1..53e8899d27f 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -31,7 +31,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 594
+Read_Master_Log_Pos 595
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -46,7 +46,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 594
+Exec_Master_Log_Pos 595
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -63,6 +63,8 @@ Last_IO_Errno #
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index 33088ee2ec8..2fbd283a9c8 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -65,6 +65,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index 013ba87ec0b..b3b1480a740 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -53,6 +53,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
select * from t1;
s
Could not break slave
@@ -132,6 +134,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
select * from t2;
m
34
@@ -196,6 +200,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 7920b9a981d..27960be8054 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -58,12 +58,12 @@ DELETE FROM t1 WHERE a = 0;
UPDATE t1 SET a=99 WHERE a = 0;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a INT)
-master-bin.000001 192 Query 1 260 BEGIN
-master-bin.000001 260 Table_map 1 301 table_id: # (test.t1)
-master-bin.000001 301 Write_rows 1 340 table_id: # flags: STMT_END_F
-master-bin.000001 340 Query 1 409 COMMIT
+master-bin.000001 4 Format_desc 1 107 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 193 Query 1 261 BEGIN
+master-bin.000001 261 Table_map 1 302 table_id: # (test.t1)
+master-bin.000001 302 Write_rows 1 341 table_id: # flags: STMT_END_F
+master-bin.000001 341 Query 1 410 COMMIT
DROP TABLE t1;
================ Test for BUG#17620 ================
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result
index 6d002a722f1..acda689ca9b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result
@@ -57,6 +57,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -111,6 +113,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -165,6 +169,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -220,6 +226,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -275,6 +283,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -329,6 +339,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -384,6 +396,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -439,6 +453,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -525,6 +541,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -580,6 +598,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -634,6 +654,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -688,6 +710,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -743,6 +767,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT COUNT(*) FROM t1;
COUNT(*)
0
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
index 0f15bfc7156..6f98c25c335 100644
--- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -24,7 +24,7 @@ a
1
[on slave]
---- Wait until slave stops with an error ----
-Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error)
+Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 347 (expected "duplicate key" error)
SELECT * FROM t1;
a
1
@@ -50,7 +50,7 @@ SELECT * FROM t1;
a
[on slave]
---- Wait until slave stops with an error ----
-Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 982 (expected "can't find record" error)
+Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 983 (expected "can't find record" error)
SELECT * FROM t1;
a
---- Resolve the conflict on the slave and restart SQL thread ----
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index 4c2b9ebeaee..9fc48e32645 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -13,30 +13,30 @@ CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name #
-Pos 106
+Pos 107
Event_type Query
Server_id #
-End_log_pos 199
+End_log_pos 200
Info use `test`; CREATE TABLE t1 (a INT, b INT)
Log_name #
-Pos 199
+Pos 200
Event_type Query
Server_id #
-End_log_pos 305
+End_log_pos 306
Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
Log_name #
-Pos 305
+Pos 306
Event_type Query
Server_id #
-End_log_pos 411
+End_log_pos 412
Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
Log_name #
-Pos 411
+Pos 412
Event_type Query
Server_id #
-End_log_pos 530
+End_log_pos 531
Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
**** On Master ****
SHOW CREATE TABLE t1;
@@ -137,7 +137,7 @@ RESET MASTER;
include/start_slave.inc
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
CREATE TABLE t7 (a INT, b INT UNIQUE);
INSERT INTO t7 SELECT a,b FROM tt3;
@@ -147,13 +147,13 @@ a b
1 2
2 4
3 6
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 206 Query # 274 BEGIN
-# 274 Table_map # 316 table_id: # (test.t7)
-# 316 Write_rows # 372 table_id: # flags: STMT_END_F
-# 372 Query # 443 ROLLBACK
+# 107 Query # 207 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+# 207 Query # 275 BEGIN
+# 275 Table_map # 317 table_id: # (test.t7)
+# 317 Write_rows # 373 table_id: # flags: STMT_END_F
+# 373 Query # 444 ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -171,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 174 BEGIN
-# 174 Table_map # 216 table_id: # (test.t7)
-# 216 Write_rows # 272 table_id: # flags: STMT_END_F
-# 272 Query # 341 COMMIT
+# 107 Query # 175 BEGIN
+# 175 Table_map # 217 table_id: # (test.t7)
+# 217 Write_rows # 273 table_id: # flags: STMT_END_F
+# 273 Query # 342 COMMIT
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -216,10 +216,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4
-# 192 Query # 331 use `test`; CREATE TABLE `t9` (
+# 107 Query # 193 use `test`; CREATE TABLE t8 LIKE t4
+# 193 Query # 332 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@@ -296,38 +296,38 @@ a
1
2
3
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Query # 260 BEGIN
-# 260 Table_map # 301 table_id: # (test.t1)
-# 301 Write_rows # 345 table_id: # flags: STMT_END_F
-# 345 Query # 414 COMMIT
-# 414 Query # 482 BEGIN
-# 482 Query # 607 use `test`; CREATE TABLE `t2` (
+# 107 Query # 193 use `test`; CREATE TABLE t1 (a INT)
+# 193 Query # 261 BEGIN
+# 261 Table_map # 302 table_id: # (test.t1)
+# 302 Write_rows # 346 table_id: # flags: STMT_END_F
+# 346 Query # 415 COMMIT
+# 415 Query # 483 BEGIN
+# 483 Query # 608 use `test`; CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 607 Table_map # 648 table_id: # (test.t2)
-# 648 Write_rows # 692 table_id: # flags: STMT_END_F
-# 692 Xid # 719 COMMIT /* XID */
-# 719 Query # 787 BEGIN
-# 787 Query # 912 use `test`; CREATE TABLE `t3` (
+# 608 Table_map # 649 table_id: # (test.t2)
+# 649 Write_rows # 693 table_id: # flags: STMT_END_F
+# 693 Xid # 720 COMMIT /* XID */
+# 720 Query # 788 BEGIN
+# 788 Query # 913 use `test`; CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 912 Table_map # 953 table_id: # (test.t3)
-# 953 Write_rows # 997 table_id: # flags: STMT_END_F
-# 997 Xid # 1024 COMMIT /* XID */
-# 1024 Query # 1092 BEGIN
-# 1092 Query # 1217 use `test`; CREATE TABLE `t4` (
+# 913 Table_map # 954 table_id: # (test.t3)
+# 954 Write_rows # 998 table_id: # flags: STMT_END_F
+# 998 Xid # 1025 COMMIT /* XID */
+# 1025 Query # 1093 BEGIN
+# 1093 Query # 1218 use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 1217 Table_map # 1258 table_id: # (test.t4)
-# 1258 Write_rows # 1302 table_id: # flags: STMT_END_F
-# 1302 Xid # 1329 COMMIT /* XID */
-# 1329 Query # 1397 BEGIN
-# 1397 Table_map # 1438 table_id: # (test.t1)
-# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
-# 1482 Query # 1551 COMMIT
+# 1218 Table_map # 1259 table_id: # (test.t4)
+# 1259 Write_rows # 1303 table_id: # flags: STMT_END_F
+# 1303 Xid # 1330 COMMIT /* XID */
+# 1330 Query # 1398 BEGIN
+# 1398 Table_map # 1439 table_id: # (test.t1)
+# 1439 Write_rows # 1483 table_id: # flags: STMT_END_F
+# 1483 Query # 1552 COMMIT
SHOW TABLES;
Tables_in_test
t1
@@ -390,20 +390,20 @@ a
4
6
9
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Query # 260 BEGIN
-# 260 Table_map # 301 table_id: # (test.t1)
-# 301 Write_rows # 345 table_id: # flags: STMT_END_F
-# 345 Query # 414 COMMIT
-# 414 Query # 514 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
-# 514 Query # 582 BEGIN
-# 582 Table_map # 623 table_id: # (test.t2)
-# 623 Write_rows # 667 table_id: # flags: STMT_END_F
-# 667 Table_map # 708 table_id: # (test.t2)
-# 708 Write_rows # 747 table_id: # flags: STMT_END_F
-# 747 Xid # 774 COMMIT /* XID */
+# 107 Query # 193 use `test`; CREATE TABLE t1 (a INT)
+# 193 Query # 261 BEGIN
+# 261 Table_map # 302 table_id: # (test.t1)
+# 302 Write_rows # 346 table_id: # flags: STMT_END_F
+# 346 Query # 415 COMMIT
+# 415 Query # 515 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
+# 515 Query # 583 BEGIN
+# 583 Table_map # 624 table_id: # (test.t2)
+# 624 Write_rows # 668 table_id: # flags: STMT_END_F
+# 668 Table_map # 709 table_id: # (test.t2)
+# 709 Write_rows # 748 table_id: # flags: STMT_END_F
+# 748 Xid # 775 COMMIT /* XID */
SELECT * FROM t2 ORDER BY a;
a
1
@@ -429,14 +429,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-# 106 Query # 174 BEGIN
-# 174 Table_map # 215 table_id: # (test.t2)
-# 215 Write_rows # 259 table_id: # flags: STMT_END_F
-# 259 Table_map # 300 table_id: # (test.t2)
-# 300 Write_rows # 339 table_id: # flags: STMT_END_F
-# 339 Query # 410 ROLLBACK
+# 107 Query # 175 BEGIN
+# 175 Table_map # 216 table_id: # (test.t2)
+# 216 Write_rows # 260 table_id: # flags: STMT_END_F
+# 260 Table_map # 301 table_id: # (test.t2)
+# 301 Write_rows # 340 table_id: # flags: STMT_END_F
+# 340 Query # 411 ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 89654ebf165..f1a350b3df0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -43,10 +43,10 @@ t2
DROP TABLE t1,t2;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a int)
-master-bin.000001 192 Query 1 278 use `test`; CREATE TABLE t2 (a int)
-master-bin.000001 278 Query 1 382 use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a int)
+master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int)
+master-bin.000001 279 Query 1 383 use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES;
Tables_in_test
t2
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index 129bad0fbcc..384573c0461 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -12,13 +12,13 @@ create table t4 (a int);
insert into t4 select * from t3;
rename table t1 to t5, t2 to t1;
flush no_write_to_binlog tables;
-SHOW BINLOG EVENTS FROM 897 ;
+SHOW BINLOG EVENTS FROM 898 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
-SHOW BINLOG EVENTS FROM 897 ;
+SHOW BINLOG EVENTS FROM 898 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 # Query 1 # use `test`; flush tables
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index 9593b009d1f..789db064eb5 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -30,14 +30,14 @@ master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
-show binlog events from 106 limit 1;
+show binlog events from 107 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-show binlog events from 106 limit 2;
+show binlog events from 107 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Query 1 # BEGIN
-show binlog events from 106 limit 2,1;
+show binlog events from 107 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
flush logs;
@@ -251,7 +251,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000002
-Read_Master_Log_Pos 516
+Read_Master_Log_Pos 517
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000002
@@ -266,7 +266,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 516
+Exec_Master_Log_Pos 517
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -283,6 +283,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 8526bad558b..fbd9f685ba9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -30,14 +30,14 @@ master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Xid 1 # COMMIT /* XID */
-show binlog events from 106 limit 1;
+show binlog events from 107 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
-show binlog events from 106 limit 2;
+show binlog events from 107 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
master-bin.000001 # Query 1 # BEGIN
-show binlog events from 106 limit 2,1;
+show binlog events from 107 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
flush logs;
@@ -251,7 +251,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000002
-Read_Master_Log_Pos 474
+Read_Master_Log_Pos 475
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000002
@@ -266,7 +266,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 474
+Exec_Master_Log_Pos 475
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -283,6 +283,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 2215b34814e..c2554218f73 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -60,6 +60,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 2
#
@@ -108,6 +110,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 3: max_relay_log_size = 0
#
@@ -156,6 +160,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -201,6 +207,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 5
#
@@ -247,6 +255,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
@@ -291,6 +301,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index fa40d8760a8..501749e12f9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -43,6 +43,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
change master to master_user='test';
SHOW SLAVE STATUS;
@@ -84,6 +86,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
reset slave;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -124,6 +128,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -164,6 +170,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
reset slave;
start slave;
diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
new file mode 100644
index 00000000000..461ab14a93a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
@@ -0,0 +1,274 @@
+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;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+[MASTER] ********* SOW BINLOG EVENTS *********
+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 (a INT)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+show binlog events from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+show binlog events from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+[SLAVE] ********* SOW BINLOG EVENTS *********
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+show binlog events from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+show binlog events from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+[SLAVE] ********* SOW RELAYLOG EVENTS *********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
+[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000003 # Query # # BEGIN
+FLUSH LOGS;
+FLUSH LOGS;
+DROP TABLE t1;
+[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'master-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE t1
+[MASTER] ********* SOW BINLOG EVENTS *********
+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 (a INT)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Rotate # # master-bin.000002;pos=4
+[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'slave-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE t1
+[SLAVE] ********* SOW BINLOG EVENTS *********
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
+[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+show relaylog events in 'slave-relay-bin.000005' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+[SLAVE] ********* SOW RELAYLOG EVENTS *********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 9a2822835f8..5a6a9ace4c5 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
@@ -22,8 +22,6 @@ END|
< ---- Master selects-- >
-------------------------
CALL test.p1(12);
-Warnings:
-Note 1051 Unknown table 't1'
SELECT * FROM test.t1;
num
12
diff --git a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
deleted file mode 100644
index 1934b01505c..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
+++ /dev/null
@@ -1,17 +0,0 @@
-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;
-create table t1 (words varchar(20)) engine=myisam;
-load data infile '../../std_data/words.dat' into table t1 (words);
-select count(*) from t1;
-count(*)
-70
-select count(*) from t1;
-count(*)
-70
-drop table t1;
-include/stop_slave.inc
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index bb9865ab2d1..cb91fd95fab 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -157,6 +157,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS;
@@ -198,6 +200,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (5);
@@ -241,6 +245,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
@@ -284,6 +290,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
@@ -326,6 +334,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index f606a28c2d9..8a87c3ca7a0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -157,6 +157,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS;
@@ -198,6 +200,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (5);
@@ -241,6 +245,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
@@ -284,6 +290,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
@@ -326,6 +334,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index ad54450af74..e878456e296 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -59,6 +59,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
SELECT * FROM t1;
n
@@ -105,6 +107,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
SELECT * FROM t2;
n
@@ -149,6 +153,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
START SLAVE;
include/stop_slave.inc
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
@@ -191,6 +197,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
new file mode 100644
index 00000000000..1e220b28d78
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -0,0 +1,440 @@
+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;
+#
+# Uninstall semi-sync plugins on master and slave
+#
+include/stop_slave.inc
+reset slave;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+reset master;
+set sql_log_bin=0;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+set sql_log_bin=1;
+#
+# Main test of semi-sync replication start here
+#
+[ on master ]
+[ default state of semi-sync on master should be OFF ]
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+[ enable semi-sync on master ]
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ status of semi-sync on master should be ON even without any semi-sync slaves ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+#
+# BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+# BUG#45673 Semisynch reports correct operation even if no slave is connected
+#
+[ status of semi-sync on master should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+#
+# INSTALL PLUGIN semi-sync on slave
+#
+[ on slave ]
+[ default state of semi-sync on slave should be OFF ]
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+[ enable semi-sync on slave ]
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+[ initial master state after the semi-sync slave connected ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+create table t1(a int) engine = ENGINE_TYPE;
+[ master state after CREATE TABLE statement ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 1
+select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
+Should be 0
+0
+[ insert records to table ]
+[ master status after inserts ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 301
+[ on slave ]
+[ slave status after replicated inserts ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+300
+select min(a) from t1;
+min(a)
+1
+select max(a) from t1;
+max(a)
+300
+#
+# Test semi-sync master will switch OFF after one transacton
+# timeout waiting for slave reply.
+#
+include/stop_slave.inc
+[ on master ]
+[ master status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 301
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+[ semi-sync replication of these transactions will fail ]
+insert into t1 values (500);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 1
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 301
+insert into t1 values (100);
+[ master status should be OFF ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 302
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 301
+#
+# Test semi-sync status on master will be ON again when slave catches up
+#
+[ on slave ]
+[ slave status should be OFF ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+[ slave status should be ON ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+select count(distinct a) from t1;
+count(distinct a)
+2
+select min(a) from t1;
+min(a)
+100
+select max(a) from t1;
+max(a)
+500
+[ on master ]
+[ master status should be ON again after slave catches up ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 302
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 301
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+#
+# Test disable/enable master semi-sync on the fly.
+#
+drop table t1;
+[ on slave ]
+include/stop_slave.inc
+#
+# Flush status
+#
+[ Semi-sync master status variables before FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 302
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 302
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+[ Semi-sync master status variables after FLUSH STATUS ]
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on master ]
+show master logs;
+Log_name master-bin.000001
+File_size #
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+[ disable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled OFF
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ enable semi-sync on the fly ]
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+Variable_name Value
+rpl_semi_sync_master_enabled ON
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+#
+# Test RESET MASTER/SLAVE
+#
+[ on slave ]
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+drop table t1;
+show status like 'Rpl_relay%';
+Variable_name Value
+[ test reset master ]
+[ on master]
+reset master;
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+[ on slave ]
+include/stop_slave.inc
+reset slave;
+include/start_slave.inc
+[ on master ]
+create table t1 (a int) engine = ENGINE_TYPE;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+[ on slave ]
+select * from t1;
+a
+1
+2
+3
+[ on master ]
+[ master semi-sync status should be ON ]
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 3
+#
+# Start semi-sync replication without SUPER privilege
+#
+include/stop_slave.inc
+reset slave;
+[ on master ]
+reset master;
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+flush privileges;
+set sql_log_bin=1;
+[ on slave ]
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+flush privileges;
+change master to master_user='rpl',master_password='rpl';
+include/start_slave.inc
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+[ on master ]
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 0
+insert into t1 values (4);
+insert into t1 values (5);
+[ master semi-sync should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+show status like 'Rpl_semi_sync_master_no_tx';
+Variable_name Value
+Rpl_semi_sync_master_no_tx 0
+show status like 'Rpl_semi_sync_master_yes_tx';
+Variable_name Value
+Rpl_semi_sync_master_yes_tx 2
+#
+# Test semi-sync slave connect to non-semi-sync master
+#
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ on master ]
+[ Semi-sync status on master should be ON ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 0
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status ON
+set global rpl_semi_sync_master_enabled= 0;
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (8);
+[ master semi-sync clients should be 1, status should be OFF ]
+show status like 'Rpl_semi_sync_master_clients';
+Variable_name Value
+Rpl_semi_sync_master_clients 1
+show status like 'Rpl_semi_sync_master_status';
+Variable_name Value
+Rpl_semi_sync_master_status OFF
+[ on slave ]
+show status like 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status ON
+include/stop_slave.inc
+[ on master ]
+set sql_log_bin=0;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+set sql_log_bin=1;
+SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled';
+Variable_name Value
+[ on slave ]
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled ON
+include/start_slave.inc
+[ on master ]
+insert into t1 values (10);
+[ on slave ]
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+#
+# Test non-semi-sync slave connect to semi-sync master
+#
+set sql_log_bin=0;
+INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_PLUGIN';
+set global rpl_semi_sync_master_timeout= 5000;
+/* 5s */
+set sql_log_bin=1;
+set global rpl_semi_sync_master_enabled= 1;
+[ on slave ]
+include/stop_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+[ uninstall semi-sync slave plugin ]
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+include/start_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+include/stop_slave.inc
+[ reinstall semi-sync slave plugin and disable semi-sync ]
+INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_PLUGIN';
+set global rpl_semi_sync_slave_enabled= 0;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+Variable_name Value
+rpl_semi_sync_slave_enabled OFF
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+include/start_slave.inc
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+Variable_name Value
+Rpl_semi_sync_slave_status OFF
+#
+# Clean up
+#
+include/stop_slave.inc
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+include/start_slave.inc
+drop table t1;
+drop user rpl@127.0.0.1;
+flush privileges;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
new file mode 100644
index 00000000000..f3f5aa1559d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
@@ -0,0 +1,46 @@
+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;
+include/stop_slave.inc
+include/start_slave.inc
+SET GLOBAL event_scheduler = ON;
+CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
+INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
+INSERT INTO t1 SELECT i+5, f FROM t1;
+INSERT INTO t1 SELECT i+10, f FROM t1;
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
+CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
+STOP SLAVE IO_THREAD;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 20;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 19;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 18;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 17;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 16;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 15;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 14;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 13;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 12;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 11;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 10;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 9;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 8;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 7;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 6;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 5;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 4;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 3;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
+UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
+SET GLOBAL event_scheduler = OFF;
+include/stop_slave.inc
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+include/start_slave.inc
+DROP EVENT ev1;
+DROP EVENT ev2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
new file mode 100644
index 00000000000..cba6571eb1a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
@@ -0,0 +1,46 @@
+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;
+master_id: 1
+stop slave;
+*** --replicate-same-server-id and change master option can clash ***
+change master to IGNORE_SERVER_IDS= (2, 1);
+ERROR HY000: The requested server id 2 clashes with the slave startup option --replicate-same-server-id
+*** must be empty due to the error ***
+ignore server id list:
+change master to IGNORE_SERVER_IDS= (10, 100);
+*** must be 10, 100 ***
+ignore server id list: 10, 100
+reset slave;
+*** must be empty due to reset slave ***
+ignore server id list: 10, 100
+change master to IGNORE_SERVER_IDS= (10, 100);
+*** CHANGE MASTER with IGNORE_SERVER_IDS option overrides (does not increment) the previous setup ***
+change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
+*** must be 1, 3, 4, 5 due to overriding policy ***
+ignore server id list: 1, 3, 4, 5
+*** ignore master (server 1) queries for a while ***
+start slave;
+create table t1 (n int);
+*** must be empty as the event is to be filtered out ***
+show tables;
+Tables_in_test
+*** allowing events from master ***
+stop slave;
+reset slave;
+change master to IGNORE_SERVER_IDS= (10, 100);
+*** the list must remain (10, 100) after reset slave ***
+change master to IGNORE_SERVER_IDS= ();
+*** must be empty due to IGNORE_SERVER_IDS empty list ***
+ignore server id list:
+change master to master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root';
+start slave;
+*** must have caught create table ***
+show tables;
+Tables_in_test
+t1
+drop table t1;
+end of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index d955859f030..7b2bd48515d 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -70,6 +70,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
==== Clean Up ====
drop table t1;
create table t1(a int primary key);
@@ -123,6 +125,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
==== Clean Up ====
drop table t1;
==== Using Innodb ====
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
index e2efcf08d7a..880fc9e8569 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
@@ -49,6 +49,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 9
Last_SQL_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table t1;
drop table t1;
call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index 6148de5d954..5a37344cac6 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -50,7 +50,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 1115
+Read_Master_Log_Pos 1116
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -65,7 +65,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 762
+Exec_Master_Log_Pos 763
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
@@ -82,6 +82,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
SELECT * FROM t1;
@@ -114,7 +116,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 248
+Read_Master_Log_Pos 249
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -129,7 +131,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 248
+Exec_Master_Log_Pos 249
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -146,6 +148,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
**** On Master ****
DROP TABLE t1, t2;
SET SESSION BINLOG_FORMAT=ROW;
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
new file mode 100644
index 00000000000..ced357b21e9
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -0,0 +1,47 @@
+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;
+include/stop_slave.inc
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET @old_long_query_time= @@long_query_time;
+SET GLOBAL long_query_time= 2;
+TRUNCATE mysql.slow_log;
+include/start_slave.inc
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 values(1, 1);
+INSERT INTO t1 values(1, sleep(3));
+TRUNCATE mysql.slow_log;
+SELECT 1, sleep(3);
+1 sleep(3)
+1 0
+SELECT 1;
+1
+1
+TRUNCATE mysql.slow_log;
+SET TIMESTAMP= 1;
+SELECT 2, sleep(3);
+2 sleep(3)
+2 0
+SELECT 2;
+2
+2
+TRUNCATE mysql.slow_log;
+SET @old_slow_query_log= @@slow_query_log;
+SET GLOBAL slow_query_log= 'OFF';
+SELECT 3, sleep(3);
+3 sleep(3)
+3 0
+SELECT 3;
+3
+3
+TRUNCATE mysql.slow_log;
+SET GLOBAL slow_query_log= @old_slow_query_log;
+DROP TABLE t1;
+include/stop_slave.inc
+SET GLOBAL long_query_time= @old_long_query_time;
+SET GLOBAL log_output= @old_log_output;
+include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 90a362c352b..e2946bb487a 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -409,110 +409,110 @@ return 0;
end|
use mysqltest;
set @a:= mysqltest2.f1();
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # drop database if exists mysqltest1
-master-bin.000001 # Query 1 # create database mysqltest1
-master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100))
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
+master-bin.000001 # Query # # drop database if exists mysqltest1
+master-bin.000001 # Query # # create database mysqltest1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
begin
declare b int;
set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp())
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp())
+master-bin.000001 # Query # # use `mysqltest1`; delete from t1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
select * from mysqltest1.t1
-master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo2 contains sql
-master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
-master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int)
-master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`()
+master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo2 contains sql
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int)
+master-bin.000001 # Query # # use `mysqltest1`; create table t2 like t1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`()
DETERMINISTIC
insert into t1 values (15)
-master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
-master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
-master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`()
+master-bin.000001 # Query # # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
+master-bin.000001 # Query # # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
+master-bin.000001 # Query # # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`()
DETERMINISTIC
begin
insert into t2 values(3);
insert into t1 values (5);
end
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (15)
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (5)
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
-master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`()
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15)
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
+master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5)
+master-bin.000001 # Query # # use `mysqltest1`; delete from t2
+master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`()
DETERMINISTIC
begin
insert into t2 values(20),(20);
end
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(20),(20)
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo2
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo3
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20)
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo2
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo3
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
DETERMINISTIC
begin
insert into t1 values (x);
return x+2;
end
-master-bin.000001 # Query 1 # use `mysqltest1`; delete t1,t2 from t1,t2
-master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21))
-master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; delete t1,t2 from t1,t2
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21))
+master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11)
NO SQL
begin
return unix_timestamp();
end
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(fn1())
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; delete from t1
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1())
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
NO SQL
begin
return unix_timestamp();
end
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11)
READS SQL DATA
begin
return 0;
end
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
-master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
-master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; delete from t2
+master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
+master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
begin
insert into t2 values(x),(x);
return 10;
end
-master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100)
-master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1)
-master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
-master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg
-master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1)
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100)
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
+master-bin.000001 # Query # # use `mysqltest1`; delete from t1
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
+master-bin.000001 # Query # # use `mysqltest1`; delete from t1
+master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
READS SQL DATA
select * from t1
-master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo
-master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
-master-bin.000001 # Query 1 # drop database mysqltest1
-master-bin.000001 # Query 1 # drop user "zedjzlcsjhd"@127.0.0.1
-master-bin.000001 # Query 1 # use `test`; drop function if exists f1
-master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo
+master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
+master-bin.000001 # Query # # drop database mysqltest1
+master-bin.000001 # Query # # drop user "zedjzlcsjhd"@127.0.0.1
+master-bin.000001 # Query # # use `test`; drop function if exists f1
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
READS SQL DATA
begin
declare var integer;
@@ -522,41 +522,41 @@ fetch c into var;
close c;
return var;
end
-master-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-master-bin.000001 # Query 1 # use `test`; insert into t1 (a) values (f1())
-master-bin.000001 # Query 1 # use `test`; drop view v1
-master-bin.000001 # Query 1 # use `test`; drop function f1
-master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1
-master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(col VARCHAR(10))
-master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
+master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1())
+master-bin.000001 # Query # # use `test`; drop view v1
+master-bin.000001 # Query # # use `test`; drop function f1
+master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1(col VARCHAR(10))
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
INSERT INTO t1 VALUES(arg)
-master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
-master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
-master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1
-master-bin.000001 # Query 1 # use `test`; DROP FUNCTION IF EXISTS f1
-master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
+master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1
+master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1
+master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS f1
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SET @a = 1
-master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 0
-master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
-master-bin.000001 # Query 1 # use `test`; DROP FUNCTION f1
-master-bin.000001 # Query 1 # use `test`; drop table t1
-master-bin.000001 # Query 1 # drop database if exists mysqltest
-master-bin.000001 # Query 1 # drop database if exists mysqltest2
-master-bin.000001 # Query 1 # create database mysqltest
-master-bin.000001 # Query 1 # create database mysqltest2
-master-bin.000001 # Query 1 # use `mysqltest2`; create table t ( t integer )
-master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
+master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1
+master-bin.000001 # Query # # use `test`; DROP FUNCTION f1
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # drop database if exists mysqltest
+master-bin.000001 # Query # # drop database if exists mysqltest2
+master-bin.000001 # Query # # create database mysqltest
+master-bin.000001 # Query # # create database mysqltest2
+master-bin.000001 # Query # # use `mysqltest2`; create table t ( t integer )
+master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
begin end
-master-bin.000001 # Query 1 # use `mysqltest2`; insert into t values ( 1 )
-master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 )
+master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
begin
insert into t values (1);
return 0;
end
-master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
+master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`()
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
diff --git a/mysql-test/suite/rpl/r/rpl_spec_variables.result b/mysql-test/suite/rpl/r/rpl_spec_variables.result
new file mode 100644
index 00000000000..ea2778bf71c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_spec_variables.result
@@ -0,0 +1,225 @@
+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;
+
+* auto_increment_increment, auto_increment_offset *
+SET @@global.auto_increment_increment=2;
+SET @@session.auto_increment_increment=2;
+SET @@global.auto_increment_offset=10;
+SET @@session.auto_increment_offset=10;
+SET @@global.auto_increment_increment=3;
+SET @@session.auto_increment_increment=3;
+SET @@global.auto_increment_offset=20;
+SET @@session.auto_increment_offset=20;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t1 (b) VALUES ('master');
+INSERT INTO t1 (b) VALUES ('master');
+SELECT * FROM t1 ORDER BY a;
+a b
+2 master
+4 master
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t1 (b) VALUES ('slave');
+INSERT INTO t1 (b) VALUES ('slave');
+INSERT INTO t2 (b) VALUES ('slave');
+INSERT INTO t2 (b) VALUES ('slave');
+SELECT * FROM t1 ORDER BY a;
+a b
+2 master
+4 master
+7 slave
+10 slave
+SELECT * FROM t2 ORDER BY a;
+a b
+1 slave
+4 slave
+DROP TABLE IF EXISTS t1,t2;
+SET @@global.auto_increment_increment=1;
+SET @@session.auto_increment_increment=1;
+SET @@global.auto_increment_offset=1;
+SET @@session.auto_increment_offset=1;
+SET @@global.auto_increment_increment=1;
+SET @@session.auto_increment_increment=1;
+SET @@global.auto_increment_offset=1;
+SET @@session.auto_increment_offset=1;
+SET auto_increment_increment=1;
+SET auto_increment_offset=1;
+
+* character_set_database, collation_server *
+SET @restore_master_character_set_database=@@global.character_set_database;
+SET @restore_master_collation_server=@@global.collation_server;
+SET @@global.character_set_database=latin1;
+SET @@session.character_set_database=latin1;
+SET @@global.collation_server=latin1_german1_ci;
+SET @@session.collation_server=latin1_german1_ci;
+SET @restore_slave_character_set_database=@@global.character_set_database;
+SET @restore_slave_collation_server=@@global.collation_server;
+SET @@global.character_set_database=utf8;
+SET @@session.character_set_database=utf8;
+SET @@global.collation_server=utf8_bin;
+SET @@session.collation_server=utf8_bin;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) COLLATE latin1_german1_ci DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) COLLATE latin1_german1_ci DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) COLLATE utf8_bin DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin
+SET @@global.collation_server=latin1_swedish_ci;
+SET @@session.collation_server=latin1_swedish_ci;
+SET @@global.collation_server=latin1_swedish_ci;
+SET @@session.collation_server=latin1_swedish_ci;
+DROP TABLE IF EXISTS t1,t2;
+
+* default_week_format *
+SET @@global.default_week_format=0;
+SET @@session.default_week_format=0;
+SET @@global.default_week_format=1;
+SET @@session.default_week_format=1;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1, 'master ', WEEK('2008-01-07'));
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 master 1
+INSERT INTO t1 VALUES (2, 'slave ', WEEK('2008-01-07'));
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 master 1
+2 slave 2
+DROP TABLE t1;
+SET @@global.default_week_format=0;
+SET @@session.default_week_format=0;
+
+* local_infile *
+SET @@global.local_infile=0;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(20), c CHAR(254)) ENGINE=MyISAM;
+LOAD DATA LOCAL INFILE 'FILE' INTO TABLE t1 (b);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+70
+LOAD DATA LOCAL INFILE 'FILE2' INTO TABLE t1 (b);
+ERROR 42000: The used command is not allowed with this MySQL version
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+70
+SET @@global.local_infile=1;
+DROP TABLE t1;
+
+* max_heap_table_size *
+SET @restore_slave_max_heap_table_size=@@global.max_heap_table_size;
+SET @@global.max_heap_table_size=16384;
+SET @@session.max_heap_table_size=16384;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), c CHAR(254)) ENGINE=MEMORY;
+SELECT COUNT(*)=2000 FROM t1;
+COUNT(*)=2000
+1
+SELECT COUNT(*)=2000 FROM t1 WHERE b='master' GROUP BY b ORDER BY b;
+COUNT(*)=2000
+1
+SELECT COUNT(*)<2000 AND COUNT(*)>0 FROM t1 WHERE b='slave' GROUP BY b ORDER BY b;
+COUNT(*)<2000 AND COUNT(*)>0
+1
+SELECT COUNT(*)<2000 AND COUNT(*)>0 FROM t2 WHERE b='slave' GROUP BY b ORDER BY b;
+COUNT(*)<2000 AND COUNT(*)>0
+1
+DROP TABLE IF EXISTS t1,t2;
+
+* storage_engine *
+SET @restore_master_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=InnoDB;
+SET @@session.storage_engine=InnoDB;
+SET @restore_slave_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=Memory;
+SET @@session.storage_engine=Memory;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10));
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) NOT NULL,
+ `b` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SET @@global.storage_engine=InnoDB;
+SET @@session.storage_engine=InnoDB;
+DROP TABLE IF EXISTS t1,t2,t3;
+
+* sql_mode *
+SET @@global.sql_mode=ANSI;
+SET @@session.sql_mode=ANSI;
+SET @@global.sql_mode=TRADITIONAL;
+SET @@session.sql_mode=TRADITIONAL;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c DATE);
+INSERT INTO t1 VALUES (1, 'master', '0000-00-00');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 master 0000-00-00
+INSERT INTO t1 VALUES (1, 'slave', '0000-00-00');
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'c' at row 1
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 master 0000-00-00
+SET @@global.sql_mode='';
+SET @@session.sql_mode='';
+SET @@global.sql_mode='';
+SET @@session.sql_mode='';
+DROP TABLE t1;
+
+*** clean up ***
+SET @@global.character_set_database=@restore_master_character_set_database;
+SET @@global.collation_server=@restore_master_collation_server;
+SET @@global.storage_engine=@restore_master_storage_engine;
+SET @@global.character_set_database=@restore_slave_character_set_database;
+SET @@global.collation_server=@restore_slave_collation_server;
+SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size;
+SET @@global.storage_engine=@restore_slave_storage_engine;
+
+call mtr.add_suppression("The table 't[12]' is full");
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index d188dd353ce..c8e9e1a4911 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -58,6 +58,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
select * from t1;
t
@@ -102,6 +104,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop user replssl@localhost;
drop table t1;
End of 5.0 tests
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index 74d2550cdaf..de255228aff 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -57,6 +57,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
change master to master_user='root',master_password='', master_ssl=0;
start slave;
@@ -101,6 +103,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
change master to
master_host="localhost",
@@ -155,4 +159,6 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index 74031af1dde..1f6c86768b5 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -12,13 +12,13 @@ create table t4 (a int);
insert into t4 select * from t3;
rename table t1 to t5, t2 to t1;
flush no_write_to_binlog tables;
-SHOW BINLOG EVENTS FROM 656 ;
+SHOW BINLOG EVENTS FROM 657 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
-SHOW BINLOG EVENTS FROM 656 ;
+SHOW BINLOG EVENTS FROM 657 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 # Query 1 # use `test`; flush tables
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index d73b8990041..22105f42879 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (word) ;file_id=1
-show binlog events from 106 limit 1;
+show binlog events from 107 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-show binlog events from 106 limit 2;
+show binlog events from 107 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Intvar 1 # INSERT_ID=1
-show binlog events from 106 limit 2,1;
+show binlog events from 107 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
flush logs;
@@ -233,7 +233,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000002
-Read_Master_Log_Pos 392
+Read_Master_Log_Pos 393
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000002
@@ -248,7 +248,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 392
+Exec_Master_Log_Pos 393
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -265,6 +265,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 2215b34814e..c2554218f73 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -60,6 +60,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 2
#
@@ -108,6 +110,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 3: max_relay_log_size = 0
#
@@ -156,6 +160,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -201,6 +207,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 5
#
@@ -247,6 +255,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
@@ -291,6 +301,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
new file mode 100644
index 00000000000..512a72c3040
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
@@ -0,0 +1,148 @@
+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;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+[MASTER] ********* SOW BINLOG EVENTS *********
+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 (a INT)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+show binlog events from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+show binlog events from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+[SLAVE] ********* SOW BINLOG EVENTS *********
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
+show binlog events from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
+show binlog events from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+[SLAVE] ********* SOW RELAYLOG EVENTS *********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
+[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1, 3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+FLUSH LOGS;
+FLUSH LOGS;
+DROP TABLE t1;
+[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'master-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE t1
+[MASTER] ********* SOW BINLOG EVENTS *********
+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 (a INT)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+master-bin.000001 # Rotate # # master-bin.000002;pos=4
+[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+show binlog events in 'slave-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE t1
+[SLAVE] ********* SOW BINLOG EVENTS *********
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
+[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+show relaylog events in 'slave-relay-bin.000005' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+[SLAVE] ********* SOW RELAYLOG EVENTS *********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index 78d9d7c41eb..d18ca563b7b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -43,6 +43,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
change master to master_user='test';
SHOW SLAVE STATUS;
@@ -84,6 +86,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
reset slave;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -124,6 +128,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -164,6 +170,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
stop slave;
reset slave;
start slave;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 55074f0be0d..6af9be0da3b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -63,6 +63,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1;
n
@@ -109,6 +111,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2;
n
@@ -153,6 +157,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
[on master]
[on slave]
@@ -197,6 +203,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
==== Test various error conditions ====
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
diff --git a/mysql-test/suite/rpl/r/rpl_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stop_middle_group.result
new file mode 100644
index 00000000000..0bf0384bf85
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stop_middle_group.result
@@ -0,0 +1,61 @@
+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;
+create table tm (a int auto_increment primary key) engine=myisam;
+create table ti (a int auto_increment primary key) engine=innodb;
+set @@global.debug="+d,stop_slave_middle_group";
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+SELECT "NO" AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error true
+NO 1
+select count(*) as one from tm;
+one
+1
+select count(*) as one from ti;
+one
+1
+set @@global.debug="-d";
+include/start_slave.inc
+truncate table tm;
+truncate table ti;
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error true
+Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+select count(*) as one from tm;
+one
+1
+select count(*) as zero from ti;
+zero
+0
+set @@global.debug="-d";
+stop slave;
+truncate table tm;
+include/start_slave.inc
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
+SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error true
+Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+select max(a) as two from tm;
+two
+2
+select max(a) as one from ti;
+one
+1
+set @@global.debug="-d";
+drop table tm, ti;
+include/stop_slave.inc
+drop table tm, ti;
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
new file mode 100644
index 00000000000..edc20c46140
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -0,0 +1,40 @@
+=====Configuring the enviroment=======;
+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;
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+=====Inserting data on the master but without the SQL Thread being running=======;
+stop slave SQL_THREAD;
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+=====Removing relay log files and crashing/recoverying the slave=======;
+stop slave IO_THREAD;
+SET SESSION debug="d,crash_before_rotate_relaylog";
+FLUSH LOGS;
+ERROR HY000: Lost connection to MySQL server during query
+=====Dumping and comparing tables=======;
+start slave;
+Comparing tables master:test.t1 and slave:test.t1
+=====Corrupting the master.info=======;
+stop slave;
+FLUSH LOGS;
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+SET SESSION debug="d,crash_before_rotate_relaylog";
+FLUSH LOGS;
+ERROR HY000: Lost connection to MySQL server during query
+=====Dumping and comparing tables=======;
+start slave;
+Comparing tables master:test.t1 and slave:test.t1
+=====Clean up=======;
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 631eb0677b0..b2400a03f63 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -27,12 +27,12 @@ Warning 1265 Data truncated for column 'b' at row 1
DROP TABLE t1;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
-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 @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
SET @@session.sql_select_limit=10, @@session.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
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index d14380a6369..f4626304fc3 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -79,6 +79,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
DROP TABLE t1;
**** On Master ****
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
index ccf16271d01..a6d23b04780 100644
--- a/mysql-test/suite/rpl/r/rpl_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
@@ -181,21 +181,21 @@ affected rows: 2
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
affected rows: 0
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
+affected rows: 1
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
+affected rows: 1
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
+affected rows: 1
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
+affected rows: 1
Warnings:
Note 1592 Statement may not be safe to log in statement format.
-affected rows: 1
SELECT * FROM t1 ORDER BY sum;
sum price
1 48.5
diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf
index 23b7ded9a7d..2c2949bd42c 100644
--- a/mysql-test/suite/rpl/rpl_1slave_base.cnf
+++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf
@@ -1,5 +1,6 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
+!include include/default_client.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 3cbb0447b9f..446c233c8a9 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -11,4 +11,6 @@
##############################################################################
rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails
-rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
+rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
+rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report
+rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
diff --git a/mysql-test/suite/rpl/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test
index 2ba321cd8c3..d6b3e46fa31 100644
--- a/mysql-test/suite/rpl/t/rpl000017.test
+++ b/mysql-test/suite/rpl/t/rpl000017.test
@@ -6,6 +6,7 @@ grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaa
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
start slave;
+source include/wait_for_slave_to_start.inc;
connection master;
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index 31163927ce2..da14b45d5c3 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -25,9 +25,7 @@ grant select on t to x@y;
#
rollback;
show grants for x@y;
---replace_result $VERSION VERSION
---replace_regex /\/\* xid=.* \*\//\/* XID *\//
-show binlog events;
+source include/show_binlog_events.inc;
start transaction;
insert into t values (2);
revoke select on t from x@y;
@@ -37,9 +35,7 @@ revoke select on t from x@y;
commit;
select * from t;
show grants for x@y;
---replace_result $VERSION VERSION
---replace_regex /\/\* xid=.* \*\//\/* XID *\//
-show binlog events;
+source include/show_binlog_events.inc;
drop user x@y;
drop database d1;
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
index d0cd40e2e11..c1ef417ea78 100644
--- a/mysql-test/suite/rpl/t/rpl_change_master.test
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test
@@ -33,3 +33,56 @@ connection slave;
sync_with_master;
# End of 4.1 tests
+
+#
+# BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
+#
+
+source include/master-slave-reset.inc;
+
+connection master;
+create table t1 (a int);
+insert into t1 values (1);
+flush logs;
+insert into t1 values (2);
+
+# Note: the master positon saved by this will also be used by the
+# 'sync_with_master' below.
+sync_slave_with_master;
+
+# Check if the table t1 and t2 are identical on master and slave;
+let $diff_table_1= master:test.t1
+let $diff_table_2= slave:test.t1
+source include/diff_tables.inc;
+
+connection slave;
+source include/stop_slave.inc;
+delete from t1 where a=2;
+
+# start replication from the second insert, after fix of BUG#12190,
+# relay_log_file does not use absolute path, only the filename is
+# required
+#
+# Note: the follow change master will automatically reset
+# relay_log_purge to false, save the old value to restore
+let $relay_log_purge= `select @@global.relay_log_purge`;
+CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
+start slave sql_thread;
+source include/wait_for_slave_sql_to_start.inc;
+
+# Sync to the same position saved by the 'sync_slave_with_master' above.
+sync_with_master;
+
+# Check if the table t1 and t2 are identical on master and slave;
+let $diff_table_1= master:test.t1
+let $diff_table_2= slave:test.t1
+source include/diff_tables.inc;
+
+# clean up
+connection slave;
+start slave io_thread;
+source include/wait_for_slave_io_to_start.inc;
+eval set global relay_log_purge=$relay_log_purge;
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_host.test b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
new file mode 100644
index 00000000000..7d245b1d5d5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
@@ -0,0 +1,51 @@
+#
+# BUG
+# ---
+# BUG#28796: CHANGE MASTER TO MASTER_HOST="" leads to invalid master.info
+#
+# Description
+# -----------
+#
+# This test aims at:
+# i) verifying that an error is thrown when setting MASTER_HOST=''
+# ii) no error is thrown when setting non empty MASTER_HOST
+# iii) replication works after setting a correct host name/ip
+#
+# Implementation is performed by feeding different values (according
+# to i), ii) and iii) ) to CHANGE MASTER TO MASTER_HOST= x and checking
+# along the way if error/no error is thrown and/or if replication starts
+# working when expected.
+
+--source include/master-slave.inc
+
+connection slave;
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+--echo Master_Host = '$master_host' (expected '127.0.0.1')
+
+# attempt to change to an empty master host should
+# result in error ER_WRONG_ARGUMENTS: "Incorrect arguments to ..."
+error ER_WRONG_ARGUMENTS;
+CHANGE MASTER TO MASTER_HOST="";
+
+# show slave status still holds previous information
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+--echo Master_Host = '$master_host' (expected '127.0.0.1')
+
+# changing master to other than empty master host succeeds
+CHANGE MASTER TO MASTER_HOST="foo";
+
+# show slave status should hold "foo" as master host
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+--echo Master_Host = '$master_host' (expected 'foo')
+
+# changing back to localhost
+CHANGE MASTER TO MASTER_HOST="127.0.0.1";
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+--echo Master_Host = '$master_host' (expected '127.0.0.1')
+
+# start slave must succeed.
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test
new file mode 100644
index 00000000000..3b0d21052ee
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test
@@ -0,0 +1,168 @@
+# Testing master to slave heartbeat protocol
+#
+# Including:
+# - user interface, grammar, checking the range and warnings about
+# unreasonable values for the heartbeat period;
+# - no rotation of relay log if heartbeat is less that slave_net_timeout
+# - SHOW STATUS like 'Slave_received_heartbeats' action
+# - SHOW STATUS like 'Slave_heartbeat_period' report
+
+-- source include/have_log_bin.inc
+
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
+
+connection master;
+reset master;
+
+connection slave;
+set @restore_slave_net_timeout= @@global.slave_net_timeout;
+set @@global.slave_net_timeout= 10;
+
+###
+### Checking the range
+###
+
+#
+# default period slave_net_timeout/2
+#
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+--query_vertical show status like 'Slave_heartbeat_period';
+
+#
+# the max for the period is ULONG_MAX/1000; an attempt to exceed it is denied
+#
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 4294968;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+#
+# the min value for the period is 1 millisecond an attempt to assign a
+# lesser will be warned with treating the value as zero
+#
+connection slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+### 5.1 mtr does not have --warning ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 0.0009999;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+#
+# the actual max and min must be accepted
+#
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 4294967;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 0.001;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+reset slave;
+
+#
+# A warning if period greater than slave_net_timeout
+#
+set @@global.slave_net_timeout= 5;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 5.001;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+reset slave;
+
+#
+# A warning if slave_net_timeout is set to less than the current HB period
+#
+set @@global.slave_net_timeout= 5;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 4;
+--query_vertical show status like 'Slave_heartbeat_period';
+set @@global.slave_net_timeout= 3 /* must be a warning */;
+
+reset slave;
+
+
+###
+### checking no rotation
+###
+
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+#
+# Even though master_heartbeat_period= 0.5 is 20 times less than
+# @@global.slave_net_timeout= 10 in some circumstances master will
+# not be able to send any heartbeat during the slave's net timeout
+# and slave's relay log will rotate.
+# The probability for such a scenario is pretty small so the following
+# part is almost deterministic.
+#
+
+connection slave;
+set @@global.slave_net_timeout= 10;
+--replace_result $MASTER_MYPORT MASTER_PORT
+# no error this time but rather a warning
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 0.5;
+--query_vertical show status like 'Slave_heartbeat_period';
+
+start slave;
+
+connection master;
+create table t1 (f1 int);
+
+#connection slave;
+sync_slave_with_master;
+source include/show_slave_status.inc;
+
+# there is an explicit sleep lasting longer than slave_net_timeout
+# to ensure that nothing will come to slave from master for that period.
+# That would cause reconnecting and relaylog rotation w/o the fix i.e
+# without a heartbeat received.
+
+real_sleep 15;
+
+# check (compare with the previous show's results) that no rotation happened
+source include/show_slave_status.inc;
+
+###
+### SHOW STATUS like 'Slave_heartbeat_period' and 'Slave_received_heartbeats'
+###
+
+--query_vertical show status like 'Slave_heartbeat_period';
+
+#
+# proof that there has been received at least one heartbeat;
+# The exact number of received heartbeat is an indeterministic value
+# and therefore it's not recorded into results.
+#
+
+let $slave_wait_param_counter= 300;
+let $slave_value= query_get_value("SHOW STATUS like 'Slave_received_heartbeats'", Value, 1);
+# Checking the fact that at least one heartbeat is received
+while (`select $slave_value = 0`)
+{
+ dec $slave_wait_param_counter;
+ if (!$slave_wait_param_counter)
+ {
+ --echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value
+ query_vertical show slave status;
+ SHOW STATUS like 'Slave_received_heartbeats';
+ exit;
+ }
+ sleep 0.1;
+ let $slave_value= query_get_value("SHOW STATUS like 'Slave_received_heartbeats'", Value, 1);
+}
+--echo A heartbeat has been received by the slave
+# cleanup
+
+connection master;
+drop table t1;
+
+#connection slave;
+sync_slave_with_master;
+set @@global.slave_net_timeout= @restore_slave_net_timeout;
+
+
+--echo End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
new file mode 100644
index 00000000000..a3ed77c8bd2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
@@ -0,0 +1,17 @@
+!include ../my.cnf
+
+[mysqld.1]
+server_id=1
+
+[mysqld.2]
+server_id=2
+
+[mysqld.3]
+server_id=3
+
+[ENV]
+SLAVE_MYPORT1= @mysqld.3.port
+SLAVE_MYSOCK1= @mysqld.3.socket
+
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
new file mode 100644
index 00000000000..81737feea9e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
@@ -0,0 +1,142 @@
+#############################################################
+# Author: Serge Kozlov <Serge.Kozlov@Sun.COM>
+# Date: 02/19/2009
+# Purpose: Testing heartbeat for schema
+# 1 master and 2 slaves
+#############################################################
+--source include/master-slave.inc
+--echo
+
+--echo *** Preparing ***
+--connection master
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--connection slave
+--echo [on slave]
+--source include/stop_slave.inc
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='$binlog_file';
+--source include/start_slave.inc
+--disconnect slave1
+--connect(slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,)
+--connection slave1
+--echo [on slave1]
+--disable_warnings
+STOP SLAVE;
+--enable_warnings
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$binlog_file';
+--source include/start_slave.inc
+--echo
+
+#
+# Testing heartbeat
+#
+
+# Check that heartbeat events sent to both slaves with correct periods
+--echo *** 2 slaves ***
+--connection slave
+let $status_var= slave_received_heartbeats;
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Slave has received heartbeat event
+--connection slave1
+let $status_var= slave_received_heartbeats;
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+let $slave1_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--echo Slave1 has received heartbeat event
+--connection slave
+let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $slave1_rcvd_heartbeats) > 1 AS Result, Result, 1);
+--echo Slave has received more heartbeats than Slave1 (1 means 'yes'): $result
+--echo
+
+
+# Create topology A->B->C and check that C receives heartbeat while B gets data
+# Slave1 (B) started w/o --log-slave-updates because B should not send data from A to C
+--echo *** Master->data->Slave1->heartbeat->Slave: ***
+--connection slave1
+--echo [on slave1]
+RESET MASTER;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--connection slave
+--echo [on slave]
+--source include/stop_slave.inc
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT1 SLAVE1_PORT $binlog_file SLAVE1_BINLOG
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT1, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='$binlog_file';
+--source include/start_slave.inc
+# Check heartbeat for new replication channel slave1->slave
+let $status_var= slave_received_heartbeats;
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Slave has received heartbeat event
+--connection master
+--echo [on master]
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
+INSERT INTO t1 VALUES (1, 'on master', '');
+--save_master_pos
+SHOW TABLES;
+--connection slave1
+--sync_with_master 0
+--echo [on slave1]
+SHOW TABLES;
+let $slave_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+--save_master_pos
+--connection slave
+--sync_with_master 0
+--echo [on slave]
+SHOW TABLES;
+--connection master
+--echo [on master]
+--echo creating updates on master and send to slave1 during 5 second
+# Generate events on master and send to slave1 during 5 second
+let $i= 1;
+let $j= 1;
+let $k= 1;
+--disable_query_log
+while ($i) {
+ eval SET @c_text=REPEAT('1234567890', $j);
+ eval UPDATE t1 SET a=$j, c=@c_text;
+ --connection slave1
+ let $slave_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+ if (`SELECT ($k*($slave_pos - $slave_pos_before)) > 0`) {
+ --connection slave
+ let $slave_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+ let $k= 0;
+ let $time_before = `SELECT NOW()`;
+ }
+ if (`SELECT ((1-$k)*TIMESTAMPDIFF(SECOND,'$time_before',NOW())) > 5`) {
+ --connection slave
+ let $slave_rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+ let $i= 0;
+ }
+ --connection master
+ inc $j;
+ sleep 0.1;
+}
+--enable_query_log
+--connection slave
+--echo [on slave]
+let $result= query_get_value(SELECT ($slave_rcvd_heartbeats_after - $slave_rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Slave has received heartbeats (1 means 'yes'): $result
+--echo
+
+#
+# Clean up
+#
+--echo *** Clean up ***
+--connection master
+DROP TABLE t1;
+--save_master_pos
+--connection slave1
+--sync_with_master 0
+--echo
+
+# End of 6.0 test
+--echo End of 6.0 test
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.cnf b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.cnf
new file mode 100644
index 00000000000..a4a291bca79
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.cnf
@@ -0,0 +1,7 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+
+[mysqld.2]
+log-slave-updates
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
new file mode 100644
index 00000000000..10d327eece0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
@@ -0,0 +1,541 @@
+#############################################################
+# Author: Serge Kozlov <Serge.Kozlov@Sun.COM>
+# Date: 02/19/2009
+# Purpose: Testing basic functionality of heartbeat.
+# Description:
+# * Testing different values for slave_heartbeat_period.
+# * How to affect various statements to slave_heartbeat_period
+# * Various states of slave and heartbeat
+# * Various states of master and heartbeat
+# * Circular replication
+#############################################################
+--source include/master-slave.inc
+--echo
+
+--echo *** Preparing ***
+--connection slave
+--source include/stop_slave.inc
+RESET SLAVE;
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period', Value, 1);
+--disable_query_log
+eval SET @restore_slave_heartbeat_timeout=$slave_heartbeat_timeout;
+--enable_query_log
+
+--connection master
+RESET MASTER;
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+SET @restore_event_scheduler=@@global.event_scheduler;
+--echo
+
+#
+# Test slave_heartbeat_period
+#
+
+--connection slave
+
+# Default value of slave_heartbeat_timeout = slave_net_timeout/2
+--echo *** Default value ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', Value, 1);
+let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period', Value, 1);
+let $result= query_get_value(SELECT $slave_net_timeout/$slave_heartbeat_timeout AS Result, Result, 1);
+--echo slave_net_timeout/slave_heartbeat_timeout=$result
+RESET SLAVE;
+--echo
+
+# Reset slave set slave_heartbeat_timeout = slave_net_timeout/2
+--echo *** Reset slave affect ***
+--disable_warnings
+SET @@global.slave_net_timeout=30;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+RESET SLAVE;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+--echo
+
+# Check default value of slave_heartbeat_timeout if slave_net_timeout is changed
+--echo *** Default value if slave_net_timeout changed ***
+--disable_warnings
+SET @@global.slave_net_timeout=50;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+--echo
+
+# Set slave_net_timeout less than current value of slave_heartbeat_period
+--echo *** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
+let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period', Value, 1);
+--replace_result $slave_heartbeat_timeout SLAVE_HEARTBEAT_TIMEOUT
+eval SET @@global.slave_net_timeout=FLOOR($slave_heartbeat_timeout)-1;
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+--echo
+
+# Set value of slave_heartbeat_period greater than slave_net_timeout
+--echo *** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
+let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', Value, 1);
+inc $slave_net_timeout;
+--replace_result $MASTER_MYPORT MASTER_PORT $slave_net_timeout SLAVE_NET_TIMEOUT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=$slave_net_timeout;
+RESET SLAVE;
+--echo
+
+# Changing of slave_net_timeout shouldn't affect to current value of slave_heartbeat_period
+--echo *** CHANGE MASTER statement only updates slave_heartbeat_period ***
+--disable_warnings
+SET @@global.slave_net_timeout=20;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+SHOW VARIABLES LIKE 'slave_net_timeout';
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SET @@global.slave_net_timeout=2*@@global.slave_net_timeout;
+SHOW VARIABLES LIKE 'slave_net_timeout';
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+RESET SLAVE;
+--echo
+
+# Master value of slave_net_timeout shouldn't affect to slave's slave_heartbeat_period
+--echo *** Update slave_net_timeout on master ***
+--connection master
+--disable_warnings
+SET @@global.slave_net_timeout=500;
+--enable_warnings
+--connection slave
+SET @@global.slave_net_timeout=200;
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+--source include/start_slave.inc
+--sync_with_master
+SHOW VARIABLES LIKE 'slave_net_timeout';
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+--source include/stop_slave.inc
+RESET SLAVE;
+--connection master
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+--echo
+
+# Start/stop slave shouldn't change slave_heartbeat_period
+--echo *** Start/stop slave ***
+--connection slave
+--disable_warnings
+SET @@global.slave_net_timeout=100;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+--source include/start_slave.inc
+--sync_with_master
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+--source include/stop_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+--echo
+
+# Reload slave shouldn't change slave_heartbeat_period
+--echo *** Reload slave ***
+--connection slave
+--disable_warnings
+SET @@global.slave_net_timeout=50;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--echo Reload slave
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+--echo
+
+# Disable heartbeat
+--echo *** Disable heartbeat ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SHOW STATUS LIKE 'slave_received_heartbeats';
+--source include/start_slave.inc
+--sync_with_master
+--sleep 2
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SHOW STATUS LIKE 'slave_received_heartbeats';
+--source include/stop_slave.inc
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+SHOW STATUS LIKE 'slave_received_heartbeats';
+RESET SLAVE;
+let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period', Value, 1);
+--replace_result $slave_heartbeat_timeout SLAVE_HEARTBEAT_TIMEOUT
+--eval SELECT $slave_heartbeat_timeout = 0 AS Result
+--echo
+
+#
+# Check limits for slave_heartbeat_timeout
+#
+
+--echo *** Min slave_heartbeat_timeout ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+RESET SLAVE;
+--echo
+
+--echo *** Max slave_heartbeat_timeout ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
+RESET SLAVE;
+# Check double size of max allowed value for master_heartbeat_period
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
+RESET SLAVE;
+# Check 2^32
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
+RESET SLAVE;
+--echo
+
+--echo *** Misc incorrect values ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_PARSE_ERROR
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1';
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_PARSE_ERROR
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--error ER_PARSE_ERROR
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+RESET SLAVE;
+--echo
+
+#
+# Testing heartbeat
+#
+
+# Check received heartbeat events for running slave
+--echo *** Running slave ***
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--source include/start_slave.inc
+--sync_with_master
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var= slave_received_heartbeats;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--echo
+
+# Check received heartbeat events for stopped slave
+--echo *** Stopped slave ***
+--source include/stop_slave.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+sleep 2;
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) AS Result, Result, 1);
+--echo Number of received heartbeat events while slave stopped: $result
+--echo
+
+# Check received heartbeat events for started slave
+--echo *** Started slave ***
+--source include/start_slave.inc
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--echo
+
+# Check received heartbeat events for stopped IO thread
+--echo *** Stopped IO thread ***
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+sleep 2;
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) AS Result, Result, 1);
+--echo Number of received heartbeat events while io thread stopped: $result
+--echo
+
+# Check received heartbeat events for started IO thread
+--echo *** Started IO thread ***
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--echo
+
+# Check received heartbeat events for stopped SQL thread
+--echo *** Stopped SQL thread ***
+STOP SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_to_stop.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+sleep 2;
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result
+--echo
+
+# Check received heartbeat events for started SQL thread
+--echo *** Started SQL thread ***
+START SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_to_start.inc
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--echo
+
+# Check received heartbeat event for stopped SQL thread by error
+--echo *** Stopped SQL thread by error ***
+--connection master
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
+--sync_slave_with_master
+INSERT INTO t1 VALUES (1, 'on slave', NULL);
+--connection master
+INSERT INTO t1 VALUES (1, 'on master', NULL);
+--connection slave
+let $slave_errno= ER_DUP_ENTRY
+--source include/wait_for_slave_sql_error.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+sleep 2;
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result
+--source include/stop_slave.inc
+DROP TABLE t1;
+--echo
+
+# Check received heartbeat events while master send events to slave
+--echo *** Master send to slave ***
+--connection master
+# Create the event that will update table t1 every second
+DELIMITER |;
+CREATE EVENT e1
+ ON SCHEDULE EVERY 1 SECOND
+ DO
+ BEGIN
+ UPDATE test.t1 SET a = a + 1 WHERE a < 10;
+ END|
+DELIMITER ;|
+--connection slave
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+--source include/start_slave.inc
+--connection master
+# Enable scheduler
+SET @@global.event_scheduler=1;
+--connection slave
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--sync_with_master
+# Wait some updates for table t1 from master
+let $wait_condition= SELECT COUNT(*)=1 FROM t1 WHERE a > 5;
+--source include/wait_condition.inc
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Number of received heartbeat events: $result
+--connection master
+DELETE FROM t1;
+DROP EVENT e1;
+--echo
+
+
+
+
+# Check received heartbeat events while logs flushed on slave
+--connection slave
+--echo *** Flush logs on slave ***
+STOP SLAVE;
+RESET SLAVE;
+DROP TABLE t1;
+--connection master
+DROP TABLE t1;
+RESET MASTER;
+--connection slave
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+let $slave_param_comparison= =;
+--source include/start_slave.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+# Flush logs every 0.1 second during 5 sec
+--disable_query_log
+let $i=50;
+while ($i) {
+ FLUSH LOGS;
+ dec $i;
+ sleep 0.1;
+}
+--enable_query_log
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Heartbeat events are received while rotation of relay logs (1 means 'yes'): $result
+--echo
+
+# Use compressed protocol between master and slave
+--echo *** Compressed protocol ***
+--connection master
+SET @@global.slave_compressed_protocol=1;
+--connection slave
+--source include/stop_slave.inc
+RESET SLAVE;
+SET @@global.slave_compressed_protocol=1;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--source include/start_slave.inc
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var= slave_received_heartbeats;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+SET @@global.slave_compressed_protocol=0;
+--connection master
+SET @@global.slave_compressed_protocol=0;
+--echo
+
+
+# Check received heartbeat events after reset of master
+--echo *** Reset master ***
+--connection slave
+STOP SLAVE;
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--source include/start_slave.inc
+let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--connection master
+RESET MASTER;
+--enable_query_log
+--sync_slave_with_master
+--sleep 2
+let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
+--echo Heartbeat events are received after reset of master (1 means 'yes'): $result
+--echo
+
+# Reloaded master should restore heartbeat
+--echo *** Reload master ***
+--connection slave
+STOP SLAVE;
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--source include/start_slave.inc
+# Wait until slave_received_heartbeats will be incremented
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var= slave_received_heartbeats;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--connection master
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+--echo Reload master
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--connection slave
+# Wait until slave_received_heartbeats will be incremented
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var= slave_received_heartbeats;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received
+--echo
+
+# Circular replication
+--echo *** Circular replication ***
+# Configure circular replication
+--connection master
+RESET MASTER;
+let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
+--sync_slave_with_master
+--source include/stop_slave.inc
+RESET MASTER;
+let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT $master_binlog MASTER_BINLOG
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='$master_binlog';
+--connection master
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
+--source include/start_slave.inc
+# Insert data on master and on slave and make sure that it replicated for both directions
+INSERT INTO t1 VALUES(1, 'on master');
+--save_master_pos
+--connection slave
+--source include/start_slave.inc
+--sync_with_master
+INSERT INTO t1 VALUES(2, 'on slave');
+--save_master_pos
+--connection master
+--sync_with_master
+SELECT * FROM t1 ORDER BY a;
+let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+--connection slave
+SELECT * FROM t1 ORDER BY a;
+# Wait heartbeat event on master
+--connection master
+let $status_var= slave_received_heartbeats;
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received on master
+let $master_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+# Wait heartbeat event on slave
+--connection slave
+let $status_var= slave_received_heartbeats;
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event received on slave
+let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+# Heartbeat period on slave less than on master therefore number of received events on slave
+# should be greater than on master
+let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $master_rcvd_heartbeats) > 1 AS Result, Result, 1);
+--echo Slave has received more events than master (1 means 'yes'): $result
+--echo
+
+#
+# Clean up and restore system variables
+#
+--echo *** Clean up ***
+--connection master
+--source include/stop_slave.inc
+DROP TABLE t1;
+--sync_slave_with_master
+--source include/stop_slave.inc
+SET @@global.slave_net_timeout=@restore_slave_net_timeout;
+--echo
+
+# End of 6.0 test
+--echo End of 6.0 test
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
new file mode 100644
index 00000000000..6460b157b52
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
@@ -0,0 +1,54 @@
+#############################################################
+# Author: Serge Kozlov <Serge.Kozlov@Sun.COM>
+# Date: 02/19/2009
+# Purpose: Testing basic functionality of heartbeat over SSL
+#############################################################
+--source include/have_ssl_communication.inc
+--source include/master-slave.inc
+--echo
+
+#
+# Testing heartbeat over SSL
+#
+
+# Heartbeat over SSL
+--echo *** Heartbeat over SSL ***
+--connection master
+let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+--connection slave
+--source include/stop_slave.inc
+RESET SLAVE;
+# Connect to master with SSL
+--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TEST_DIR MYSQL_TEST_DIR $master_binlog MASTER_BINLOG
+eval CHANGE MASTER TO
+ MASTER_HOST='127.0.0.1',
+ MASTER_PORT=$MASTER_MYPORT,
+ MASTER_USER='root',
+ MASTER_HEARTBEAT_PERIOD=0.1,
+ MASTER_LOG_FILE='$master_binlog',
+ MASTER_SSL=1,
+ MASTER_SSL_CA='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ MASTER_SSL_CERT='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ MASTER_SSL_KEY='$MYSQL_TEST_DIR/std_data/client-key.pem';
+--source include/start_slave.inc
+# Check SSL state of slave
+let $slave_ssl_status= query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1);
+--echo Master_SSL_Allowed: $slave_ssl_status
+# Wait until hearbeat event will received
+let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+let $status_var= slave_received_heartbeats;
+let $status_var_comparsion= >;
+--source include/wait_for_status_var.inc
+--echo Heartbeat event has received
+--echo
+
+#
+# Clean up
+#
+--echo *** Clean up ***
+--connection master
+--sync_slave_with_master
+--echo
+
+# End of 6.0 test
+--echo End of 6.0 test
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 54dcbd24419..7e3cb4a7a05 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -38,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 106
+--query_vertical SHOW BINLOG EVENTS FROM 107
--echo **** On Master ****
--query_vertical SHOW CREATE TABLE t1
--query_vertical SHOW CREATE TABLE t2
@@ -76,7 +76,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
# Shouldn't be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
# Test that INSERT-SELECT works the same way as for SBR.
CREATE TABLE t7 (a INT, b INT UNIQUE);
@@ -86,7 +86,7 @@ SELECT * FROM t7 ORDER BY a,b;
# Should be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
@@ -100,7 +100,7 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
@@ -118,7 +118,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
--query_vertical SHOW CREATE TABLE t9
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
--echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
@@ -170,7 +170,7 @@ SELECT * FROM t3 ORDER BY a;
SELECT * FROM t4 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
SHOW TABLES;
SELECT TABLE_NAME,ENGINE
@@ -216,7 +216,7 @@ COMMIT;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
@@ -239,7 +239,7 @@ ROLLBACK;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
index 667e1d9a1a8..d2996bbe525 100644
--- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -1,7 +1,7 @@
# depends on the binlog output
-- source include/have_binlog_format_row.inc
-let $rename_event_pos= 897;
+let $rename_event_pos= 898;
# Bug#18326: Do not lock table for writing during prepare of statement
# The use of the ps protocol causes extra table maps in the binlog, so
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index 3328d582692..a7967f6643a 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -164,13 +164,13 @@ remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
# this test for position option
-# By setting this position to 416, we should only get the create of t3
+# By setting this position to 417, we should only get the create of t3
--disable_query_log
select "--- Test 2 position test --" as "";
--enable_query_log
let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLD_DATADIR/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=417 --stop-position=570 $MYSQLD_DATADIR/master-bin.000001
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -181,7 +181,7 @@ select "--- Test 3 First Remote test --" as "";
# This is broken now
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=569 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=570 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This part is disabled due to bug #17654
@@ -272,7 +272,7 @@ let $MYSQLD_DATADIR= `select @@datadir;`;
select "--- Test 7 reading stdin w/position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --position=417 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
# Bug#16217 (mysql client did not know how not switch its internal charset)
--disable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
new file mode 100644
index 00000000000..6a426efc7ea
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
@@ -0,0 +1,18 @@
+# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files
+#
+# GOAL
+# ====
+#
+# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after
+# the patch, both on master and slave.
+#
+# HOW
+# ===
+#
+# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after
+# some statements have been issued.
+
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+-- source extra/rpl_tests/rpl_show_relaylog_events.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
deleted file mode 100644
index b7db8f97bdd..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-binlog-row-event-max-size=256
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
deleted file mode 100644
index ea49a27adf4..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,STOP_SLAVE_after_first_Rows_event
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
deleted file mode 100644
index 9b24c78e62d..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
+++ /dev/null
@@ -1,32 +0,0 @@
--- source include/have_binlog_format_row.inc
--- source include/have_debug.inc
--- source include/master-slave.inc
-
-# master is asked to create small Rows events: if only one event is
-# created, stopping slave at the end of that one will show no bug, we
-# need at least two (and stop after first); in this test we use three.
-
-connection master;
-create table t1 (words varchar(20)) engine=myisam;
-
-load data infile '../../std_data/words.dat' into table t1 (words);
-select count(*) from t1;
-save_master_pos;
-
-connection slave;
-
-# slave will automatically stop the sql thread thanks to the .opt
-# file; it will initiate the stop request after the first
-# Rows_log_event (out of 3) but should wait until the last one is
-# executed before stopping.
-
-source include/wait_for_slave_sql_to_stop.inc;
-
-# check that we inserted all rows (waited until the last Rows event)
-select count(*) from t1;
-
-connection master;
-drop table t1;
-connection slave; # slave SQL thread is stopped
-source include/stop_slave.inc;
-drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt
new file mode 100644
index 00000000000..58029d28ace
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt
@@ -0,0 +1 @@
+$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt
new file mode 100644
index 00000000000..58029d28ace
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt
@@ -0,0 +1 @@
+$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
new file mode 100644
index 00000000000..4900acc1e91
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -0,0 +1,585 @@
+source include/have_semisync_plugin.inc;
+source include/not_embedded.inc;
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+let $engine_type= InnoDB;
+#let $engine_type= MyISAM;
+
+# Suppress warnings that might be generated during the test
+disable_query_log;
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+connection slave;
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+enable_query_log;
+connection master;
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master, save the count of connections before start
+# semi-sync slave for comparison below.
+let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+
+--echo #
+--echo # Uninstall semi-sync plugins on master and slave
+--echo #
+connection slave;
+disable_query_log;
+source include/stop_slave.inc;
+reset slave;
+disable_warnings;
+error 0,1305;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+error 0,1305;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+enable_warnings;
+
+connection master;
+reset master;
+set sql_log_bin=0;
+disable_warnings;
+error 0,1305;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+error 0,1305;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+enable_warnings;
+set sql_log_bin=1;
+enable_query_log;
+
+--echo #
+--echo # Main test of semi-sync replication start here
+--echo #
+
+connection master;
+echo [ on master ];
+
+disable_query_log;
+let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
+if (`select '$value' = 'No such row'`)
+{
+ set sql_log_bin=0;
+ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+ set global rpl_semi_sync_master_timeout= 5000; /* 5s */
+ set sql_log_bin=1;
+}
+enable_query_log;
+
+echo [ default state of semi-sync on master should be OFF ];
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ enable semi-sync on master ];
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
+--echo #
+
+# BUG#45672 When semi-sync is enabled on master, it would allocate
+# transaction node even without semi-sync slave connected, and would
+# finally result in transaction node allocation error.
+#
+# Semi-sync master will pre-allocate 'max_connections' transaction
+# nodes, so here we do more than that much transactions to check if it
+# will fail or not.
+# select @@global.max_connections + 1;
+let $i= `select @@global.max_connections + 1`;
+disable_query_log;
+eval create table t1 (a int) engine=$engine_type;
+while ($i)
+{
+ eval insert into t1 values ($i);
+ dec $i;
+}
+drop table t1;
+enable_query_log;
+
+# BUG#45673
+echo [ status of semi-sync on master should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+disable_query_log;
+# reset master to make sure the following test will start with a clean environment
+reset master;
+enable_query_log;
+
+--echo #
+--echo # INSTALL PLUGIN semi-sync on slave
+--echo #
+
+connection slave;
+echo [ on slave ];
+
+disable_query_log;
+let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
+if (`select '$value' = 'No such row'`)
+{
+ set sql_log_bin=0;
+ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+ set sql_log_bin=1;
+}
+enable_query_log;
+
+echo [ default state of semi-sync on slave should be OFF ];
+show variables like 'rpl_semi_sync_slave_enabled';
+
+echo [ enable semi-sync on slave ];
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+# NOTE: Rpl_semi_sync_master_client will only be updated when
+# semi-sync slave has started binlog dump request
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+echo [ initial master state after the semi-sync slave connected ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1(a int) engine = $engine_type;
+
+echo [ master state after CREATE TABLE statement ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master.
+let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+replace_result $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
+replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE;
+eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
+
+let $i=300;
+echo [ insert records to table ];
+disable_query_log;
+while ($i)
+{
+ eval insert into t1 values ($i);
+ dec $i;
+}
+enable_query_log;
+
+echo [ master status after inserts ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+sync_slave_with_master;
+echo [ on slave ];
+
+echo [ slave status after replicated inserts ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+--echo #
+--echo # Test semi-sync master will switch OFF after one transacton
+--echo # timeout waiting for slave reply.
+--echo #
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+echo [ on master ];
+
+# The first semi-sync check should be on because after slave stop,
+# there are no transactions on the master.
+echo [ master status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+echo [ semi-sync replication of these transactions will fail ];
+insert into t1 values (500);
+
+# Wait for the semi-sync replication of this transaction to timeout
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= OFF;
+source include/wait_for_status_var.inc;
+
+# The second semi-sync check should be off because one transaction
+# times out during waiting.
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# Semi-sync status on master is now OFF, so all these transactions
+# will be replicated asynchronously.
+let $i=300;
+disable_query_log;
+while ($i)
+{
+ eval delete from t1 where a=$i;
+ dec $i;
+}
+enable_query_log;
+
+insert into t1 values (100);
+
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync status on master will be ON again when slave catches up
+--echo #
+
+# Save the master position for later use.
+save_master_pos;
+
+connection slave;
+echo [ on slave ];
+
+echo [ slave status should be OFF ];
+show status like 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+sync_with_master;
+
+echo [ slave status should be ON ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+connection master;
+echo [ on master ];
+
+# The master semi-sync status should be on again after slave catches up.
+echo [ master status should be ON again after slave catches up ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo #
+--echo # Test disable/enable master semi-sync on the fly.
+--echo #
+
+drop table t1;
+sync_slave_with_master;
+echo [ on slave ];
+
+source include/stop_slave.inc;
+
+--echo #
+--echo # Flush status
+--echo #
+connection master;
+echo [ Semi-sync master status variables before FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
+# clean status after this.
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+echo [ Semi-sync master status variables after FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+
+connection master;
+echo [ on master ];
+
+source include/show_master_logs.inc;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ disable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+echo [ enable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+--echo #
+--echo # Test RESET MASTER/SLAVE
+--echo #
+
+connection slave;
+echo [ on slave ];
+
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+drop table t1;
+
+##show status like 'Rpl_semi_sync_master_status';
+
+sync_slave_with_master;
+--replace_column 2 #
+show status like 'Rpl_relay%';
+
+echo [ test reset master ];
+connection master;
+echo [ on master];
+
+reset master;
+
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+connection slave;
+echo [ on slave ];
+
+source include/stop_slave.inc;
+reset slave;
+
+# Kill the dump thread on master for previous slave connection and
+# wait for it to exit
+connection master;
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ disable_query_log;
+ eval kill query $_tid;
+ enable_query_log;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+
+# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
+# 1 after dump thread started.
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+
+sync_slave_with_master;
+echo [ on slave ];
+
+select * from t1;
+
+connection master;
+echo [ on master ];
+
+echo [ master semi-sync status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Start semi-sync replication without SUPER privilege
+--echo #
+connection slave;
+source include/stop_slave.inc;
+reset slave;
+connection master;
+echo [ on master ];
+reset master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ disable_query_log;
+ eval kill query $_tid;
+ enable_query_log;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+# Do not binlog the following statement because it will generate
+# different events for ROW and STATEMENT format
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+flush privileges;
+set sql_log_bin=1;
+connection slave;
+echo [ on slave ];
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+flush privileges;
+change master to master_user='rpl',master_password='rpl';
+source include/start_slave.inc;
+show status like 'Rpl_semi_sync_slave_status';
+connection master;
+echo [ on master ];
+
+# Wait for the semi-sync binlog dump thread to start
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+insert into t1 values (4);
+insert into t1 values (5);
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync slave connect to non-semi-sync master
+--echo #
+
+# Disable semi-sync on master
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+connection master;
+echo [ on master ];
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
+if ($_tid)
+{
+ disable_query_log;
+ eval kill query $_tid;
+ enable_query_log;
+
+ # After dump thread exit, Rpl_semi_sync_master_clients will be 0
+ let $status_var= Rpl_semi_sync_master_clients;
+ let $status_var_value= 0;
+ source include/wait_for_status_var.inc;
+}
+
+echo [ Semi-sync status on master should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+echo [ on slave ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+connection master;
+echo [ on master ];
+insert into t1 values (8);
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync clients should be 1, status should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+sync_slave_with_master;
+echo [ on slave ];
+show status like 'Rpl_semi_sync_slave_status';
+
+# Uninstall semi-sync plugin on master
+connection slave;
+source include/stop_slave.inc;
+connection master;
+echo [ on master ];
+set sql_log_bin=0;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+set sql_log_bin=1;
+enable_query_log;
+SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled';
+
+connection slave;
+echo [ on slave ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+insert into t1 values (10);
+sync_slave_with_master;
+echo [ on slave ];
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+--echo #
+--echo # Test non-semi-sync slave connect to semi-sync master
+--echo #
+
+connection master;
+set sql_log_bin=0;
+replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_PLUGIN;
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+set global rpl_semi_sync_master_timeout= 5000; /* 5s */
+set sql_log_bin=1;
+set global rpl_semi_sync_master_enabled= 1;
+
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+echo [ uninstall semi-sync slave plugin ];
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+source include/stop_slave.inc;
+
+echo [ reinstall semi-sync slave plugin and disable semi-sync ];
+replace_result $SEMISYNC_SLAVE_PLUGIN SEMISYNC_SLAVE_PLUGIN;
+eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+set global rpl_semi_sync_slave_enabled= 0;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+--echo #
+--echo # Clean up
+--echo #
+
+connection slave;
+source include/stop_slave.inc;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+
+connection master;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+connection master;
+drop user rpl@127.0.0.1;
+flush privileges;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
new file mode 100644
index 00000000000..3c4a05d640c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
@@ -0,0 +1 @@
+$SEMISYNC_PLUGIN_OPT --max-connections=23
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt
new file mode 100644
index 00000000000..58029d28ace
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt
@@ -0,0 +1 @@
+$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
new file mode 100644
index 00000000000..b08e1b49ea2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -0,0 +1,108 @@
+source include/have_semisync_plugin.inc;
+source include/not_embedded.inc;
+source include/master-slave.inc;
+source include/have_innodb.inc;
+
+let $engine_type= InnoDB;
+
+# Suppress warnings that might be generated during the test
+disable_query_log;
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
+call mtr.add_suppression("Read semi-sync reply");
+connection slave;
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+enable_query_log;
+
+connection master;
+disable_query_log;
+let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
+if (`select '$value' = 'No such row'`)
+{
+ set sql_log_bin=0;
+ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+ SET GLOBAL rpl_semi_sync_master_enabled = 1;
+ set sql_log_bin=1;
+}
+enable_query_log;
+
+connection slave;
+source include/stop_slave.inc;
+
+disable_query_log;
+let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
+if (`select '$value' = 'No such row'`)
+{
+ set sql_log_bin=0;
+ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+ SET GLOBAL rpl_semi_sync_slave_enabled = 1;
+ set sql_log_bin=1;
+}
+enable_query_log;
+
+source include/start_slave.inc;
+
+connection master;
+SET GLOBAL event_scheduler = ON;
+
+replace_result $engine_type ENGINE_TYPE;
+eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type;
+INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
+INSERT INTO t1 SELECT i+5, f FROM t1;
+INSERT INTO t1 SELECT i+10, f FROM t1;
+
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
+CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
+
+connection slave;
+STOP SLAVE IO_THREAD;
+
+connection master;
+let $run = 20;
+while ($run)
+{
+ connect (m$run,localhost,root,,);
+ connection m$run;
+ send;
+ eval UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = $run;
+ connection master;
+ dec $run;
+}
+
+connection master;
+SET GLOBAL event_scheduler = OFF;
+
+let $run = 20;
+while ($run)
+{
+ connection m$run;
+ reap;
+ disconnect m$run;
+ dec $run;
+}
+
+#
+# Clean up
+#
+connection slave;
+source include/stop_slave.inc;
+
+disable_warnings;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+
+connection master;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+enable_warnings;
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+DROP EVENT ev1;
+DROP EVENT ev2;
+DROP TABLE t1;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt
new file mode 100644
index 00000000000..302889525dd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt
@@ -0,0 +1 @@
+--disable-log-slave-updates --replicate-same-server-id
diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
new file mode 100644
index 00000000000..1b38bd34d3d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
@@ -0,0 +1,114 @@
+# This test checks that the slave rejects events originating
+# by a server from the list of ignored originators (bug#27808 etc)
+#
+# phases of tests:
+#
+# 0. master_id new line in show slave status
+# 1. syntax related:
+# a. error reporting if options clash;
+# b. overriding the old IGNORE_SERVER_IDS setup by the following
+# CHANGE MASTER ... IGNORE_SERVER_IDS= (list);
+# c. the old setup preserving by CHANGE MASTER w/o IGNORE_SERVER_IDS
+# d. resetting the ignored server ids with the empty list arg to
+# IGNORE_SERVER_IDS=()
+# e. RESET SLAVE preserves the list
+# 2. run time related:
+# a. observing no processing events from a master listed in IGNORE_SERVER_IDS
+# b. nullifying the list and resuming of taking binlog from the very beginning with
+# executing events this time
+
+source include/master-slave.inc;
+
+connection slave;
+
+# a new line for master_id
+let $master_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1);
+echo master_id: $master_id;
+
+stop slave;
+--echo *** --replicate-same-server-id and change master option can clash ***
+--error ER_SLAVE_IGNORE_SERVER_IDS
+change master to IGNORE_SERVER_IDS= (2, 1);
+--echo *** must be empty due to the error ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+echo ignore server id list: $ignore_list;
+
+change master to IGNORE_SERVER_IDS= (10, 100);
+--echo *** must be 10, 100 ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+echo ignore server id list: $ignore_list;
+reset slave;
+--echo *** must be empty due to reset slave ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+echo ignore server id list: $ignore_list;
+change master to IGNORE_SERVER_IDS= (10, 100);
+--echo *** CHANGE MASTER with IGNORE_SERVER_IDS option overrides (does not increment) the previous setup ***
+change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
+--echo *** must be 1, 3, 4, 5 due to overriding policy ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+echo ignore server id list: $ignore_list;
+--echo *** ignore master (server 1) queries for a while ***
+start slave;
+
+connection master;
+
+#connection slave;
+sync_slave_with_master;
+let $slave_relay_pos0= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
+
+connection master;
+create table t1 (n int);
+let $master_binlog_end= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+let $slave_param= Exec_Master_Log_Pos;
+let $slave_param_value= $master_binlog_end;
+source include/wait_for_slave_param.inc;
+--echo *** must be empty as the event is to be filtered out ***
+show tables;
+--echo *** allowing events from master ***
+let $slave_relay_pos1= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
+#
+# checking stability of relay log pos
+#
+if (`select $slave_relay_pos1 - $slave_relay_pos0`)
+{
+ --echo Error: relay log position changed: $slave_relay_pos0, $slave_relay_pos1
+ query_vertical show slave status;
+}
+
+stop slave;
+source include/wait_for_slave_to_stop.inc;
+reset slave;
+change master to IGNORE_SERVER_IDS= (10, 100);
+--echo *** the list must remain (10, 100) after reset slave ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+
+change master to IGNORE_SERVER_IDS= ();
+--echo *** must be empty due to IGNORE_SERVER_IDS empty list ***
+let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+echo ignore server id list: $ignore_list;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root';
+start slave;
+
+connection master;
+
+#connection slave;
+sync_slave_with_master;
+--echo *** must have caught create table ***
+show tables;
+
+# cleanup
+connection master;
+drop table t1;
+#connection slave
+sync_slave_with_master;
+
+--echo end of the tests
+
+
+
+
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index f4cb0f69e93..6336e775af1 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -27,7 +27,7 @@ connection slave;
# Stop when reaching the the first table map event.
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762;
-wait_for_slave_to_stop;
+-- source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
@@ -59,7 +59,7 @@ source include/show_binlog_events.inc;
connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
-wait_for_slave_to_stop;
+-- source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
sync_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index 4edf1802a5d..02fd555d13c 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -54,6 +54,7 @@ sync_slave_with_master;
source include/stop_slave.inc;
START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
+source include/wait_for_slave_io_to_stop.inc;
--echo ==== Verify that Slave_IO_Running = No ====
let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt b/mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt
new file mode 100644
index 00000000000..a27d3a0f5a7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt
@@ -0,0 +1 @@
+--force-restart --log-slow-slave-statements --log-slow-queries
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
new file mode 100644
index 00000000000..fd2fef82eb2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -0,0 +1,191 @@
+#
+# BUG#23300: Slow query log on slave does not log slow replicated statements
+#
+# Description:
+# The slave should log slow queries replicated from master when
+# --log-slow-slave-statements is used.
+#
+# Test is implemented as follows:
+# i) stop slave
+# ii) On slave, set long_query_time to a small value.
+# ii) start slave so that long_query_time variable is picked by sql thread
+# iii) On master, do one short time query and one long time query, on slave
+# and check that slow query is logged to slow query log but fast query
+# is not.
+# iv) On slave, check that slow queries go into the slow log and fast dont,
+# when issued through a regular client connection
+# v) On slave, check that slow queries go into the slow log and fast dont
+# when we use SET TIMESTAMP= 1 on a regular client connection.
+# vi) check that when setting slow_query_log= OFF in a connection 'extra2'
+# prevents logging slow queries in a connection 'extra'
+#
+# OBS:
+# This test only runs for statement binlogging format because on row format
+# slow queries do not get slow query logged.
+# Note that due to the sleep() command the insert is written to the binary
+# log in row format.
+
+source include/master-slave.inc;
+source include/have_binlog_format_statement.inc;
+
+
+# Prepare slave for different long_query_time we need to stop the slave
+# and restart it as long_query_time variable is dynamic and, after
+# setting it, it only takes effect on new connections.
+#
+# Reference:
+# http://dev.mysql.com/doc/refman/6.0/en/set-option.html
+connection slave;
+
+source include/stop_slave.inc;
+
+SET @old_log_output= @@log_output;
+SET GLOBAL log_output= 'TABLE';
+SET @old_long_query_time= @@long_query_time;
+SET GLOBAL long_query_time= 2;
+TRUNCATE mysql.slow_log;
+
+source include/start_slave.inc;
+
+connection master;
+CREATE TABLE t1 (a int, b int);
+
+# test:
+# check that slave logs the slow query to the slow log, but not the fast one.
+
+let $slow_query= INSERT INTO t1 values(1, sleep(3));
+let $fast_query= INSERT INTO t1 values(1, 1);
+
+eval $fast_query;
+--disable_warnings
+eval $slow_query;
+--enable_warnings
+sync_slave_with_master;
+
+let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
+let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if ($found_fast_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
+}
+
+if (!$found_slow_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
+}
+TRUNCATE mysql.slow_log;
+
+# regular checks for slow query log (using a new connection - 'extra' - to slave)
+
+# test:
+# when using direct connections to the slave, check that slow query is logged
+# but not the fast one.
+
+connect(extra,127.0.0.1,root,,test,$SLAVE_MYPORT);
+connection extra;
+
+let $fast_query= SELECT 1;
+let $slow_query= SELECT 1, sleep(3);
+
+eval $slow_query;
+eval $fast_query;
+
+let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
+let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if ($found_fast_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
+}
+
+if (!$found_slow_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
+}
+TRUNCATE mysql.slow_log;
+
+# test:
+# when using direct connections to the slave, check that when setting timestamp to 1 the
+# slow query is logged but the fast one is not.
+
+let $fast_query= SELECT 2;
+let $slow_query= SELECT 2, sleep(3);
+
+SET TIMESTAMP= 1;
+eval $slow_query;
+eval $fast_query;
+
+let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
+let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if ($found_fast_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
+}
+
+if (!$found_slow_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
+}
+TRUNCATE mysql.slow_log;
+
+# test:
+# check that when setting the slow_query_log= OFF on connection 'extra2'
+# prevents connection 'extra' from logging to slow query log.
+
+let $fast_query= SELECT 3;
+let $slow_query= SELECT 3, sleep(3);
+
+connect(extra2,127.0.0.1,root,,test,$SLAVE_MYPORT);
+connection extra2;
+
+SET @old_slow_query_log= @@slow_query_log;
+SET GLOBAL slow_query_log= 'OFF';
+
+connection extra;
+
+eval $slow_query;
+eval $fast_query;
+
+let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
+let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+
+if ($found_fast_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Fast query FOUND in slow query log when slow_query_log= OFF. Bailing out!";
+}
+
+if ($found_slow_query)
+{
+ SELECT * FROM mysql.slow_log;
+ die "Assertion failed! Slow query FOUND in slow query log when slow_query_log= OFF. Bailing out!";
+}
+TRUNCATE mysql.slow_log;
+
+# clean up: drop tables, reset the variables back to the previous value,
+# disconnect extra connections
+connection extra2;
+
+SET GLOBAL slow_query_log= @old_slow_query_log;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+source include/stop_slave.inc;
+
+SET GLOBAL long_query_time= @old_long_query_time;
+SET GLOBAL log_output= @old_log_output;
+
+source include/start_slave.inc;
+
+disconnect extra;
+disconnect extra2;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index 9be630e9ae8..2811db8ef1e 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -568,9 +568,7 @@ connection master;
# Final inspection which verifies how all statements of this test file
# were written to the binary log.
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events in 'master-bin.000001' from 106;
+source include/show_binlog_events.inc;
# Restore log_bin_trust_function_creators to its original value.
diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt b/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables.test b/mysql-test/suite/rpl/t/rpl_spec_variables.test
new file mode 100644
index 00000000000..a60738316c8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_spec_variables.test
@@ -0,0 +1,306 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 07/01/2008
+# Purpose: Testing possible affects of some system dynamic
+# variables to the replication.
+# Scenario for each variable:
+# 1) Set different values for master and slave
+# 2) Create and replicate a data from master to slave
+# 3) Check results on master and slave: changes on slave
+# shouldn't be affected to replicated data.
+#############################################################
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--echo
+
+#
+# AUTO_INCREMENT
+#
+--echo * auto_increment_increment, auto_increment_offset *
+
+--connection master
+SET @@global.auto_increment_increment=2;
+SET @@session.auto_increment_increment=2;
+SET @@global.auto_increment_offset=10;
+SET @@session.auto_increment_offset=10;
+
+--connection slave
+SET @@global.auto_increment_increment=3;
+SET @@session.auto_increment_increment=3;
+SET @@global.auto_increment_offset=20;
+SET @@session.auto_increment_offset=20;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t1 (b) VALUES ('master');
+INSERT INTO t1 (b) VALUES ('master');
+SELECT * FROM t1 ORDER BY a;
+
+--sync_slave_with_master
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+INSERT INTO t1 (b) VALUES ('slave');
+INSERT INTO t1 (b) VALUES ('slave');
+INSERT INTO t2 (b) VALUES ('slave');
+INSERT INTO t2 (b) VALUES ('slave');
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--connection master
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+SET @@global.auto_increment_increment=1;
+SET @@session.auto_increment_increment=1;
+SET @@global.auto_increment_offset=1;
+SET @@session.auto_increment_offset=1;
+
+--connection slave
+SET @@global.auto_increment_increment=1;
+SET @@session.auto_increment_increment=1;
+SET @@global.auto_increment_offset=1;
+SET @@session.auto_increment_offset=1;
+
+--connection slave
+SET auto_increment_increment=1;
+SET auto_increment_offset=1;
+--echo
+
+#
+# CHARACTER_SET_DATABASE, COLLATION_SERVER
+#
+--echo * character_set_database, collation_server *
+
+--connection master
+SET @restore_master_character_set_database=@@global.character_set_database;
+SET @restore_master_collation_server=@@global.collation_server;
+SET @@global.character_set_database=latin1;
+SET @@session.character_set_database=latin1;
+SET @@global.collation_server=latin1_german1_ci;
+SET @@session.collation_server=latin1_german1_ci;
+
+--connection slave
+SET @restore_slave_character_set_database=@@global.character_set_database;
+SET @restore_slave_collation_server=@@global.collation_server;
+SET @@global.character_set_database=utf8;
+SET @@session.character_set_database=utf8;
+SET @@global.collation_server=utf8_bin;
+SET @@session.collation_server=utf8_bin;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+
+--sync_slave_with_master
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+SET @@global.collation_server=latin1_swedish_ci;
+SET @@session.collation_server=latin1_swedish_ci;
+
+--connection master
+SET @@global.collation_server=latin1_swedish_ci;
+SET @@session.collation_server=latin1_swedish_ci;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+--echo
+
+#
+# DEFAULT_WEEK_FORMAT
+#
+--echo * default_week_format *
+
+--connection master
+SET @@global.default_week_format=0;
+SET @@session.default_week_format=0;
+
+--connection slave
+SET @@global.default_week_format=1;
+SET @@session.default_week_format=1;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1, 'master ', WEEK('2008-01-07'));
+SELECT * FROM t1 ORDER BY a;
+
+--sync_slave_with_master
+INSERT INTO t1 VALUES (2, 'slave ', WEEK('2008-01-07'));
+SELECT * FROM t1 ORDER BY a;
+
+--connection master
+DROP TABLE t1;
+
+--connection slave
+SET @@global.default_week_format=0;
+SET @@session.default_week_format=0;
+--echo
+
+#
+# LOCAL_INFILE
+#
+--echo * local_infile *
+
+--connection slave
+SET @@global.local_infile=0;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(20), c CHAR(254)) ENGINE=MyISAM;
+--copy_file ./std_data/words.dat $MYSQLTEST_VARDIR/tmp/words.dat
+--copy_file ./std_data/words2.dat $MYSQLTEST_VARDIR/tmp/words2.dat
+--replace_regex /\'.+\'/'FILE'/
+--eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/words.dat' INTO TABLE t1 (b)
+SELECT COUNT(*) FROM t1;
+--sync_slave_with_master
+--replace_regex /\'.+\'/'FILE2'/
+--error 1148
+--eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/words2.dat' INTO TABLE t1 (b)
+SELECT COUNT(*) FROM t1;
+
+SET @@global.local_infile=1;
+
+--connection master
+DROP TABLE t1;
+--echo
+
+#
+# MAX_HEAP_TABLE_SIZE
+#
+--echo * max_heap_table_size *
+
+--connection slave
+SET @restore_slave_max_heap_table_size=@@global.max_heap_table_size;
+SET @@global.max_heap_table_size=16384;
+SET @@session.max_heap_table_size=16384;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), c CHAR(254)) ENGINE=MEMORY;
+let $counter=2000;
+--disable_query_log
+while ($counter) {
+ INSERT INTO t1 (b,c) VALUES ('master', REPEAT('A', 254));
+ dec $counter;
+}
+--enable_query_log
+SELECT COUNT(*)=2000 FROM t1;
+
+--sync_slave_with_master
+let $counter=2000;
+--disable_query_log
+while ($counter) {
+ --error 0,1114
+ INSERT INTO t1 (b,c) VALUES ('slave', REPEAT('A', 254));
+ dec $counter;
+}
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), c CHAR(254)) ENGINE=MEMORY;
+let $counter=2000;
+--disable_query_log
+while ($counter) {
+ --error 0,1114
+ INSERT INTO t2 (b,c) VALUES ('slave', REPEAT('A', 254));
+ dec $counter;
+}
+--enable_query_log
+# We don't know how many memory used and can't check exact values so need to check following
+# conditions
+SELECT COUNT(*)=2000 FROM t1 WHERE b='master' GROUP BY b ORDER BY b;
+SELECT COUNT(*)<2000 AND COUNT(*)>0 FROM t1 WHERE b='slave' GROUP BY b ORDER BY b;
+SELECT COUNT(*)<2000 AND COUNT(*)>0 FROM t2 WHERE b='slave' GROUP BY b ORDER BY b;
+
+--connection master
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+--echo
+
+#
+# STORAGE_ENGINE
+#
+--echo * storage_engine *
+
+--connection master
+SET @restore_master_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=InnoDB;
+SET @@session.storage_engine=InnoDB;
+
+--connection slave
+SET @restore_slave_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=Memory;
+SET @@session.storage_engine=Memory;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10));
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+
+--sync_slave_with_master
+CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10));
+
+--connection master
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection slave
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+SHOW CREATE TABLE t3;
+
+SET @@global.storage_engine=InnoDB;
+SET @@session.storage_engine=InnoDB;
+
+--connection master
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+--echo
+
+#
+# SQL_MODE
+#
+--echo * sql_mode *
+
+--connection master
+SET @@global.sql_mode=ANSI;
+SET @@session.sql_mode=ANSI;
+
+--connection slave
+SET @@global.sql_mode=TRADITIONAL;
+SET @@session.sql_mode=TRADITIONAL;
+
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c DATE);
+INSERT INTO t1 VALUES (1, 'master', '0000-00-00');
+SELECT * FROM t1 ORDER BY a;
+
+--sync_slave_with_master
+--error 1292
+INSERT INTO t1 VALUES (1, 'slave', '0000-00-00');
+SELECT * FROM t1 ORDER BY a;
+SET @@global.sql_mode='';
+SET @@session.sql_mode='';
+
+--connection master
+SET @@global.sql_mode='';
+SET @@session.sql_mode='';
+DROP TABLE t1;
+--echo
+
+
+# Clean up
+--echo *** clean up ***
+--connection master
+SET @@global.character_set_database=@restore_master_character_set_database;
+SET @@global.collation_server=@restore_master_collation_server;
+SET @@global.storage_engine=@restore_master_storage_engine;
+--sync_slave_with_master
+SET @@global.character_set_database=@restore_slave_character_set_database;
+SET @@global.collation_server=@restore_slave_collation_server;
+SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size;
+SET @@global.storage_engine=@restore_slave_storage_engine;
+
+# Put at the end since the test otherwise emptied the table.
+
+--echo
+call mtr.add_suppression("The table 't[12]' is full");
+
+# End of 5.1 test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index a8a33d05e8b..f3993f80b90 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
@@ -1,7 +1,7 @@
# depends on the binlog output
--source include/have_binlog_format_mixed_or_statement.inc
-let $rename_event_pos= 656;
+let $rename_event_pos= 657;
-- source extra/rpl_tests/rpl_flsh_tbls.test
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
new file mode 100644
index 00000000000..523e883d9fa
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
@@ -0,0 +1,18 @@
+# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files
+#
+# GOAL
+# ====
+#
+# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after
+# the patch, both on master and slave.
+#
+# HOW
+# ===
+#
+# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after
+# some statements have been issued.
+
+-- source include/master-slave.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+-- source extra/rpl_tests/rpl_show_relaylog_events.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stop_middle_group.test
new file mode 100644
index 00000000000..2cd41b45cf9
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stop_middle_group.test
@@ -0,0 +1,149 @@
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+
+# Proving that stopping in the middle of applying a group of events
+# does not have immediate effect if a non-transaction table has been changed.
+# The slave sql thread has to try to finish applying first.
+# The tests rely on simulation of the killed status.
+# The matter of testing correlates to some of `rpl_start_stop_slave' that does
+# not require `have_debug'.
+
+connection master;
+
+create table tm (a int auto_increment primary key) engine=myisam;
+create table ti (a int auto_increment primary key) engine=innodb;
+
+sync_slave_with_master;
+set @@global.debug="+d,stop_slave_middle_group";
+
+connection master;
+
+begin;
+insert into ti set a=null;
+insert into tm set a=null; # to simulate killed status on the slave
+commit;
+
+connection slave;
+
+# slave will catch the killed status but won't shut down immediately
+# only after the whole group has done (commit)
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: no error and the group is finished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read = $exec into @check;
+--enable_query_log
+eval SELECT "NO$error" AS Last_SQL_Error, @check as `true`;
+select count(*) as one from tm;
+select count(*) as one from ti;
+
+set @@global.debug="-d";
+
+#
+# bug#45940 issues around rli->last_event_start_time
+# Testing of slave stopped after it had waited (in vain) for
+# the group be finished.
+# It could not be finished because of simulation of failure to
+# receive the terminal part
+# The test relay on simulation of the incomplete group in the relay log
+
+# Two cases are verified: a mixed transacton and a mixed multi-table update.
+#
+# The mixed transacton.
+#
+source include/start_slave.inc;
+
+connection master;
+
+truncate table tm; # cleanup of former tests
+truncate table ti;
+
+#connection slave;
+sync_slave_with_master;
+
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+
+connection master;
+
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+
+connection slave;
+
+# slave will catch the killed status, won't shut down immediately
+# but does it eventually having the whole group unfinished (not committed)
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: the error and group unfinished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read - $exec > 0 into @check;
+--enable_query_log
+eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
+select count(*) as one from tm;
+select count(*) as zero from ti;
+
+set @@global.debug="-d";
+
+#
+# The mixed multi-table update
+#
+stop slave;
+truncate table tm;
+source include/start_slave.inc;
+
+connection master;
+
+#connection slave;
+sync_slave_with_master;
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+
+connection master;
+update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
+
+connection slave;
+
+# slave will catch the killed status, won't shut down immediately
+# but does it eventually having the whole group unfinished (not committed)
+#
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+# checking: the error and group unfinished
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $read = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1);
+let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval SELECT $read - $exec > 0 into @check;
+--enable_query_log
+eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
+select max(a) as two from tm;
+select max(a) as one from ti;
+
+set @@global.debug="-d";
+
+#
+# clean-up
+#
+
+connection master;
+drop table tm, ti;
+
+connection slave; # slave SQL thread is stopped
+source include/stop_slave.inc;
+drop table tm, ti;
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index e6c1d5256a0..0a031f1bff9 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -145,7 +145,9 @@ create table t3 select 1 union select UUID();
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
# what if UUID() is first:
+--disable_warnings
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+--enable_warnings
# inside a stored procedure
diff --git a/mysql-test/suite/rpl/t/rpl_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
new file mode 100644
index 00000000000..77809a42c43
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
@@ -0,0 +1 @@
+--sync-relay-log-info=1 --relay-log-recovery=1
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
new file mode 100644
index 00000000000..80b6a144187
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -0,0 +1,148 @@
+########################################################################################
+# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
+# crashing the slave in two different situations:
+# (case-1) - Corrupt the relay log with changes which were not processed by
+# the SQL Thread and crashes it.
+# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
+#
+# Case 1:
+# 1 - Stops the SQL Thread
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the relay-log.bin* which most likely has such changes.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+#
+# Case 2:
+# 1 - Stops the SQL/IO Threads
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the master.info with wrong coordinates.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+########################################################################################
+
+########################################################################################
+# Configuring the environment
+########################################################################################
+--echo =====Configuring the enviroment=======;
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+
+########################################################################################
+# Case 1: Corrupt a relay-log.bin*
+########################################################################################
+--echo =====Inserting data on the master but without the SQL Thread being running=======;
+sync_slave_with_master;
+
+connection slave;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
+stop slave SQL_THREAD;
+source include/wait_for_slave_sql_to_stop.inc;
+
+connection master;
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+
+--echo =====Removing relay log files and crashing/recoverying the slave=======;
+connection slave;
+stop slave IO_THREAD;
+source include/wait_for_slave_io_to_stop.inc;
+
+let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo =====Dumping and comparing tables=======;
+start slave;
+source include/wait_for_slave_to_start.inc;
+
+connection master;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Case 2: Corrupt a master.info
+########################################################################################
+--echo =====Corrupting the master.info=======;
+connection slave;
+stop slave;
+source include/wait_for_slave_to_stop.inc;
+
+connection master;
+FLUSH LOGS;
+
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+
+connection slave;
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info
+
+let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
+
+--perl
+use strict;
+use warnings;
+my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
+my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
+open(FILE, "<", $src) or die;
+my @content= <FILE>;
+close FILE;
+open(FILE, ">", $dst) or die;
+binmode FILE;
+print FILE @content;
+close FILE;
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo =====Dumping and comparing tables=======;
+start slave;
+source include/wait_for_slave_to_start.inc;
+
+connection master;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Clean up
+########################################################################################
+--echo =====Clean up=======;
+connection master;
+drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf
index 58fec36eedd..a0ec3659c18 100644
--- a/mysql-test/suite/rpl_ndb/my.cnf
+++ b/mysql-test/suite/rpl_ndb/my.cnf
@@ -1,5 +1,6 @@
!include include/default_mysqld.cnf
!include include/default_ndbd.cnf
+!include include/default_client.cnf
[cluster_config.1]
NoOfReplicas= 2
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
index b16a63ec5ad..6680f3fd70f 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
@@ -179,6 +179,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno <Last_SQL_Errno>
Last_SQL_Error <Last_SQL_Error>
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
set GLOBAL slave_transaction_retries=10;
include/start_slave.inc
select * from t1 order by nid;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
index 2daacb351a9..aeb9e215d15 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
@@ -56,6 +56,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT * FROM t1 ORDER BY a;
a b
1 2
@@ -99,5 +101,7 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 2
STOP SLAVE;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
index b6f32668c42..8eb7df3f890 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
@@ -53,6 +53,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 2
SELECT * FROM t1 ORDER BY a;
a b
1 2
@@ -102,4 +104,6 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
index f514bf7a75b..8a32cff0cd3 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
@@ -93,6 +93,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@@ -160,6 +162,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t3 ***
@@ -222,6 +226,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t4 ***
@@ -284,6 +290,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t5 ***
@@ -345,6 +353,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
DROP TABLE t6;
@@ -457,6 +467,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t10 ***
@@ -518,6 +530,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t11 ***
@@ -768,6 +782,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1060
Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
*** Try to insert in master ****
@@ -908,6 +924,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
** DROP table t17 ***
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
index e2fee391bab..2df70ace0c1 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
@@ -33,15 +33,15 @@ c1 c2 c3
row3 C 3
row4 D 4
SHOW SLAVE STATUS;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0 1
STOP SLAVE;
CHANGE MASTER TO
master_log_file = 'master-bin.000001',
master_log_pos = <the_pos> ;
SHOW SLAVE STATUS;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0 1
START SLAVE;
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
@@ -68,6 +68,6 @@ SELECT * FROM t1;
c1 c2 c3
row2 new on slave 2
SHOW SLAVE STATUS;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
-<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Last_IO_Errno> <Last_IO_Error> 0
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Last_IO_Errno> <Last_IO_Error> 0 1
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
index 540c430e757..301f4c2e45b 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
@@ -34,14 +34,14 @@ master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
-show binlog events from 106 limit 1;
+show binlog events from 107 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
-show binlog events from 106 limit 2;
+show binlog events from 107 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN
-show binlog events from 106 limit 2,1;
+show binlog events from 107 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
flush logs;
@@ -267,7 +267,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000002
-Read_Master_Log_Pos 623
+Read_Master_Log_Pos 624
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000002
@@ -282,7 +282,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 623
+Exec_Master_Log_Pos 624
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -299,6 +299,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result
new file mode 100644
index 00000000000..43efc10c2e1
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result
@@ -0,0 +1,246 @@
+==== Initialization ====
+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;
+---- setup master ----
+CREATE TABLE myisam_innodb (a INT) ENGINE=MYISAM;
+CREATE TABLE innodb_myisam (a INT) ENGINE=INNODB;
+CREATE TABLE myisam_ndb (a INT) ENGINE=MYISAM;
+CREATE TABLE ndb_myisam (a INT) ENGINE=NDB;
+CREATE TABLE innodb_ndb (a INT) ENGINE=INNODB;
+CREATE TABLE ndb_innodb (a INT) ENGINE=NDB;
+SHOW CREATE TABLE myisam_innodb;
+Table Create Table
+myisam_innodb CREATE TABLE `myisam_innodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE innodb_myisam;
+Table Create Table
+innodb_myisam CREATE TABLE `innodb_myisam` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE myisam_ndb;
+Table Create Table
+myisam_ndb CREATE TABLE `myisam_ndb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE ndb_myisam;
+Table Create Table
+ndb_myisam CREATE TABLE `ndb_myisam` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE innodb_ndb;
+Table Create Table
+innodb_ndb CREATE TABLE `innodb_ndb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE ndb_innodb;
+Table Create Table
+ndb_innodb CREATE TABLE `ndb_innodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+---- setup slave with different engines ----
+DROP TABLE myisam_innodb, innodb_myisam;
+DROP TABLE myisam_ndb, ndb_myisam;
+DROP TABLE innodb_ndb, ndb_innodb;
+CREATE TABLE myisam_innodb (a INT) ENGINE=INNODB;
+CREATE TABLE innodb_myisam (a INT) ENGINE=MYISAM;
+CREATE TABLE myisam_ndb (a INT) ENGINE=NDB;
+CREATE TABLE ndb_myisam (a INT) ENGINE=MYISAM;
+CREATE TABLE innodb_ndb (a INT) ENGINE=NDB;
+CREATE TABLE ndb_innodb (a INT) ENGINE=INNODB;
+SHOW CREATE TABLE myisam_innodb;
+Table Create Table
+myisam_innodb CREATE TABLE `myisam_innodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE innodb_myisam;
+Table Create Table
+innodb_myisam CREATE TABLE `innodb_myisam` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE myisam_ndb;
+Table Create Table
+myisam_ndb CREATE TABLE `myisam_ndb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE ndb_myisam;
+Table Create Table
+ndb_myisam CREATE TABLE `ndb_myisam` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE innodb_ndb;
+Table Create Table
+innodb_ndb CREATE TABLE `innodb_ndb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE ndb_innodb;
+Table Create Table
+ndb_innodb CREATE TABLE `ndb_innodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+==== AUTOCOMMIT=0, transactions ====
+---- COMMIT ----
+SET AUTOCOMMIT = 0;
+BEGIN;
+INSERT INTO myisam_innodb VALUES (1);
+INSERT INTO myisam_innodb VALUES (2);
+COMMIT;
+BEGIN;
+INSERT INTO innodb_myisam VALUES (3);
+INSERT INTO innodb_myisam VALUES (4);
+COMMIT;
+BEGIN;
+INSERT INTO myisam_ndb VALUES (5);
+INSERT INTO myisam_ndb VALUES (6);
+COMMIT;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (7);
+INSERT INTO ndb_myisam VALUES (8);
+COMMIT;
+BEGIN;
+INSERT INTO ndb_innodb VALUES (9);
+INSERT INTO ndb_innodb VALUES (10);
+COMMIT;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (11);
+INSERT INTO innodb_ndb VALUES (12);
+COMMIT;
+---- ROLLBACK ----
+BEGIN;
+INSERT INTO innodb_myisam VALUES (15);
+INSERT INTO innodb_myisam VALUES (16);
+ROLLBACK;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (19);
+INSERT INTO ndb_myisam VALUES (20);
+ROLLBACK;
+BEGIN;
+INSERT INTO ndb_innodb VALUES (21);
+INSERT INTO ndb_innodb VALUES (22);
+ROLLBACK;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (23);
+INSERT INTO innodb_ndb VALUES (24);
+ROLLBACK;
+==== AUTOCOMMIT=1, transactions ====
+---- COMMIT ----
+SET AUTOCOMMIT = 1;
+BEGIN;
+INSERT INTO myisam_innodb VALUES (25);
+INSERT INTO myisam_innodb VALUES (26);
+COMMIT;
+BEGIN;
+INSERT INTO innodb_myisam VALUES (27);
+INSERT INTO innodb_myisam VALUES (28);
+COMMIT;
+BEGIN;
+INSERT INTO myisam_ndb VALUES (29);
+INSERT INTO myisam_ndb VALUES (30);
+COMMIT;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (31);
+INSERT INTO ndb_myisam VALUES (32);
+COMMIT;
+BEGIN;
+INSERT INTO ndb_innodb VALUES (33);
+INSERT INTO ndb_innodb VALUES (34);
+COMMIT;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (35);
+INSERT INTO innodb_ndb VALUES (36);
+COMMIT;
+---- ROLLBACK ----
+BEGIN;
+INSERT INTO innodb_myisam VALUES (39);
+INSERT INTO innodb_myisam VALUES (40);
+ROLLBACK;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (43);
+INSERT INTO ndb_myisam VALUES (44);
+ROLLBACK;
+BEGIN;
+INSERT INTO ndb_innodb VALUES (45);
+INSERT INTO ndb_innodb VALUES (46);
+ROLLBACK;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (47);
+INSERT INTO innodb_ndb VALUES (48);
+ROLLBACK;
+==== AUTOCOMMIT=1, single statements ====
+INSERT INTO myisam_innodb VALUES (49);
+INSERT INTO myisam_innodb VALUES (50);
+INSERT INTO innodb_myisam VALUES (51);
+INSERT INTO innodb_myisam VALUES (52);
+INSERT INTO myisam_ndb VALUES (53);
+INSERT INTO myisam_ndb VALUES (54);
+INSERT INTO ndb_myisam VALUES (55);
+INSERT INTO ndb_myisam VALUES (56);
+INSERT INTO ndb_innodb VALUES (57);
+INSERT INTO ndb_innodb VALUES (58);
+INSERT INTO innodb_ndb VALUES (59);
+INSERT INTO innodb_ndb VALUES (60);
+==== AUTOCOMMIT=0, single statements, myisam on master ====
+SET AUTOCOMMIT = 0;
+==== Show results ====
+SELECT * FROM myisam_innodb ORDER BY a;
+a
+1
+2
+25
+26
+49
+50
+SELECT * FROM innodb_myisam ORDER BY a;
+a
+3
+4
+27
+28
+51
+52
+SELECT * FROM myisam_ndb ORDER BY a;
+a
+5
+6
+29
+30
+53
+54
+SELECT * FROM ndb_myisam ORDER BY a;
+a
+7
+8
+31
+32
+55
+56
+SELECT * FROM innodb_ndb ORDER BY a;
+a
+11
+12
+35
+36
+59
+60
+SELECT * FROM ndb_innodb ORDER BY a;
+a
+9
+10
+33
+34
+57
+58
+Comparing tables master:test.myisam_innodb and slave:test.myisam_innodb
+Comparing tables master:test.innodb_myisam and slave:test.innodb_myisam
+Comparing tables master:test.myisam_ndb and slave:test.myisam_ndb
+Comparing tables master:test.ndb_myisam and slave:test.ndb_myisam
+Comparing tables master:test.innodb_ndb and slave:test.innodb_ndb
+Comparing tables master:test.ndb_innodb and slave:test.ndb_innodb
+==== Clean up ====
+drop table myisam_innodb, innodb_myisam;
+drop table myisam_ndb, ndb_myisam;
+drop table innodb_ndb, ndb_innodb;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
index f8eb5ebdd89..66eeaa6357c 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
@@ -26,11 +26,11 @@ stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-106 master-bin.000001
+107 master-bin.000001
CHANGE MASTER TO
master_port=<MASTER_PORT1>,
master_log_file = 'master-bin.000001',
-master_log_pos = 106 ;
+master_log_pos = 107 ;
start slave;
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
DELETE FROM t1 WHERE c3 = 1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
index 3ef5e2b7e53..b61f5550719 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
@@ -107,6 +107,8 @@ Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1) hex(c2) c3
1 1 row1
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
index d6c57aed41b..6c9e20fd56a 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
@@ -29,16 +29,16 @@ a b
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
-master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 392 Write_rows 1 451 table_id: #
-master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
-master-bin.000001 498 Query 1 563 COMMIT
-master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
-master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
+master-bin.000001 4 Format_desc 1 107 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 107 Query 1 224 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 224 Query 1 288 BEGIN
+master-bin.000001 288 Table_map 1 331 table_id: # (test.t1)
+master-bin.000001 331 Table_map 1 393 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 393 Write_rows 1 452 table_id: #
+master-bin.000001 452 Write_rows 1 499 table_id: # flags: STMT_END_F
+master-bin.000001 499 Query 1 564 COMMIT
+master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1
+master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
@@ -65,27 +65,27 @@ a b
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
-master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 392 Write_rows 1 451 table_id: #
-master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
-master-bin.000001 498 Query 1 563 COMMIT
-master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
-master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
-master-bin.000001 719 Query 1 836 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 836 Query 1 900 BEGIN
-master-bin.000001 900 Table_map 1 943 table_id: # (test.t1)
-master-bin.000001 943 Table_map 1 1005 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1005 Write_rows 1 1064 table_id: #
-master-bin.000001 1064 Write_rows 1 1111 table_id: # flags: STMT_END_F
-master-bin.000001 1111 Query 1 1176 COMMIT
-master-bin.000001 1176 Query 1 1240 BEGIN
-master-bin.000001 1240 Table_map 1 1283 table_id: # (test.t1)
-master-bin.000001 1283 Table_map 1 1345 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1345 Write_rows 1 1404 table_id: #
-master-bin.000001 1404 Delete_rows 1 1443 table_id: # flags: STMT_END_F
-master-bin.000001 1443 Query 1 1508 COMMIT
-master-bin.000001 1508 Query 1 1584 use `test`; DROP TABLE t1
+master-bin.000001 4 Format_desc 1 107 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 107 Query 1 224 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 224 Query 1 288 BEGIN
+master-bin.000001 288 Table_map 1 331 table_id: # (test.t1)
+master-bin.000001 331 Table_map 1 393 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 393 Write_rows 1 452 table_id: #
+master-bin.000001 452 Write_rows 1 499 table_id: # flags: STMT_END_F
+master-bin.000001 499 Query 1 564 COMMIT
+master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1
+master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1
+master-bin.000001 720 Query 1 837 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 837 Query 1 901 BEGIN
+master-bin.000001 901 Table_map 1 944 table_id: # (test.t1)
+master-bin.000001 944 Table_map 1 1006 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1006 Write_rows 1 1065 table_id: #
+master-bin.000001 1065 Write_rows 1 1112 table_id: # flags: STMT_END_F
+master-bin.000001 1112 Query 1 1177 COMMIT
+master-bin.000001 1177 Query 1 1241 BEGIN
+master-bin.000001 1241 Table_map 1 1284 table_id: # (test.t1)
+master-bin.000001 1284 Table_map 1 1346 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1346 Write_rows 1 1405 table_id: #
+master-bin.000001 1405 Delete_rows 1 1444 table_id: # flags: STMT_END_F
+master-bin.000001 1444 Query 1 1509 COMMIT
+master-bin.000001 1509 Query 1 1585 use `test`; DROP TABLE t1
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt
new file mode 100644
index 00000000000..b74354b22e1
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt
@@ -0,0 +1 @@
+--innodb --ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt
new file mode 100644
index 00000000000..bbb86b2991b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt
@@ -0,0 +1 @@
+--innodb --ndbcluster --replicate-ignore-table=mysql.ndb_apply_status
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
new file mode 100644
index 00000000000..a20e42f1b24
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
@@ -0,0 +1,373 @@
+# ==== Purpose ====
+#
+# Test replication of transactions on tables which have different
+# engines on master and slave. This tests all combinations of innodb,
+# myisam, and ndb.
+#
+# ==== Method ====
+#
+# Set up six tables, each being innodb, myisam, or innodb on master,
+# and another of innodb, myisam, or innodb on slave. For each table,
+# do the following:
+#
+# - committed and rollback'ed transactions, with autocommit on and
+# off
+# - non-transactions with autocommit on
+# - non-transactions with autocommit off, where the master table is
+# myisam.
+#
+# Note: we are running the slave with
+# --replicate-ignore-table=mysql.ndb_apply_status . See BUG#34557 for
+# explanation.
+#
+# ==== Related bugs ====
+#
+# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
+# BUG#29288: myisam transactions replicated to a transactional slave leaves slave unstable
+# BUG#34557: Row-based replication from ndb to non-ndb gives error on slave
+# BUG#34600: Rolled-back punch transactions not replicated correctly
+#
+# ==== Todo ====
+#
+# We should eventually try transactions touching two tables which are
+# of different engines on the same server (so that we try, e.g. punch
+# transactions; cf BUG#34600). However, that will make the test much
+# bigger (9 master-slave engine combinations [myisam->myisam,
+# myisam->ndb, etc]. To try all combinations of one or more such
+# tables means 2^9-1=511 transactions. We need to multiplied by 5
+# since we want to test committed/rollback'ed transactions
+# with/without AUTOCOMMIT, as well as non-transactions with
+# autocommit). We'd have to write a script to produce the test case.
+
+
+--echo ==== Initialization ====
+
+--source include/have_ndb.inc
+--source include/have_innodb.inc
+--source include/ndb_master-slave.inc
+
+--echo ---- setup master ----
+
+CREATE TABLE myisam_innodb (a INT) ENGINE=MYISAM;
+CREATE TABLE innodb_myisam (a INT) ENGINE=INNODB;
+CREATE TABLE myisam_ndb (a INT) ENGINE=MYISAM;
+CREATE TABLE ndb_myisam (a INT) ENGINE=NDB;
+CREATE TABLE innodb_ndb (a INT) ENGINE=INNODB;
+CREATE TABLE ndb_innodb (a INT) ENGINE=NDB;
+
+SHOW CREATE TABLE myisam_innodb;
+SHOW CREATE TABLE innodb_myisam;
+SHOW CREATE TABLE myisam_ndb;
+SHOW CREATE TABLE ndb_myisam;
+SHOW CREATE TABLE innodb_ndb;
+SHOW CREATE TABLE ndb_innodb;
+
+--echo ---- setup slave with different engines ----
+
+sync_slave_with_master;
+
+DROP TABLE myisam_innodb, innodb_myisam;
+DROP TABLE myisam_ndb, ndb_myisam;
+DROP TABLE innodb_ndb, ndb_innodb;
+
+CREATE TABLE myisam_innodb (a INT) ENGINE=INNODB;
+CREATE TABLE innodb_myisam (a INT) ENGINE=MYISAM;
+CREATE TABLE myisam_ndb (a INT) ENGINE=NDB;
+CREATE TABLE ndb_myisam (a INT) ENGINE=MYISAM;
+CREATE TABLE innodb_ndb (a INT) ENGINE=NDB;
+CREATE TABLE ndb_innodb (a INT) ENGINE=INNODB;
+
+SHOW CREATE TABLE myisam_innodb;
+SHOW CREATE TABLE innodb_myisam;
+SHOW CREATE TABLE myisam_ndb;
+SHOW CREATE TABLE ndb_myisam;
+SHOW CREATE TABLE innodb_ndb;
+SHOW CREATE TABLE ndb_innodb;
+
+connection master;
+
+
+--echo ==== AUTOCOMMIT=0, transactions ====
+
+--echo ---- COMMIT ----
+
+SET AUTOCOMMIT = 0;
+
+BEGIN;
+INSERT INTO myisam_innodb VALUES (1);
+INSERT INTO myisam_innodb VALUES (2);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_myisam VALUES (3);
+INSERT INTO innodb_myisam VALUES (4);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO myisam_ndb VALUES (5);
+INSERT INTO myisam_ndb VALUES (6);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (7);
+INSERT INTO ndb_myisam VALUES (8);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO ndb_innodb VALUES (9);
+INSERT INTO ndb_innodb VALUES (10);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (11);
+INSERT INTO innodb_ndb VALUES (12);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+--echo ---- ROLLBACK ----
+
+# This test does not work in ROW mode after the changes introduced in
+# BUG#40116. After WL#2687 is pushed, Tests should be added again.
+--disable_parsing
+BEGIN;
+INSERT INTO myisam_innodb VALUES (13);
+INSERT INTO myisam_innodb VALUES (14);
+ROLLBACK;
+sync_slave_with_master;
+--enable_parsing
+connection master;
+BEGIN;
+INSERT INTO innodb_myisam VALUES (15);
+INSERT INTO innodb_myisam VALUES (16);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+# This test does not work in ROW mode after the changes introduced in
+# BUG#40116. After WL#2687 is pushed, these tests should be enabled
+# again.
+--disable_parsing
+BEGIN;
+INSERT INTO myisam_ndb VALUES (17);
+INSERT INTO myisam_ndb VALUES (18);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+--enable_parsing
+BEGIN;
+INSERT INTO ndb_myisam VALUES (19);
+INSERT INTO ndb_myisam VALUES (20);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO ndb_innodb VALUES (21);
+INSERT INTO ndb_innodb VALUES (22);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (23);
+INSERT INTO innodb_ndb VALUES (24);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+
+--echo ==== AUTOCOMMIT=1, transactions ====
+
+--echo ---- COMMIT ----
+
+SET AUTOCOMMIT = 1;
+
+BEGIN;
+INSERT INTO myisam_innodb VALUES (25);
+INSERT INTO myisam_innodb VALUES (26);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_myisam VALUES (27);
+INSERT INTO innodb_myisam VALUES (28);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO myisam_ndb VALUES (29);
+INSERT INTO myisam_ndb VALUES (30);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO ndb_myisam VALUES (31);
+INSERT INTO ndb_myisam VALUES (32);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO ndb_innodb VALUES (33);
+INSERT INTO ndb_innodb VALUES (34);
+COMMIT;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (35);
+INSERT INTO innodb_ndb VALUES (36);
+COMMIT;
+sync_slave_with_master;
+connection master;
+
+--echo ---- ROLLBACK ----
+
+# This test does not work in ROW mode after the changes introduced in
+# BUG#40116. After WL#2687 is pushed, these tests should be enabled
+# again.
+--disable_parsing
+BEGIN;
+INSERT INTO myisam_innodb VALUES (37);
+INSERT INTO myisam_innodb VALUES (38);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+--enable_parsing
+BEGIN;
+INSERT INTO innodb_myisam VALUES (39);
+INSERT INTO innodb_myisam VALUES (40);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+# This test does not work in ROW mode after the changes introduced in
+# BUG#40116. After WL#2687 is pushed, these tests should be enabled
+# again.
+--disable_parsing
+BEGIN;
+INSERT INTO myisam_ndb VALUES (41);
+INSERT INTO myisam_ndb VALUES (42);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+--enable_parsing
+BEGIN;
+INSERT INTO ndb_myisam VALUES (43);
+INSERT INTO ndb_myisam VALUES (44);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+BEGIN;
+INSERT INTO ndb_innodb VALUES (45);
+INSERT INTO ndb_innodb VALUES (46);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+BEGIN;
+INSERT INTO innodb_ndb VALUES (47);
+INSERT INTO innodb_ndb VALUES (48);
+ROLLBACK;
+sync_slave_with_master;
+connection master;
+
+
+--echo ==== AUTOCOMMIT=1, single statements ====
+
+INSERT INTO myisam_innodb VALUES (49);
+INSERT INTO myisam_innodb VALUES (50);
+sync_slave_with_master;
+connection master;
+INSERT INTO innodb_myisam VALUES (51);
+INSERT INTO innodb_myisam VALUES (52);
+sync_slave_with_master;
+connection master;
+
+INSERT INTO myisam_ndb VALUES (53);
+INSERT INTO myisam_ndb VALUES (54);
+sync_slave_with_master;
+connection master;
+INSERT INTO ndb_myisam VALUES (55);
+INSERT INTO ndb_myisam VALUES (56);
+sync_slave_with_master;
+connection master;
+
+INSERT INTO ndb_innodb VALUES (57);
+INSERT INTO ndb_innodb VALUES (58);
+sync_slave_with_master;
+connection master;
+INSERT INTO innodb_ndb VALUES (59);
+INSERT INTO innodb_ndb VALUES (60);
+sync_slave_with_master;
+connection master;
+
+
+--echo ==== AUTOCOMMIT=0, single statements, myisam on master ====
+
+SET AUTOCOMMIT = 0;
+
+# These tests do not work in ROW mode after the changes introduced in
+# BUG#40116. After WL#2687 is pushed, these tests should be enabled
+# again.
+--disable_parsing
+# This tests BUG#29288.
+INSERT INTO myisam_innodb VALUES (61);
+INSERT INTO myisam_innodb VALUES (62);
+sync_slave_with_master;
+connection master;
+
+INSERT INTO myisam_ndb VALUES (63);
+INSERT INTO myisam_ndb VALUES (64);
+sync_slave_with_master;
+connection master;
+--enable_parsing
+
+
+--echo ==== Show results ====
+
+SELECT * FROM myisam_innodb ORDER BY a;
+SELECT * FROM innodb_myisam ORDER BY a;
+SELECT * FROM myisam_ndb ORDER BY a;
+SELECT * FROM ndb_myisam ORDER BY a;
+SELECT * FROM innodb_ndb ORDER BY a;
+SELECT * FROM ndb_innodb ORDER BY a;
+
+let $diff_table_1=master:test.myisam_innodb;
+let $diff_table_2=slave:test.myisam_innodb;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.innodb_myisam;
+let $diff_table_2=slave:test.innodb_myisam;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.myisam_ndb;
+let $diff_table_2=slave:test.myisam_ndb;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.ndb_myisam;
+let $diff_table_2=slave:test.ndb_myisam;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.innodb_ndb;
+let $diff_table_2=slave:test.innodb_ndb;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.ndb_innodb;
+let $diff_table_2=slave:test.ndb_innodb;
+source include/diff_tables.inc;
+
+
+--echo ==== Clean up ====
+
+drop table myisam_innodb, innodb_myisam;
+drop table myisam_ndb, ndb_myisam;
+drop table innodb_ndb, ndb_innodb;
+sync_slave_with_master;
diff --git a/mysql-test/suite/sys_vars/r/auto_commit_basic.result b/mysql-test/suite/sys_vars/r/auto_commit_basic.result
index c3643aaa1db..96cfd3e7ee6 100644
--- a/mysql-test/suite/sys_vars/r/auto_commit_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_commit_basic.result
@@ -54,19 +54,19 @@ ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with
SELECT @@global.autocommit;
ERROR HY000: Variable 'autocommit' is a SESSION variable
'#----------------------FN_DYNVARS_003_06------------------------#'
-SELECT @@session.autocommit = VARIABLE_VALUE
+SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
-@@session.autocommit = VARIABLE_VALUE
-0
+IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
+1
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#----------------------FN_DYNVARS_003_07------------------------#'
SET @@autocommit = 1;
-SELECT @@autocommit = VARIABLE_VALUE
+SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='autocommit';
-@@autocommit = VARIABLE_VALUE
-0
+IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
+1
'#---------------------FN_DYNVARS_003_08-------------------------#'
SET @@autocommit = OFF;
SELECT @@autocommit;
diff --git a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
index b9cf9b5ee80..26e33a384b9 100644
--- a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
@@ -53,11 +53,11 @@ ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should
SELECT @@session.automatic_sp_privileges;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable
'#----------------------FN_DYNVARS_004_06------------------------#'
-SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE
+SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
-@@global.automatic_sp_privileges = VARIABLE_VALUE
-0
+IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
+1
'Bug# 34839: Values in variable and information_schema donot match'
'#---------------------FN_DYNVARS_004_07----------------------#'
SET @@global.automatic_sp_privileges = OFF;
diff --git a/mysql-test/suite/sys_vars/r/big_tables_basic.result b/mysql-test/suite/sys_vars/r/big_tables_basic.result
index 937576a76d3..e88caae47cf 100644
--- a/mysql-test/suite/sys_vars/r/big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/big_tables_basic.result
@@ -49,11 +49,11 @@ ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with
SELECT @@global.big_tables;
ERROR HY000: Variable 'big_tables' is a SESSION variable
'#----------------------FN_DYNVARS_005_05------------------------#'
-SELECT @@big_tables = VARIABLE_VALUE
+SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
-@@big_tables = VARIABLE_VALUE
-0
+IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
+1
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#---------------------FN_DYNVARS_005_06----------------------#'
SET @@big_tables = OFF;
diff --git a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
index 7073066c2f1..93e3cd56c77 100644
--- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
@@ -103,10 +103,10 @@ SELECT @@session.engine_condition_pushdown AS res_is_1;
res_is_1
1
'#----------------------FN_DYNVARS_028_06------------------------#'
-SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE
+SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='engine_condition_pushdown';
-@@global.engine_condition_pushdown = VARIABLE_VALUE
+IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
@@ -117,11 +117,11 @@ WHERE VARIABLE_NAME='engine_condition_pushdown';
VARIABLE_VALUE
OFF
'#----------------------FN_DYNVARS_028_07------------------------#'
-SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE
+SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='engine_condition_pushdown';
-@@session.engine_condition_pushdown = VARIABLE_VALUE
-0
+IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
1
diff --git a/mysql-test/suite/sys_vars/r/flush_basic.result b/mysql-test/suite/sys_vars/r/flush_basic.result
index 259f8f929a1..e0584d46351 100644
--- a/mysql-test/suite/sys_vars/r/flush_basic.result
+++ b/mysql-test/suite/sys_vars/r/flush_basic.result
@@ -63,11 +63,11 @@ ERROR HY000: Variable 'flush' is a GLOBAL variable and should be set with SET GL
SELECT @@session.flush;
ERROR HY000: Variable 'flush' is a GLOBAL variable
'#----------------------FN_DYNVARS_030_06------------------------#'
-SELECT @@global.flush = VARIABLE_VALUE
+SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='flush';
-@@global.flush = VARIABLE_VALUE
-0
+IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
+1
'#---------------------FN_DYNVARS_030_07----------------------#'
SET @@global.flush = TRUE;
SELECT @@global.flush;
diff --git a/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
index e09e680fe99..8540467b9b2 100644
--- a/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
@@ -65,10 +65,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_032_07------------------------#'
-SELECT @@session.foreign_key_checks = VARIABLE_VALUE
+SELECT IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='foreign_key_checks';
-@@session.foreign_key_checks = VARIABLE_VALUE
+IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
diff --git a/mysql-test/suite/sys_vars/r/general_log_basic.result b/mysql-test/suite/sys_vars/r/general_log_basic.result
index 18a5fde45c0..df6ec9fb384 100644
--- a/mysql-test/suite/sys_vars/r/general_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/general_log_basic.result
@@ -47,10 +47,10 @@ ERROR HY000: Variable 'general_log' is a GLOBAL variable and should be set with
SELECT @@session.general_log;
ERROR HY000: Variable 'general_log' is a GLOBAL variable
'#----------------------FN_DYNVARS_004_05------------------------#'
-SELECT @@global.general_log = VARIABLE_VALUE
+SELECT IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log';
-@@global.general_log = VARIABLE_VALUE
+IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_004_06----------------------#'
SET @@global.general_log = 0;
diff --git a/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result
index ac4bed60eb5..bb3cbac1863 100644
--- a/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_checksums_basic.result
@@ -12,11 +12,11 @@ COUNT(@@GLOBAL.innodb_checksums)
1
1 Expected
'#---------------------BS_STVARS_023_03----------------------#'
-SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_checksums';
-@@GLOBAL.innodb_checksums = VARIABLE_VALUE
-0
+IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
+1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_checksums);
COUNT(@@GLOBAL.innodb_checksums)
diff --git a/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
index 6062399e8b8..4a5baf0aeda 100644
--- a/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
@@ -12,11 +12,11 @@ COUNT(@@GLOBAL.innodb_doublewrite)
1
1 Expected
'#---------------------BS_STVARS_026_03----------------------#'
-SELECT @@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_doublewrite';
-@@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
-0
+IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
+1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_doublewrite);
COUNT(@@GLOBAL.innodb_doublewrite)
diff --git a/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result b/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result
index a5967d28913..c2229d54d02 100644
--- a/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_locks_unsafe_for_binlog_basic.result
@@ -12,10 +12,10 @@ COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog)
1
1 Expected
'#---------------------BS_STVARS_031_03----------------------#'
-SELECT @@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
-@@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog);
diff --git a/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result
index 6887166fae6..0b7c71ce488 100644
--- a/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_rollback_on_timeout_basic.result
@@ -12,10 +12,10 @@ COUNT(@@GLOBAL.innodb_rollback_on_timeout)
1
1 Expected
'#---------------------BS_STVARS_039_03----------------------#'
-SELECT @@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
-@@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout);
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
index dcd6f498d56..96a48d7789f 100644
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
@@ -105,10 +105,10 @@ SELECT @@session.innodb_support_xa AS res_is_1;
res_is_1
1
'#----------------------FN_DYNVARS_046_06------------------------#'
-SELECT @@global.innodb_support_xa =
+SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_support_xa';
-@@global.innodb_support_xa =
+IF(@@global.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE
1
SELECT @@global.innodb_support_xa;
@@ -119,12 +119,12 @@ WHERE VARIABLE_NAME='innodb_support_xa';
VARIABLE_VALUE
OFF
'#----------------------FN_DYNVARS_046_07------------------------#'
-SELECT @@session.innodb_support_xa =
+SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_support_xa';
-@@session.innodb_support_xa =
+IF(@@session.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE
-0
+1
SELECT @@session.innodb_support_xa;
@@session.innodb_support_xa
1
diff --git a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
index 14aa995273b..f2424a3ea27 100644
--- a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
@@ -99,10 +99,10 @@ SELECT @@session.innodb_table_locks AS res_is_1;
res_is_1
1
'#----------------------FN_DYNVARS_046_06------------------------#'
-SELECT @@global.innodb_table_locks =
+SELECT IF(@@global.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_table_locks';
-@@global.innodb_table_locks =
+IF(@@global.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE
1
SELECT @@global.innodb_table_locks;
@@ -113,12 +113,12 @@ WHERE VARIABLE_NAME='innodb_table_locks';
VARIABLE_VALUE
OFF
'#----------------------FN_DYNVARS_046_07------------------------#'
-SELECT @@session.innodb_table_locks =
+SELECT IF(@@session.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_table_locks';
-@@session.innodb_table_locks =
+IF(@@session.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE
-0
+1
SELECT @@session.innodb_table_locks;
@@session.innodb_table_locks
1
diff --git a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
index f782ee3b078..696ac5cc279 100644
--- a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
@@ -120,16 +120,16 @@ SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
'#------------------FN_DYNVARS_054_06-----------------------#'
-SELECT @@global.keep_files_on_create = VARIABLE_VALUE
+SELECT IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='keep_files_on_create';
-@@global.keep_files_on_create = VARIABLE_VALUE
+IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_054_07-----------------------#'
-SELECT @@session.keep_files_on_create = VARIABLE_VALUE
+SELECT IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='keep_files_on_create';
-@@session.keep_files_on_create = VARIABLE_VALUE
+IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@keep_files_on_create = OFF;
diff --git a/mysql-test/suite/sys_vars/r/local_infile_basic.result b/mysql-test/suite/sys_vars/r/local_infile_basic.result
index 5f4c215719a..7afb367fde9 100644
--- a/mysql-test/suite/sys_vars/r/local_infile_basic.result
+++ b/mysql-test/suite/sys_vars/r/local_infile_basic.result
@@ -53,11 +53,11 @@ ERROR HY000: Variable 'local_infile' is a GLOBAL variable and should be set with
SELECT @@session.local_infile = 1;
ERROR HY000: Variable 'local_infile' is a GLOBAL variable
'#----------------------FN_DYNVARS_018_06------------------------#'
-SELECT @@global.local_infile = VARIABLE_VALUE
+SELECT IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='local_infile';
-@@global.local_infile = VARIABLE_VALUE
-0
+IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE
+1
'#---------------------FN_DYNVARS_018_07----------------------#'
SET @@global.local_infile = OFF;
SELECT @@global.local_infile;
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
index 40dc0e217c4..72daac1edc1 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
@@ -69,12 +69,12 @@ ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the valu
SET @@global.log_bin_trust_function_creators = test;
ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'test'
'#------------------FN_DYNVARS_063_06-----------------------#'
-SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE
+SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
-@@global.log_bin_trust_function_creators = VARIABLE_VALUE
+IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
1
-SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE
+SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
index b19b11a4209..7c69655f109 100644
--- a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
@@ -102,3 +102,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SET @@SESSION log_queries_not_using_indexes= TRUE;
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 'log_queries_not_using_indexes= TRUE' at line 1
SET @@global.log_queries_not_using_indexes= @start_value;
+SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
+IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
+1
diff --git a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
index 87b30814837..d41e4cfc56f 100644
--- a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
@@ -118,16 +118,16 @@ ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '65550
SET @@session.low_priority_updates = test;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'test'
'#------------------FN_DYNVARS_069_06-----------------------#'
-SELECT @@global.low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='low_priority_updates';
-@@global.low_priority_updates = VARIABLE_VALUE
+IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_069_07-----------------------#'
-SELECT @@session.low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='low_priority_updates';
-@@session.low_priority_updates = VARIABLE_VALUE
+IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_069_08----------------------#'
SET @@low_priority_updates = FALSE;
diff --git a/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result b/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result
index c0f92acb983..4b0e4afa38e 100644
--- a/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_use_mmap_basic.result
@@ -11,10 +11,10 @@ COUNT(@@GLOBAL.myisam_use_mmap)
1
1 Expected
'#---------------------BS_STVARS_042_03----------------------#'
-SELECT @@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_use_mmap';
-@@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.myisam_use_mmap);
diff --git a/mysql-test/suite/sys_vars/r/new_basic.result b/mysql-test/suite/sys_vars/r/new_basic.result
index b36e540ddd9..5854649e6b1 100644
--- a/mysql-test/suite/sys_vars/r/new_basic.result
+++ b/mysql-test/suite/sys_vars/r/new_basic.result
@@ -117,16 +117,16 @@ ERROR 42000: Variable 'new' can't be set to the value of '65550'
SET @@session.new = test;
ERROR 42000: Variable 'new' can't be set to the value of 'test'
'#------------------FN_DYNVARS_113_06-----------------------#'
-SELECT @@global.new = VARIABLE_VALUE
+SELECT IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='new';
-@@global.new = VARIABLE_VALUE
+IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_113_07-----------------------#'
-SELECT @@session.new = VARIABLE_VALUE
+SELECT IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='new';
-@@session.new = VARIABLE_VALUE
+IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_113_08----------------------#'
SET @@new = OFF;
diff --git a/mysql-test/suite/sys_vars/r/old_passwords_basic.result b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
index ecf23ab302b..f8600167801 100644
--- a/mysql-test/suite/sys_vars/r/old_passwords_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
@@ -113,16 +113,16 @@ ERROR 42000: Variable 'old_passwords' can't be set to the value of '65550'
SET @@session.old_passwords = test;
ERROR 42000: Variable 'old_passwords' can't be set to the value of 'test'
'#------------------FN_DYNVARS_114_06-----------------------#'
-SELECT @@global.old_passwords = VARIABLE_VALUE
+SELECT IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='old_passwords';
-@@global.old_passwords = VARIABLE_VALUE
+IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_114_07-----------------------#'
-SELECT @@session.old_passwords = VARIABLE_VALUE
+SELECT IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='old_passwords';
-@@session.old_passwords = VARIABLE_VALUE
+IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_114_08----------------------#'
SET @@old_passwords = OFF;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
index bff07741656..bfbebab7ed1 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
@@ -103,10 +103,10 @@ SELECT @@session.query_cache_wlock_invalidate AS res_is_1;
res_is_1
1
'#----------------------FN_DYNVARS_135_06------------------------#'
-SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE
+SELECT IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
-@@global.query_cache_wlock_invalidate = VARIABLE_VALUE
+IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@global.query_cache_wlock_invalidate;
@@global.query_cache_wlock_invalidate
@@ -117,11 +117,11 @@ WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
VARIABLE_VALUE
OFF
'#----------------------FN_DYNVARS_135_07------------------------#'
-SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE
+SELECT IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
-@@session.query_cache_wlock_invalidate = VARIABLE_VALUE
-0
+IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@session.query_cache_wlock_invalidate;
@@session.query_cache_wlock_invalidate
1
diff --git a/mysql-test/suite/sys_vars/r/read_only_basic.result b/mysql-test/suite/sys_vars/r/read_only_basic.result
index ac153fa337c..4ea316a41f1 100644
--- a/mysql-test/suite/sys_vars/r/read_only_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_only_basic.result
@@ -82,15 +82,15 @@ SELECT @@read_only;
@@read_only
0
'#----------------------FN_DYNVARS_139_06------------------------#'
-SELECT @@global.read_only = VARIABLE_VALUE
+SELECT IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='read_only';
-@@global.read_only = VARIABLE_VALUE
+IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE
1
-SELECT @@read_only = VARIABLE_VALUE
+SELECT IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='read_only';
-@@read_only = VARIABLE_VALUE
+IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_139_07----------------------#'
SET @@global.read_only = 1;
diff --git a/mysql-test/suite/sys_vars/r/read_only_func.result b/mysql-test/suite/sys_vars/r/read_only_func.result
index 35b42d468d6..7e98b7adc50 100644
--- a/mysql-test/suite/sys_vars/r/read_only_func.result
+++ b/mysql-test/suite/sys_vars/r/read_only_func.result
@@ -20,7 +20,7 @@ id name
CREATE user sameea;
** Connecting connn using username 'sameea' **
SET Global read_ONLY=ON;
-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 TABLE t2
(
id INT NOT NULL auto_increment,
diff --git a/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
index 6f938c5265f..660550639cc 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_purge_basic.result
@@ -69,10 +69,10 @@ ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set w
SELECT @@session.relay_log_purge;
ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable
'#----------------------FN_DYNVARS_141_06------------------------#'
-SELECT @@global.relay_log_purge = VARIABLE_VALUE
+SELECT IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='relay_log_purge';
-@@global.relay_log_purge = VARIABLE_VALUE
+IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_141_07----------------------#'
SET @@global.relay_log_purge = 1;
diff --git a/mysql-test/suite/sys_vars/r/secure_auth_basic.result b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
index b8a903ba420..9f12a1760a4 100644
--- a/mysql-test/suite/sys_vars/r/secure_auth_basic.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_basic.result
@@ -68,11 +68,11 @@ WHERE VARIABLE_NAME='secure_auth';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_143_07------------------------#'
-SELECT @@global.secure_auth = VARIABLE_VALUE
+SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='secure_auth';
-@@global.secure_auth = VARIABLE_VALUE
-0
+IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@global.secure_auth;
@@global.secure_auth
1
diff --git a/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
index 186cfbc8f0f..36f0978d3af 100644
--- a/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
@@ -8,5 +8,8 @@ ERROR HY000: Unknown system variable 'slave_allow_batching'
'#-------------------FN_DYNVARS_145_05----------------------------#'
'#----------------------FN_DYNVARS_145_06------------------------#'
'#----------------------FN_DYNVARS_145_07------------------------#'
+SELECT IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
+IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE
+1
'#---------------------FN_DYNVARS_145_08-------------------------#'
'#---------------------FN_DYNVARS_145_09----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result
index 3f2d9d2fb3f..039cce257e5 100644
--- a/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_basic.result
@@ -66,11 +66,11 @@ WHERE VARIABLE_NAME='slave_compressed_protocol';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_147_07------------------------#'
-SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE
+SELECT IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slave_compressed_protocol';
-@@global.slave_compressed_protocol = VARIABLE_VALUE
-0
+IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@global.slave_compressed_protocol;
@@global.slave_compressed_protocol
1
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
index 716309aeaff..aece80cdada 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_basic.result
@@ -47,10 +47,10 @@ ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable and should be set wi
SELECT @@session.slow_query_log;
ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable
'#----------------------FN_DYNVARS_004_05------------------------#'
-SELECT @@global.slow_query_log = VARIABLE_VALUE
+SELECT IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log';
-@@global.slow_query_log = VARIABLE_VALUE
+IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_004_06----------------------#'
SET @@global.slow_query_log = 0;
diff --git a/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
index b3a3eecd93a..0d8247ae1ef 100644
--- a/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
@@ -12,11 +12,11 @@ COUNT(@@SESSION.sql_auto_is_null)
1
1 Expected
'#---------------------BS_STVARS_044_03----------------------#'
-SELECT @@SESSION.sql_auto_is_null = VARIABLE_VALUE
+SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
-@@SESSION.sql_auto_is_null = VARIABLE_VALUE
-0
+IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
+1
1 Expected
SELECT COUNT(@@SESSION.sql_auto_is_null);
COUNT(@@SESSION.sql_auto_is_null)
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
index 1171382380d..cf071b5b417 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
@@ -66,10 +66,10 @@ WHERE VARIABLE_NAME='sql_big_selects';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_153_07------------------------#'
-SELECT @@session.sql_big_selects = VARIABLE_VALUE
+SELECT IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_selects';
-@@session.sql_big_selects = VARIABLE_VALUE
+IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
diff --git a/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
index bce14b2aba2..46e93f7ff23 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_big_tables';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_154_07------------------------#'
-SELECT @@session.sql_big_tables = VARIABLE_VALUE
+SELECT IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_tables';
-@@session.sql_big_tables = VARIABLE_VALUE
+IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_big_tables;
@@session.sql_big_tables
diff --git a/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
index d03b688dbe6..146872afc1d 100644
--- a/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
@@ -79,10 +79,10 @@ WHERE VARIABLE_NAME='sql_buffer_result';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_155_07------------------------#'
-SELECT @@session.sql_buffer_result = VARIABLE_VALUE
+SELECT IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_buffer_result';
-@@session.sql_buffer_result = VARIABLE_VALUE
+IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_buffer_result;
@@session.sql_buffer_result
diff --git a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
index 4e37c2079d6..751b801047c 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
@@ -69,10 +69,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_156_07------------------------#'
-SELECT @@session.sql_log_bin = VARIABLE_VALUE
+SELECT IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_bin';
-@@session.sql_log_bin = VARIABLE_VALUE
+IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_log_bin;
@@session.sql_log_bin
diff --git a/mysql-test/suite/sys_vars/r/sql_log_off_basic.result b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
index 03846cb6ce8..9f610991ce2 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_log_off';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_157_07------------------------#'
-SELECT @@session.sql_log_off = VARIABLE_VALUE
+SELECT IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_off';
-@@session.sql_log_off = VARIABLE_VALUE
+IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_log_off;
@@session.sql_log_off
diff --git a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
index 6a09e6720b3..7b834d70038 100644
--- a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
@@ -102,10 +102,10 @@ SELECT @@session.sql_low_priority_updates AS res_is_1;
res_is_1
1
'#----------------------FN_DYNVARS_159_06------------------------#'
-SELECT @@global.sql_low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='sql_low_priority_updates';
-@@global.sql_low_priority_updates = VARIABLE_VALUE
+IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@global.sql_low_priority_updates;
@@global.sql_low_priority_updates
@@ -116,11 +116,11 @@ WHERE VARIABLE_NAME='sql_low_priority_updates';
VARIABLE_VALUE
OFF
'#----------------------FN_DYNVARS_159_07------------------------#'
-SELECT @@session.sql_low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_low_priority_updates';
-@@session.sql_low_priority_updates = VARIABLE_VALUE
-0
+IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@session.sql_low_priority_updates;
@@session.sql_low_priority_updates
1
diff --git a/mysql-test/suite/sys_vars/r/sql_notes_basic.result b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
index 5dd792d8ede..d6ec1239f45 100644
--- a/mysql-test/suite/sys_vars/r/sql_notes_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
@@ -69,10 +69,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_161_07------------------------#'
-SELECT @@session.sql_notes = VARIABLE_VALUE
+SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_notes';
-@@session.sql_notes = VARIABLE_VALUE
+IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_notes;
@@session.sql_notes
diff --git a/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
index 2550f2d1057..ed9322618f0 100644
--- a/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_quote_show_create';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_162_07------------------------#'
-SELECT @@session.sql_quote_show_create = VARIABLE_VALUE
+SELECT IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_quote_show_create';
-@@session.sql_quote_show_create = VARIABLE_VALUE
+IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_quote_show_create;
@@session.sql_quote_show_create
diff --git a/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
index 539b38bb1fe..4daf78228f3 100644
--- a/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_safe_updates';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_163_07------------------------#'
-SELECT @@session.sql_safe_updates = VARIABLE_VALUE
+SELECT IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_safe_updates';
-@@session.sql_safe_updates = VARIABLE_VALUE
+IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_safe_updates;
@@session.sql_safe_updates
diff --git a/mysql-test/suite/sys_vars/r/sql_warnings_basic.result b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
index 46907c0ced8..cf39ef851d4 100644
--- a/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_warnings';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_166_07------------------------#'
-SELECT @@session.sql_warnings = VARIABLE_VALUE
+SELECT IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_warnings';
-@@session.sql_warnings = VARIABLE_VALUE
+IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_warnings;
@@session.sql_warnings
diff --git a/mysql-test/suite/sys_vars/r/sync_frm_basic.result b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
index 9792307d17f..aa5416749a3 100644
--- a/mysql-test/suite/sys_vars/r/sync_frm_basic.result
+++ b/mysql-test/suite/sys_vars/r/sync_frm_basic.result
@@ -69,10 +69,10 @@ ERROR HY000: Variable 'sync_frm' is a GLOBAL variable and should be set with SET
SELECT @@session.sync_frm;
ERROR HY000: Variable 'sync_frm' is a GLOBAL variable
'#----------------------FN_DYNVARS_169_06------------------------#'
-SELECT @@global.sync_frm = VARIABLE_VALUE
+SELECT IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='sync_frm';
-@@global.sync_frm = VARIABLE_VALUE
+IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_169_07----------------------#'
SET @@global.sync_frm = 1;
diff --git a/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result b/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result
index d8bd2cd975f..50a5285b0d7 100644
--- a/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result
+++ b/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result
@@ -67,11 +67,11 @@ WHERE VARIABLE_NAME='timed_mutexes';
count(VARIABLE_VALUE)
1
'#----------------------FN_DYNVARS_177_07------------------------#'
-SELECT @@global.timed_mutexes = VARIABLE_VALUE
+SELECT IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='timed_mutexes';
-@@global.timed_mutexes = VARIABLE_VALUE
-0
+IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
+1
SELECT @@global.timed_mutexes;
@@global.timed_mutexes
1
diff --git a/mysql-test/suite/sys_vars/r/unique_checks_basic.result b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
index cc22c1c7f98..50ca7317490 100644
--- a/mysql-test/suite/sys_vars/r/unique_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
@@ -58,10 +58,10 @@ ERROR 42000: Variable 'unique_checks' can't be set to the value of 'test'
SET @@session.unique_checks = 123456789031;
ERROR 42000: Variable 'unique_checks' can't be set to the value of '123456789031'
'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.unique_checks = VARIABLE_VALUE
+SELECT IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='unique_checks';
-@@session.unique_checks = VARIABLE_VALUE
+IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@unique_checks = 1;
diff --git a/mysql-test/suite/sys_vars/t/auto_commit_basic.test b/mysql-test/suite/sys_vars/t/auto_commit_basic.test
index 0ea070ded59..b899c273093 100644
--- a/mysql-test/suite/sys_vars/t/auto_commit_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_commit_basic.test
@@ -113,7 +113,7 @@ SELECT @@global.autocommit;
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.autocommit = VARIABLE_VALUE
+SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
--echo Bug # 34839: Values in variable and information_schema do not match for autocommit
@@ -124,7 +124,7 @@ WHERE VARIABLE_NAME='autocommit';
#########################################################################
SET @@autocommit = 1;
-SELECT @@autocommit = VARIABLE_VALUE
+SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='autocommit';
diff --git a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
index 74da0904454..005aec91acf 100644
--- a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
@@ -113,7 +113,7 @@ SELECT @@session.automatic_sp_privileges;
# Check if the value in GLOBAL Tables matches values in variable #
##############################################################################
-SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE
+SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
echo 'Bug# 34839: Values in variable and information_schema donot match';
diff --git a/mysql-test/suite/sys_vars/t/big_tables_basic.test b/mysql-test/suite/sys_vars/t/big_tables_basic.test
index 8665895bb19..67215f2625d 100644
--- a/mysql-test/suite/sys_vars/t/big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/big_tables_basic.test
@@ -107,7 +107,7 @@ SELECT @@global.big_tables;
# Check if the value in SESSION Tables matches values in variable #
##############################################################################
-SELECT @@big_tables = VARIABLE_VALUE
+SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
--echo Bug # 34839: Values in variable and information_schema do not match for autocommit
diff --git a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
index ee781159d6a..58ac196d1c2 100644
--- a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
@@ -160,7 +160,7 @@ SELECT @@session.engine_condition_pushdown AS res_is_1;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE
+SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='engine_condition_pushdown';
SELECT @@global.engine_condition_pushdown;
@@ -173,7 +173,7 @@ WHERE VARIABLE_NAME='engine_condition_pushdown';
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE
+SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='engine_condition_pushdown';
SELECT @@session.engine_condition_pushdown;
diff --git a/mysql-test/suite/sys_vars/t/flush_basic.test b/mysql-test/suite/sys_vars/t/flush_basic.test
index f5f6665562e..0b8fc0388ee 100644
--- a/mysql-test/suite/sys_vars/t/flush_basic.test
+++ b/mysql-test/suite/sys_vars/t/flush_basic.test
@@ -120,7 +120,7 @@ SELECT @@session.flush;
# Check if the value in GLOBAL Tables matches values in variable #
####################################################################
-SELECT @@global.flush = VARIABLE_VALUE
+SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='flush';
diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
index 54d94aca971..d7a01f2bf71 100644
--- a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
@@ -131,7 +131,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.foreign_key_checks = VARIABLE_VALUE
+SELECT IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='foreign_key_checks';
SELECT @@session.foreign_key_checks;
diff --git a/mysql-test/suite/sys_vars/t/general_log_basic.test b/mysql-test/suite/sys_vars/t/general_log_basic.test
index 82f3be45bc9..6a1d00f1b6f 100644
--- a/mysql-test/suite/sys_vars/t/general_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/general_log_basic.test
@@ -103,7 +103,7 @@ SELECT @@session.general_log;
# Check if the value in GLOBAL Tables matches values in variable #
##############################################################################
-SELECT @@global.general_log = VARIABLE_VALUE
+SELECT IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log';
diff --git a/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
index 89daad9ce0a..c4c39d7d380 100644
--- a/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_checksums);
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_checksums';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
index 4a0460bb4bc..72dd22cbeb8 100644
--- a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_doublewrite);
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_doublewrite';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
index 63835113770..08792d299a1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog);
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
index c33e0fa1b75..81025bb9d73 100644
--- a/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout);
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
index 6da3e68ebdf..840fd240bde 100644
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
@@ -169,7 +169,7 @@ SELECT @@session.innodb_support_xa AS res_is_1;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.innodb_support_xa =
+SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_support_xa';
SELECT @@global.innodb_support_xa;
@@ -182,7 +182,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.innodb_support_xa =
+SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_support_xa';
SELECT @@session.innodb_support_xa;
diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
index 35961c43a7f..f7d06d18ada 100644
--- a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
@@ -167,7 +167,7 @@ SELECT @@session.innodb_table_locks AS res_is_1;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.innodb_table_locks =
+SELECT IF(@@global.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_table_locks';
SELECT @@global.innodb_table_locks;
@@ -179,7 +179,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.innodb_table_locks =
+SELECT IF(@@session.innodb_table_locks, "ON", "OFF") =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_table_locks';
SELECT @@session.innodb_table_locks;
diff --git a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
index a855f56c863..bc6ac8687f7 100644
--- a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
@@ -156,7 +156,7 @@ SELECT @@session.keep_files_on_create;
####################################################################
-SELECT @@global.keep_files_on_create = VARIABLE_VALUE
+SELECT IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='keep_files_on_create';
@@ -165,7 +165,7 @@ WHERE VARIABLE_NAME='keep_files_on_create';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.keep_files_on_create = VARIABLE_VALUE
+SELECT IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='keep_files_on_create';
diff --git a/mysql-test/suite/sys_vars/t/local_infile_basic.test b/mysql-test/suite/sys_vars/t/local_infile_basic.test
index 63f6b0fdb91..731eac42541 100644
--- a/mysql-test/suite/sys_vars/t/local_infile_basic.test
+++ b/mysql-test/suite/sys_vars/t/local_infile_basic.test
@@ -112,7 +112,7 @@ SELECT @@session.local_infile = 1;
# Check if the value in GLOBAL Tables matches values in variable #
####################################################################
-SELECT @@global.local_infile = VARIABLE_VALUE
+SELECT IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='local_infile';
diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
index 3b8b43e1354..e7bdb433971 100644
--- a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
@@ -122,12 +122,12 @@ SET @@global.log_bin_trust_function_creators = test;
###############################################################################
-SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE
+SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE
+SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
diff --git a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
index f1152c07176..f7e6e8df640 100644
--- a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
@@ -129,4 +129,5 @@ SET @@SESSION log_queries_not_using_indexes= TRUE;
SET @@global.log_queries_not_using_indexes= @start_value;
+SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
diff --git a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
index 0ce4ee8f921..762fa726f1f 100644
--- a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
@@ -156,7 +156,7 @@ SET @@session.low_priority_updates = test;
####################################################################
-SELECT @@global.low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='low_priority_updates';
@@ -165,7 +165,7 @@ WHERE VARIABLE_NAME='low_priority_updates';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='low_priority_updates';
diff --git a/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test b/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test
index d2cc39cfea7..dd1f8dbeee7 100644
--- a/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_use_mmap_basic.test
@@ -54,7 +54,7 @@ SELECT COUNT(@@GLOBAL.myisam_use_mmap);
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_use_mmap';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/new_basic.test b/mysql-test/suite/sys_vars/t/new_basic.test
index b1d12c9a4de..cf0ba08dfdb 100644
--- a/mysql-test/suite/sys_vars/t/new_basic.test
+++ b/mysql-test/suite/sys_vars/t/new_basic.test
@@ -154,7 +154,7 @@ SET @@session.new = test;
####################################################################
-SELECT @@global.new = VARIABLE_VALUE
+SELECT IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='new';
@@ -163,7 +163,7 @@ WHERE VARIABLE_NAME='new';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.new = VARIABLE_VALUE
+SELECT IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='new';
diff --git a/mysql-test/suite/sys_vars/t/old_passwords_basic.test b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
index b78ac9ca9b8..34a9394a1e7 100644
--- a/mysql-test/suite/sys_vars/t/old_passwords_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
@@ -154,7 +154,7 @@ SET @@session.old_passwords = test;
####################################################################
-SELECT @@global.old_passwords = VARIABLE_VALUE
+SELECT IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='old_passwords';
@@ -163,7 +163,7 @@ WHERE VARIABLE_NAME='old_passwords';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.old_passwords = VARIABLE_VALUE
+SELECT IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='old_passwords';
diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
index f253c1b4f43..5acb36961af 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
@@ -165,7 +165,7 @@ SELECT @@session.query_cache_wlock_invalidate AS res_is_1;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE
+SELECT IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
SELECT @@global.query_cache_wlock_invalidate;
@@ -178,7 +178,7 @@ WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE
+SELECT IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
SELECT @@session.query_cache_wlock_invalidate;
diff --git a/mysql-test/suite/sys_vars/t/read_only_basic.test b/mysql-test/suite/sys_vars/t/read_only_basic.test
index 917842256b1..9d8078b8c68 100644
--- a/mysql-test/suite/sys_vars/t/read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_only_basic.test
@@ -121,11 +121,11 @@ SELECT @@read_only;
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
-SELECT @@global.read_only = VARIABLE_VALUE
+SELECT IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='read_only';
-SELECT @@read_only = VARIABLE_VALUE
+SELECT IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='read_only';
diff --git a/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
index 7e4d6a51440..081b79ebb73 100644
--- a/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
+++ b/mysql-test/suite/sys_vars/t/relay_log_purge_basic.test
@@ -123,7 +123,7 @@ SELECT @@session.relay_log_purge;
# Check if the value in GLOBAL Tables matches values in variable #
#####################################################################
-SELECT @@global.relay_log_purge = VARIABLE_VALUE
+SELECT IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='relay_log_purge';
diff --git a/mysql-test/suite/sys_vars/t/secure_auth_basic.test b/mysql-test/suite/sys_vars/t/secure_auth_basic.test
index b52f219097b..4e4566ce1ff 100644
--- a/mysql-test/suite/sys_vars/t/secure_auth_basic.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_basic.test
@@ -130,7 +130,7 @@ WHERE VARIABLE_NAME='secure_auth';
# Check if the value in GLOBAL Table matches value in variable #
########################################################################
-SELECT @@global.secure_auth = VARIABLE_VALUE
+SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='secure_auth';
SELECT @@global.secure_auth;
diff --git a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
index cf31917933a..020fd9c84c2 100644
--- a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
@@ -130,7 +130,7 @@ SET @global_start_value = @@global.slave_allow_batching;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-#SELECT @@global.slave_allow_batching = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
+#SELECT IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
#SELECT @@global.slave_allow_batching;
#SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
#--echo 'Bug: value in information schema does not match'
diff --git a/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test b/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test
index 29a3227a8f5..25ac8f35c5d 100644
--- a/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_compressed_protocol_basic.test
@@ -127,7 +127,7 @@ WHERE VARIABLE_NAME='slave_compressed_protocol';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE
+SELECT IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slave_compressed_protocol';
SELECT @@global.slave_compressed_protocol;
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
index 3a1b2fbd9e7..fef37b5ff4a 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_basic.test
@@ -104,7 +104,7 @@ SELECT @@session.slow_query_log;
# Check if the value in GLOBAL Tables matches values in variable #
##############################################################################
-SELECT @@global.slow_query_log = VARIABLE_VALUE
+SELECT IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slow_query_log';
diff --git a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
index a843b88bf85..da01a3b4459 100644
--- a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
@@ -55,7 +55,7 @@ SELECT COUNT(@@SESSION.sql_auto_is_null);
# Check if the value in SESSION Table matches value in variable #
#################################################################
-SELECT @@SESSION.sql_auto_is_null = VARIABLE_VALUE
+SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
--echo 1 Expected
diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
index dd83a19230a..dd9b585cc84 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
@@ -132,7 +132,7 @@ WHERE VARIABLE_NAME='sql_big_selects';
# Check if the value in GLOBAL Table matches value in variable #
########################################################################
-SELECT @@session.sql_big_selects = VARIABLE_VALUE
+SELECT IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_selects';
SELECT @@session.sql_big_selects;
diff --git a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
index 4e3dbdc9504..64ce47b044b 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_big_tables';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_big_tables = VARIABLE_VALUE
+SELECT IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_tables';
SELECT @@session.sql_big_tables;
diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
index f5a5e323fc4..04e65239ccb 100644
--- a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
@@ -144,7 +144,7 @@ WHERE VARIABLE_NAME='sql_buffer_result';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_buffer_result = VARIABLE_VALUE
+SELECT IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_buffer_result';
SELECT @@session.sql_buffer_result;
diff --git a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
index 0f6d9e1e126..9ac0474f982 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
@@ -134,7 +134,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_log_bin = VARIABLE_VALUE
+SELECT IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_bin';
SELECT @@session.sql_log_bin;
diff --git a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
index bcf9e87c1dd..a208d30a39b 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_log_off';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_log_off = VARIABLE_VALUE
+SELECT IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_off';
SELECT @@session.sql_log_off;
diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
index 499723b636d..8d75349b851 100644
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
@@ -166,7 +166,7 @@ SELECT @@session.sql_low_priority_updates AS res_is_1;
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.sql_low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='sql_low_priority_updates';
SELECT @@global.sql_low_priority_updates;
@@ -179,7 +179,7 @@ WHERE VARIABLE_NAME='sql_low_priority_updates';
# Check if the value in SESSION Table matches value in variable #
#########################################################################
-SELECT @@session.sql_low_priority_updates = VARIABLE_VALUE
+SELECT IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_low_priority_updates';
SELECT @@session.sql_low_priority_updates;
diff --git a/mysql-test/suite/sys_vars/t/sql_notes_basic.test b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
index 984dca34e46..461e5d35e4f 100644
--- a/mysql-test/suite/sys_vars/t/sql_notes_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
@@ -135,7 +135,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARI
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_notes = VARIABLE_VALUE
+SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_notes';
SELECT @@session.sql_notes;
diff --git a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
index 1919b3ee642..5e0edef55e5 100644
--- a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
@@ -136,7 +136,7 @@ WHERE VARIABLE_NAME='sql_quote_show_create';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_quote_show_create = VARIABLE_VALUE
+SELECT IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_quote_show_create';
SELECT @@session.sql_quote_show_create;
diff --git a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
index 489b42949a0..4f2c57bdb81 100644
--- a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_safe_updates';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_safe_updates = VARIABLE_VALUE
+SELECT IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_safe_updates';
SELECT @@session.sql_safe_updates;
diff --git a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
index f740403ceda..99a9ad8dda2 100644
--- a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
@@ -140,7 +140,7 @@ WHERE VARIABLE_NAME='sql_warnings';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@session.sql_warnings = VARIABLE_VALUE
+SELECT IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_warnings';
SELECT @@session.sql_warnings;
diff --git a/mysql-test/suite/sys_vars/t/sync_frm_basic.test b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
index 6c00182a805..33e6202167f 100644
--- a/mysql-test/suite/sys_vars/t/sync_frm_basic.test
+++ b/mysql-test/suite/sys_vars/t/sync_frm_basic.test
@@ -121,7 +121,7 @@ SELECT @@session.sync_frm;
# Check if the value in GLOBAL Tables matches values in variable #
####################################################################
-SELECT @@global.sync_frm = VARIABLE_VALUE
+SELECT IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='sync_frm';
diff --git a/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test b/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test
index b0eb41afb49..9422ecdabf9 100644
--- a/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test
+++ b/mysql-test/suite/sys_vars/t/timed_mutexes_basic.test
@@ -128,7 +128,7 @@ WHERE VARIABLE_NAME='timed_mutexes';
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.timed_mutexes = VARIABLE_VALUE
+SELECT IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='timed_mutexes';
SELECT @@global.timed_mutexes;
diff --git a/mysql-test/suite/sys_vars/t/unique_checks_basic.test b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
index 55308adcc82..364dfc07cd1 100644
--- a/mysql-test/suite/sys_vars/t/unique_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
@@ -121,7 +121,7 @@ SET @@session.unique_checks = 123456789031;
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.unique_checks = VARIABLE_VALUE
+SELECT IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='unique_checks';
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 5534aa0a234..bf599818ad6 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1062,3 +1062,18 @@ ALTER TABLE t1 CHANGE COLUMN f1 f1_no_real_change TIMESTAMP NULL DEFAULT NULL;
DROP TABLE t1;
--echo End of 5.1 tests
+
+#
+# Bug #31031 ALTER TABLE regression in 5.0
+#
+# The ALTER TABLE operation failed with
+# ERROR 1089 (HY000): Incorrect sub part key; ...
+#
+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/t/create.test b/mysql-test/t/create.test
index 5ffa1b93929..9f3c3a88151 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1582,3 +1582,56 @@ create table t3 (a int) row_format=page;
--echo
--echo End of 5.1 tests
+
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
+--echo # -- failed when redefining trigger
+--echo
+
+#--disable_abort_on_error
+
+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 ;
+
+--delimiter |
+
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ;
+END ; |
+
+--delimiter ;
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+CREATE TABLE IF NOT EXISTS t1 (
+ `pk` INTEGER NOT NULL AUTO_INCREMENT ,
+ `int` INTEGER ,
+ PRIMARY KEY ( `pk` )
+) SELECT `pk` , `int_key` FROM B ;
+
+--delimiter |
+--error ER_NOT_SUPPORTED_YET
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ UPDATE A SET `pk`=1 WHERE `pk`=0 ;
+END ;|
+
+--delimiter ;
+
+DROP TABLE t1;
+DROP TABLE B;
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index 6b6abbcfbcc..cb2113277b9 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -172,6 +172,18 @@ DROP TABLE t1;
#
# Test that optimizer doesn't use indexes with wrong collation
#
+#
+# BUG#48447, Delivering too few records with indexes using collate syntax
+#
+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;
+select * from t1 where a <> 'B' collate latin1_bin;
+create index i on t1 (a);
+select * from t1 where a > 'B' collate latin1_bin;
+select * from t1 where a <> 'B' collate latin1_bin;
+drop table t1;
+
SET NAMES latin1;
CREATE TABLE t1
(s1 char(10) COLLATE latin1_german1_ci,
diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test
index 89df33a6df5..af6e6baf92a 100644
--- a/mysql-test/t/ctype_cp932_binlog_stm.test
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test
@@ -22,18 +22,18 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
SELECT HEX(s1),HEX(s2),d FROM t4|
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 370|
+SHOW BINLOG EVENTS FROM 371|
delimiter ;|
--echo End of 5.0 tests
#
# #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump
-# Note: 364 is a magic position (found experimentally, depends on
+# Note: 365 is a magic position (found experimentally, depends on
# the log's contents) that caused the server crash.
--error 1220
-SHOW BINLOG EVENTS FROM 365;
+SHOW BINLOG EVENTS FROM 366;
--echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932;
diff --git a/mysql-test/t/ctype_errors.test b/mysql-test/t/ctype_errors.test
new file mode 100644
index 00000000000..3c73fdae264
--- /dev/null
+++ b/mysql-test/t/ctype_errors.test
@@ -0,0 +1,47 @@
+--echo Start of 5.4 tests
+
+#
+# ls_messages
+#
+CREATE TABLE t1(f1 INT);
+connect (con1,localhost,root,,test);
+connection con1;
+SET lc_messages=ru_RU;
+SHOW VARIABLES LIKE 'lc_messages';
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1(f1 INT);
+SET NAMES utf8;
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1(f1 INT);
+connection default;
+SHOW VARIABLES LIKE 'lc_messages';
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1(f1 INT);
+
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+SET GLOBAL lc_messages=ru_RU;
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+SET GLOBAL lc_messages=en_US;
+
+disconnect con1;
+DROP TABLE t1;
+
+#
+# Bug#1406 Tablename in Errormessage not in default characterset
+#
+--error ER_BAD_TABLE_ERROR
+drop table `ק`;
+
+#
+# Bug#14602 Error messages not returned in character_set_results
+#
+connect (con1,localhost,root,,test);
+connection con1;
+SET lc_messages=cs_CZ;
+SET NAMES UTF8;
+--error ER_BAD_DB_ERROR
+USE nonexistant;
+disconnect con1;
+connection default;
+
+--echo End of 5.4 tests
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index 0395de273de..0fcfd603aad 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -57,6 +57,7 @@ DROP TABLE t1;
#
# Vietnamese experimental collation
#
+--echo Vietnamese experimental collation
show collation like 'ucs2_vn_ci';
create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
@@ -99,3 +100,28 @@ drop table t1;
set names latin1;
show collation like 'latin1_test';
select "foo" = "foo " collate latin1_test;
+
+-- echo The following tests check that two-byte collation IDs work
+# The file ../std-data/Index.xml has a number of collations with high IDs.
+
+# Test that the "ID" column in I_S and SHOW queries can handle two bytes
+select * from information_schema.collations where id>256 order by id;
+show collation like '%test%';
+
+# Test that two-byte collation ID is correctly transfered to the client side.
+show collation like 'ucs2_vn_ci';
+create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
+insert into t1 values (0x0061);
+--enable_metadata
+set @@character_set_results=NULL;
+select * from t1;
+--disable_metadata
+drop table t1;
+
+#
+# Check maximum collation ID (2047 as of MySQL-6.0.9)
+#
+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;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index f0c769251cf..bb3eaa84391 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -2,6 +2,8 @@
# Tests with the utf8 character set
#
+--source include/have_innodb.inc
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -256,9 +258,7 @@ drop table t1;
# Bug 4521: unique key prefix interacts poorly with utf8
# InnoDB: keys with prefix compression, case insensitive collation.
#
---disable_warnings
create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb;
---enable_warnings
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
--error ER_DUP_ENTRY
@@ -306,9 +306,7 @@ drop table t1;
# Bug 4521: unique key prefix interacts poorly with utf8
# InnoDB: fixed length keys, case insensitive collation
#
---disable_warnings
create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb;
---enable_warnings
insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
@@ -383,12 +381,10 @@ drop table t1;
# Bug 4531: unique key prefix interacts poorly with utf8
# Check BDB, case insensitive collation
#
---disable_warnings
create table t1 (
c char(10) character set utf8,
unique key a (c(1))
) engine=innodb;
---enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error ER_DUP_ENTRY
insert into t1 values ('aa');
@@ -506,12 +502,10 @@ drop table t1;
# Bug 4531: unique key prefix interacts poorly with utf8
# Check BDB, binary collation
#
---disable_warnings
create table t1 (
c char(10) character set utf8 collate utf8_bin,
unique key a (c(1))
) engine=innodb;
---enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error ER_DUP_ENTRY
insert into t1 values ('aa');
@@ -543,12 +537,10 @@ drop table t1;
# Bug#4594: column index make = failed for gbk, but like works
# Check InnoDB
#
---disable_warnings
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=innodb;
---enable_warnings
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
@@ -581,12 +573,10 @@ drop table t1;
# the same for BDB
#
---disable_warnings
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=innodb;
---enable_warnings
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
@@ -603,14 +593,11 @@ DROP TABLE t1;
#
# Bug #5723: length(<varchar utf8 field>) returns varying results
#
---disable_warnings
SET NAMES utf8;
---disable_warnings
CREATE TABLE t1 (
subject varchar(255) character set utf8 collate utf8_unicode_ci,
p varchar(15) character set utf8
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
INSERT INTO t1 VALUES ('è°·å·ä¿ŠäºŒã¨ç”³ã—ã¾ã™ãŒã€ã‚¤ãƒ³ã‚¿ãƒ¼ãƒãƒƒãƒˆäºˆç´„ã®ä¼šå“¡ç™»éŒ²ã‚’ã—ã¾ã—ãŸã¨ã“ã‚ã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’é–“é•ãˆã¦ã—ã¾ã„会員IDãŒå—ã‘å–ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ã§ã—ãŸã€‚é–“é•ãˆã‚¢ãƒ‰ãƒ¬ã‚¹ã¯tani-shun@n.vodafone.ne.jpを書ãè¾¼ã¿ã¾ã—ãŸã€‚ã©ã†ã™ã‚Œã°ã‚ˆã„ã§ã™ã‹ï¼Ÿ ãã®ä»–ã€ä½æ‰€ç­‰ã¯é–“é•ãˆã‚ã‚Šã¾ã›ã‚“。連絡ãã ã•ã„。よã‚ã—ããŠé¡˜ã„ã—ã¾ã™ã€‚m(__)m','040312-000057');
INSERT INTO t1 VALUES ('aaa','bbb');
SELECT length(subject) FROM t1;
@@ -661,18 +648,14 @@ DROP TABLE t1;
# Bug #6019 SELECT tries to use too short prefix index on utf8 data
#
set names utf8;
---disable_warnings
create table t1 (
a int primary key,
b varchar(6),
index b3(b(3))
) engine=innodb character set=utf8;
---enable_warnings
insert into t1 values(1,'foo'),(2,'foobar');
select * from t1 where b like 'foob%';
---disable_warnings
alter table t1 engine=innodb;
---enable_warnings
select * from t1 where b like 'foob%';
drop table t1;
@@ -841,14 +824,12 @@ INSERT INTO t1 VALUES
(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Ðфимим.Ðеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ðд.Д имдимримрад.Ðдимримримрмдиримримримр м.Дадимфшьмримд им.Ðдимимрн имадми','ИМРИ.ÐФИМИМ.ÐЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
---disable_warnings
CREATE TABLE t2 (
`msisdn` varchar(15) NOT NULL default '',
`operator_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
UNIQUE KEY `PK_user` (`msisdn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
---enable_warnings
INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
@@ -1013,10 +994,8 @@ drop table t1;
# additional tests from duplicate bug#20744 MySQL return no result
set names utf8;
---disable_warnings
create table t1 (a varchar(30) not null primary key)
engine=innodb default character set utf8 collate utf8_general_ci;
---enable_warnings
insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
select a as gci1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
@@ -1024,10 +1003,8 @@ select a as gci2 from t1 where a like 'ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã
drop table t1;
set names utf8;
---disable_warnings
create table t1 (a varchar(30) not null primary key)
engine=innodb default character set utf8 collate utf8_unicode_ci;
---enable_warnings
insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
select a as uci1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
@@ -1035,10 +1012,8 @@ select a as uci2 from t1 where a like 'ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã
drop table t1;
set names utf8;
---disable_warnings
create table t1 (a varchar(30) not null primary key)
engine=innodb default character set utf8 collate utf8_bin;
---enable_warnings
insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
select a as bin1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
@@ -1363,26 +1338,22 @@ select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
drop table t1;
-
#
# Bug#19960: Inconsistent results when joining
# InnoDB tables using partial UTF8 indexes
#
---disable_warnings
+
CREATE TABLE t1 (
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
PRIMARY KEY (colA)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar');
---disable_warnings
CREATE TABLE t2 (
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
KEY bad (colA,colB(3))
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB
WHERE t1.colA < 3;
@@ -1456,3 +1427,22 @@ SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
DROP TABLE t1;
--echo End of 5.0 tests
+
+
+--echo Start of 5.4 tests
+#
+# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+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;
+DROP TABLE t1;
+
+--echo End of 5.4 tests
+
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 689341391c9..d1e9bc154f5 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -247,7 +247,7 @@ DROP TABLE t1;
# Bug #32676: insert delayed crash with wrong column and function specified
#
CREATE TABLE t1 (a INT);
---error ER_BAD_FIELD_ERROR
+--error 1305
INSERT DELAYED INTO t1 SET b= b();
DROP TABLE t1;
@@ -353,3 +353,38 @@ DROP TABLE t1, t2;
--echo End of 5.1 tests
+
+
+
+--echo #
+--echo # Bug #47274 assert in open_table on CREATE TABLE <already existing>
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
+
+--echo # The following CREATE TABLEs before gave an assert.
+
+INSERT DELAYED t1 VALUES (4);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 AS SELECT 1 AS f1;
+
+REPLACE DELAYED t1 VALUES (5);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 AS SELECT 1 AS f1;
+
+INSERT DELAYED t1 VALUES (6);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 (f1 INTEGER);
+
+CREATE TABLE t2 (f1 INTEGER);
+INSERT DELAYED t1 VALUES (7);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 LIKE t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/t/drop-no_root.test b/mysql-test/t/drop-no_root.test
new file mode 100644
index 00000000000..8fb5b3f74a8
--- /dev/null
+++ b/mysql-test/t/drop-no_root.test
@@ -0,0 +1,85 @@
+# This test uses chmod, can't be run with root permissions
+--source include/not_as_root.inc
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#26704: Failing DROP DATABASE brings mysql-client out of sync.
+--echo # --
+
+--echo
+--disable_warnings
+DROP DATABASE IF EXISTS mysql_test;
+--enable_warnings
+
+--echo
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(c INT);
+
+use mysql_test;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo
+--echo chmod 000 mysql_test/t1.frm
+--chmod 0000 $MYSQLD_DATADIR/mysql_test/t1.frm
+
+# NOTE: For the DROP DATABASE below we need:
+# - disable result log because ER_DB_DROP_RMDIR contains errno, which can be
+# different on different platforms.
+# - expect different error codes, because Windows and UNIX behaves
+# differently (see below).
+#
+# NOTE: Windows and UNIX behaves differently in this test case:
+#
+# - on UNIX when t1.frm is chmoded to 000, it is perfectly deleted
+# by the first DROP DATABASE, but some other files (t1.MYI and t1.MYD) left
+# in the directory. So, we have to explicitly removes them before the
+# second DROP DATABASE.
+#
+# - on Windows when t1.frm is chmoded to 000, it is not deleted by the first
+# DROP DATABASE, but all other files in the database directory are deleted.
+# Thus, we have to change the t1.frm permissions again and delete it
+# explicitly before the second DROP DATABASE.
+#
+# All those differences do not really matter for the idea of this test case:
+# checking that if DROP DATABASE failed, the client is Ok.
+
+--echo
+--disable_result_log
+--error ER_DB_DROP_RMDIR,6
+DROP DATABASE mysql_test;
+--enable_result_log
+
+--echo
+SELECT DATABASE();
+
+# Remove t1.MYI and t1.MYD. On UNIX it should succeed. On Windows, it fails.
+--echo
+--echo rm -f mysql_test/t1.MYD mysql_test/t1.MYI
+--error 0, 1
+--remove_file $MYSQLD_DATADIR/mysql_test/t1.MYD
+--error 0, 1
+--remove_file $MYSQLD_DATADIR/mysql_test/t1.MYI
+
+# Make t1.frm removable: fail on UNIX, succeed on Windows.
+--echo chmod 666 mysql_test/t1.frm
+--error 0, 1
+--chmod 0666 $MYSQLD_DATADIR/mysql_test/t1.frm
+
+# Remove t1.frm: fail on UNIX, succeed on Windows.
+--echo rm -f mysql_test/t1.frm
+--error 0, 1
+--remove_file $MYSQLD_DATADIR/mysql_test/t1.frm
+
+--echo
+DROP DATABASE mysql_test;
+
+--echo
+use test;
+
+--echo
+--echo # -- End of Bug#26704.
+
+###########################################################################
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index bb4dd3e11f9..6be4ea25007 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -202,3 +202,24 @@ use test;
drop database mysqltestbug26703;
--echo End of 5.1 tests
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#37431 (DROP TABLE does not report errors correctly).
+--echo # --
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+
+SHOW WARNINGS;
+
+--echo
+--echo # --
+--echo # -- End of Bug#37431.
+--echo # --
diff --git a/mysql-test/t/drop_debug.test b/mysql-test/t/drop_debug.test
new file mode 100644
index 00000000000..97ee5847d0a
--- /dev/null
+++ b/mysql-test/t/drop_debug.test
@@ -0,0 +1,35 @@
+#
+# DROP-related tests which execution requires debug server.
+#
+--source include/have_debug.inc
+
+###########################################################################
+--echo
+--echo # --
+--echo # -- Bug#43138: DROP DATABASE failure does not clean up message list.
+--echo # --
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysql_test;
+--enable_warnings
+
+--echo
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+
+--echo
+SET SESSION DEBUG = "+d,bug43138";
+
+--echo
+DROP DATABASE mysql_test;
+
+--echo
+SET SESSION DEBUG = "-d,bug43138";
+
+--echo
+--echo # --
+--echo # -- End of Bug#43138.
+--echo # --
+
+###########################################################################
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 89579ec1739..820766c3a78 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -67,3 +67,38 @@ SHOW ERRORS;
INSERT INTO t1 SELECT b FROM t1;
DROP TABLE t1;
# End of 5.0 tests
+
+#
+# testing the value encoding in the error messages of set_var
+#
+SET NAMES utf8;
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _binary x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create=_latin1 x'5452DC45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create='TRÃœE';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create=TRÃœE;
+
+SET NAMES latin1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _binary x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create=_latin1 x'5452DC45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create='TR.E';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create=TR.E;
+
+SET NAMES binary;
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _binary x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+--error ER_WRONG_VALUE_FOR_VAR
+SET sql_quote_show_create=_latin1 x'5452DC45';
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 77b49a8b1a5..7e2a9bdc811 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -187,4 +187,16 @@ SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
+--echo #
+--echo # Bug#30302: Tables that were optimized away are printed in the
+--echo # EXPLAIN EXTENDED warning.
+--echo #
+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;
+explain extended select * from t1 join t2 on f1=f2 where f1=1;
+drop table t1,t2;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 4537559509d..fb060cc83dd 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -420,6 +420,15 @@ DROP TABLE t1;
# End of 4.1 tests
#
+# bug#34374 - mysql generates incorrect warning
+#
+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';
+drop table t1;
+show warnings;
+
+#
# BUG#38842 - Fix for 25951 seems incorrect
#
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index e92f3e96303..71d3d5a140b 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -694,3 +694,35 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN
DROP TABLE t1, t2;
--echo End of 5.0 tests
+
+#
+# Bug#36785: Wrong error message when group_concat() exceeds max length
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+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;
+--error ER_CUT_VALUE_GROUP_CONCAT
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+UPDATE t1 SET a = '11111' WHERE b = 1;
+UPDATE t1 SET a = '22222' WHERE b = 2;
+--error ER_CUT_VALUE_GROUP_CONCAT
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+
+SET group_concat_max_len = DEFAULT;
+SET @@sql_mode = @old_sql_mode;
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 66b9eabd385..032c9ade643 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1318,3 +1318,45 @@ insert into t1 values (-1),(null);
explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a;
explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a;
drop table t1;
+
+
+
+--echo Start of 5.4 tests
+#
+# WL#4584 Internationalized number format
+#
+SELECT format(12345678901234567890.123, 3);
+SELECT format(12345678901234567890.123, 3, NULL);
+SELECT format(12345678901234567890.123, 3, 'ar_AE');
+SELECT format(12345678901234567890.123, 3, 'ar_SA');
+SELECT format(12345678901234567890.123, 3, 'be_BY');
+SELECT format(12345678901234567890.123, 3, 'de_DE');
+SELECT format(12345678901234567890.123, 3, 'en_IN');
+SELECT format(12345678901234567890.123, 3, 'en_US');
+SELECT format(12345678901234567890.123, 3, 'it_CH');
+SELECT format(12345678901234567890.123, 3, 'ru_RU');
+SELECT format(12345678901234567890.123, 3, 'ta_IN');
+
+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;
+SELECT fmt, format(12345678901234567890.123, 0, fmt) FROM t1 ORDER BY fmt;
+SELECT fmt, format(12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+SELECT fmt, format(-12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+SELECT fmt, format(-02345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+SELECT fmt, format(-00345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+SELECT fmt, format(-00045678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+DROP TABLE t1;
+
+SELECT format(123, 1, 'Non-existent-locale');
+
+--echo End of 5.4 tests
+
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index bcd393bd6ab..bda48fb9ecf 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1525,5 +1525,357 @@ DROP USER 'user1'@'localhost';
DROP USER 'user2';
DROP DATABASE db1;
+
+--echo #
+--echo # Bug #25863 No database selected error, but documentation
+--echo # says * for global allowed
+--echo #
+
+connect(conn1,localhost,root,,*NO-ONE*);
+
+--error ER_NO_DB_ERROR
+GRANT ALL ON * TO mysqltest_1;
+
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+DROP USER mysqltest_1;
+
+USE test;
+
+GRANT ALL ON * TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+DROP USER mysqltest_1;
+
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+DROP USER mysqltest_1;
+
+connection default;
+disconnect conn1;
+
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
+
+--echo #########################################################################
+--echo #
+--echo # Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
+--echo #
+--echo #########################################################################
+
+--echo
+--echo # --
+--echo # -- Prepare the environment.
+--echo # --
+
+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;
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest_db1;
+--enable_warnings
+
+CREATE DATABASE mysqltest_db1;
+
+CREATE TABLE mysqltest_db1.t1(a INT);
+
+--echo
+--echo # --
+--echo # -- Check that global privileges don't allow SHOW CREATE TABLE.
+--echo # --
+
+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;
+
+--echo
+SHOW GRANTS FOR mysqltest_u1@localhost;
+
+--echo
+--echo # connection: con1 (mysqltest_u1@mysqltest_db1)
+--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
+--connection con1
+
+--echo
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE TABLE t1;
+
+--echo
+--echo # connection: default
+--connection default
+
+--disconnect con1
+
+--echo
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+
+--echo
+--echo # --
+--echo # -- Check that global SELECT allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT SELECT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global INSERT allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT INSERT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global UPDATE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global DELETE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global CREATE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT CREATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global DROP allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT DROP ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global ALTER allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT ALTER ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global INDEX allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT INDEX ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global REFERENCES allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT REFERENCES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global GRANT OPTION allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT GRANT OPTION ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global CREATE VIEW allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT CREATE VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that global SHOW VIEW allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT SHOW VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level SELECT allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level INSERT allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT INSERT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level UPDATE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level DELETE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT DELETE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level CREATE allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT CREATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level DROP allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT DROP ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level ALTER allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT ALTER ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level INDEX allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT INDEX ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level REFERENCES allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT REFERENCES ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level GRANT OPTION allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT GRANT OPTION ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level CREATE VIEW allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT CREATE VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Check that table-level SHOW VIEW allows SHOW CREATE TABLE.
+--echo # --
+
+--echo
+GRANT SHOW VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+--source include/bug38347.inc
+
+--echo
+--echo # --
+--echo # -- Cleanup.
+--echo # --
+
+--echo
+DROP DATABASE mysqltest_db1;
+
+DROP USER mysqltest_u1@localhost;
+
+--echo
+--echo # End of Bug#38347.
+--echo
diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test
new file mode 100644
index 00000000000..f3e551cd623
--- /dev/null
+++ b/mysql-test/t/grant4.test
@@ -0,0 +1,146 @@
+--source include/not_embedded.inc
+
+# Setup database, tables and user accounts
+--disable_warnings
+drop database if exists mysqltest_db1;
+--enable_warnings
+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;
+
+--echo ** Connect as restricted user mysqltest_u1.
+--echo
+connect (con1,localhost,mysqltest_u1,,);
+connection con1;
+
+########################################################################
+--echo ** Test column level privileges only. No SELECT privileges on the table.
+--echo ** INSERT INTO ... VALUES ...
+--echo ** Attempting to insert values to a table with only column privileges
+--echo ** should work.
+insert into mysqltest_db1.t_column_priv_only (a) VALUES (1);
+--echo
+
+#########################################################################
+--echo ** SHOW COLUMNS
+--echo ** 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';
+show columns from mysqltest_db1.t_column_priv_only;
+#########################################################################
+--echo ** SHOW COLUMNS
+--echo ** Should fail because there are no privileges on any column combination.
+--error 1142
+show columns from mysqltest_db1.t_no_priv;
+--echo ** 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';
+--echo
+#########################################################################
+--echo ** CREATE TABLE ... LIKE ... require SELECT privleges and will fail.
+--error 1142
+create table test.t_no_priv like mysqltest_db1.column_priv_only;
+--echo
+#########################################################################
+--echo ** Just to be sure... SELECT also fails.
+--error 1142
+select * from mysqltest_db1.t_column_priv_only;
+--echo
+#########################################################################
+--echo ** SHOW CREATE TABLE ... require any privileges on all columns (the entire table).
+--echo ** First we try and fail on a table with only one column privilege.
+--error 1142
+show create table mysqltest_db1.t_column_priv_only;
+--echo
+#########################################################################
+--echo ** Now we do the same on a table with SELECT privileges.
+--echo
+#########################################################################
+--echo ** SHOW COLUMNS
+--echo ** Success because we got some privileges on the table (SELECT_ACL)
+show columns from mysqltest_db1.t_select_priv;
+--echo
+#########################################################################
+--echo ** CREATE TABLE ... LIKE ... require SELECT privleges and will SUCCEED.
+--disable_warnings
+drop table if exists test.t_duplicated;
+--enable_warnings
+create table test.t_duplicated like mysqltest_db1.t_select_priv;
+drop table test.t_duplicated;
+--echo
+#########################################################################
+--echo ** 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;
+--echo
+#########################################################################
+--echo ** SHOW CREATE TABLE will fail if there is no grants at all:
+--error 1142
+show create table mysqltest_db1.t_no_priv;
+--echo
+
+connection default;
+
+#
+# SHOW INDEX
+#
+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;
+
+connection con1;
+use mysqltest_db1;
+--echo ** Connect as restricted user mysqltest_u1.
+--echo ** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough).
+#
+# this result is wrong. reported as bug#34104
+#
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5';
+#
+# Bug27145 EXTRA_ACL trouble
+#
+--echo ** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column combination.
+--error 1142
+SHOW INDEX FROM t5;
+--echo ** SHOW INDEX FROM t6 will succeed because there exist a privilege on a column combination on t6.
+SHOW INDEX FROM t6;
+
+# CHECK TABLE
+--echo ** CHECK TABLE requires any privilege on any column combination and should succeed for t6:
+CHECK TABLE t6;
+--echo ** With no privileges access is naturally denied:
+--error 1142
+CHECK TABLE t5;
+
+# CHECKSUM
+--echo ** CHECKSUM TABLE requires SELECT privileges on the table. The following should fail:
+--error 1142
+CHECKSUM TABLE t6;
+--echo ** And this should work:
+CHECKSUM TABLE t_select_priv;
+
+# SHOW CREATE VIEW
+--error 1142
+SHOW CREATE VIEW v5;
+--error 1142
+SHOW CREATE VIEW v6;
+--error 1142
+SHOW CREATE VIEW v2;
+SHOW CREATE VIEW v3;
+
+connection default;
+disconnect con1;
+drop database mysqltest_db1;
+drop user mysqltest_u1@localhost;
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index f623df372fa..0e6fef9b855 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -570,13 +570,13 @@ explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
-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');
select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
-select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
#
# Queries with expressions in the select clause
@@ -1045,3 +1045,124 @@ SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
DROP TABLE t;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # WL#3220 (Loose index scan for COUNT DISTINCT)
+--echo #
+
+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;
+SELECT COUNT(DISTINCT a) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT a,b) FROM t1;
+SELECT COUNT(DISTINCT a,b) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT b,a) FROM t1;
+SELECT COUNT(DISTINCT b,a) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1;
+SELECT COUNT(DISTINCT b) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+
+EXPLAIN SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+
+EXPLAIN SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+
+EXPLAIN SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+
+EXPLAIN SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+
+EXPLAIN SELECT COUNT(DISTINCT a), 12 FROM t1;
+SELECT COUNT(DISTINCT a), 12 FROM t1;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b, c) FROM t2;
+SELECT COUNT(DISTINCT a, b, c) FROM t2;
+
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+
+EXPLAIN SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+
+EXPLAIN SELECT COUNT(DISTINCT c, a, b) FROM t2
+ WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+SELECT COUNT(DISTINCT c, a, b) FROM t2
+ WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+ GROUP BY b;
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+ GROUP BY b;
+
+EXPLAIN SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+
+EXPLAIN SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+ WHERE b = 13 AND c = 42 GROUP BY a;
+SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+ WHERE b = 13 AND c = 42 GROUP BY a;
+
+EXPLAIN SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+
+EXPLAIN SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+
+EXPLAIN SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+
+EXPLAIN SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+
+DROP TABLE t1,t2;
+
+--echo # end of WL#3220 tests
diff --git a/mysql-test/t/information_schema-big.test b/mysql-test/t/information_schema-big.test
new file mode 100644
index 00000000000..c9cd65f0851
--- /dev/null
+++ b/mysql-test/t/information_schema-big.test
@@ -0,0 +1,48 @@
+# This test uses grants, which can't get tested for embedded server
+-- source include/big_test.inc
+-- source include/not_embedded.inc
+
+# check that CSV engine was compiled in, as the result of the test depends
+# on the presence of the log tables (which are CSV-based).
+--source include/have_csv.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+
+--echo #
+--echo # Bug#18925: subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
+--echo #
+
+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%';
+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%';
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 6060c78f791..9da7cc1042d 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -366,7 +366,7 @@ show tables from information_schema like "T%";
create database information_schema;
use information_schema;
show full tables like "T%";
---error ER_UNKNOWN_TABLE
+--error ER_DBACCESS_DENIED_ERROR
create table t1(a int);
use test;
show tables;
@@ -914,41 +914,6 @@ DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
#
-# 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_%';
-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_%';
-
-#
# Bug#2123 query with a simple non-correlated subquery over
# INFORMARTION_SCHEMA.TABLES
#
@@ -1426,6 +1391,65 @@ SET TIMESTAMP=DEFAULT;
--echo End of 5.1 tests.
+#
+# Bug#24062 Incorrect error msg after execute DROP TABLE IF EXISTS on information_schema
+#
+--error ER_DBACCESS_DENIED_ERROR
+create table information_schema.t1 (f1 INT);
+--error ER_DBACCESS_DENIED_ERROR
+drop table information_schema.t1;
+--error ER_DBACCESS_DENIED_ERROR
+drop temporary table if exists information_schema.t1;
+--error ER_DBACCESS_DENIED_ERROR
+create temporary table information_schema.t1 (f1 INT);
+--error ER_DBACCESS_DENIED_ERROR
+drop view information_schema.v1;
+--error ER_DBACCESS_DENIED_ERROR
+create view information_schema.v1;
+--error ER_DBACCESS_DENIED_ERROR
+create trigger mysql.trg1 after insert on information_schema.t1 for each row set @a=1;
+--error 1109
+create table t1 select * from information_schema.t1;
+
+CREATE TABLE t1(f1 char(100));
+--error ER_DBACCESS_DENIED_ERROR
+REPAIR TABLE t1, information_schema.tables;
+CHECKSUM TABLE t1, information_schema.tables;
+--error ER_DBACCESS_DENIED_ERROR
+ANALYZE TABLE t1, information_schema.tables;
+CHECK TABLE t1, information_schema.tables;
+--error ER_DBACCESS_DENIED_ERROR
+OPTIMIZE TABLE t1, information_schema.tables;
+--error ER_DBACCESS_DENIED_ERROR
+RENAME TABLE v1 to v2, information_schema.tables to t2;
+--error ER_DBACCESS_DENIED_ERROR
+DROP TABLE t1, information_schema.tables;
+
+--error ER_DBACCESS_DENIED_ERROR
+LOCK TABLES t1 READ, information_schema.tables READ;
+DROP TABLE t1;
+
+#
+# Bug#39270 I_S optimization algorithm does not work properly in some cases
+#
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+ WHERE CONSTRAINT_SCHEMA='test';
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
+ WHERE TABLE_NAME='t1' and TABLE_SCHEMA='test';
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE EVENT_OBJECT_SCHEMA='test';
+
+#
+# Bug #43834 Assertion in Natural_join_column::db_name() on an I_S query
+#
+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';
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
-
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index ef66f71d2ad..7326f33b113 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -1,5 +1,5 @@
# this test mostly test privilege control (what doesn't work
-# in the embedded server by default). So disabled in embedded-server mode
+# in the embedded server by default). So skip the test in embedded-server mode.
-- source include/not_embedded.inc
-- source include/testdb_only.inc
@@ -13,7 +13,7 @@ drop function if exists f2;
use INFORMATION_SCHEMA;
--replace_result Tables_in_INFORMATION_SCHEMA Tables_in_information_schema
-show tables where Tables_in_information_schema not like "Innodb%";
+show tables where Tables_in_INFORMATION_SCHEMA NOT LIKE 'Innodb%';
--replace_result 'Tables_in_INFORMATION_SCHEMA (T%)' 'Tables_in_information_schema (T%)'
show tables from INFORMATION_SCHEMA like 'T%';
create database `inf%`;
@@ -123,7 +123,7 @@ 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;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
@@ -131,7 +131,7 @@ create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
connection default;
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;
@@ -163,10 +163,10 @@ show fields from testdb_1.v7;
show create view testdb_1.v7;
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;
connection default;
use testdb_1;
-revoke show view on v6 from testdb_2@localhost;
+revoke select,show view on v6 from testdb_2@localhost;
connection testdb_2;
--error ER_TABLEACCESS_DENIED_ERROR
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index a2a1113598d..3cd7b40f4ab 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -537,3 +537,21 @@ DROP VIEW v1;
DROP TABLE t1,t2;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Test for bug #39932 "create table fails if column for FK is in different
+--echo # case than in corr index".
+--echo #
+--disable_warnings
+drop tables if exists t1, t2;
+--enable_warnings
+create table t1 (pk int primary key) engine=InnoDB;
+--echo # Even although the below statement uses uppercased field names in
+--echo # foreign key definition it still should be able to find explicitly
+--echo # created supporting index. So it should succeed and should not
+--echo # 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;
+drop table t2, t1;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 8f9ed6c7d06..40d1464b86a 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -235,8 +235,10 @@ insert into t1 values (1,11), (2,22);
insert into t2 values (1,12), (2,24);
--error 1393
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
+--error 1393
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
select * from t1;
+--error 1393
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
select * from t1;
drop view v1;
@@ -499,3 +501,33 @@ DROP TABLE t1, t2;
--echo End of 5.0 tests.
+--echo #
+--echo # Bug#34898 "mysql_info() reports 0 warnings while
+--echo # mysql_warning_count() reports 1"
+--echo # Check that the number of warnings reported by
+--echo # mysql_info() is correct.
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (data varchar(4) not null);
+
+set sql_mode='error_for_division_by_zero';
+--echo #
+--echo # Demonstrate that the number of warnings matches
+--echo # the information in mysql_info().
+--echo #
+--enable_info
+insert t1 (data) values ('letter'), (1/0);
+update t1 set data='envelope' where 1/0 or 1;
+insert t1 (data) values (default), (1/0), ('dead beef');
+--disable_info
+
+set sql_mode=default;
+drop table t1;
+
+--echo #
+--echo # End of 5.4 tests
+--echo #
diff --git a/mysql-test/t/join_optimizer.test b/mysql-test/t/join_optimizer.test
new file mode 100644
index 00000000000..3afe82113b9
--- /dev/null
+++ b/mysql-test/t/join_optimizer.test
@@ -0,0 +1,45 @@
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+--echo #
+--echo # BUG#38049 incorrect rows estimations with references from preceding table
+--echo #
+
+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);
+--echo 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;
+
+drop table t0,t1,t2,t3;
diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test
new file mode 100644
index 00000000000..8b9c1bd1b0d
--- /dev/null
+++ b/mysql-test/t/loadxml.test
@@ -0,0 +1,108 @@
+#
+# Tests for "LOAD XML" - a contributed patch from Erik Wetterberg.
+#
+
+# Running the $MYSQL_DUMP tool against an embedded server does not work.
+--source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+create table t1 (a int, b varchar(64));
+
+
+--echo -- 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;
+delete from t1;
+
+
+--echo -- 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;
+
+
+--echo -- Check 'mysqldump --xml' + 'LOAD XML' round trip
+--exec $MYSQL_DUMP --xml test t1 > "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" 2>&1
+delete from t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval load xml infile '$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1 rows identified by '<row>';
+select * from t1 order by a;
+
+--echo --Check that default row tag is '<row>
+delete from t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval load xml infile '$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1;
+select * from t1 order by a;
+
+--echo -- Check that 'xml' is not a keyword
+select 1 as xml;
+
+
+#
+# Bug #42520 killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
+#
+
+--disable_query_log
+delete from t1;
+insert into t1 values (1, '12345678900987654321'), (2, 'asdfghjkl;asdfghjkl;');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+--exec $MYSQL_DUMP --xml test t1 > "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" 2>&1
+--enable_query_log
+
+connect (addconroot, localhost, root,,);
+connection addconroot;
+create table t2(fl text);
+--let $PSEUDO_THREAD_ID=`select @@pseudo_thread_id `
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--send_eval LOAD XML LOCAL INFILE "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';
+
+sleep 3;
+
+
+connection default;
+sleep 1;
+
+--disable_query_log
+--eval kill $PSEUDO_THREAD_ID
+sleep 2;
+--enable_query_log
+
+disconnect addconroot;
+
+#
+# Clean up
+#
+remove_file $MYSQLTEST_VARDIR/tmp/loadxml-dump.xml;
+drop table t1;
+drop table t2;
+
+#
+# Bug #36750 LOAD XML doesn't understand new line (feed) characters in multi line text fields
+#
+
+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;
+drop table t1;
+
diff --git a/mysql-test/t/locale.test b/mysql-test/t/locale.test
index 7ceb49fd1f4..04ac95cea06 100644
--- a/mysql-test/t/locale.test
+++ b/mysql-test/t/locale.test
@@ -3,6 +3,44 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
--echo Start of 5.4 tests
+
+--echo #
+--echo # WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
+--echo #
+
+SET NAMES utf8;
+
+SET @@lc_time_names=109;
+SELECT @@lc_time_names;
+
+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;
+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;
+
+SELECT format(123456.789, 3, 'el_GR');
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#46633 Obsolete Serbian locale name
+--echo #
+SET lc_messages=sr_YU;
+SHOW VARIABLES LIKE 'lc_messages';
+SET lc_messages=sr_RS;
+SHOW VARIABLES LIKE 'lc_messages';
+SET lc_time_names=sr_RS;
+SELECT format(123456.789, 3, 'sr_RS');
+
--echo #
--echo # Bug#43207 wrong LC_TIME names for romanian locale
--echo #
diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test
new file mode 100644
index 00000000000..73289685114
--- /dev/null
+++ b/mysql-test/t/lock_sync.test
@@ -0,0 +1,118 @@
+#
+# Locking related tests which use DEBUG_SYNC facility.
+#
+--source include/have_debug_sync.inc
+# We need InnoDB to be able use TL_WRITE_ALLOW_WRITE type of locks in our tests.
+--source include/have_innodb.inc
+# Until bug#41971 'Thread state on embedded server is always "Writing to net"'
+# is fixed this test can't be run on embedded version of server.
+--source include/not_embedded.inc
+
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+
+--echo #
+--echo # Test for bug #45143 "All connections hang on concurrent ALTER TABLE".
+--echo #
+--echo # Concurrent execution of statements which required weak write lock
+--echo # (TL_WRITE_ALLOW_WRITE) on several instances of the same table and
+--echo # statements which tried to acquire stronger write lock (TL_WRITE,
+--echo # TL_WRITE_ALLOW_READ) on this table might have led to deadlock.
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # Create auxiliary connections used through the test.
+connect (con_bug45143_1,localhost,root,,test,,);
+connect (con_bug45143_3,localhost,root,,test,,);
+connect (con_bug45143_2,localhost,root,,test,,);
+connection default;
+--echo # Reset DEBUG_SYNC facility before using it.
+set debug_sync= 'RESET';
+--echo # Turn off logging so calls to locking subsystem performed
+--echo # 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);
+--echo # Prepare user lock which will be used for resuming execution of
+--echo # the first statement after it acquires TL_WRITE_ALLOW_WRITE lock.
+select get_lock("lock_bug45143_wait", 0);
+
+--echo # Switch to connection 'con_bug45143_1'.
+connection con_bug45143_1;
+--echo # Sending:
+--send insert into t1 values (get_lock("lock_bug45143_wait", 100));
+
+--echo # Switch to connection 'con_bug45143_2'.
+connection con_bug45143_2;
+--echo # Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
+--echo # and then gets blocked on user lock 'lock_bug45143_wait'.
+let $wait_condition= select count(*)= 1 from information_schema.processlist
+ where state= 'User lock' and
+ info='insert into t1 values (get_lock("lock_bug45143_wait", 100))';
+--source include/wait_condition.inc
+--echo # Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE
+--echo # lock for the first instance of 't1'.
+set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
+--echo # Sending:
+--send select count(*) > 0 from t1 as a, t1 as b for update;
+
+--echo # Switch to connection 'con_bug45143_3'.
+connection con_bug45143_3;
+--echo # Wait until the above SELECT ... FOR UPDATE is blocked after
+--echo # acquiring lock for the the first instance of 't1'.
+set debug_sync= 'now WAIT_FOR parked';
+--echo # Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
+--send lock table t1 write;
+
+--echo # Switch to connection 'default'.
+connection default;
+--echo # Wait until this LOCK TABLES statement starts waiting for table lock.
+let $wait_condition= select count(*)= 1 from information_schema.processlist
+ where state= 'Locked' and
+ info='lock table t1 write';
+--source include/wait_condition.inc
+--echo # Allow SELECT ... FOR UPDATE to resume.
+--echo # Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance
+--echo # of 't1' it should be able to get lock on the second instance without
+--echo # waiting, even although there is another thread which has such lock
+--echo # on this table and also there is a thread waiting for a TL_WRITE on it.
+set debug_sync= 'now SIGNAL go';
+
+--echo # Switch to connection 'con_bug45143_2'.
+connection con_bug45143_2;
+--echo # Reap SELECT ... FOR UPDATE
+--reap
+
+--echo # Switch to connection 'default'.
+connection default;
+--echo # Resume execution of the INSERT statement.
+select release_lock("lock_bug45143_wait");
+
+--echo # Switch to connection 'con_bug45143_1'.
+connection con_bug45143_1;
+--echo # Reap INSERT statement.
+--reap
+
+--echo # Switch to connection 'con_bug45143_3'.
+connection con_bug45143_3;
+--echo # Reap LOCK TABLES statement.
+--reap
+unlock tables;
+
+--echo # Switch to connection 'default'.
+connection default;
+--echo # Do clean-up.
+disconnect con_bug45143_1;
+disconnect con_bug45143_2;
+disconnect con_bug45143_3;
+set debug_sync= 'RESET';
+set @@global.general_log= @old_general_log;
+drop table t1;
+
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index e40dd1e3491..4d8c8fc6e74 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -1,16 +1,5 @@
### t/log_state.test ###
#
-# This test suffers from server
-# Bug#38124 "general_log_file" variable silently unset when using expression
-# In short:
-# SET GLOBAL general_log_file = @<whatever>
-# SET GLOBAL slow_query_log = @<whatever>
-# cause that the value of these server system variables is set to default
-# instead of the assigned values. There comes no error message or warning.
-# If this bug is fixed please
-# 1. try this test with "let $fixed_bug38124 = 0;"
-# 2. remove all workarounds if 1. was successful.
-let $fixed_bug38124 = 0;
--source include/not_embedded.inc
--source include/have_csv.inc
@@ -166,16 +155,6 @@ SET @@global.general_log = @old_general_log;
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;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-
###########################################################################
@@ -278,15 +257,6 @@ SET GLOBAL slow_query_log_file= NULL;
# Reset to initial values in case a setting above was successful.
SET GLOBAL general_log_file= @old_general_log_file;
SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
###########################################################################
@@ -307,15 +277,6 @@ SHOW VARIABLES LIKE '%log_file';
--echo
SET GLOBAL general_log_file = @old_general_log_file;
SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
--echo
--echo # -- End of Bug#32748.
@@ -351,19 +312,43 @@ SET @@global.general_log = @old_general_log;
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;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-
--echo End of 5.1 tests
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#38124: "general_log_file" variable silently unset when
+--echo # -- using expression
+--echo # --
+
+# Store away the special DEFAULT value so we
+# can compare it later, then try to set the
+# general_log_file using different functions
+# and expressions.
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+
+
+## Reset to initial values
+SET GLOBAL general_log_file = @old_general_log_file;
+
+
--enable_ps_protocol
#
@@ -380,17 +365,7 @@ SET global general_log = @old_general_log;
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;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-
-# Remove the log files that was created in the "default location"
+
+# Remove the log file that was created in the "default location"
# i.e var/run
---remove_file $MYSQLTEST_VARDIR/run/mysqld.log
--remove_file $MYSQLTEST_VARDIR/tmp/log.master
diff --git a/mysql-test/t/log_state_bug33693-master.opt b/mysql-test/t/log_state_bug33693-master.opt
new file mode 100644
index 00000000000..9f4ae1a0c8f
--- /dev/null
+++ b/mysql-test/t/log_state_bug33693-master.opt
@@ -0,0 +1 @@
+--pid-file=$MYSQLTEST_VARDIR/run/mysqld.1.pid --log=
diff --git a/mysql-test/t/log_state_bug33693.test b/mysql-test/t/log_state_bug33693.test
new file mode 100644
index 00000000000..d67b28fc3e9
--- /dev/null
+++ b/mysql-test/t/log_state_bug33693.test
@@ -0,0 +1,18 @@
+### t/log_state_bug33693.test
+#
+# Regression test for bug #33693
+# "general log name and location depend on PID
+# file, not on predefined values"
+#
+# The server is started with a hard-coded
+# PID file in the $MYSQLTEST_VARDIR/run
+# directory, and an unspecified general log
+# file name.
+#
+# The correct result should show the log file to
+# rest in the database directory. Unfixed, the
+# log file will be in the same directory as the
+# PID.
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT INSTR(@@general_log_file, '$MYSQLTEST_VARDIR/run');
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index 521df01cc9b..92add60616a 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -150,3 +150,75 @@ select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES
where TABLE_SCHEMA ='mysqltest_LC2';
use test;
drop database mysqltest_LC2;
+
+--echo # End of 5.1 tests
+
+
+--echo #
+--echo # Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+--echo # lowercasing table name". Due to not properly normalizing table names
+--echo # in lower_case_table_names modes in this function queries to I_S which
+--echo # were executed through it left entries with incorrect key in table
+--echo # definition cache. As result further queries to I_S that used this
+--echo # function produced stale results in cases when table definition was
+--echo # changed by a DDL statement. Also combination of this issue and a
+--echo # similar problem in CREATE TABLE (it also has peeked into table
+--echo # definition cache using non-normalized key) led to spurious
+--echo # ER_TABLE_EXISTS_ERROR errors when one tried to create table with the
+--echo # same name as a previously existing but dropped table.
+--echo #
+--disable_warnings
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+--enable_warnings
+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;
+alter table t_bug44738_UPPERCASE comment='New comment';
+alter table t_bug44738_lowercase comment='New comment';
+--echo # There should be no stale entries in TDC for our tables after the
+--echo # above ALTER TABLE statements so new version of comments should be
+--echo # 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;
+drop database mysqltest_UPPERCASE;
+use test;
+
+--echo # Let us check that the original test case which led to discovery
+--echo # 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_%';
+drop table t_bug44738_UPPERCASE;
+--echo # After the above DROP TABLE there are no entries in TDC which correspond
+--echo # to our table and therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+
+--echo # Finally, let us check that another issue which was exposed by
+--echo # the original test case is solved. I.e. that fuse in CREATE TABLE
+--echo # which ensures that table is not created if there is an entry for
+--echo # it in TDC even though it was removed from disk uses normalized
+--echo # version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+--echo # 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_%';
+--echo # Simulate manual removal of the table.
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.frm
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYD
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYI
+--echo # After manual removal of table still there should be an entry for table
+--echo # in TDC so attempt to create table with the same name should fail.
+--error ER_TABLE_EXISTS_ERROR
+create table t_bug44738_UPPERCASE (i int);
+--echo # 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/t/merge.test b/mysql-test/t/merge.test
index 015ae28c155..63ad5a1e97c 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1634,3 +1634,63 @@ DROP TRIGGER tr1;
DROP TABLE t1, t2, t3;
--echo End of 5.1 tests
+
+--echo #
+--echo # An additional test case for Bug#27430 Crash in subquery code
+--echo # when in PS and table DDL changed after PREPARE
+--echo #
+--echo # Test merge table with too many merge children.
+--echo #
+--disable_warnings
+drop table if exists t_parent;
+--enable_warnings
+set @save_table_definition_cache=@@global.table_definition_cache;
+--echo #
+--echo # Set @@global.table_definition_cache to minimum
+--echo #
+set @@global.table_definition_cache=400;
+set @a=null;
+let $1 = 400;
+--echo #
+--echo # Create 400 merge children
+--echo #
+--disable_query_log
+while ($1)
+{
+--disable_warnings
+ eval drop table if exists t$1;
+--enable_warnings
+ eval create table t$1 (a int) engine=myisam;
+ eval set @a=ifnull(concat(@a, ", ", "t$1"), "t$1");
+ dec $1;
+}
+--enable_query_log
+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";
+--error ER_NEED_REPREPARE
+execute stmt;
+--error ER_NEED_REPREPARE
+execute stmt;
+--error ER_NEED_REPREPARE
+execute stmt;
+deallocate prepare stmt;
+--echo #
+--echo # Create merge parent
+--echo #
+
+--echo #
+--echo # Cleanup
+--echo #
+let $1 = 400;
+--disable_query_log
+while ($1)
+{
+ eval drop table t$1;
+ dec $1;
+}
+--enable_query_log
+drop table t_parent;
+set @@global.table_definition_cache=@save_table_definition_cache;
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index a10767579fb..a42dcfd618d 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -130,3 +130,60 @@ SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
DROP TABLE t1;
--echo End of 5.0 tests
+
+# Verify that column metadata is correct for all possible data types.
+# Originally about BUG#42980 "Client doesn't set NUM_FLAG for DECIMAL"
+
+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")
+);
+
+--enable_metadata
+select * from t1;
+--disable_metadata
+
+drop table t1;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 7e28358ba8b..8b30d9961d8 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -383,6 +383,11 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug31060.sql;
drop tables t1, t2;
#
+# mysql client with 'init-command' option
+#
+--exec $MYSQL --init-command="SET lc_messages=ru_RU" -e "SHOW VARIABLES LIKE 'lc_messages';"
+
+#
# Bug #27884: mysql --html does not quote HTML special characters in output
#
--write_file $MYSQLTEST_VARDIR/tmp/bug27884.sql
diff --git a/mysql-test/t/mysql_locale_posix.test b/mysql-test/t/mysql_locale_posix.test
new file mode 100644
index 00000000000..7d306dfc6c4
--- /dev/null
+++ b/mysql-test/t/mysql_locale_posix.test
@@ -0,0 +1,205 @@
+--source include/not_windows.inc
+--source include/have_case_sensitive_file_system.inc
+
+
+#
+# Note, please keep this file UTF-8 compatible.
+# After editing, make sure that
+# "file mysql_locale_posix.test"
+# says
+# "UTF-8 Unicode text"
+# or
+# "UTF-8 Unicode English text"
+#
+
+
+#
+# Check if we're running on a POSIX-locale machine
+#
+
+--disable_query_log
+--exec locale -a > $MYSQLTEST_VARDIR/tmp/locale_a.output 2>/dev/null || true
+SET @file=REPLACE(LOAD_FILE('../../tmp/locale_a.output'), '-', '');
+#
+# Note, file content must be case sensitive.
+# Some platforms are case sensitive regarding to locale name.
+# For example, on HP-UX
+# LANG=cs_CZ.iso88592 - works fine
+# LANG=cs_CZ.ISO88592 - does not work
+#
+--remove_file $MYSQLTEST_VARDIR/tmp/locale_a.output
+
+if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nde_DE.iso88591\n%')`)
+{
+ Skip Need POSIX locale de_DE.iso88591;
+}
+
+if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nru_RU.koi8r\n%')`)
+{
+ Skip Need POSIX locale ru_RU.koi8r;
+}
+
+if (`SELECT (IFNULL(@file,'') NOT LIKE '%\ncs_CZ.iso88592\n%')`)
+{
+ Skip Need POSIX locale cs_CZ.iso88592;
+}
+
+if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nen_US.utf8\n%')`)
+{
+ Skip Need POSIX locale en_US.utf8;
+}
+--enable_query_log
+
+
+
+SET NAMES utf8;
+
+--disable_warnings
+DROP DATABASE IF EXISTS `ó`;
+DROP DATABASE IF EXISTS `Ä‚Å‚`;
+DROP DATABASE IF EXISTS `цÐ`;
+DROP DATABASE IF EXISTS `ó`;
+--enable_warnings
+
+#
+# Test some of the OS-to-MySQL character set mappings
+#
+
+
+# {"ANSI_X3.4-1968", "ascii", my_cs_exact},
+# {"ansi1251", "cp1251", my_cs_exact},
+# {"armscii8", "armscii8", my_cs_exact},
+# {"ASCII", "ascii", my_cs_exact},
+# {"Big5", "big5", my_cs_exact},
+# {"cp1251", "cp1251", my_cs_exact},
+# {"cp1255", "cp1255", my_cs_exact},
+# {"CP866", "cp866", my_cs_exact},
+# {"eucCN", "gb2312", my_cs_exact},
+# {"eucJP", "ujis", my_cs_exact},
+# {"eucKR", "euckr", my_cs_exact},
+#
+# {"gb18030", "gb18030", my_cs_exact},
+#
+# {"gb2312", "gb2312", my_cs_exact},
+# {"gbk", "gbk", my_cs_exact},
+# {"georgianps", "geostd8", my_cs_exact},
+# {"IBM-1252", "cp1252", my_cs_exact},
+#
+# {"iso88591", "latin1", my_cs_approx},
+# {"ISO_8859-1", "latin1", my_cs_approx},
+# {"ISO8859-1", "latin1", my_cs_approx},
+# {"ISO-8859-1", "latin1", my_cs_approx},
+
+
+#
+# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
+# _latin1 0xC3 = LATIN CAPITAL LETTER A WITH TILDE
+# _latin1 0xB3 = SUPERSCRIPT THREE
+#
+--echo
+--echo iso88591
+--exec LC_ALL=fi_FI.iso88591 $MYSQL --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=fi_FI.iso88591 $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=fi_FI.iso88591 $MYSQL_SHOW --default-character-set=auto ó
+--exec LC_ALL=fi_FI.iso88591 $MYSQL_CHECK --default-character-set=auto "ó"
+
+
+# {"iso885913", "latin7", my_cs_exact},
+# {"ISO_8859-13", "latin7", my_cs_exact},
+# {"ISO8859-13", "latin7", my_cs_exact},
+# {"ISO-8859-13", "latin7", my_cs_exact},
+#
+# {"iso885915", "latin9", my_cs_exact},
+# {"ISO_8859-15", "latin9", my_cs_exact},
+# {"ISO8859-15", "latin9", my_cs_exact},
+# {"ISO-8859-15", "latin9", my_cs_exact},
+#
+# {"iso88592", "latin2", my_cs_exact},
+# {"ISO_8859-2", "latin2", my_cs_exact},
+# {"ISO8859-2", "latin2", my_cs_exact},
+# {"ISO-8859-2", "latin2", my_cs_exact},
+#
+
+
+#
+# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
+# _latin2 0xC3 = LATIN CAPITAL LETTER A WITH BREVE
+# _latin2 0xB3 = LATIN SMALL LETTER L WITH STROKE
+#
+--echo
+--echo iso88592
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR--default-character-set=auto "ó"
+
+
+# {"iso88597", "greek", my_cs_exact},
+# {"ISO_8859-7", "greek", my_cs_exact},
+# {"ISO8859-7", "greek", my_cs_exact},
+# {"ISO-8859-7", "greek", my_cs_exact},
+#
+# {"iso88598", "hebrew", my_cs_exact},
+# {"ISO_8859-8", "hebrew", my_cs_exact},
+# {"ISO8859-8", "hebrew", my_cs_exact},
+# {"ISO-8859-8", "hebrew", my_cs_exact},
+#
+# {"iso88599", "latin5", my_cs_exact},
+# {"ISO_8859-9", "latin5", my_cs_exact},
+# {"ISO8859-9", "latin5", my_cs_exact},
+# {"ISO-8859-9", "latin5", my_cs_exact},
+#
+# {"koi8r", "koi8r", my_cs_exact},
+# {"KOI8-R", "koi8r", my_cs_exact},
+# {"koi8u", "koi8u", my_cs_exact},
+# {"KOI8-U", "koi8u", my_cs_exact},
+#
+
+#
+# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
+# _koi8r 0xC3 = CYRILLIC SMALL LETTER TSE
+# _koi8r 0xB3 = CYRILLIC CAPITAL LETTER IO
+#
+
+--echo
+--echo koi8r
+--exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
+--exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR --default-character-set=auto "ó"
+
+
+# {"Shift_JIS", "sjis", my_cs_exact},
+# {"SJIS", "sjis", my_cs_exact},
+#
+# {"tis620", "tis620", my_cs_exact},
+#
+# {"ujis", "ujis", my_cs_exact},
+#
+# {"US-ASCII", "ascii", my_cs_exact},
+#
+# {"utf8", "utf8", my_cs_exact},
+# {"utf-8", "utf8", my_cs_exact},
+
+--echo
+--echo utf8
+--exec LC_ALL=en_US.utf8 $MYSQL --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=en_US.utf8 $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=en_US.utf8 $MYSQL_SHOW --default-character-set=auto ó
+--exec LC_ALL=en_US.utf8 $MYSQL_SHOW --default-character-set=auto "ó"
+--exec LC_ALL=en_US.utf8 $MYSQL_SHOW --default-character-set=auto "Ä‚Å‚"
+--exec LC_ALL=en_US.utf8 $MYSQL_SHOW --default-character-set=auto "цÐ"
+--exec LC_ALL=en_US.utf8 $MYSQL_CHECK --default-character-set=auto ó
+--exec LC_ALL=en_US.utf8 $MYSQL_CHECK --default-character-set=auto "ó"
+--exec LC_ALL=en_US.utf8 $MYSQL_CHECK --default-character-set=auto "Ä‚Å‚"
+--exec LC_ALL=en_US.utf8 $MYSQL_CHECK --default-character-set=auto "цÐ"
+
+SHOW DATABASES LIKE 'ó';
+SHOW DATABASES LIKE 'Ä‚Å‚';
+SHOW DATABASES LIKE 'цÐ';
+SHOW DATABASES LIKE 'ó';
+
+DROP DATABASE `ó`;
+DROP DATABASE `Ä‚Å‚`;
+DROP DATABASE `цÐ`;
+DROP DATABASE `ó`;
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index d1f97d7287e..8bcbe064b68 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -89,3 +89,10 @@ DROP USER mysqltest1@'%';
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
eval set GLOBAL sql_mode=default;
+
+#
+# Test the --upgrade-system-tables option
+#
+--replace_result $MYSQLTEST_VARDIR var
+--exec $MYSQL_UPGRADE --skip-verbose --upgrade-system-tables
+
diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test
index 839ecf00b60..eb59e60eefe 100644
--- a/mysql-test/t/mysqladmin.test
+++ b/mysql-test/t/mysqladmin.test
@@ -4,7 +4,7 @@
# Test "mysqladmin ping"
#
---exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
+--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
#
@@ -19,7 +19,7 @@ EOF
--replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/
--error 7
---exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
+--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
# When mysqladmin finds "loose-database" in .cnf file it shall print
@@ -30,6 +30,6 @@ loose-database=db2
EOF
--replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/
---exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
+--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 78661b1bbc4..1e5ce4cb0e1 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -71,8 +71,7 @@ select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=330 $MYSQLD_DATADIR/master-bin.000002
-
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=331 $MYSQLD_DATADIR/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -108,7 +107,7 @@ select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=330 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=331 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 mysqlbinlog does not accept input from stdin
--disable_query_log
@@ -443,3 +442,27 @@ FLUSH LOGS;
--echo End of 5.0 tests
--echo End of 5.1 tests
+
+#
+# BUG#38468 Memory leak detected when using mysqlbinlog utility;
+#
+disable_query_log;
+RESET MASTER;
+CREATE TABLE t1 SELECT 1;
+FLUSH LOGS;
+DROP TABLE t1;
+enable_query_log;
+
+# Write an empty file for comparison
+write_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+EOF
+
+# Before fix of BUG#38468, this would generate some warnings
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 >/dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+# Make sure the command above does not generate any error or warnings
+diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+
+# Cleanup for this part of test
+remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index d6be029ea56..6089b83e42d 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -50,15 +50,15 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=609 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=609 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=609 --stop-position 726 $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -84,11 +84,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --start-position=609 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --stop-position=135 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -111,15 +111,15 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=609 --stop-position 726 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -142,11 +142,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
+--exec $MYSQL_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=134 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
+--exec $MYSQL_BINLOG --short-form --stop-position=135 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 986b5aba385..831aba72fb5 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -178,7 +178,7 @@ SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
--echo mysqlcheck --fix-db-names --fix-table-names --all-databases
---exec $MYSQL_CHECK --fix-db-names --fix-table-names --all-databases
+--exec $MYSQL_CHECK --default-character-set=utf8 --fix-db-names --fix-table-names --all-databases
USE `a@b`;
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 45b13f141f7..9f2fc22da99 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -109,7 +109,7 @@ create user user_1@localhost;
grant all on mysqltest.* to user_1@localhost;
connect (con28181_1,localhost,user_1,,mysqltest);
---error ER_DBACCESS_DENIED_ERROR
+--error ER_ACCESS_DENIED_ERROR
eval select schema_name
into outfile "../../tmp/outfile-test.4"
fields terminated by ',' optionally enclosed by '"'
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 0ff4b118426..f23cb73daf6 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -372,12 +372,12 @@ drop table t1;
#
# BUG 16002: Handle unsigned integer functions properly
#
---error ER_PARSE_ERROR
+--error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
---error ER_PARSE_ERROR
+--error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
@@ -1410,7 +1410,7 @@ PARTITION BY LIST (a)
SHOW CREATE TABLE t1;
DROP TABLE t1;
---error ER_PARSE_ERROR
+--error ER_NULL_IN_VALUES_LESS_THAN
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test
new file mode 100644
index 00000000000..9e47b94b036
--- /dev/null
+++ b/mysql-test/t/partition_column.test
@@ -0,0 +1,426 @@
+#
+# Tests for the new column list partitioning introduced in second
+# version for partitioning.
+#
+--source include/have_partition.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# BUG#49180, Possible to define empty intervals for column list partitioning
+#
+--error ER_RANGE_NOT_INCREASING_ERROR
+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 ER_RANGE_NOT_INCREASING_ERROR
+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));
+
+#
+# BUG#48161, Delivering too few records using collate syntax with partitions
+#
+# Test case from BUG#48447 with some extension
+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;
+select * from t1 where a <> 'B' collate latin1_bin;
+alter table t1 remove partitioning;
+select * from t1 where a > 'B' collate latin1_bin;
+select * from t1 where a <> 'B' collate latin1_bin;
+drop table t1;
+
+# Test case from BUG#48161
+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;
+alter table t1 remove partitioning;
+select * from t1 where b <> 'a' collate latin1_bin AND
+ a = 'A' collate latin1_bin;
+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;
+drop table t1;
+
+#
+# BUG#48165, sql_mode gives error
+#
+set @@sql_mode=allow_invalid_dates;
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+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 ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+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'));
+set @@sql_mode='';
+
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+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));
+
+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";
+show create table t1;
+drop table t1;
+
+--error ER_NULL_IN_VALUES_LESS_THAN
+create table t1 (a int, b int)
+partition by range columns (a,b)
+(partition p0 values less than (NULL, maxvalue));
+
+--error ER_MAXVALUE_IN_VALUES_IN, ER_PARSE_ERROR
+create table t1 (a int, b int)
+partition by list columns(a,b)
+( partition p0 values in ((maxvalue, 0)));
+
+create table t1 (a int, b int)
+partition by list columns (a,b)
+( partition p0 values in ((0,0)));
+--error ER_MAXVALUE_IN_VALUES_IN, ER_PARSE_ERROR
+alter table t1 add partition
+(partition p1 values in (maxvalue, maxvalue));
+drop table t1;
+#
+# BUG#47837, Crash when two same fields in column list processing
+#
+--error ER_SAME_NAME_PARTITION_FIELD
+create table t1 (a int, b int)
+partition by key (a,a);
+--error ER_SAME_NAME_PARTITION_FIELD
+create table t1 (a int, b int)
+partition by list columns(a,a)
+( partition p values in ((1,1)));
+
+#
+# BUG#47838, List partitioning have problems with <= and >=
+#
+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;
+select * from t1 where a is null;
+explain partitions select * from t1 where a is null;
+select * from t1 where a <= 1;
+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;
+select * from t1 where a is null;
+explain partitions select * from t1 where a is null;
+select * from t1 where a <= 1;
+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";
+show create table t1;
+#
+# BUG#47754 Crash when selecting using NOT BETWEEN for column list partitioning
+#
+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;
+select * from t1 where a = 2;
+select * from t1 where a > 8;
+select * from t1 where a not between 8 and 8;
+show create table t1;
+drop table t1;
+
+--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
+create table t1 (a int)
+partition by list (a)
+( partition p0 values in (1),
+ partition p1 values in (1));
+
+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";
+show create table t1;
+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);
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (5);
+drop table t1;
+
+--error ER_PARSE_ERROR
+create table t1 (a int)
+partition by list columns(a)
+( partition p0 values in (2, 1),
+ partition p1 values in ((4), (NULL), (3)));
+
+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";
+show create table t1;
+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);
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (5);
+show create table t1;
+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";
+show create table t1;
+
+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))));
+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";
+show create table t1;
+insert into t1 values (1, 'A', 1);
+explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1;
+select * from t1 where a = 1 AND b <= 'A' and c = 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';
+drop table t1;
+
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+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 ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+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 ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+create table t1 (d bit(1))
+partition by range columns(d)
+( partition p0 values less than (0),
+ partition p1 values less than (1));
+
+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;
+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';
+drop table t1;
+
+--error ER_PARSE_ERROR
+create table t1 (a int, b int)
+partition by list columns(a,b)
+(partition p0 values in ((maxvalue,maxvalue)));
+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';
+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;
+drop table t1;
+
+-- error 1054
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (H23456),
+ partition p1 values less than (M23456));
+
+-- error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (23456),
+ partition p1 values less than (23456));
+
+-- error 1064
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (10));
+
+-- error ER_PARTITION_COLUMN_LIST_ERROR
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (1,1,1);
+
+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));
+
+-- error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (11,0);
+insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
+select * from t1;
+
+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;
+select * from t1 where b < 2;
+explain partitions select * from t1 where b < 4;
+select * from t1 where b < 4;
+
+alter table t1 reorganize partition p1 into
+(partition p11 values less than (2,2),
+ partition p12 values less than (3,3));
+
+-- error ER_REORG_OUTSIDE_RANGE
+alter table t1 reorganize partition p0 into
+(partition p01 values less than (0,3),
+ partition p02 values less than (1,1));
+
+-- error ER_PARTITION_COLUMN_LIST_ERROR
+alter table t1 reorganize partition p2 into
+(partition p2 values less than(9,6,1));
+
+-- error ER_PARTITION_COLUMN_LIST_ERROR
+alter table t1 reorganize partition p2 into
+(partition p2 values less than (10));
+
+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;
+select * from t1 where b < 4;
+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);
+#select * from t1 where a = 0 and b = 0;
+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/t/partition_column_prune.test b/mysql-test/t/partition_column_prune.test
new file mode 100644
index 00000000000..848825ba71b
--- /dev/null
+++ b/mysql-test/t/partition_column_prune.test
@@ -0,0 +1,71 @@
+#
+# Partition pruning tests for new COLUMN LIST feature
+#
+-- source include/have_partition.inc
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+
+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';
+select * from t1 where a = 'a' AND c = 'd';
+drop table t1;
+
+## COLUMN_LIST partition pruning tests
+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;
+explain partitions select * from t2 where a > 35 and a < 45;
+
+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;
+explain partitions select * from t1 where a=4;
+explain partitions select * from t1 where a=2 and b < 22;
+
+drop table t1;
diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test
index 7440a9bf3a3..0a9fae15354 100644
--- a/mysql-test/t/partition_datatype.test
+++ b/mysql-test/t/partition_datatype.test
@@ -4,6 +4,7 @@
# as partition by key
# Created to verify the fix for Bug#31705
# Partitions: crash if varchar length > 65530
+# BUG#48164 limited size to 3072 bytes
#
-- source include/have_partition.inc
@@ -192,27 +193,29 @@ create table t1 (a set('y','n')) partition by key (a);
insert into t1 values ('y');
select * from t1 where 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';
select * from t1 where a like 'aaa%';
select * from t1 where 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';
select * from t1 where a like 'aaa%';
select * from t1 where 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';
select * from t1 where a like 'aaa%';
select * from t1 where a = 'bbbb';
drop table t1;
+-- error ER_PARTITION_FIELDS_TOO_LONG
+create table t1 (a varchar(3070)) partition by key (a);
-- error ER_TOO_BIG_ROWSIZE
create table t1 (a varchar(65533)) partition by key (a);
-- error ER_TOO_BIG_ROWSIZE
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 49632f95dfb..eb7a4942f5b 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -180,7 +180,7 @@ partitions 3
(partition x1, partition x2);
#
-# Partition by key specified 3 partitions but only defined 2 => error
+# Partition by hash, random function
#
--error 1064
CREATE TABLE t1 (
@@ -193,7 +193,7 @@ partitions 2
(partition x1, partition x2);
#
-# Partition by key specified 3 partitions but only defined 2 => error
+# Partition by range, random function
#
--error 1064
CREATE TABLE t1 (
@@ -206,7 +206,7 @@ partitions 2
(partition x1 values less than (0), partition x2 values less than (2));
#
-# Partition by key specified 3 partitions but only defined 2 => error
+# Partition by list, random function
#
--error 1064
CREATE TABLE t1 (
@@ -452,7 +452,7 @@ partitions 2
#
# Partition by range, inconsistent partition function and constants
#
---error 1064
+--error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -522,7 +522,7 @@ partitions 2
#
# Partition by range, missing parenthesis
#
---error 1064
+--error ER_PARTITION_WRONG_VALUES_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -536,7 +536,7 @@ partitions 2
#
# Partition by range, maxvalue in wrong place
#
---error 1064
+--error ER_PARTITION_MAXVALUE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -550,7 +550,7 @@ partitions 2
#
# Partition by range, maxvalue in several places
#
---error 1064
+--error ER_PARTITION_MAXVALUE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -765,7 +765,7 @@ partitions 2
#
# Partition by list, wrong constant result type (not INT)
#
---error 1064
+--error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 36e3edf05aa..2e08834cfc7 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -6,6 +6,51 @@ drop table if exists t1;
--enable_warnings
#
+# BUG#47774, Assertion failure in InnoDB using column list partitioning
+#
+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;
+
+#
+# BUG#47776, Failed to update for MEMORY engine, crash for InnoDB and success for MyISAM
+#
+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;
+
+#
# Bug#47029: Crash when reorganize partition with subpartition
#
create table t1 (a int not null,
diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test
index 1c76de9d55a..8d2ec88e0f4 100644
--- a/mysql-test/t/partition_list.test
+++ b/mysql-test/t/partition_list.test
@@ -40,6 +40,8 @@ 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";
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);
diff --git a/mysql-test/t/partition_mgm_err.test b/mysql-test/t/partition_mgm_err.test
index 0f8b8d3cd90..f921fa8ebca 100644
--- a/mysql-test/t/partition_mgm_err.test
+++ b/mysql-test/t/partition_mgm_err.test
@@ -61,7 +61,7 @@ ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (5));
---error ER_REORG_OUTSIDE_RANGE
+--error ER_RANGE_NOT_INCREASING_ERROR
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (4),
PARTITION x11 VALUES LESS THAN (2));
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 11e65be45fc..fd3f7f2c322 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -51,6 +51,26 @@ INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
ALTER TABLE t1 DROP KEY a;
--source include/partition_date_range.inc
DROP TABLE t1;
+--echo # 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')));
+if ($verify_without_partitions)
+{
+ALTER TABLE t1 REMOVE PARTITIONING;
+}
+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');
+--source include/partition_date_range.inc
+--echo # test without index
+ALTER TABLE t1 DROP KEY a;
+--source include/partition_date_range.inc
+DROP TABLE t1;
+
#
# Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
@@ -1159,3 +1179,22 @@ INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
-- echo must use p0 only:
explain partitions select * from t1 where recdate < '2006-01-01 00:00:00';
drop table t1;
+
+-- echo #
+-- echo # BUG#33730 Full table scan instead selected partitions for query more than 10 partitions
+-- echo #
+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;
+
+# this will use interval_via_walking
+explain partitions select * from t1 where a between 10 and 13;
+explain partitions select * from t1 where a between 10 and 10+33;
+
+drop table t0, t1;
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index c02d9049f2e..07c345faed5 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -9,6 +9,78 @@
drop table if exists t1, t2;
--enable_warnings
+--error ER_NULL_IN_VALUES_LESS_THAN
+create table t1 (a int)
+partition by range (a)
+( partition p0 values less than (NULL),
+ partition p1 values less than (MAXVALUE));
+#
+# Merge fix of bug#27927 for TO_SECONDS function
+#
+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";
+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';
+explain partitions select * from t1 where a < '2007-03-08 00:00:01';
+explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
+explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
+explain partitions select * from t1 where a < '2007-03-07 23:59:59';
+drop table t1;
+#
+# New test cases for new function to_seconds
+#
+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;
+explain partitions select * from t1 where a <= '2003-12-31';
+select * from t1 where a <= '2003-12-31';
+explain partitions select * from t1 where a <= '2005-01-01';
+select * from t1 where a <= '2005-01-01';
+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;
+explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
+select * from t1 where a <= '2004-01-01 11:59:59';
+explain partitions select * from t1 where a <= '2005-01-01';
+select * from t1 where a <= '2005-01-01';
+drop table t1;
+
+#
+# Adding new test cases for column list variant for partitioning
+#
+--error 1064
+create table t1 (a int, b char(20))
+partition by range columns(a,b)
+(partition p0 values less than (1));
+
+--error ER_TOO_MANY_VALUES_ERROR
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+
+--error ER_TOO_MANY_VALUES_ERROR
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+
+create table t1 (a int, b char(20))
+partition by range columns(b)
+(partition p0 values less than ("b"));
+drop table t1;
+
#
# BUG 33429: Succeeds in adding partition when maxvalue on last partition
#
diff --git a/mysql-test/t/partition_truncate.test b/mysql-test/t/partition_truncate.test
new file mode 100644
index 00000000000..93b9cf62d14
--- /dev/null
+++ b/mysql-test/t/partition_truncate.test
@@ -0,0 +1,26 @@
+#
+# Simple tests to verify truncate partition syntax
+#
+--source include/have_partition.inc
+--disable_warnings
+drop table if exists t1, t2, t3, t4;
+--enable_warnings
+
+create table t1 (a int)
+partition by list (a)
+(partition p1 values in (0));
+--error ER_WRONG_PARTITION_NAME
+alter table t1 truncate partition p1,p1;
+--error ER_WRONG_PARTITION_NAME
+alter table t1 truncate partition p0;
+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));
+--error ER_WRONG_PARTITION_NAME
+alter table t1 truncate partition sp1;
+drop table t1;
diff --git a/mysql-test/t/partition_utf8.test b/mysql-test/t/partition_utf8.test
new file mode 100644
index 00000000000..d3ad7ba671e
--- /dev/null
+++ b/mysql-test/t/partition_utf8.test
@@ -0,0 +1,42 @@
+# Tests for Column list which requires utf8 output
+--source include/have_partition.inc
+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;
+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;
+drop table t1;
+
+#
+# BUG#48164, too long partition fields causes crash
+#
+--error ER_PARTITION_FIELDS_TOO_LONG
+create table t1 (a varchar(1500), b varchar(1570))
+partition by list columns(a,b)
+( partition p0 values in (('a','b')));
+
+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';
+drop table t1;
+
+#
+# BUG#48163, Dagger in UCS2 not working as partition value
+#
+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;
+insert into t1 values ('');
+insert into t1 values (_ucs2 0x2020);
+drop table t1;
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 788a7b336ef..0bf86b47dd7 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -22,6 +22,12 @@ SELECT * FROM t1;
DROP TABLE t1;
+# a couple of tests for variables
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+show variables like 'example%';
+
UNINSTALL PLUGIN example;
--error 1305
UNINSTALL PLUGIN EXAMPLE;
diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test
index 275c2d77c4a..afbce04b966 100644
--- a/mysql-test/t/profiling.test
+++ b/mysql-test/t/profiling.test
@@ -1,4 +1,4 @@
---source include/have_community_features.inc
+--source include/have_profiling.inc
# Verify that the protocol isn't violated if we ask for profiling info
# before profiling has recorded anything.
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index db5994d434b..844be582290 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3009,5 +3009,209 @@ execute stmt;
drop table t1;
deallocate prepare stmt;
+###########################################################################
+--echo
--echo End of 5.1 tests.
+
+###########################################################################
+
+--echo
+--echo #
+--echo # WL#4435: Support OUT-parameters in prepared statements.
+--echo #
+--echo
+
+# The idea of this test case is to check that
+# - OUT-parameters of four allowed types (string, double, int, decimal) work
+# properly;
+# - INOUT and OUT parameters work properly;
+# - A mix of IN and OUT parameters work properly;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p_string;
+DROP PROCEDURE IF EXISTS p_double;
+DROP PROCEDURE IF EXISTS p_int;
+DROP PROCEDURE IF EXISTS p_decimal;
+--enable_warnings
+
+delimiter |;
+
+--echo
+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|
+
+--echo
+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|
+
+--echo
+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|
+
+--echo
+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|
+
+delimiter ;|
+
+--echo
+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(?, ?, ?, ?)';
+
+--echo
+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;
+
+--echo
+--echo -- Testing strings...
+
+--echo
+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;
+
+--echo
+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;
+
+--echo
+--echo -- Testing doubles...
+
+--echo
+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;
+
+--echo
+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;
+
+--echo
+--echo -- Testing ints...
+
+--echo
+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;
+
+--echo
+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;
+
+--echo
+--echo -- Testing decs...
+
+--echo
+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;
+
+--echo
+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;
+
+--echo
+DEALLOCATE PREPARE stmt_str;
+DEALLOCATE PREPARE stmt_dbl;
+DEALLOCATE PREPARE stmt_int;
+DEALLOCATE PREPARE stmt_dec;
+
+--echo
+DROP PROCEDURE p_string;
+DROP PROCEDURE p_double;
+DROP PROCEDURE p_int;
+DROP PROCEDURE p_decimal;
+
+#
+# Another test case for WL#4435: check out parameters in Dynamic SQL.
+#
+
+--echo
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+--enable_warnings
+
+--echo
+
+CREATE PROCEDURE p1(OUT v1 CHAR(10))
+ SET v1 = 'test1';
+
+--echo
+
+delimiter |;
+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|
+delimiter ;|
+
+--echo
+
+CALL p2(@a);
+SELECT @a;
+
+--echo
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+--echo
+--echo # End of WL#4435.
+
+###########################################################################
+
+--echo
+--echo End of 6.0 tests.
+
+###########################################################################
diff --git a/mysql-test/t/query_cache_disabled-master.opt b/mysql-test/t/query_cache_disabled-master.opt
new file mode 100644
index 00000000000..d7d47164883
--- /dev/null
+++ b/mysql-test/t/query_cache_disabled-master.opt
@@ -0,0 +1 @@
+--query_cache_type=0
diff --git a/mysql-test/t/query_cache_disabled.test b/mysql-test/t/query_cache_disabled.test
new file mode 100644
index 00000000000..cbc98bd94d6
--- /dev/null
+++ b/mysql-test/t/query_cache_disabled.test
@@ -0,0 +1,15 @@
+-- source include/have_query_cache.inc
+#
+# Bug#38551 query cache can still consume [very little] cpu time even when it is off.
+#
+SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
+--error ER_QUERY_CACHE_DISABLED
+SET GLOBAL query_cache_type=ON;
+--error ER_QUERY_CACHE_DISABLED
+SET GLOBAL query_cache_type=DEMAND;
+--error ER_QUERY_CACHE_DISABLED
+SET GLOBAL query_cache_type=OFF;
+SET GLOBAL query_cache_size=1024*1024;
+SHOW GLOBAL VARIABLES LIKE 'query_cache_size';
+SET GLOBAL query_cache_size=0;
+
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 0ce807ae73e..0e4af16dd1f 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -629,7 +629,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;
diff --git a/mysql-test/t/signal.test b/mysql-test/t/signal.test
new file mode 100644
index 00000000000..bdb6625ba32
--- /dev/null
+++ b/mysql-test/t/signal.test
@@ -0,0 +1,2685 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for SIGNAL and RESIGNAL
+
+--echo #
+--echo # PART 1: syntax
+--echo #
+
+--echo #
+--echo # Test every new reserved and non reserved keywords
+--echo #
+
+--disable_warnings
+drop table if exists signal_non_reserved;
+--enable_warnings
+
+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;
+
+--disable_warnings
+drop table if exists diag_non_reserved;
+--enable_warnings
+
+create table diag_non_reserved (
+ diagnostics int,
+ current int,
+ stacked int,
+ exception int
+);
+
+drop table diag_non_reserved;
+
+--disable_warnings
+drop table if exists diag_cond_non_reserved;
+--enable_warnings
+
+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;
+
+--disable_warnings
+drop table if exists diag_stmt_non_reserved;
+--enable_warnings
+
+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;
+
+--disable_warnings
+drop table if exists test_reserved;
+--enable_warnings
+
+--error ER_PARSE_ERROR
+create table test_reserved (signal int);
+
+--error ER_PARSE_ERROR
+create table test_reserved (resignal int);
+
+--error ER_PARSE_ERROR
+create table test_reserved (condition int);
+
+--echo #
+--echo # Test the SIGNAL syntax
+--echo #
+
+--disable_warnings
+drop procedure if exists test_invalid;
+drop procedure if exists test_signal_syntax;
+drop function if exists test_signal_func;
+--enable_warnings
+
+delimiter $$;
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL;
+end $$
+
+--error ER_SP_COND_MISMATCH
+create procedure test_invalid()
+begin
+ SIGNAL foo;
+end $$
+
+--error ER_SIGNAL_BAD_CONDITION_TYPE
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR 1234;
+ SIGNAL foo;
+end $$
+
+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 $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+
+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 $$
+
+--error ER_SP_BAD_SQLSTATE
+SIGNAL SQLSTATE '00000' $$
+
+--error ER_SP_BAD_SQLSTATE
+SIGNAL SQLSTATE '00001' $$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '00000';
+end $$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '00001';
+end $$
+
+--echo #
+--echo # Test conditions information that SIGNAL can not set
+--echo #
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET bla_bla = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET CONDITION_IDENTIFIER = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET CONDITION_NUMBER = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET CONNECTION_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET MESSAGE_LENGTH = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET MESSAGE_OCTET_LENGTH = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET PARAMETER_MODE = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET PARAMETER_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET PARAMETER_ORDINAL_POSITION = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET RETURNED_SQLSTATE = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET ROUTINE_CATALOG = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET ROUTINE_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET ROUTINE_SCHEMA = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET SERVER_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET SPECIFIC_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET TRIGGER_CATALOG = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET TRIGGER_NAME = 'foo';
+end $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ SIGNAL SQLSTATE '12345' SET TRIGGER_SCHEMA = 'foo';
+end $$
+
+delimiter ;$$
+
+--echo #
+--echo # Test the RESIGNAL syntax
+--echo #
+
+--disable_warnings
+drop procedure if exists test_invalid;
+drop procedure if exists test_resignal_syntax;
+--enable_warnings
+
+delimiter $$;
+
+--error ER_SP_COND_MISMATCH
+create procedure test_invalid()
+begin
+ RESIGNAL foo;
+end $$
+
+create procedure test_resignal_syntax()
+begin
+ RESIGNAL;
+end $$
+drop procedure test_resignal_syntax $$
+
+--error ER_SIGNAL_BAD_CONDITION_TYPE
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR 1234;
+ RESIGNAL foo;
+end $$
+
+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 $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ RESIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ RESIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+
+--error ER_DUP_SIGNAL_SET
+create procedure test_invalid()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ RESIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+
+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 $$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure test_invalid()
+begin
+ RESIGNAL SQLSTATE '00000';
+end $$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure test_invalid()
+begin
+ RESIGNAL SQLSTATE '00001';
+end $$
+
+delimiter ;$$
+
+--echo #
+--echo # PART 2: non preparable statements
+--echo #
+
+--error ER_UNSUPPORTED_PS
+prepare stmt from 'SIGNAL SQLSTATE \'23000\'';
+
+--error ER_UNSUPPORTED_PS
+prepare stmt from 'RESIGNAL SQLSTATE \'23000\'';
+
+--echo #
+--echo # PART 3: runtime execution
+--echo #
+
+--disable_warnings
+drop procedure if exists test_signal;
+drop procedure if exists test_resignal;
+drop table if exists t_warn;
+drop table if exists t_cursor;
+--enable_warnings
+
+# Helper tables
+create table t_warn(a integer(2));
+create table t_cursor(a integer);
+
+--echo #
+--echo # SIGNAL can also appear in a query
+--echo #
+
+--error ER_SP_COND_MISMATCH
+SIGNAL foo;
+
+SIGNAL SQLSTATE '01000';
+
+--error ER_SIGNAL_NOT_FOUND
+SIGNAL SQLSTATE '02000';
+
+--error ER_SIGNAL_EXCEPTION
+SIGNAL SQLSTATE '23000';
+
+--error ER_SIGNAL_EXCEPTION
+SIGNAL SQLSTATE VALUE '23000';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65536;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 99999;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 4294967295;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 0;
+
+--error ER_PARSE_ERROR
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = -1;
+
+--error 65535
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65535;
+
+--echo #
+--echo # RESIGNAL can also appear in a query
+--echo #
+
+--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
+RESIGNAL;
+
+--error ER_SP_COND_MISMATCH
+RESIGNAL foo;
+
+--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
+RESIGNAL SQLSTATE '12345';
+
+--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
+RESIGNAL SQLSTATE VALUE '12345';
+
+--echo #
+--echo # Different kind of SIGNAL conditions
+--echo #
+
+delimiter $$;
+
+create procedure test_signal()
+begin
+ # max range
+ DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+ SIGNAL foo SET MYSQL_ERRNO = 65535;
+end $$
+
+--error 65535
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # max range
+ DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+ SIGNAL foo SET MYSQL_ERRNO = 65536;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Error
+ DECLARE foo CONDITION FOR SQLSTATE '99999';
+ SIGNAL foo SET MYSQL_ERRNO = 9999;
+end $$
+
+--error 9999
+call test_signal() $$
+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() $$
+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 $$
+
+--error ER_SP_FETCH_NO_DATA
+call test_signal() $$
+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 $$
+
+--error ER_SP_CURSOR_ALREADY_OPEN
+call test_signal() $$
+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 $$
+
+--error ER_LOCK_DEADLOCK
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Unknown -> error
+ DECLARE foo CONDITION FOR SQLSTATE "99999";
+ SIGNAL foo;
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # warning, no subclass
+ DECLARE warn CONDITION FOR SQLSTATE "01000";
+ SIGNAL warn;
+end $$
+
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # warning, with subclass
+ DECLARE warn CONDITION FOR SQLSTATE "01123";
+ SIGNAL warn;
+end $$
+
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Not found, no subclass
+ DECLARE not_found CONDITION FOR SQLSTATE "02000";
+ SIGNAL not_found;
+end $$
+
+--error ER_SIGNAL_NOT_FOUND
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Not found, with subclass
+ DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+ SIGNAL not_found;
+end $$
+
+--error ER_SIGNAL_NOT_FOUND
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Error, no subclass
+ DECLARE error CONDITION FOR SQLSTATE "12000";
+ SIGNAL error;
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Error, with subclass
+ DECLARE error CONDITION FOR SQLSTATE "12ABC";
+ SIGNAL error;
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Severe error, no subclass
+ DECLARE error CONDITION FOR SQLSTATE "40000";
+ SIGNAL error;
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ # Severe error, with subclass
+ DECLARE error CONDITION FOR SQLSTATE "40001";
+ SIGNAL error;
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+drop procedure test_signal $$
+
+--echo #
+--echo # Test the scope of condition
+--echo #
+
+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 $$
+
+--error 9999
+call test_signal() $$
+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 $$
+
+--error 8888
+call test_signal() $$
+drop procedure test_signal $$
+
+--echo #
+--echo # Test SET MYSQL_ERRNO
+--echo #
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '99999';
+ SIGNAL foo SET MYSQL_ERRNO = 1111;
+end $$
+
+--error 1111
+call test_signal() $$
+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() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE not_found CONDITION FOR SQLSTATE "02000";
+ SIGNAL not_found SET MYSQL_ERRNO = 1111;
+end $$
+
+--error 1111
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE "55000";
+ SIGNAL error SET MYSQL_ERRNO = 1111;
+end $$
+
+--error 1111
+call test_signal() $$
+drop procedure test_signal $$
+
+--echo #
+--echo # Test SET MESSAGE_TEXT
+--echo #
+
+--error ER_SIGNAL_EXCEPTION
+SIGNAL SQLSTATE '77777' SET MESSAGE_TEXT='' $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '77777';
+ SIGNAL foo SET
+ MESSAGE_TEXT = "",
+ MYSQL_ERRNO=5678;
+end $$
+
+--error 5678
+call test_signal() $$
+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 $$
+
+--error 9999
+call test_signal() $$
+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() $$
+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 $$
+
+--error ER_SIGNAL_NOT_FOUND
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE "55000";
+ SIGNAL error SET MESSAGE_TEXT = "Something bad happened";
+end $$
+
+--error ER_SIGNAL_EXCEPTION
+call test_signal() $$
+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() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE something CONDITION FOR SQLSTATE "01000";
+ SIGNAL something SET MESSAGE_TEXT = "";
+end $$
+
+call test_signal() $$
+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() $$
+show warnings $$
+drop procedure test_signal $$
+
+--echo #
+--echo # Test SET complex expressions
+--echo #
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ MYSQL_ERRNO = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CLASS_ORIGIN = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ SUBCLASS_ORIGIN = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CONSTRAINT_CATALOG = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CONSTRAINT_SCHEMA = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CONSTRAINT_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CATALOG_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ SCHEMA_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ TABLE_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ COLUMN_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ CURSOR_NAME = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE error CONDITION FOR SQLSTATE '99999';
+ SIGNAL error SET
+ MESSAGE_TEXT = NULL;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+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 $$
+
+--error 1234
+call test_signal() $$
+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 $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal("Parameter string", NULL) $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal(NULL, 1234) $$
+
+--error 5678
+call test_signal("Parameter string", 5678) $$
+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 $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+
+set @sqlcode= 12 $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+
+set @message_text= "User variable" $$
+
+--error 12
+call test_signal() $$
+drop procedure test_signal $$
+
+--error ER_PARSE_ERROR
+create procedure test_invalid()
+begin
+ DECLARE something CONDITION FOR SQLSTATE "AABBB";
+
+ SIGNAL something SET
+ MESSAGE_TEXT = @message_text := 'illegal',
+ MYSQL_ERRNO = @sqlcode := 1234;
+end $$
+
+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() $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE warn CONDITION FOR SQLSTATE "01234";
+
+ SIGNAL warn SET
+ MYSQL_ERRNO = 999999999999999999999999999999999999999999999999999;
+end $$
+
+--error ER_WRONG_VALUE_FOR_VAR
+call test_signal() $$
+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 $$
+
+#NOTE: the warning text for ER_TRUNCATED_WRONG_VALUE contains
+# value: '%-.128s', so the warning printed truncates the value too,
+# which affects MESSAGE_TEXT (the X is missing)
+
+call test_signal() $$
+drop procedure test_signal $$
+
+# Test that HANDLER can catch conditions raised by 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() $$
+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() $$
+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() $$
+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() $$
+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() $$
+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() $$
+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() $$
+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() $$
+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() $$
+drop procedure test_signal $$
+
+--echo #
+--echo # Test where SIGNAL can be used
+--echo #
+
+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() $$
+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 $$
+
+--error 1012
+select test_signal_func() $$
+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 $$
+
+--error 1012
+select test_signal_func() $$
+drop function test_signal_func $$
+
+--disable_warnings
+drop table if exists t1 $$
+--enable_warnings
+
+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) $$
+
+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 $$
+
+--error 1012
+insert into t1 values (3), (4) $$
+
+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 $$
+
+--error 1012
+insert into t1 values (5), (6) $$
+
+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' $$
+insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$
+
+drop table t1 $$
+
+--disable_warnings
+drop table if exists t1 $$
+drop procedure if exists p1 $$
+drop function if exists f1 $$
+--enable_warnings
+
+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 $$
+
+## FIXME : MEMORY plugin warning, valgrind leak, bug#36518
+## call p1() $$
+
+drop table t1 $$
+drop procedure p1 $$
+drop function f1 $$
+
+--echo #
+--echo # Test the RESIGNAL runtime
+--echo #
+
+# 6 tests:
+# {Signaled warning, Signaled Not Found, Signaled Error,
+# warning, not found, error} --> RESIGNAL
+
+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() $$
+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 $$
+
+--error 1012
+call test_resignal() $$
+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 $$
+
+--error 1012
+call test_resignal() $$
+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() $$
+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 $$
+
+--error ER_SP_FETCH_NO_DATA
+call test_resignal() $$
+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 $$
+
+--error ER_BAD_TABLE_ERROR
+call test_resignal() $$
+drop procedure test_resignal $$
+
+# 6 tests:
+# {Signaled warning, Signaled Not Found, Signaled Error,
+# warning, not found, error} --> RESIGNAL SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+drop procedure test_resignal $$
+
+#########################################################
+
+# 3 tests:
+# {Signaled warning}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+# 3 tests:
+# {Signaled not found}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+# 3 tests:
+# {Signaled error}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+# 3 tests:
+# {warning}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+# 3 tests:
+# {not found}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+# 3 tests:
+# {error}
+# --> RESIGNAL SQLSTATE {warning, not found, error} SET ...
+
+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() $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+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 $$
+
+--error 5555
+call test_resignal() $$
+show warnings $$
+drop procedure test_resignal $$
+
+--echo #
+--echo # More complex cases
+--echo #
+
+--disable_warnings
+drop procedure if exists peter_p1 $$
+drop procedure if exists peter_p2 $$
+--enable_warnings
+
+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
+$$
+
+#
+# Here, RESIGNAL only modifies the condition caught,
+# so there is only 1 condition at the end
+# The final SQLSTATE is 42000 (it comes from the error 1231),
+# since the condition attributes are preserved.
+#
+--error 9999
+CALL peter_p2() $$
+show warnings $$
+
+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
+$$
+
+#
+# Here, "RESIGNAL <condition>" create a new condition in the diagnostics
+# area, so that there are 4 conditions at the end.
+#
+--error 9999
+CALL peter_p2() $$
+show warnings $$
+
+drop procedure peter_p1 $$
+drop procedure peter_p2 $$
+
+#
+# Test the value of MESSAGE_TEXT in RESIGNAL when no SET MESSAGE_TEXT clause
+# is provided (the expected result is the text from the SIGNALed condition)
+#
+
+drop procedure if exists peter_p3 $$
+
+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 $$
+
+--error 2
+call peter_p3() $$
+
+# Expecting 2 conditions, both with the text "Original"
+show warnings $$
+
+drop procedure peter_p3 $$
+
+delimiter ;$$
+
+drop table t_warn;
+drop table t_cursor;
+
+--echo #
+--echo # Miscelaneous test cases
+--echo #
+
+delimiter $$;
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = 0x12; /* 18 */
+end $$
+
+-- error 18
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = 0b00010010; /* 18 */
+end $$
+
+-- error 18
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = '65'; /* 65 */
+end $$
+
+-- error 65
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = 'A'; /* illegal */
+end $$
+
+-- error ER_WRONG_VALUE_FOR_VAR
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = "65"; /* 65 */
+end $$
+
+-- error 65
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = "A"; /* illegal */
+end $$
+
+-- error ER_WRONG_VALUE_FOR_VAR
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = `65`; /* illegal */
+end $$
+
+-- error ER_BAD_FIELD_ERROR
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = `A`; /* illegal */
+end $$
+
+-- error ER_BAD_FIELD_ERROR
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ DECLARE foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL foo SET MYSQL_ERRNO = 3.141592; /* 3 */
+end $$
+
+-- error 3
+call test_signal $$
+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 $$
+
+-- error 1000
+call test_signal $$
+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 $$
+
+-- error 1000
+call test_signal $$
+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 $$
+
+-- error 1000
+call test_signal $$
+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 $$
+
+-- error 1000
+call test_signal $$
+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 $$
+
+-- error ER_BAD_FIELD_ERROR
+call test_signal $$
+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 $$
+
+-- error 1000
+call test_signal $$
+drop procedure test_signal $$
+
+-- error ER_PARSE_ERROR
+create procedure test_signal()
+begin
+ DECLARE céèçà foo CONDITION FOR SQLSTATE '12345';
+ SIGNAL céèçà SET MYSQL_ERRNO = 1000;
+end $$
+
+-- error ER_PARSE_ERROR
+create procedure test_signal()
+begin
+ DECLARE "céèçà" CONDITION FOR SQLSTATE '12345';
+ SIGNAL "céèçà" SET MYSQL_ERRNO = 1000;
+end $$
+
+-- error ER_PARSE_ERROR
+create procedure test_signal()
+begin
+ DECLARE 'céèçà' CONDITION FOR SQLSTATE '12345';
+ SIGNAL 'céèçà' SET MYSQL_ERRNO = 1000;
+end $$
+
+create procedure test_signal()
+begin
+ DECLARE `céèçà` CONDITION FOR SQLSTATE '12345';
+ SIGNAL `céèçà` SET MYSQL_ERRNO = 1000;
+end $$
+
+-- error 1000
+call test_signal $$
+drop procedure test_signal $$
+
+create procedure test_signal()
+begin
+ SIGNAL SQLSTATE '77777' SET MYSQL_ERRNO = 1000, MESSAGE_TEXT='ÃÂÃÅÄ';
+end $$
+
+# Commented until WL#751 is implemented in this version
+# -- error 1000
+# call test_signal $$
+drop procedure test_signal $$
+
+delimiter ; $$
+
diff --git a/mysql-test/t/signal_code.test b/mysql-test/t/signal_code.test
new file mode 100644
index 00000000000..d2f65647c81
--- /dev/null
+++ b/mysql-test/t/signal_code.test
@@ -0,0 +1,57 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for SIGNAL and RESIGNAL
+
+-- source include/have_debug.inc
+
+use test;
+
+--disable_warnings
+drop procedure if exists signal_proc;
+drop function if exists signal_func;
+--enable_warnings
+
+delimiter $$;
+
+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 $$
+
+delimiter ;$$
+
+show procedure code signal_proc;
+drop procedure signal_proc;
+
+show function code signal_func;
+drop function signal_func;
+
diff --git a/mysql-test/t/signal_demo1.test b/mysql-test/t/signal_demo1.test
new file mode 100644
index 00000000000..5de847ba0ba
--- /dev/null
+++ b/mysql-test/t/signal_demo1.test
@@ -0,0 +1,345 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Demonstrate how SIGNAL can be used to enforce integrity constraints.
+#
+
+# Naming:
+# - PO: Purchase Order
+# - AB: Address Book
+# - IN: Inventory
+
+# Simplified schema:
+#
+# Relation 1:
+# PO_ORDER (PK: po_id) 1:1 <---> 0:N (FK: po_id) PO_ORDER_LINE
+#
+# Relation 2:
+# IN_INVENTORY (PK: item_id) 1:1 <---> 0:N (FK: item_id) PO_ORDER_LINE
+#
+# Relation 3:
+# +--> 0:1 (PK: person_id) AB_PHYSICAL_PERSON
+# PO_ORDER (FK: cust_id) 1:1 <--|
+# +--> 0:1 (PK: company_id) AB_MORAL_PERSON
+# This is an 'arc' relationship :)
+#
+
+
+--disable_warnings
+drop database if exists demo;
+--enable_warnings
+
+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);
+
+delimiter $$;
+
+--echo #
+--echo # Schema integrity enforcement
+--echo #
+
+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
+$$
+
+--echo #
+--echo # Application helpers
+--echo #
+
+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
+$$
+
+delimiter ;$$
+
+--echo #
+--echo # Create sample data
+--echo #
+
+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;
+select * from ab_moral_person order by company_id;
+select * from in_inventory order by item_id;
+
+--echo #
+--echo # Entering an order
+--echo #
+
+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);
+
+--echo #
+--echo # Entering bad data in an order
+--echo #
+
+# There is no item 999 in in_inventory
+--error 10000
+call po_add_order_line (@my_po, 1, 999, 1);
+
+--echo #
+--echo # Entering bad data in an unknown order
+--echo #
+
+# There is no order 99 in po_order
+--error 10000
+call po_add_order_line (99, 1, 100, 1);
+
+--echo #
+--echo # Entering an order for an unknown company
+--echo #
+
+# There is no moral person of id 7
+--error 10000
+call po_create_order("M", 7, @my_po);
+
+--echo #
+--echo # Entering an order for an unknown person type
+--echo #
+
+# There is no person of type X
+--error 20000
+call po_create_order("X", 1, @my_po);
+
+/* 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);
+
+# Raw data
+select * from po_order;
+select * from po_order_line;
+
+# Creative reporting ...
+
+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
+;
+
+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;
+
+drop database demo;
+
+
diff --git a/mysql-test/t/signal_demo2.test b/mysql-test/t/signal_demo2.test
new file mode 100644
index 00000000000..fc909cb926c
--- /dev/null
+++ b/mysql-test/t/signal_demo2.test
@@ -0,0 +1,207 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Demonstrate how RESIGNAL can be used to 'catch' and 're-throw' an error
+#
+
+--disable_warnings
+drop database if exists demo;
+--enable_warnings
+
+create database demo;
+
+use demo;
+
+delimiter $$;
+
+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
+$$
+
+delimiter ;$$
+
+#
+# Code without RESIGNAL:
+# errors are apparent to the caller,
+# but there is no cleanup code,
+# so that the environment (get_lock(), temporary table) is polluted ...
+#
+call proc_top_a(1);
+
+# Expected
+--error ER_BAD_TABLE_ERROR
+call proc_top_a(2);
+
+# Dirty state
+--error ER_TABLE_EXISTS_ERROR
+call proc_top_a(3);
+
+# Dirty state
+--error ER_TABLE_EXISTS_ERROR
+call proc_top_a(1);
+
+drop temporary table if exists t1;
+
+delimiter $$;
+
+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
+$$
+
+delimiter ;$$
+
+#
+# Code with RESIGNAL:
+# errors are apparent to the caller,
+# the but cleanup code did get a chance to act ...
+#
+
+call proc_top_b(1);
+
+--error ER_BAD_TABLE_ERROR
+call proc_top_b(2);
+
+call proc_top_b(3);
+
+call proc_top_b(1);
+
+drop database demo;
+
diff --git a/mysql-test/t/signal_demo3.test b/mysql-test/t/signal_demo3.test
new file mode 100644
index 00000000000..347f1b75a79
--- /dev/null
+++ b/mysql-test/t/signal_demo3.test
@@ -0,0 +1,159 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Demonstrate how RESIGNAL can be used to print a stack trace
+#
+
+# Save defaults
+
+SET @start_global_value = @@global.max_error_count;
+SELECT @start_global_value;
+SET @start_session_value = @@session.max_error_count;
+SELECT @start_session_value;
+
+--disable_warnings
+drop database if exists demo;
+--enable_warnings
+
+create database demo;
+
+use demo;
+
+delimiter $$;
+
+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
+$$
+
+delimiter ;$$
+
+-- error ER_SIGNAL_EXCEPTION
+call proc_1();
+
+# This is the interesting part:
+# the complete call stack from the origin of failure (proc_9)
+# to the top level caller (proc_1) is available ...
+
+show warnings;
+
+SET @@session.max_error_count = 5;
+SELECT @@session.max_error_count;
+
+-- error ER_SIGNAL_EXCEPTION
+call proc_1();
+show warnings;
+
+SET @@session.max_error_count = 7;
+SELECT @@session.max_error_count;
+
+-- error ER_SIGNAL_EXCEPTION
+call proc_1();
+show warnings;
+
+SET @@session.max_error_count = 9;
+SELECT @@session.max_error_count;
+
+-- error ER_SIGNAL_EXCEPTION
+call proc_1();
+show warnings;
+
+drop database demo;
+
+# Restore defaults
+
+SET @@global.max_error_count = @start_global_value;
+SELECT @@global.max_error_count;
+SET @@session.max_error_count = @start_session_value;
+SELECT @@session.max_error_count;
+
diff --git a/mysql-test/t/signal_sqlmode.test b/mysql-test/t/signal_sqlmode.test
new file mode 100644
index 00000000000..860c145a361
--- /dev/null
+++ b/mysql-test/t/signal_sqlmode.test
@@ -0,0 +1,123 @@
+# Copyright (C) 2008 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for SIGNAL, RESIGNAL and GET DIAGNOSTICS
+
+SET @save_sql_mode=@@sql_mode;
+
+SET sql_mode='';
+
+--disable_warnings
+drop procedure if exists p;
+drop procedure if exists p2;
+drop procedure if exists p3;
+--enable_warnings
+
+delimiter $$;
+
+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
+$$
+delimiter ;$$
+
+call p;
+
+--error ER_SIGNAL_EXCEPTION
+call p2;
+
+--error ER_SIGNAL_EXCEPTION
+call p3;
+
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+
+SET sql_mode='STRICT_ALL_TABLES';
+
+delimiter $$;
+
+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
+$$
+
+delimiter ;$$
+
+--error ER_DATA_TOO_LONG
+call p;
+
+--error ER_COND_ITEM_TOO_LONG
+call p2;
+
+--error ER_COND_ITEM_TOO_LONG
+call p3;
+
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+
+SET @@sql_mode=@save_sql_mode;
+
diff --git a/mysql-test/t/sp-no-code.test b/mysql-test/t/sp-no-code.test
new file mode 100644
index 00000000000..ce16c32a270
--- /dev/null
+++ b/mysql-test/t/sp-no-code.test
@@ -0,0 +1,12 @@
+#
+# Test the debugging feature "show procedure/function code <name>"
+#
+
+-- source include/have_nodebug.inc
+
+--error ER_FEATURE_DISABLED
+show procedure code foo;
+
+--error ER_FEATURE_DISABLED
+show function code foo;
+
diff --git a/mysql-test/t/sp-vars.test b/mysql-test/t/sp-vars.test
index fe063889f81..2e7257cbcea 100644
--- a/mysql-test/t/sp-vars.test
+++ b/mysql-test/t/sp-vars.test
@@ -1448,3 +1448,42 @@ drop function f1;
drop table t1;
# End of 5.1 tests.
+
+###########################################################################
+#
+# Test case for BUG#28299: To-number conversion warnings work
+# differenly with CHAR and VARCHAR sp variables
+#
+###########################################################################
+
+--echo
+--echo ---------------------------------------------------------------
+--echo BUG#28299
+--echo ---------------------------------------------------------------
+--echo
+
+DELIMITER |;
+CREATE PROCEDURE ctest()
+BEGIN
+ DECLARE i CHAR(16);
+ DECLARE j INT;
+ SET i= 'string';
+ SET j= 1 + i;
+END|
+DELIMITER ;|
+
+CALL ctest();
+DROP PROCEDURE ctest;
+
+DELIMITER |;
+CREATE PROCEDURE vctest()
+BEGIN
+ DECLARE i VARCHAR(16);
+ DECLARE j INT;
+ SET i= 'string';
+ SET j= 1 + i;
+END|
+DELIMITER ;|
+
+CALL vctest();
+DROP PROCEDURE vctest;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 73ba62612b8..b35c10450a2 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -2882,7 +2882,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';
@@ -8334,3 +8333,53 @@ DROP PROCEDURE p5;
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
+
+#
+# Bug#39255: Stored procedures: crash if function references nonexistent table
+#
+
+--disable_warnings
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t_non_existing;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ DECLARE v INT;
+ SELECT a INTO v FROM t_non_existing;
+ RETURN 1;
+END|
+delimiter ;|
+
+CREATE TABLE t1 (a INT) ENGINE = myisam;
+INSERT INTO t1 VALUES (1);
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t1 WHERE a = f1();
+
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non
+--echo # strict SQL mode
+--echo #
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE PROCEDURE p1 ()
+COMMENT
+'12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+BEGIN
+END;
+
+SELECT comment FROM mysql.proc WHERE name = "p1";
+
+SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1";
+
+DROP PROCEDURE p1;
+
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index 0b04b9d7668..ce18b2b578e 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -592,6 +592,44 @@ select distinct f1, bug13575(f1) from t3 order by f1|
drop function bug13575|
drop table t3|
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+--echo #
+--echo # Bug #35877 Update .. WHERE with function, constraint violation, crash
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1_aux|
+DROP TABLE IF EXISTS t1_not_null|
+DROP FUNCTION IF EXISTS f1_two_inserts|
+--enable_warnings
+
+-- echo # 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|
+
+-- error ER_BAD_NULL_ERROR
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+
+-- echo # InnoDB test
+ALTER TABLE t1_not_null ENGINE = InnoDB|
+ALTER TABLE t1_aux ENGINE = InnoDB|
+
+-- error ER_BAD_NULL_ERROR
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+
+DROP TABLE t1_aux, t1_not_null|
+DROP FUNCTION f1_two_inserts|
+
#
# BUG#NNNN: New bug synopsis
diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test
index 2f2b84a9bef..68467f71ee1 100644
--- a/mysql-test/t/sp_trans_log.test
+++ b/mysql-test/t/sp_trans_log.test
@@ -35,7 +35,8 @@ reset master|
--error ER_DUP_ENTRY
insert into t2 values (bug23333(),1)|
--replace_column 2 # 5 # 6 #
-show binlog events from 106 /* with fixes for #23333 will show there is the query */|
+# the following must show there is (are) events after the query */
+source include/show_binlog_events.inc|
select count(*),@a from t1 /* must be 1,1 */|
delimiter ;|
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index 4a9f34443cb..27956bc8877 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -309,6 +309,21 @@ flush privileges;
--connection default
drop user mysqltest_32753@localhost;
+
+#
+# Bug#21099 MySQL 5.0.22 silently creates MyISAM tables even though
+# InnoDB specified.
+#
+
+SET @org_mode=@@sql_mode;
+SET @@sql_mode='traditional';
+
+# Agreed change was to add NO_ENGINE_SUBSTITUTION to TRADITIONAL sql mode.
+SELECT @@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%';
+
+SET sql_mode=@org_mode;
+
+
#
# Bug#45100: Incomplete DROP USER in case of SQL_MODE = 'PAD_CHAR_TO_FULL_LENGTH'
#
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 1e55f9d5993..3ab724a835a 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -2397,3 +2397,31 @@ SELECT * FROM t2;
DROP TABLE t1, t2;
--echo End of 5.1 tests.
+
+
+--echo #
+--echo # Bug#34453 Can't change size of file (Errcode: 1224)
+--echo #
+
+--disable_warnings
+DROP TRIGGER IF EXISTS t1_bi;
+DROP TRIGGER IF EXISTS t1_bd;
+DROP TABLE IF EXISTS t1;
+DROP TEMPORARY TABLE IF EXISTS t2;
+--enable_warnings
+
+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;
+SELECT * FROM t2;
+-- echo # Reported to give ERROR 14 (HY000):
+-- echo # Can't change size of file (Errcode: 1224)
+-- echo # on Windows
+DELETE FROM t1;
+
+DROP TABLE t1;
+DROP TEMPORARY TABLE t2;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index aec60bc2dee..db273f90425 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -247,3 +247,21 @@ select * from t1 where a between '0000-00-01' and '0000-00-02';
drop table t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug #33629: last_day function can return null, but has 'not null'
+--echo # flag set for result
+--echo #
+
+SELECT 1 FROM (SELECT LAST_DAY('0')) a;
+SELECT 1 FROM (SELECT MAKEDATE(2011,0)) a;
+
+CREATE TABLE t1 AS
+ SELECT LAST_DAY('1970-01-01') AS f1,
+ MAKEDATE(1970, 1) AS f2;
+DESCRIBE t1;
+DROP TABLE t1;
+
+--echo #
+
+--echo End of 6.0 tests
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 8a81908296f..dfe36ed0905 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -8,13 +8,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');
@@ -148,8 +148,8 @@ 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;
-select * from t1 where minvalue<=-1 and maxvalue>=-1 and datatype_id=16;
+select * from t1 where min_value<=1 and max_value>=-1 and datatype_id=16;
+select * from t1 where min_value<=-1 and max_value>=-1 and datatype_id=16;
drop table t1;
#
diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test
index 9098881e379..33b84266118 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -199,3 +199,21 @@ SELECT a,(a + 0) FROM t1 ORDER BY a;
SELECT a,(a DIV 2) FROM t1 ORDER BY a;
SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
DROP TABLE t1;
+
+#
+# Bug #28299: To-number conversion warnings work differenly with CHAR
+# and VARCHAR sp variables
+#
+# * Verify that 'Truncated incorrect DOUBLE value' is shown for 's'
+# when using both CHAR and VARCHAR.
+#
+
+CREATE TABLE t1 (a VARCHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a CHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/variables+c.test b/mysql-test/t/variables+c.test
index 0092d34133d..aa4bc6c631c 100644
--- a/mysql-test/t/variables+c.test
+++ b/mysql-test/t/variables+c.test
@@ -1,4 +1,4 @@
---source include/have_community_features.inc
+--source include/have_profiling.inc
#
# Bug#24822: Patch: uptime_since_flush_status
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 1580d7f36d7..bf91dbf570b 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -559,7 +559,7 @@ select @@lc_time_names;
--echo *** LC_TIME_NAMES: testing with string expressions
set lc_time_names=concat('de','_','DE');
select @@lc_time_names;
---error ER_UNKNOWN_ERROR
+--error ER_UNKNOWN_LOCALE
set lc_time_names=concat('de','+','DE');
select @@lc_time_names;
--echo LC_TIME_NAMES: testing with numeric expressions
@@ -572,15 +572,15 @@ set lc_time_names=en_US;
--echo LC_TIME_NAMES: testing NULL and a negative number:
--error ER_WRONG_VALUE_FOR_VAR
set lc_time_names=NULL;
---error ER_UNKNOWN_ERROR
+--error ER_UNKNOWN_LOCALE
set lc_time_names=-1;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing locale with the last ID:
-set lc_time_names=108;
+set lc_time_names=109;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
---error ER_UNKNOWN_ERROR
-set lc_time_names=109;
+--error ER_UNKNOWN_LOCALE
+set lc_time_names=110;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
@@ -948,15 +948,15 @@ SET @@global.init_file= 'x';
#
--echo #
--replace_column 2 #
-SHOW VARIABLES like 'language';
+SHOW VARIABLES like 'lc_messages_dir';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.language;
+SELECT @@session.lc_messages_dir;
--replace_column 1 #
-SELECT @@global.language;
+SELECT @@global.lc_messages_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@session.language= 'x';
+SET @@session.lc_messages_dir= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.language= 'x';
+SET @@global.lc_messages_dir= 'x';
#
--echo #
--replace_column 2 #
@@ -1227,3 +1227,165 @@ SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024;
SELECT @@GLOBAL.max_binlog_cache_size;
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
--echo End of 5.1 tests
+
+###########################################################################
+
+--echo
+--echo #
+--echo # Bug#34828: OF is taken as OFF and a value of 0 is set for variable SQL_notes.
+--echo #
+--echo
+
+--echo # Checking sql_notes...
+SET @sql_notes_saved = @@sql_notes;
+
+--echo
+SET @@sql_notes = ON;
+SELECT @@sql_notes;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@sql_notes = OF;
+SELECT @@sql_notes;
+
+--echo
+SET @@sql_notes = OFF;
+SELECT @@sql_notes;
+
+--echo
+SET @@sql_notes = @sql_notes_saved;
+
+--echo
+--echo # Checking delay_key_write...
+SET @delay_key_write_saved = @@delay_key_write;
+
+--echo
+SET GLOBAL delay_key_write = ON;
+SELECT @@delay_key_write;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL delay_key_write = OF;
+SELECT @@delay_key_write;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL delay_key_write = AL;
+SELECT @@delay_key_write;
+
+--echo
+SET GLOBAL delay_key_write = OFF;
+SELECT @@delay_key_write;
+
+--echo
+SET GLOBAL delay_key_write = ALL;
+SELECT @@delay_key_write;
+
+--echo
+SET GLOBAL delay_key_write = @delay_key_write_saved;
+
+--echo
+--echo # Checking sql_safe_updates...
+SET @sql_safe_updates_saved = @@sql_safe_updates;
+
+--echo
+SET @@sql_safe_updates = ON;
+SELECT @@sql_safe_updates;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@sql_safe_updates = OF;
+SELECT @@sql_safe_updates;
+
+--echo
+SET @@sql_safe_updates = OFF;
+SELECT @@sql_safe_updates;
+
+--echo
+SET @@sql_safe_updates = @sql_safe_updates_saved;
+
+--echo
+--echo # Checking foreign_key_checks...
+SET @foreign_key_checks_saved = @@foreign_key_checks;
+
+--echo
+SET @@foreign_key_checks = ON;
+SELECT @@foreign_key_checks;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@foreign_key_checks = OF;
+SELECT @@foreign_key_checks;
+
+--echo
+SET @@foreign_key_checks = OFF;
+SELECT @@foreign_key_checks;
+
+--echo
+SET @@foreign_key_checks = @foreign_key_checks_saved;
+
+--echo
+--echo # Checking unique_checks...
+SET @unique_checks_saved = @@unique_checks;
+
+--echo
+SET @@unique_checks = ON;
+SELECT @@unique_checks;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@unique_checks = OF;
+SELECT @@unique_checks;
+
+--echo
+SET @@unique_checks = OFF;
+SELECT @@unique_checks;
+
+--echo
+SET @@unique_checks = @unique_checks_saved;
+
+--echo
+--echo # Checking sql_buffer_result...
+SET @sql_buffer_result_saved = @@sql_buffer_result;
+
+--echo
+SET @@sql_buffer_result = ON;
+SELECT @@sql_buffer_result;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@sql_buffer_result = OF;
+SELECT @@sql_buffer_result;
+
+--echo
+SET @@sql_buffer_result = OFF;
+SELECT @@sql_buffer_result;
+
+--echo
+SET @@sql_buffer_result = @sql_buffer_result_saved;
+
+--echo
+--echo # Checking sql_quote_show_create...
+SET @sql_quote_show_create_saved = @@sql_quote_show_create;
+
+--echo
+SET @@sql_quote_show_create = ON;
+SELECT @@sql_quote_show_create;
+
+--echo
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@sql_quote_show_create = OF;
+SELECT @@sql_quote_show_create;
+
+--echo
+SET @@sql_quote_show_create = OFF;
+SELECT @@sql_quote_show_create;
+
+--echo
+SET @@sql_quote_show_create = @sql_quote_show_create_saved;
+
+--echo
+--echo # End of Bug#34828.
+--echo
+
+###########################################################################
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 175468db702..f01edb1e499 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1072,12 +1072,12 @@ 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;
connect (u2,localhost,u29908_2,,mysqltest_29908);
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 7afb800643c..21b04e7c968 100755
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
# Only the server link with this library, the client libraries and the client
# executables all link with recompiles of source found in the "mysys" directory.
# So we only need to create one version of this library, with the "static"
@@ -39,7 +37,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_
my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c
my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c
- my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c stacktrace.c
+ my_winerr.c my_winfile.c my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c stacktrace.c
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c)
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index a17b49c93ac..68fde34ee07 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -64,7 +64,7 @@ endif
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c \
CMakeLists.txt mf_soundex.c \
- my_conio.c my_wincond.c my_winthread.c
+ my_conio.c my_wincond.c my_winthread.c my_winerr.c my_winfile.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 63bbceef29b..bf2576621ce 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -42,6 +42,7 @@ extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
extern CHARSET_INFO my_charset_ucs2_persian_uca_ci;
extern CHARSET_INFO my_charset_ucs2_esperanto_uca_ci;
extern CHARSET_INFO my_charset_ucs2_hungarian_uca_ci;
+extern CHARSET_INFO my_charset_ucs2_sinhala_uca_ci;
#endif
#ifdef HAVE_CHARSET_utf8
@@ -63,6 +64,7 @@ extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
extern CHARSET_INFO my_charset_utf8_persian_uca_ci;
extern CHARSET_INFO my_charset_utf8_esperanto_uca_ci;
extern CHARSET_INFO my_charset_utf8_hungarian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_sinhala_uca_ci;
#ifdef HAVE_UTF8_GENERAL_CS
extern CHARSET_INFO my_charset_utf8_general_cs;
#endif
@@ -152,6 +154,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_ucs2_sinhala_uca_ci);
#endif
#endif
@@ -186,6 +189,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_persian_uca_ci);
add_compiled_collation(&my_charset_utf8_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf8_hungarian_uca_ci);
+ add_compiled_collation(&my_charset_utf8_sinhala_uca_ci);
#endif
#endif
diff --git a/mysys/charset.c b/mysys/charset.c
index b23ab084e90..280b2ad6091 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -42,7 +42,7 @@ get_collation_number_internal(const char *name)
{
CHARSET_INFO **cs;
for (cs= all_charsets;
- cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs < all_charsets + array_elements(all_charsets);
cs++)
{
if ( cs[0] && cs[0]->name &&
@@ -248,6 +248,7 @@ static int add_collation(CHARSET_INFO *cs)
{
#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci);
+ newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII;
#endif
}
else if (!strcmp(cs->csname, "utf8"))
@@ -280,6 +281,8 @@ static int add_collation(CHARSET_INFO *cs)
if (my_charset_is_8bit_pure_ascii(all_charsets[cs->number]))
all_charsets[cs->number]->state|= MY_CS_PUREASCII;
+ if (!my_charset_is_ascii_compatible(cs))
+ all_charsets[cs->number]->state|= MY_CS_NONASCII;
}
}
else
@@ -384,7 +387,7 @@ char *get_charsets_dir(char *buf)
DBUG_RETURN(res);
}
-CHARSET_INFO *all_charsets[256]={NULL};
+CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]={NULL};
CHARSET_INFO *default_charset_info = &my_charset_latin1;
void add_compiled_collation(CHARSET_INFO *cs)
@@ -426,7 +429,7 @@ static my_bool init_available_charsets(myf myflags)
/* Copy compiled charsets */
for (cs=all_charsets;
- cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs < all_charsets + array_elements(all_charsets);
cs++)
{
if (*cs)
@@ -466,7 +469,7 @@ uint get_charset_number(const char *charset_name, uint cs_flags)
init_available_charsets(MYF(0));
for (cs= all_charsets;
- cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs < all_charsets + array_elements(all_charsets);
cs++)
{
if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) &&
@@ -540,7 +543,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
- if (!cs_number || cs_number >= array_elements(all_charsets)-1)
+ if (!cs_number || cs_number > array_elements(all_charsets))
return NULL;
cs=get_internal_charset(cs_number, flags);
diff --git a/mysys/default.c b/mysys/default.c
index 1c021b4584f..6468cf2b35d 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -41,6 +41,29 @@
#include <winbase.h>
#endif
+/**
+ arguments separator
+
+ load_defaults() loads arguments from config file and put them
+ before the arguments from command line, this separator is used to
+ separate the arguments loaded from config file and arguments user
+ provided on command line.
+
+ Options with value loaded from config file are always in the form
+ '--option=value', while for command line options, the value can be
+ given as the next argument. Thus we used a separator so that
+ handle_options() can distinguish them.
+
+ Note: any other places that does not need to distinguish them
+ should skip the separator.
+
+ The content of arguments separator does not matter, one should only
+ check the pointer, use "----args-separator----" here to ease debug
+ if someone misused it.
+
+ See BUG#25192
+*/
+const char *args_separator= "----args-separator----";
const char *my_defaults_file=0;
const char *my_defaults_group_suffix=0;
char *my_defaults_extra_file=0;
@@ -454,10 +477,11 @@ int my_load_defaults(const char *conf_file, const char **groups,
goto err;
res= (char**) (ptr+sizeof(alloc));
res[0]= **argv; /* Copy program name */
+ /* set arguments separator */
+ res[1]= (char *)args_separator;
for (i=2 ; i < (uint) *argc ; i++)
- res[i-1]=argv[0][i];
- res[i-1]=0; /* End pointer */
- (*argc)--;
+ res[i]=argv[0][i];
+ res[i]=0; /* End pointer */
*argv=res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
if (default_directories)
@@ -487,7 +511,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
or a forced default file
*/
if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
- (args.elements + *argc +1) *sizeof(char*))))
+ (args.elements + *argc + 1 + 1) *sizeof(char*))))
goto err;
res= (char**) (ptr+sizeof(alloc));
@@ -508,12 +532,16 @@ int my_load_defaults(const char *conf_file, const char **groups,
--*argc; ++*argv; /* skip argument */
}
+ /* set arguments separator for arguments from config file and
+ command line */
+ res[args.elements+1]= (char *)args_separator;
+
if (*argc)
- memcpy((uchar*) (res+1+args.elements), (char*) ((*argv)+1),
+ memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1),
(*argc-1)*sizeof(char*));
- res[args.elements+ *argc]=0; /* last null */
+ res[args.elements+ *argc+1]=0; /* last null */
- (*argc)+=args.elements;
+ (*argc)+=args.elements+1;
*argv= (char**) res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
delete_dynamic(&args);
@@ -523,7 +551,8 @@ int my_load_defaults(const char *conf_file, const char **groups,
printf("%s would have been started with the following arguments:\n",
**argv);
for (i=1 ; i < *argc ; i++)
- printf("%s ", (*argv)[i]);
+ if ((*argv)[i] != args_separator) /* skip arguments separator */
+ printf("%s ", (*argv)[i]);
puts("");
exit(0);
}
diff --git a/mysys/default_modify.c b/mysys/default_modify.c
index 88df0122da2..b214a1df445 100644
--- a/mysys/default_modify.c
+++ b/mysys/default_modify.c
@@ -21,7 +21,7 @@
#define BUFF_SIZE 1024
#define RESERVE 1024 /* Extend buffer with this extent */
-#ifdef __WIN__
+#ifdef _WIN32
#define NEWLINE "\r\n"
#define NEWLINE_LEN 2
#else
@@ -78,7 +78,7 @@ int modify_defaults_file(const char *file_location, const char *option,
DBUG_RETURN(2);
/* my_fstat doesn't use the flag parameter */
- if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
+ if (my_fstat(my_fileno(cnf_file), &file_stat, MYF(0)))
goto malloc_err;
if (option && option_value)
@@ -213,7 +213,7 @@ int modify_defaults_file(const char *file_location, const char *option,
if (opt_applied)
{
/* Don't write the file if there are no changes to be made */
- if (my_chsize(fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
+ if (my_chsize(my_fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
MYF(MY_WME)) ||
my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
my_fwrite(cnf_file, (uchar*) file_buffer, (size_t) (dst_ptr - file_buffer),
diff --git a/mysys/errors.c b/mysys/errors.c
index 8d3303cac9f..4000c5c4e52 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -106,3 +106,8 @@ void wait_for_free_space(const char *filename, int errors)
MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC );
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
}
+
+const char **get_global_errmsgs()
+{
+ return globerrs;
+}
diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c
index 6227a05ce06..999e8cc7975 100644
--- a/mysys/mf_keycaches.c
+++ b/mysys/mf_keycaches.c
@@ -108,9 +108,9 @@ static my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
uchar *default_value)
{
DBUG_ENTER("safe_hash");
- if (hash_init(&hash->hash, &my_charset_bin, elements,
- 0, 0, (hash_get_key) safe_hash_entry_get,
- (void (*)(void*)) safe_hash_entry_free, 0))
+ if (my_hash_init(&hash->hash, &my_charset_bin, elements,
+ 0, 0, (my_hash_get_key) safe_hash_entry_get,
+ (void (*)(void*)) safe_hash_entry_free, 0))
{
hash->default_value= 0;
DBUG_RETURN(1);
@@ -137,7 +137,7 @@ static void safe_hash_free(SAFE_HASH *hash)
*/
if (hash->default_value)
{
- hash_free(&hash->hash);
+ my_hash_free(&hash->hash);
rwlock_destroy(&hash->mutex);
hash->default_value=0;
}
@@ -152,7 +152,7 @@ static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length)
uchar *result;
DBUG_ENTER("safe_hash_search");
rw_rdlock(&hash->mutex);
- result= hash_search(&hash->hash, key, length);
+ result= my_hash_search(&hash->hash, key, length);
rw_unlock(&hash->mutex);
if (!result)
result= hash->default_value;
@@ -192,7 +192,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data));
rw_wrlock(&hash->mutex);
- entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length);
+ entry= (SAFE_HASH_ENTRY*) my_hash_search(&hash->hash, key, length);
if (data == hash->default_value)
{
@@ -206,7 +206,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
/* unlink entry from list */
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (uchar*) entry);
+ my_hash_delete(&hash->hash, (uchar*) entry);
goto end;
}
if (entry)
@@ -277,7 +277,7 @@ static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data)
{
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (uchar*) entry);
+ my_hash_delete(&hash->hash, (uchar*) entry);
}
else
entry->data= new_data;
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index b1dbb22c687..b9013811b34 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -52,20 +52,13 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
if (oldsize > newlength)
{
-#if defined(HAVE_SETFILEPOINTER)
- /* This is for the moment only true on windows */
- long is_success;
- HANDLE win_file= (HANDLE) _get_osfhandle(fd);
- long length_low, length_high;
- length_low= (long) (ulong) newlength;
- length_high= (long) ((ulonglong) newlength >> 32);
- is_success= SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN);
- if (is_success == -1 && (my_errno= GetLastError()) != NO_ERROR)
+#ifdef _WIN32
+ if (my_win_chsize(fd, newlength))
+ {
+ my_errno= errno;
goto err;
- if (SetEndOfFile(win_file))
- DBUG_RETURN(0);
- my_errno= GetLastError();
- goto err;
+ }
+ DBUG_RETURN(0);
#elif defined(HAVE_FTRUNCATE)
if (ftruncate(fd, (off_t) newlength))
{
diff --git a/mysys/my_create.c b/mysys/my_create.c
index 5c9a1e027d2..d0436276d03 100644
--- a/mysys/my_create.c
+++ b/mysys/my_create.c
@@ -18,7 +18,7 @@
#include "mysys_err.h"
#include <errno.h>
#include <my_sys.h>
-#if defined(__WIN__)
+#if defined(_WIN32)
#include <share.h>
#endif
@@ -41,16 +41,12 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
FileName, CreateFlags, access_flags, MyFlags));
#if !defined(NO_OPEN_3)
- fd = open((char *) FileName, access_flags | O_CREAT,
+ fd= open((char *) FileName, access_flags | O_CREAT,
CreateFlags ? CreateFlags : my_umask);
-#elif defined(VMS)
- fd = open((char *) FileName, access_flags | O_CREAT, 0,
- "ctx=stm","ctx=bin");
-#elif defined(__WIN__)
- fd= my_sopen((char *) FileName, access_flags | O_CREAT | O_BINARY,
- SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
+#elif defined(_WIN32)
+ fd= my_win_open(FileName, access_flags | O_CREAT);
#else
- fd = open(FileName, access_flags);
+ fd= open(FileName, access_flags);
#endif
if ((MyFlags & MY_SYNC_DIR) && (fd >=0) &&
@@ -71,6 +67,7 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
if (unlikely(fd >= 0 && rc < 0))
{
int tmp= my_errno;
+ my_close(fd, MyFlags);
my_delete(FileName, MyFlags);
my_errno= tmp;
}
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index 22425ed95fd..3ab6ba399f9 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -36,7 +36,7 @@ int my_delete(const char *name, myf MyFlags)
DBUG_RETURN(err);
} /* my_delete */
-#if defined(__WIN__) && defined(__NT__)
+#if defined(__WIN__)
/*
Delete file which is possibly not closed.
diff --git a/mysys/my_dup.c b/mysys/my_dup.c
index 55f5e0c0099..5fdd6e9f364 100644
--- a/mysys/my_dup.c
+++ b/mysys/my_dup.c
@@ -29,7 +29,11 @@ File my_dup(File file, myf MyFlags)
const char *filename;
DBUG_ENTER("my_dup");
DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags));
- fd = dup(file);
+#ifdef _WIN32
+ fd= my_win_dup(file);
+#else
+ fd= dup(file);
+#endif
filename= (((uint) file < my_file_limit) ?
my_file_info[(int) file].name : "Unknown");
DBUG_RETURN(my_register_filename(fd, filename, FILE_BY_DUP,
diff --git a/mysys/my_error.c b/mysys/my_error.c
index 2cf704d0089..e2523a39d0b 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -22,7 +22,6 @@
/* Max length of a error message. Should be kept in sync with MYSQL_ERRMSG_SIZE. */
#define ERRMSGSIZE (512)
-
/* Define some external variables for error handling */
/*
@@ -49,11 +48,11 @@
*/
static struct my_err_head
{
- struct my_err_head *meh_next; /* chain link */
- const char **meh_errmsgs; /* error messages array */
- int meh_first; /* error number matching array slot 0 */
- int meh_last; /* error number matching last slot */
-} my_errmsgs_globerrs = {NULL, globerrs, EE_ERROR_FIRST, EE_ERROR_LAST};
+ struct my_err_head *meh_next; /* chain link */
+ const char** (*get_errmsgs) (); /* returns error message format */
+ int meh_first; /* error number matching array slot 0 */
+ int meh_last; /* error number matching last slot */
+} my_errmsgs_globerrs = {NULL, get_global_errmsgs, EE_ERROR_FIRST, EE_ERROR_LAST};
static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs;
@@ -67,12 +66,9 @@ static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs;
MyFlags Flags
... variable list
- RETURN
- What (*error_handler_hook)() returns:
- 0 OK
*/
-int my_error(int nr, myf MyFlags, ...)
+void my_error(int nr, myf MyFlags, ...)
{
const char *format;
struct my_err_head *meh_p;
@@ -88,15 +84,17 @@ int my_error(int nr, myf MyFlags, ...)
/* get the error message string. Default, if NULL or empty string (""). */
if (! (format= (meh_p && (nr >= meh_p->meh_first)) ?
- meh_p->meh_errmsgs[nr - meh_p->meh_first] : NULL) || ! *format)
+ meh_p->get_errmsgs()[nr - meh_p->meh_first] : NULL) || ! *format)
(void) my_snprintf (ebuff, sizeof(ebuff), "Unknown error %d", nr);
else
{
va_start(args,MyFlags);
- (void) my_vsnprintf (ebuff, sizeof(ebuff), format, args);
+ (void) my_vsnprintf_ex(&my_charset_utf8_general_ci, ebuff,
+ sizeof(ebuff), format, args);
va_end(args);
}
- DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags));
+ (*error_handler_hook)(nr, ebuff, MyFlags);
+ DBUG_VOID_RETURN;
}
@@ -111,7 +109,7 @@ int my_error(int nr, myf MyFlags, ...)
... variable list
*/
-int my_printf_error(uint error, const char *format, myf MyFlags, ...)
+void my_printf_error(uint error, const char *format, myf MyFlags, ...)
{
va_list args;
char ebuff[ERRMSGSIZE];
@@ -120,9 +118,34 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...)
error, MyFlags, errno, format));
va_start(args,MyFlags);
- (void) my_vsnprintf (ebuff, sizeof(ebuff), format, args);
+ (void) my_vsnprintf_ex(&my_charset_utf8_general_ci, ebuff,
+ sizeof(ebuff), format, args);
va_end(args);
- DBUG_RETURN((*error_handler_hook)(error, ebuff, MyFlags));
+ (*error_handler_hook)(error, ebuff, MyFlags);
+ DBUG_VOID_RETURN;
+}
+
+/*
+ Error with va_list
+
+ SYNOPSIS
+ my_printv_error()
+ error Errno
+ format Format string
+ MyFlags Flags
+ ... variable list
+*/
+
+void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
+{
+ char ebuff[ERRMSGSIZE];
+ DBUG_ENTER("my_printv_error");
+ DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s",
+ error, MyFlags, errno, format));
+
+ (void) my_vsnprintf(ebuff, sizeof(ebuff), format, ap);
+ (*error_handler_hook)(error, ebuff, MyFlags);
+ DBUG_VOID_RETURN;
}
/*
@@ -135,9 +158,9 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...)
MyFlags Flags
*/
-int my_message(uint error, const char *str, register myf MyFlags)
+void my_message(uint error, const char *str, register myf MyFlags)
{
- return (*error_handler_hook)(error, str, MyFlags);
+ (*error_handler_hook)(error, str, MyFlags);
}
@@ -163,7 +186,7 @@ int my_message(uint error, const char *str, register myf MyFlags)
!= 0 Error
*/
-int my_error_register(const char **errmsgs, int first, int last)
+int my_error_register(const char** (*get_errmsgs) (), int first, int last)
{
struct my_err_head *meh_p;
struct my_err_head **search_meh_pp;
@@ -172,7 +195,7 @@ int my_error_register(const char **errmsgs, int first, int last)
if (! (meh_p= (struct my_err_head*) my_malloc(sizeof(struct my_err_head),
MYF(MY_WME))))
return 1;
- meh_p->meh_errmsgs= errmsgs;
+ meh_p->get_errmsgs= get_errmsgs;
meh_p->meh_first= first;
meh_p->meh_last= last;
@@ -243,7 +266,7 @@ const char **my_error_unregister(int first, int last)
*search_meh_pp= meh_p->meh_next;
/* Save the return value and free the header. */
- errmsgs= meh_p->meh_errmsgs;
+ errmsgs= meh_p->get_errmsgs();
my_free((uchar*) meh_p, MYF(0));
return errmsgs;
diff --git a/mysys/my_file.c b/mysys/my_file.c
index 44bacf55307..ec0c9c425ea 100644
--- a/mysys/my_file.c
+++ b/mysys/my_file.c
@@ -97,6 +97,7 @@ uint my_set_max_open_files(uint files)
DBUG_ENTER("my_set_max_open_files");
DBUG_PRINT("enter",("files: %u my_file_limit: %u", files, my_file_limit));
+ files+= MY_FILE_MIN;
files= set_max_open_files(min(files, OS_FILE_LIMIT));
if (files <= MY_NFILE)
DBUG_RETURN(files);
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index 44156da6ae3..879acac0111 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -41,24 +41,14 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
DBUG_ENTER("my_fopen");
DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %d",
filename, flags, MyFlags));
- /*
- if we are not creating, then we need to use my_access to make sure
- the file exists since Windows doesn't handle files like "com1.sym"
- very well
- */
-#ifdef __WIN__
- if (check_if_legal_filename(filename))
- {
- errno= EACCES;
- fd= 0;
- }
- else
+
+ make_ftype(type,flags);
+
+#ifdef _WIN32
+ fd= my_win_fopen(filename, type);
+#else
+ fd= fopen(filename, type);
#endif
- {
- make_ftype(type,flags);
- fd = fopen(filename, type);
- }
-
if (fd != 0)
{
/*
@@ -66,18 +56,20 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
on some OS (SUNOS). Actually the filename save isn't that important
so we can ignore if this doesn't work.
*/
- if ((uint) fileno(fd) >= my_file_limit)
+
+ int filedesc= my_fileno(fd);
+ if ((uint)filedesc >= my_file_limit)
{
thread_safe_increment(my_stream_opened,&THR_LOCK_open);
DBUG_RETURN(fd); /* safeguard */
}
pthread_mutex_lock(&THR_LOCK_open);
- if ((my_file_info[fileno(fd)].name = (char*)
+ if ((my_file_info[filedesc].name= (char*)
my_strdup(filename,MyFlags)))
{
my_stream_opened++;
my_file_total_opened++;
- my_file_info[fileno(fd)].type = STREAM_BY_FOPEN;
+ my_file_info[filedesc].type= STREAM_BY_FOPEN;
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
DBUG_RETURN(fd);
@@ -99,6 +91,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
/* Close a stream */
+/* Close a stream */
int my_fclose(FILE *fd, myf MyFlags)
{
int err,file;
@@ -106,8 +99,13 @@ int my_fclose(FILE *fd, myf MyFlags)
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags));
pthread_mutex_lock(&THR_LOCK_open);
- file=fileno(fd);
- if ((err = fclose(fd)) < 0)
+ file= my_fileno(fd);
+#ifndef _WIN32
+ err= fclose(fd);
+#else
+ err= my_win_fclose(fd);
+#endif
+ if(err < 0)
{
my_errno=errno;
if (MyFlags & (MY_FAE | MY_WME))
@@ -138,7 +136,12 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
Filedes, Flags, MyFlags));
make_ftype(type,Flags);
- if ((fd = fdopen(Filedes, type)) == 0)
+#ifdef _WIN32
+ fd= my_win_fdopen(Filedes, type);
+#else
+ fd= fdopen(Filedes, type);
+#endif
+ if (!fd)
{
my_errno=errno;
if (MyFlags & (MY_FAE | MY_WME))
diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c
index f3b5418b906..2059e1a9f18 100644
--- a/mysys/my_fstream.c
+++ b/mysys/my_fstream.c
@@ -56,11 +56,11 @@ size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
{
if (ferror(stream))
my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
else
if (MyFlags & (MY_NABP | MY_FNABP))
my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
}
my_errno=errno ? errno : -1;
if (ferror(stream) || MyFlags & (MY_NABP | MY_FNABP))
@@ -142,7 +142,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
}
writtenbytes= (size_t) -1; /* Return that we got error */
break;
@@ -182,3 +182,14 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
DBUG_PRINT("exit",("ftell: %lu",(ulong) pos));
DBUG_RETURN((my_off_t) pos);
} /* my_ftell */
+
+
+/* Get a File corresponding to the stream*/
+int my_fileno(FILE *f)
+{
+#ifdef _WIN32
+ return my_win_fileno(f);
+#else
+ return fileno(f);
+#endif
+}
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index c7f138c7337..38fa0313c5d 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -101,7 +101,105 @@ err:
return res;
}
-#else /* FreeBSD elif linux */
+#elif defined(__WIN__)
+
+/* Workaround for BUG#32082 (Definition of VOID in my_global.h conflicts with
+windows headers) */
+#ifdef VOID
+#undef VOID
+#define VOID void
+#endif
+
+#include <iphlpapi.h>
+
+/*
+ The following typedef is for dynamically loading
+ iphlpapi.dll / GetAdaptersAddresses. Dynamic loading is
+ used because GetAdaptersAddresses is not available on Windows 2000
+ which MySQL still supports. Static linking would cause an unresolved export.
+*/
+typedef DWORD (WINAPI *pfnGetAdaptersAddresses)(IN ULONG Family,
+ IN DWORD Flags,IN PVOID Reserved,
+ OUT PIP_ADAPTER_ADDRESSES pAdapterAddresses,
+ IN OUT PULONG pOutBufLen);
+
+/*
+ my_gethwaddr - Windows version
+
+ @brief Retrieve MAC address from network hardware
+
+ @param[out] to MAC address exactly six bytes
+
+ @return Operation status
+ @retval 0 OK
+ @retval <>0 FAILED
+*/
+my_bool my_gethwaddr(uchar *to)
+{
+ PIP_ADAPTER_ADDRESSES pAdapterAddresses;
+ PIP_ADAPTER_ADDRESSES pCurrAddresses;
+ IP_ADAPTER_ADDRESSES adapterAddresses;
+ ULONG address_len;
+ my_bool return_val= 1;
+ static pfnGetAdaptersAddresses fnGetAdaptersAddresses=
+ (pfnGetAdaptersAddresses)-1;
+
+ if(fnGetAdaptersAddresses == (pfnGetAdaptersAddresses)-1)
+ {
+ /* Get the function from the DLL */
+ fnGetAdaptersAddresses= (pfnGetAdaptersAddresses)
+ GetProcAddress(LoadLibrary("iphlpapi.dll"),
+ "GetAdaptersAddresses");
+ }
+ if (!fnGetAdaptersAddresses)
+ return 1; /* failed to get function */
+ address_len= sizeof (IP_ADAPTER_ADDRESSES);
+
+ /* Get the required size for the address data. */
+ if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, &adapterAddresses, &address_len)
+ == ERROR_BUFFER_OVERFLOW)
+ {
+ pAdapterAddresses= my_malloc(address_len, 0);
+ if (!pAdapterAddresses)
+ return 1; /* error, alloc failed */
+ }
+ else
+ pAdapterAddresses= &adapterAddresses; /* one is enough don't alloc */
+
+ /* Get the hardware info. */
+ if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, pAdapterAddresses, &address_len)
+ == NO_ERROR)
+ {
+ pCurrAddresses= pAdapterAddresses;
+
+ while (pCurrAddresses)
+ {
+ /* Look for ethernet cards. */
+ if (pCurrAddresses->IfType == IF_TYPE_ETHERNET_CSMACD)
+ {
+ /* check for a good address */
+ if (pCurrAddresses->PhysicalAddressLength < 6)
+ continue; /* bad address */
+
+ /* save 6 bytes of the address in the 'to' parameter */
+ memcpy(to, pCurrAddresses->PhysicalAddress, 6);
+
+ /* Network card found, we're done. */
+ return_val= 0;
+ break;
+ }
+ pCurrAddresses= pCurrAddresses->Next;
+ }
+ }
+
+ /* Clean up memory allocation. */
+ if (pAdapterAddresses != &adapterAddresses)
+ my_free(pAdapterAddresses, 0);
+
+ return return_val;
+}
+
+#else /* __FreeBSD__ || __linux__ || __WIN__ */
/* just fail */
my_bool my_gethwaddr(uchar *to __attribute__((unused)))
{
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index e561d74f4d1..d24f328cdf0 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -121,6 +121,7 @@ int handle_options(int *argc, char ***argv,
const struct my_option *optp;
uchar* *value;
int error, i;
+ my_bool is_cmdline_arg= 1;
LINT_INIT(opt_found);
/* handle_options() assumes arg0 (program name) always exists */
@@ -130,10 +131,34 @@ int handle_options(int *argc, char ***argv,
(*argv)++; /* --- || ---- */
init_variables(longopts, init_one_value);
+ /*
+ Search for args_separator, if found, then the first part of the
+ arguments are loaded from configs
+ */
+ for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
+ {
+ if (*pos == args_separator)
+ {
+ is_cmdline_arg= 0;
+ break;
+ }
+ }
+
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
char **first= pos;
char *cur_arg= *pos;
+ if (!is_cmdline_arg && (cur_arg == args_separator))
+ {
+ is_cmdline_arg= 1;
+
+ /* save the separator too if skip unkown options */
+ if (my_getopt_skip_unknown)
+ (*argv)[argvpos++]= cur_arg;
+ else
+ (*argc)--;
+ continue;
+ }
if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */
{
char *argument= 0;
@@ -426,8 +451,12 @@ invalid value '%s'",
}
else if (optp->arg_type == REQUIRED_ARG && !optend)
{
- /* Check if there are more arguments after this one */
- if (!*++pos)
+ /* Check if there are more arguments after this one,
+
+ Note: options loaded from config file that requires value
+ should always be in the form '--option=value'.
+ */
+ if (!is_cmdline_arg || !*++pos)
{
if (my_getopt_print_errors)
my_getopt_error_reporter(ERROR_LEVEL,
diff --git a/mysys/my_handler_errors.h b/mysys/my_handler_errors.h
index c239cabb168..e4e62f47fed 100644
--- a/mysys/my_handler_errors.h
+++ b/mysys/my_handler_errors.h
@@ -1,3 +1,5 @@
+#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED
+#define MYSYS_MY_HANDLER_ERRORS_INCLUDED
/*
Errors a handler can give you
@@ -66,3 +68,4 @@ static const char *handler_error_messages[]=
"Too many active concurrent transactions"
};
+#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
diff --git a/mysys/my_init.c b/mysys/my_init.c
index a60927be693..c4fda599481 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -27,6 +27,8 @@
#ifdef _MSC_VER
#include <locale.h>
#include <crtdbg.h>
+/* WSAStartup needs winsock library*/
+#pragma comment(lib, "ws2_32")
#endif
my_bool have_tcpip=0;
static void my_win_init(void);
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index b50a606c8d8..d96e1048fd0 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -128,7 +128,7 @@ uchar* my_large_malloc_int(size_t size, myf my_flags)
{
if (my_flags & MY_WME)
fprintf(stderr,
- "Warning: Failed to allocate %lu bytesx from HugeTLB memory."
+ "Warning: Failed to allocate %lu bytes from HugeTLB memory."
" errno %d\n", (ulong) size, errno);
DBUG_RETURN(NULL);
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index c18d14fb549..033f8789b49 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -35,8 +35,7 @@
# if defined(HAVE_NDIR_H)
# include <ndir.h>
# endif
-# if defined(__WIN__)
-# include <dos.h>
+# if defined(_WIN32)
# ifdef __BORLANDC__
# include <dir.h>
# endif
@@ -92,7 +91,7 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b)
} /* comp_names */
-#if !defined(__WIN__)
+#if !defined(_WIN32)
MY_DIR *my_dir(const char *path, myf MyFlags)
{
@@ -507,19 +506,24 @@ error:
DBUG_RETURN((MY_DIR *) NULL);
} /* my_dir */
-#endif /* __WIN__ */
+#endif /* _WIN32 */
/****************************************************************************
** File status
** Note that MY_STAT is assumed to be same as struct stat
****************************************************************************/
-int my_fstat(int Filedes, MY_STAT *stat_area,
+
+int my_fstat(File Filedes, MY_STAT *stat_area,
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_fstat");
DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
+#ifdef _WIN32
+ DBUG_RETURN(my_win_fstat(Filedes, stat_area));
+#else
DBUG_RETURN(fstat(Filedes, (struct stat *) stat_area));
+#endif
}
@@ -531,11 +535,15 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
(long) stat_area, my_flags));
if ((m_used= (stat_area == NULL)))
- if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
+ if (!(stat_area= (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
goto error;
- if (! stat((char *) path, (struct stat *) stat_area) )
- DBUG_RETURN(stat_area);
-
+#ifndef _WIN32
+ if (! stat((char *) path, (struct stat *) stat_area) )
+ DBUG_RETURN(stat_area);
+#else
+ if (! my_win_stat(path, stat_area) )
+ DBUG_RETURN(stat_area);
+#endif
DBUG_PRINT("error",("Got errno: %d from stat", errno));
my_errno= errno;
if (m_used) /* Free if new area */
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index c0522ee849d..62f39bd3b71 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -22,13 +22,113 @@
#undef NO_ALARM_LOOP
#endif
#include <my_alarm.h>
-#ifdef __WIN__
-#include <sys/locking.h>
-#endif
#ifdef __NETWARE__
#include <nks/fsio.h>
#endif
+#ifdef _WIN32
+#define WIN_LOCK_INFINITE -1
+#define WIN_LOCK_SLEEP_MILLIS 100
+
+static int win_lock(File fd, int locktype, my_off_t start, my_off_t length,
+ int timeout_sec)
+{
+ LARGE_INTEGER liOffset,liLength;
+ DWORD dwFlags;
+ OVERLAPPED ov= {0};
+ HANDLE hFile= (HANDLE)my_get_osfhandle(fd);
+ DWORD lastError= 0;
+ int i;
+ int timeout_millis= timeout_sec * 1000;
+
+ DBUG_ENTER("win_lock");
+
+ liOffset.QuadPart= start;
+ liLength.QuadPart= length;
+
+ ov.Offset= liOffset.LowPart;
+ ov.OffsetHigh= liOffset.HighPart;
+
+ if (locktype == F_UNLCK)
+ {
+ if (UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+ /*
+ For compatibility with fcntl implementation, ignore error,
+ if region was not locked
+ */
+ if (GetLastError() == ERROR_NOT_LOCKED)
+ {
+ SetLastError(0);
+ DBUG_RETURN(0);
+ }
+ goto error;
+ }
+ else if (locktype == F_RDLCK)
+ /* read lock is mapped to a shared lock. */
+ dwFlags= 0;
+ else
+ /* write lock is mapped to an exclusive lock. */
+ dwFlags= LOCKFILE_EXCLUSIVE_LOCK;
+
+ /*
+ Drop old lock first to avoid double locking.
+ During analyze of Bug#38133 (Myisamlog test fails on Windows)
+ I met the situation that the program myisamlog locked the file
+ exclusively, then additionally shared, then did one unlock, and
+ then blocked on an attempt to lock it exclusively again.
+ Unlocking before every lock fixed the problem.
+ Note that this introduces a race condition. When the application
+ wants to convert an exclusive lock into a shared one, it will now
+ first unlock the file and then lock it shared. A waiting exclusive
+ lock could step in here. For reasons described in Bug#38133 and
+ Bug#41124 (Server hangs on Windows with --external-locking after
+ INSERT...SELECT) and in the review thread at
+ http://lists.mysql.com/commits/60721 it seems to be the better
+ option than not to unlock here.
+ If one day someone notices a way how to do file lock type changes
+ on Windows without unlocking before taking the new lock, please
+ change this code accordingly to fix the race condition.
+ */
+ if (!UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov) &&
+ (GetLastError() != ERROR_NOT_LOCKED))
+ goto error;
+
+ if (timeout_sec == WIN_LOCK_INFINITE)
+ {
+ if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+ goto error;
+ }
+
+ dwFlags|= LOCKFILE_FAIL_IMMEDIATELY;
+ timeout_millis= timeout_sec * 1000;
+ /* Try lock in a loop, until the lock is acquired or timeout happens */
+ for(i= 0; ;i+= WIN_LOCK_SLEEP_MILLIS)
+ {
+ if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+
+ if (GetLastError() != ERROR_LOCK_VIOLATION)
+ goto error;
+
+ if (i >= timeout_millis)
+ break;
+ Sleep(WIN_LOCK_SLEEP_MILLIS);
+ }
+
+ /* timeout */
+ errno= EAGAIN;
+ DBUG_RETURN(-1);
+
+error:
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+#endif
+
+
+
/*
Lock a part of a file
@@ -48,8 +148,9 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#ifdef __NETWARE__
int nxErrno;
#endif
+
DBUG_ENTER("my_lock");
- DBUG_PRINT("my",("Fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
fd,locktype,(long) start,(long) length,MyFlags));
#ifdef VMS
DBUG_RETURN(0);
@@ -97,29 +198,16 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
DBUG_RETURN(0);
}
}
-#elif defined(HAVE_LOCKING)
- /* Windows */
+#elif defined(_WIN32)
{
- my_bool error= FALSE;
- pthread_mutex_lock(&my_file_info[fd].mutex);
- if (MyFlags & MY_SEEK_NOT_DONE)
- {
- if( my_seek(fd,start,MY_SEEK_SET,MYF(MyFlags & ~MY_SEEK_NOT_DONE))
- == MY_FILEPOS_ERROR )
- {
- /*
- If my_seek fails my_errno will already contain an error code;
- just unlock and return error code.
- */
- DBUG_PRINT("error",("my_errno: %d (%d)",my_errno,errno));
- pthread_mutex_unlock(&my_file_info[fd].mutex);
- DBUG_RETURN(-1);
- }
- }
- error= locking(fd,locktype,(ulong) length) && errno != EINVAL;
- pthread_mutex_unlock(&my_file_info[fd].mutex);
- if (!error)
- DBUG_RETURN(0);
+ int timeout_sec;
+ if (MyFlags & MY_DONT_WAIT)
+ timeout_sec= 0;
+ else
+ timeout_sec= WIN_LOCK_INFINITE;
+
+ if(win_lock(fd, locktype, start, length, timeout_sec) == 0)
+ DBUG_RETURN(0);
}
#else
#if defined(HAVE_FCNTL)
diff --git a/mysys/my_messnc.c b/mysys/my_messnc.c
index e2431959b7a..e2dee3f6710 100644
--- a/mysys/my_messnc.c
+++ b/mysys/my_messnc.c
@@ -15,8 +15,8 @@
#include "mysys_priv.h"
-int my_message_no_curses(uint error __attribute__((unused)),
- const char *str, myf MyFlags)
+void my_message_no_curses(uint error __attribute__((unused)),
+ const char *str, myf MyFlags)
{
DBUG_ENTER("my_message_no_curses");
DBUG_PRINT("enter",("message: %s",str));
@@ -34,5 +34,5 @@ int my_message_no_curses(uint error __attribute__((unused)),
(void)fputs(str,stderr);
(void)fputc('\n',stderr);
(void)fflush(stderr);
- DBUG_RETURN(0);
+ DBUG_VOID_RETURN;
}
diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c
index 023a06fd896..303d8efaf30 100644
--- a/mysys/my_mmap.c
+++ b/mysys/my_mmap.c
@@ -27,17 +27,17 @@ int my_msync(int fd, void *addr, size_t len, int flags)
return my_sync(fd, MYF(0));
}
-#elif defined(__WIN__)
+#elif defined(_WIN32)
static SECURITY_ATTRIBUTES mmap_security_attributes=
{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
void *my_mmap(void *addr, size_t len, int prot,
- int flags, int fd, my_off_t offset)
+ int flags, File fd, my_off_t offset)
{
HANDLE hFileMap;
LPVOID ptr;
- HANDLE hFile= (HANDLE)_get_osfhandle(fd);
+ HANDLE hFile= (HANDLE)my_get_osfhandle(fd);
if (hFile == INVALID_HANDLE_VALUE)
return MAP_FAILED;
diff --git a/mysys/my_open.c b/mysys/my_open.c
index fe7f65c450b..79a4da242f9 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -17,9 +17,7 @@
#include "mysys_err.h"
#include <my_dir.h>
#include <errno.h>
-#if defined(__WIN__)
-#include <share.h>
-#endif
+
/*
Open a file
@@ -43,29 +41,8 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
DBUG_ENTER("my_open");
DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d",
FileName, Flags, MyFlags));
-#if defined(__WIN__)
- /*
- Check that we don't try to open or create a file name that may
- cause problems for us in the future (like PRN)
- */
- if (check_if_legal_filename(FileName))
- {
- errno= EACCES;
- DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
- EE_FILENOTFOUND, MyFlags));
- }
-#ifndef __WIN__
- if (Flags & O_SHARE)
- fd = sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
- MY_S_IREAD | MY_S_IWRITE);
- else
- fd = open((char *) FileName, Flags | O_BINARY,
- MY_S_IREAD | MY_S_IWRITE);
-#else
- fd= my_sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
- MY_S_IREAD | MY_S_IWRITE);
-#endif
-
+#if defined(_WIN32)
+ fd= my_win_open(FileName, Flags);
#elif !defined(NO_OPEN_3)
fd = open(FileName, Flags, my_umask); /* Normal unix */
#else
@@ -94,11 +71,14 @@ int my_close(File fd, myf MyFlags)
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
pthread_mutex_lock(&THR_LOCK_open);
+#ifndef _WIN32
do
{
err= close(fd);
} while (err == -1 && errno == EINTR);
-
+#else
+ err= my_win_close(fd);
+#endif
if (err)
{
DBUG_PRINT("error",("Got error %d on close",err));
@@ -109,7 +89,7 @@ int my_close(File fd, myf MyFlags)
if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
{
my_free(my_file_info[fd].name, MYF(0));
-#if defined(THREAD) && !defined(HAVE_PREAD)
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
pthread_mutex_destroy(&my_file_info[fd].mutex);
#endif
my_file_info[fd].type = UNOPEN;
@@ -141,11 +121,11 @@ File my_register_filename(File fd, const char *FileName, enum file_type
type_of_file, uint error_message_number, myf MyFlags)
{
DBUG_ENTER("my_register_filename");
- if ((int) fd >= 0)
+ if ((int) fd >= MY_FILE_MIN)
{
if ((uint) fd >= my_file_limit)
{
-#if defined(THREAD) && !defined(HAVE_PREAD)
+#if defined(THREAD) && !defined(HAVE_PREAD)
my_errno= EMFILE;
#else
thread_safe_increment(my_file_opened,&THR_LOCK_open);
@@ -160,7 +140,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
my_file_opened++;
my_file_total_opened++;
my_file_info[fd].type = type_of_file;
-#if defined(THREAD) && !defined(HAVE_PREAD)
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST);
#endif
pthread_mutex_unlock(&THR_LOCK_open);
@@ -187,188 +167,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
DBUG_RETURN(-1);
}
-#ifdef __WIN__
-
-extern void __cdecl _dosmaperr(unsigned long);
-
-/*
- Open a file with sharing. Similar to _sopen() from libc, but allows managing
- share delete on win32
-
- SYNOPSIS
- my_sopen()
- path fully qualified file name
- oflag operation flags
- shflag share flag
- pmode permission flags
-
- RETURN VALUE
- File descriptor of opened file if success
- -1 and sets errno if fails.
-*/
-
-File my_sopen(const char *path, int oflag, int shflag, int pmode)
-{
- int fh; /* handle of opened file */
- int mask;
- HANDLE osfh; /* OS handle of opened file */
- DWORD fileaccess; /* OS file access (requested) */
- DWORD fileshare; /* OS file sharing mode */
- DWORD filecreate; /* OS method of opening/creating */
- DWORD fileattrib; /* OS file attribute flags */
- SECURITY_ATTRIBUTES SecurityAttributes;
-
- SecurityAttributes.nLength= sizeof(SecurityAttributes);
- SecurityAttributes.lpSecurityDescriptor= NULL;
- SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT);
-
- /*
- * decode the access flags
- */
- switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
- case _O_RDONLY: /* read access */
- fileaccess= GENERIC_READ;
- break;
- case _O_WRONLY: /* write access */
- fileaccess= GENERIC_WRITE;
- break;
- case _O_RDWR: /* read and write access */
- fileaccess= GENERIC_READ | GENERIC_WRITE;
- break;
- default: /* error, bad oflag */
- errno= EINVAL;
- _doserrno= 0L; /* not an OS error */
- return -1;
- }
-
- /*
- * decode sharing flags
- */
- switch (shflag) {
- case _SH_DENYRW: /* exclusive access except delete */
- fileshare= FILE_SHARE_DELETE;
- break;
- case _SH_DENYWR: /* share read and delete access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE;
- break;
- case _SH_DENYRD: /* share write and delete access */
- fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
- break;
- case _SH_DENYNO: /* share read, write and delete access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
- break;
- case _SH_DENYRWD: /* exclusive access */
- fileshare= 0L;
- break;
- case _SH_DENYWRD: /* share read access */
- fileshare= FILE_SHARE_READ;
- break;
- case _SH_DENYRDD: /* share write access */
- fileshare= FILE_SHARE_WRITE;
- break;
- case _SH_DENYDEL: /* share read and write access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE;
- break;
- default: /* error, bad shflag */
- errno= EINVAL;
- _doserrno= 0L; /* not an OS error */
- return -1;
- }
-
- /*
- * decode open/create method flags
- */
- switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
- case 0:
- case _O_EXCL: /* ignore EXCL w/o CREAT */
- filecreate= OPEN_EXISTING;
- break;
-
- case _O_CREAT:
- filecreate= OPEN_ALWAYS;
- break;
-
- case _O_CREAT | _O_EXCL:
- case _O_CREAT | _O_TRUNC | _O_EXCL:
- filecreate= CREATE_NEW;
- break;
-
- case _O_TRUNC:
- case _O_TRUNC | _O_EXCL: /* ignore EXCL w/o CREAT */
- filecreate= TRUNCATE_EXISTING;
- break;
-
- case _O_CREAT | _O_TRUNC:
- filecreate= CREATE_ALWAYS;
- break;
-
- default:
- /* this can't happen ... all cases are covered */
- errno= EINVAL;
- _doserrno= 0L;
- return -1;
- }
-
- /*
- * decode file attribute flags if _O_CREAT was specified
- */
- fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */
- if (oflag & _O_CREAT)
- {
- _umask((mask= _umask(0)));
-
- if (!((pmode & ~mask) & _S_IWRITE))
- fileattrib= FILE_ATTRIBUTE_READONLY;
- }
-
- /*
- * Set temporary file (delete-on-close) attribute if requested.
- */
- if (oflag & _O_TEMPORARY)
- {
- fileattrib|= FILE_FLAG_DELETE_ON_CLOSE;
- fileaccess|= DELETE;
- }
-
- /*
- * Set temporary file (delay-flush-to-disk) attribute if requested.
- */
- if (oflag & _O_SHORT_LIVED)
- fileattrib|= FILE_ATTRIBUTE_TEMPORARY;
-
- /*
- * Set sequential or random access attribute if requested.
- */
- if (oflag & _O_SEQUENTIAL)
- fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN;
- else if (oflag & _O_RANDOM)
- fileattrib|= FILE_FLAG_RANDOM_ACCESS;
-
- /*
- * try to open/create the file
- */
- if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
- filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE)
- {
- /*
- * OS call to open/create file failed! map the error, release
- * the lock, and return -1. note that it's not necessary to
- * call _free_osfhnd (it hasn't been used yet).
- */
- _dosmaperr(GetLastError()); /* map error */
- return -1; /* return error to caller */
- }
-
- if ((fh= _open_osfhandle((intptr_t)osfh,
- oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1)
- {
- _dosmaperr(GetLastError()); /* map error */
- CloseHandle(osfh);
- }
- return fh; /* return handle */
-}
-#endif /* __WIN__ */
#ifdef EXTRA_DEBUG
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index 3f62f150c91..eaabcb1b728 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -15,11 +15,15 @@
#include "mysys_priv.h"
#include "mysys_err.h"
+#include "my_base.h"
+#include <m_string.h>
#include <errno.h>
-#ifdef HAVE_PREAD
+#if defined (HAVE_PREAD) && !defined(_WIN32)
#include <unistd.h>
#endif
+
+
/*
Read a chunk of bytes from a file from a given position
@@ -46,27 +50,39 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
{
size_t readbytes;
int error= 0;
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
+ int save_errno;
+#endif
DBUG_ENTER("my_pread");
- DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d",
- Filedes, (ulong) offset, (long) Buffer, (uint) Count,
- MyFlags));
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags));
for (;;)
{
-#ifndef __WIN__
- errno=0; /* Linux doesn't reset this */
-#endif
-#ifndef HAVE_PREAD
+ errno= 0; /* Linux, Windows don't reset this on EOF/success */
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
pthread_mutex_lock(&my_file_info[Filedes].mutex);
readbytes= (uint) -1;
error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 ||
- (readbytes= read(Filedes, Buffer, (uint) Count)) != Count);
+ (readbytes= read(Filedes, Buffer, Count)) != Count);
+ save_errno= errno;
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
+ if (error)
+ errno= save_errno;
#else
- if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
- my_errno= errno ? errno : -1;
+#if defined(_WIN32)
+ readbytes= my_win_pread(Filedes, Buffer, Count, offset);
+#else
+ readbytes= pread(Filedes, Buffer, Count, offset);
+#endif
+ error= (readbytes != Count);
#endif
- if (error || readbytes != Count)
+ if(error)
{
+ my_errno= errno ? errno : -1;
+ if (errno == 0 || (readbytes != (size_t) -1 &&
+ (MyFlags & (MY_NABP | MY_FNABP))))
+ my_errno= HA_ERR_FILE_TOO_SHORT;
+
DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
(int) readbytes, (uint) Count,Filedes,my_errno));
#ifdef THREAD
@@ -79,19 +95,19 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
#endif
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- if (readbytes == (size_t) -1)
- my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
- my_filename(Filedes),my_errno);
- else if (MyFlags & (MY_NABP | MY_FNABP))
- my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
- my_filename(Filedes),my_errno);
+ if (readbytes == (size_t) -1)
+ my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
+ my_filename(Filedes),my_errno);
+ else if (MyFlags & (MY_NABP | MY_FNABP))
+ my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
+ my_filename(Filedes),my_errno);
}
if (readbytes == (size_t) -1 || (MyFlags & (MY_FNABP | MY_NABP)))
- DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
+ DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
}
if (MyFlags & (MY_NABP | MY_FNABP))
- DBUG_RETURN(0); /* Read went ok; Return 0 */
- DBUG_RETURN(readbytes); /* purecov: inspected */
+ DBUG_RETURN(0); /* Read went ok; Return 0 */
+ DBUG_RETURN(readbytes); /* purecov: inspected */
}
} /* my_pread */
@@ -117,42 +133,45 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
# Number of bytes read
*/
-size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
+size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
my_off_t offset, myf MyFlags)
{
- size_t writenbytes, written;
+ size_t writtenbytes, written;
uint errors;
+
DBUG_ENTER("my_pwrite");
- DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d",
- Filedes, (ulong) offset, (long) Buffer, (uint) Count,
- MyFlags));
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, offset, Buffer, (ulong)Count, MyFlags));
errors= 0;
written= 0;
for (;;)
{
-#ifndef HAVE_PREAD
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
int error;
- writenbytes= (size_t) -1;
+ writtenbytes= (size_t) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex);
error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 &&
- (writenbytes = write(Filedes, Buffer, (uint) Count)) == Count);
+ (writtenbytes= write(Filedes, Buffer, Count)) == Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
if (error)
break;
+#elif defined (_WIN32)
+ writtenbytes= my_win_pwrite(Filedes, Buffer, Count, offset);
#else
- if ((writenbytes= pwrite(Filedes, Buffer, Count,offset)) == Count)
+ writtenbytes= pwrite(Filedes, Buffer, Count, offset);
+#endif
+ if(writtenbytes == Count)
break;
my_errno= errno;
-#endif
- if (writenbytes != (size_t) -1)
- { /* Safegueard */
- written+=writenbytes;
- Buffer+=writenbytes;
- Count-=writenbytes;
- offset+=writenbytes;
+ if (writtenbytes != (size_t) -1)
+ {
+ written+= writtenbytes;
+ Buffer+= writtenbytes;
+ Count-= writtenbytes;
+ offset+= writtenbytes;
}
- DBUG_PRINT("error",("Write only %u bytes", (uint) writenbytes));
+ DBUG_PRINT("error",("Write only %u bytes", (uint) writtenbytes));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -165,15 +184,15 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
errors++;
continue;
}
- if ((writenbytes && writenbytes != (size_t) -1) || my_errno == EINTR)
+ if ((writtenbytes && writtenbytes != (size_t) -1) || my_errno == EINTR)
continue; /* Retry */
#endif
if (MyFlags & (MY_NABP | MY_FNABP))
{
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG),
- my_filename(Filedes),my_errno);
+ my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG),
+ my_filename(Filedes),my_errno);
}
DBUG_RETURN(MY_FILE_ERROR); /* Error on read */
}
@@ -183,5 +202,5 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
DBUG_EXECUTE_IF("check", my_seek(Filedes, -1, SEEK_SET, MYF(0)););
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Want only errors */
- DBUG_RETURN(writenbytes+written); /* purecov: inspected */
+ DBUG_RETURN(writtenbytes+written); /* purecov: inspected */
} /* my_pwrite */
diff --git a/mysys/my_quick.c b/mysys/my_quick.c
index 0ba20a5bdee..b93e7e17224 100644
--- a/mysys/my_quick.c
+++ b/mysys/my_quick.c
@@ -19,11 +19,19 @@
#include "my_nosys.h"
+#ifdef _WIN32
+extern size_t my_win_read(File Filedes,uchar *Buffer,size_t Count);
+#endif
+
size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
{
size_t readbytes;
-
- if ((readbytes = read(Filedes, Buffer, (uint) Count)) != Count)
+#ifdef _WIN32
+ readbytes= my_win_read(Filedes, Buffer, Count);
+#else
+ readbytes= read(Filedes, Buffer, Count);
+#endif
+ if(readbytes != Count)
{
#ifndef DBUG_OFF
if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
@@ -40,8 +48,13 @@ size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
}
-size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
+
+size_t my_quick_write(File Filedes, const uchar *Buffer, size_t Count)
{
+#ifdef _WIN32
+ return my_win_write(Filedes, Buffer, Count);
+#else
+
#ifndef DBUG_OFF
size_t writtenbytes;
#endif
@@ -50,7 +63,7 @@ size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
#ifndef DBUG_OFF
writtenbytes =
#endif
- (size_t) write(Filedes,Buffer, (uint) Count)) != Count)
+ (size_t) write(Filedes,Buffer,Count)) != Count)
{
#ifndef DBUG_OFF
if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)
@@ -64,4 +77,5 @@ size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
return (size_t) -1;
}
return 0;
+#endif
}
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 0c302d5b227..75f9dd64f1d 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -15,9 +15,9 @@
#include "mysys_priv.h"
#include "mysys_err.h"
+#include <my_base.h>
#include <errno.h>
-
/*
Read a chunk of bytes from a file with retry's if needed
@@ -37,16 +37,25 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
{
size_t readbytes, save_count;
DBUG_ENTER("my_read");
- DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d",
- Filedes, (long) Buffer, (ulong) Count, MyFlags));
+ DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, Buffer, (ulong) Count, MyFlags));
save_count= Count;
for (;;)
{
- errno= 0; /* Linux doesn't reset this */
- if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count)
+ errno= 0; /* Linux, Windows don't reset this on EOF/success */
+#ifdef _WIN32
+ readbytes= my_win_read(Filedes, Buffer, Count);
+#else
+ readbytes= read(Filedes, Buffer, Count);
+#endif
+
+ if (readbytes != Count)
{
- my_errno= errno ? errno : -1;
+ my_errno= errno;
+ if (errno == 0 || (readbytes != (size_t) -1 &&
+ (MyFlags & (MY_NABP | MY_FNABP))))
+ my_errno= HA_ERR_FILE_TOO_SHORT;
DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
(int) readbytes, (ulong) Count, Filedes,
my_errno));
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 2c661baeff7..8502c259353 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -45,36 +45,30 @@
my_off_t my_seek(File fd, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
{
- reg1 os_off_t newpos= -1;
+ os_off_t newpos= -1;
DBUG_ENTER("my_seek");
- DBUG_PRINT("my",("Fd: %d Hpos: %lu Pos: %lu Whence: %d MyFlags: %d",
- fd, (ulong) (((ulonglong) pos) >> 32), (ulong) pos,
- whence, MyFlags));
+ DBUG_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %d",
+ fd, (ulonglong) pos, whence, MyFlags));
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
/*
Make sure we are using a valid file descriptor!
*/
DBUG_ASSERT(fd != -1);
-#if defined(THREAD) && !defined(HAVE_PREAD)
- if (MyFlags & MY_THREADSAFE)
- {
- pthread_mutex_lock(&my_file_info[fd].mutex);
- newpos= lseek(fd, pos, whence);
- pthread_mutex_unlock(&my_file_info[fd].mutex);
- }
- else
+#if defined (_WIN32)
+ newpos= my_win_lseek(fd, pos, whence);
+#else
+ newpos= lseek(fd, pos, whence);
#endif
- newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1)
{
- my_errno=errno;
- DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno));
+ my_errno= errno;
+ DBUG_PRINT("error",("lseek: %llu errno: %d", (ulonglong) newpos,errno));
DBUG_RETURN(MY_FILEPOS_ERROR);
}
if ((my_off_t) newpos != pos)
{
- DBUG_PRINT("exit",("pos: %lu", (ulong) newpos));
+ DBUG_PRINT("exit",("pos: %llu", (ulonglong) newpos));
}
DBUG_RETURN((my_off_t) newpos);
} /* my_seek */
@@ -87,15 +81,15 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
{
os_off_t pos;
DBUG_ENTER("my_tell");
- DBUG_PRINT("my",("Fd: %d MyFlags: %d",fd, MyFlags));
+ DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
DBUG_ASSERT(fd >= 0);
-#ifdef HAVE_TELL
- pos=tell(fd);
+#if defined (HAVE_TELL) && !defined (_WIN32)
+ pos= tell(fd);
#else
- pos=lseek(fd, 0L, MY_SEEK_CUR);
+ pos= my_seek(fd, 0L, MY_SEEK_CUR,0);
#endif
if (pos == (os_off_t) -1)
- my_errno=errno;
- DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
+ my_errno= errno;
+ DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos));
DBUG_RETURN((my_off_t) pos);
} /* my_tell */
diff --git a/mysys/my_static.c b/mysys/my_static.c
index a21a3d11104..62e6d402315 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@ int NEAR my_umask=0664, NEAR my_umask_dir=0777;
#ifndef THREAD
int NEAR my_errno=0;
#endif
-struct st_my_file_info my_file_info_default[MY_NFILE]= {{0,UNOPEN}};
+struct st_my_file_info my_file_info_default[MY_NFILE];
uint my_file_limit= MY_NFILE;
struct st_my_file_info *my_file_info= my_file_info_default;
@@ -87,9 +87,9 @@ ulong my_time_to_wait_for_lock=2; /* In seconds */
char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */
#endif
void (*my_abort_hook)(int) = (void(*)(int)) exit;
-int (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
+void (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
-int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
+void (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
#if defined(ENABLED_DEBUG_SYNC)
diff --git a/mysys/my_static.h b/mysys/my_static.h
index 90168b099a8..c336115bc35 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -1,3 +1,6 @@
+#ifndef MYSYS_MY_STATIC_INCLUDED
+#define MYSYS_MY_STATIC_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -72,3 +75,5 @@ extern ulonglong query_performance_frequency, query_performance_offset;
extern sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif
C_MODE_END
+
+#endif /* MYSYS_MY_STATIC_INCLUDED */
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index 97540f5eb48..6497ae59159 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -62,8 +62,8 @@ int my_sync(File fd, myf my_flags)
res= fdatasync(fd);
#elif defined(HAVE_FSYNC)
res= fsync(fd);
-#elif defined(__WIN__)
- res= _commit(fd);
+#elif defined(_WIN32)
+ res= my_win_fsync(fd);
#else
#error Cannot find a way to sync a file, durability in danger
res= 0; /* No sync (strange OS) */
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index d8c7d85ff30..b2972faf0f8 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -23,11 +23,7 @@
#include <signal.h>
#ifdef THREAD
-#ifdef USE_TLS
pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
-#else
-pthread_key(struct st_my_thread_var, THR_KEY_mysys);
-#endif /* USE_TLS */
pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open,
THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_myisam,THR_LOCK_heap,
THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time;
@@ -46,7 +42,9 @@ pthread_mutexattr_t my_fast_mutexattr;
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_t my_errorcheck_mutexattr;
#endif
-
+#ifdef _MSC_VER
+static void install_sigabrt_handler();
+#endif
#ifdef TARGET_OS_LINUX
/*
@@ -150,15 +148,18 @@ my_bool my_thread_global_init(void)
pthread_mutex_init(&THR_LOCK_threads,MY_MUTEX_INIT_FAST);
pthread_mutex_init(&THR_LOCK_time,MY_MUTEX_INIT_FAST);
pthread_cond_init(&THR_COND_threads, NULL);
-#if defined( __WIN__) || defined(OS2)
- win_pthread_init();
-#endif
+
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
pthread_mutex_init(&LOCK_localtime_r,MY_MUTEX_INIT_SLOW);
#endif
#ifndef HAVE_GETHOSTBYNAME_R
pthread_mutex_init(&LOCK_gethostbyname_r,MY_MUTEX_INIT_SLOW);
#endif
+
+#ifdef _MSC_VER
+ install_sigabrt_handler();
+#endif
+
if (my_thread_init())
{
my_thread_global_end(); /* Clean up */
@@ -259,7 +260,6 @@ my_bool my_thread_init(void)
(ulong) pthread_self());
#endif
-#if !defined(__WIN__) || defined(USE_TLS)
if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys))
{
#ifdef EXTRA_DEBUG_THREADS
@@ -268,26 +268,18 @@ my_bool my_thread_init(void)
#endif
goto end;
}
+
+#ifdef _MSC_VER
+ install_sigabrt_handler();
+#endif
+
if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp))))
{
error= 1;
goto end;
}
pthread_setspecific(THR_KEY_mysys,tmp);
-
-#else /* defined(__WIN__) && !(defined(USE_TLS) */
- /*
- Skip initialization if the thread specific variable is already initialized
- */
- if (THR_KEY_mysys.id)
- goto end;
- tmp= &THR_KEY_mysys;
-#endif
-#if defined(__WIN__) && defined(EMBEDDED_LIBRARY)
- tmp->pthread_self= (pthread_t) getpid();
-#else
tmp->pthread_self= pthread_self();
-#endif
pthread_mutex_init(&tmp->mutex,MY_MUTEX_INIT_FAST);
pthread_cond_init(&tmp->suspend, NULL);
tmp->init= 1;
@@ -343,11 +335,7 @@ void my_thread_end(void)
pthread_cond_destroy(&tmp->suspend);
#endif
pthread_mutex_destroy(&tmp->mutex);
-#if !defined(__WIN__) || defined(USE_TLS)
free(tmp);
-#else
- tmp->init= 0;
-#endif
/*
Decrement counter for number of running threads. We are using this
@@ -361,10 +349,7 @@ void my_thread_end(void)
pthread_cond_signal(&THR_COND_threads);
pthread_mutex_unlock(&THR_LOCK_threads);
}
- /* The following free has to be done, even if my_thread_var() is 0 */
-#if !defined(__WIN__) || defined(USE_TLS)
pthread_setspecific(THR_KEY_mysys,0);
-#endif
}
struct st_my_thread_var *_my_thread_var(void)
@@ -402,6 +387,15 @@ const char *my_thread_name(void)
}
return tmp->name;
}
+
+/* Return pointer to DBUG for holding current state */
+
+extern void **my_thread_var_dbug()
+{
+ struct st_my_thread_var *tmp=
+ my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
+ return tmp && tmp->init ? &tmp->dbug : 0;
+}
#endif /* DBUG_OFF */
@@ -420,4 +414,30 @@ static uint get_thread_lib(void)
return THD_LIB_OTHER;
}
+#ifdef _WIN32
+/*
+ In Visual Studio 2005 and later, default SIGABRT handler will overwrite
+ any unhandled exception filter set by the application and will try to
+ call JIT debugger. This is not what we want, this we calling __debugbreak
+ to stop in debugger, if process is being debugged or to generate
+ EXCEPTION_BREAKPOINT and then handle_segfault will do its magic.
+*/
+
+#if (_MSC_VER >= 1400)
+static void my_sigabrt_handler(int sig)
+{
+ __debugbreak();
+}
+#endif /*_MSC_VER >=1400 */
+
+static void install_sigabrt_handler(void)
+{
+#if (_MSC_VER >=1400)
+ /*abort() should not override our exception filter*/
+ _set_abort_behavior(0,_CALL_REPORTFAULT);
+ signal(SIGABRT,my_sigabrt_handler);
+#endif /* _MSC_VER >=1400 */
+}
+#endif
+
#endif /* THREAD */
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 1134d40229a..e7d8073a163 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -16,12 +16,11 @@
/*****************************************************************************
** The following is a simple implementation of posix conditions
*****************************************************************************/
+#if defined(_WIN32)
#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
-#if defined(THREAD) && defined(__WIN__)
#include <m_string.h>
-#undef getpid
#include <process.h>
#include <sys/timeb.h>
diff --git a/mysys/my_winerr.c b/mysys/my_winerr.c
new file mode 100644
index 00000000000..534078b6737
--- /dev/null
+++ b/mysys/my_winerr.c
@@ -0,0 +1,123 @@
+/* Copyright (C) 2008 MySQL AB
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Convert Windows API error (GetLastError() to Posix equivalent (errno)
+ The exported function my_osmaperr() is modelled after and borrows
+ heavily from undocumented _dosmaperr()(found of the static Microsoft C runtime).
+*/
+
+#include <my_global.h>
+#include <my_sys.h>
+
+
+struct errentry
+{
+ unsigned long oscode; /* OS return value */
+ int sysv_errno; /* System V error code */
+};
+
+static struct errentry errtable[]= {
+ { ERROR_INVALID_FUNCTION, EINVAL }, /* 1 */
+ { ERROR_FILE_NOT_FOUND, ENOENT }, /* 2 */
+ { ERROR_PATH_NOT_FOUND, ENOENT }, /* 3 */
+ { ERROR_TOO_MANY_OPEN_FILES, EMFILE }, /* 4 */
+ { ERROR_ACCESS_DENIED, EACCES }, /* 5 */
+ { ERROR_INVALID_HANDLE, EBADF }, /* 6 */
+ { ERROR_ARENA_TRASHED, ENOMEM }, /* 7 */
+ { ERROR_NOT_ENOUGH_MEMORY, ENOMEM }, /* 8 */
+ { ERROR_INVALID_BLOCK, ENOMEM }, /* 9 */
+ { ERROR_BAD_ENVIRONMENT, E2BIG }, /* 10 */
+ { ERROR_BAD_FORMAT, ENOEXEC }, /* 11 */
+ { ERROR_INVALID_ACCESS, EINVAL }, /* 12 */
+ { ERROR_INVALID_DATA, EINVAL }, /* 13 */
+ { ERROR_INVALID_DRIVE, ENOENT }, /* 15 */
+ { ERROR_CURRENT_DIRECTORY, EACCES }, /* 16 */
+ { ERROR_NOT_SAME_DEVICE, EXDEV }, /* 17 */
+ { ERROR_NO_MORE_FILES, ENOENT }, /* 18 */
+ { ERROR_LOCK_VIOLATION, EACCES }, /* 33 */
+ { ERROR_BAD_NETPATH, ENOENT }, /* 53 */
+ { ERROR_NETWORK_ACCESS_DENIED, EACCES }, /* 65 */
+ { ERROR_BAD_NET_NAME, ENOENT }, /* 67 */
+ { ERROR_FILE_EXISTS, EEXIST }, /* 80 */
+ { ERROR_CANNOT_MAKE, EACCES }, /* 82 */
+ { ERROR_FAIL_I24, EACCES }, /* 83 */
+ { ERROR_INVALID_PARAMETER, EINVAL }, /* 87 */
+ { ERROR_NO_PROC_SLOTS, EAGAIN }, /* 89 */
+ { ERROR_DRIVE_LOCKED, EACCES }, /* 108 */
+ { ERROR_BROKEN_PIPE, EPIPE }, /* 109 */
+ { ERROR_DISK_FULL, ENOSPC }, /* 112 */
+ { ERROR_INVALID_TARGET_HANDLE, EBADF }, /* 114 */
+ { ERROR_INVALID_HANDLE, EINVAL }, /* 124 */
+ { ERROR_WAIT_NO_CHILDREN, ECHILD }, /* 128 */
+ { ERROR_CHILD_NOT_COMPLETE, ECHILD }, /* 129 */
+ { ERROR_DIRECT_ACCESS_HANDLE, EBADF }, /* 130 */
+ { ERROR_NEGATIVE_SEEK, EINVAL }, /* 131 */
+ { ERROR_SEEK_ON_DEVICE, EACCES }, /* 132 */
+ { ERROR_DIR_NOT_EMPTY, ENOTEMPTY }, /* 145 */
+ { ERROR_NOT_LOCKED, EACCES }, /* 158 */
+ { ERROR_BAD_PATHNAME, ENOENT }, /* 161 */
+ { ERROR_MAX_THRDS_REACHED, EAGAIN }, /* 164 */
+ { ERROR_LOCK_FAILED, EACCES }, /* 167 */
+ { ERROR_ALREADY_EXISTS, EEXIST }, /* 183 */
+ { ERROR_FILENAME_EXCED_RANGE, ENOENT }, /* 206 */
+ { ERROR_NESTING_NOT_ALLOWED, EAGAIN }, /* 215 */
+ { ERROR_NOT_ENOUGH_QUOTA, ENOMEM } /* 1816 */
+};
+
+/* size of the table */
+#define ERRTABLESIZE (sizeof(errtable)/sizeof(errtable[0]))
+
+/* The following two constants must be the minimum and maximum
+values in the (contiguous) range of Exec Failure errors. */
+#define MIN_EXEC_ERROR ERROR_INVALID_STARTING_CODESEG
+#define MAX_EXEC_ERROR ERROR_INFLOOP_IN_RELOC_CHAIN
+
+/* These are the low and high value in the range of errors that are
+access violations */
+#define MIN_EACCES_RANGE ERROR_WRITE_PROTECT
+#define MAX_EACCES_RANGE ERROR_SHARING_BUFFER_EXCEEDED
+
+
+static int get_errno_from_oserr(unsigned long oserrno)
+{
+ int i;
+
+ /* check the table for the OS error code */
+ for (i= 0; i < ERRTABLESIZE; ++i)
+ {
+ if (oserrno == errtable[i].oscode)
+ {
+ return errtable[i].sysv_errno;
+ }
+ }
+
+ /* The error code wasn't in the table. We check for a range of */
+ /* EACCES errors or exec failure errors (ENOEXEC). Otherwise */
+ /* EINVAL is returned. */
+
+ if (oserrno >= MIN_EACCES_RANGE && oserrno <= MAX_EACCES_RANGE)
+ return EACCES;
+ else if (oserrno >= MIN_EXEC_ERROR && oserrno <= MAX_EXEC_ERROR)
+ return ENOEXEC;
+ else
+ return EINVAL;
+}
+
+/* Set errno corresponsing to GetLastError() value */
+void my_osmaperr ( unsigned long oserrno)
+{
+ errno= get_errno_from_oserr(oserrno);
+}
diff --git a/mysys/my_winfile.c b/mysys/my_winfile.c
new file mode 100644
index 00000000000..6a2cda5ba29
--- /dev/null
+++ b/mysys/my_winfile.c
@@ -0,0 +1,672 @@
+/* Copyright (C) 2008 MySQL AB
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ The purpose of this file is to provide implementation of file IO routines on
+ Windows that can be thought as drop-in replacement for corresponding C runtime
+ functionality.
+
+ Compared to Windows CRT, this one
+ - does not have the same file descriptor
+ limitation (default is 16384 and can be increased further, whereas CRT poses
+ a hard limit of 2048 file descriptors)
+ - the file operations are not serialized
+ - positional IO pread/pwrite is ported here.
+ - no text mode for files, all IO is "binary"
+
+ Naming convention:
+ All routines are prefixed with my_win_, e.g Posix open() is implemented with
+ my_win_open()
+
+ Implemented are
+ - POSIX routines(e.g open, read, lseek ...)
+ - Some ANSI C stream routines (fopen, fdopen, fileno, fclose)
+ - Windows CRT equvalients (my_get_osfhandle, open_osfhandle)
+
+ Worth to note:
+ - File descriptors used here are located in a range that is not compatible
+ with CRT on purpose. Attempt to use a file descriptor from Windows CRT library
+ range in my_win_* function will be punished with DBUG_ASSERT()
+
+ - File streams (FILE *) are actually from the C runtime. The routines provided
+ here are useful only in scernarios that use low-level IO with my_win_fileno()
+*/
+
+#ifdef _WIN32
+
+#include "mysys_priv.h"
+#include <share.h>
+#include <sys/stat.h>
+
+/* Associates a file descriptor with an existing operating-system file handle.*/
+File my_open_osfhandle(HANDLE handle, int oflag)
+{
+ int offset= -1;
+ uint i;
+ DBUG_ENTER("my_open_osfhandle");
+
+ pthread_mutex_lock(&THR_LOCK_open);
+ for(i= MY_FILE_MIN; i < my_file_limit;i++)
+ {
+ if(my_file_info[i].fhandle == 0)
+ {
+ struct st_my_file_info *finfo= &(my_file_info[i]);
+ finfo->type= FILE_BY_OPEN;
+ finfo->fhandle= handle;
+ finfo->oflag= oflag;
+ offset= i;
+ break;
+ }
+ }
+ pthread_mutex_unlock(&THR_LOCK_open);
+ if(offset == -1)
+ errno= EMFILE; /* to many file handles open */
+ DBUG_RETURN(offset);
+}
+
+
+static void invalidate_fd(File fd)
+{
+ DBUG_ENTER("invalidate_fd");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ my_file_info[fd].fhandle= 0;
+ DBUG_VOID_RETURN;
+}
+
+
+/* Get Windows handle for a file descriptor */
+HANDLE my_get_osfhandle(File fd)
+{
+ DBUG_ENTER("my_get_osfhandle");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ DBUG_RETURN(my_file_info[fd].fhandle);
+}
+
+
+static int my_get_open_flags(File fd)
+{
+ DBUG_ENTER("my_get_osfhandle");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ DBUG_RETURN(my_file_info[fd].oflag);
+}
+
+
+/*
+ Open a file with sharing. Similar to _sopen() from libc, but allows managing
+ share delete on win32
+
+ SYNOPSIS
+ my_win_sopen()
+ path file name
+ oflag operation flags
+ shflag share flag
+ pmode permission flags
+
+ RETURN VALUE
+ File descriptor of opened file if success
+ -1 and sets errno if fails.
+*/
+
+File my_win_sopen(const char *path, int oflag, int shflag, int pmode)
+{
+ int fh; /* handle of opened file */
+ int mask;
+ HANDLE osfh; /* OS handle of opened file */
+ DWORD fileaccess; /* OS file access (requested) */
+ DWORD fileshare; /* OS file sharing mode */
+ DWORD filecreate; /* OS method of opening/creating */
+ DWORD fileattrib; /* OS file attribute flags */
+ SECURITY_ATTRIBUTES SecurityAttributes;
+
+ DBUG_ENTER("my_win_sopen");
+
+ if (check_if_legal_filename(path))
+ {
+ errno= EACCES;
+ DBUG_RETURN(-1);
+ }
+ SecurityAttributes.nLength= sizeof(SecurityAttributes);
+ SecurityAttributes.lpSecurityDescriptor= NULL;
+ SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT);
+
+ /* decode the access flags */
+ switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
+ case _O_RDONLY: /* read access */
+ fileaccess= GENERIC_READ;
+ break;
+ case _O_WRONLY: /* write access */
+ fileaccess= GENERIC_WRITE;
+ break;
+ case _O_RDWR: /* read and write access */
+ fileaccess= GENERIC_READ | GENERIC_WRITE;
+ break;
+ default: /* error, bad oflag */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode sharing flags */
+ switch (shflag) {
+ case _SH_DENYRW: /* exclusive access except delete */
+ fileshare= FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYWR: /* share read and delete access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYRD: /* share write and delete access */
+ fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYNO: /* share read, write and delete access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYRWD: /* exclusive access */
+ fileshare= 0L;
+ break;
+ case _SH_DENYWRD: /* share read access */
+ fileshare= FILE_SHARE_READ;
+ break;
+ case _SH_DENYRDD: /* share write access */
+ fileshare= FILE_SHARE_WRITE;
+ break;
+ case _SH_DENYDEL: /* share read and write access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE;
+ break;
+ default: /* error, bad shflag */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode open/create method flags */
+ switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
+ case 0:
+ case _O_EXCL: /* ignore EXCL w/o CREAT */
+ filecreate= OPEN_EXISTING;
+ break;
+
+ case _O_CREAT:
+ filecreate= OPEN_ALWAYS;
+ break;
+
+ case _O_CREAT | _O_EXCL:
+ case _O_CREAT | _O_TRUNC | _O_EXCL:
+ filecreate= CREATE_NEW;
+ break;
+
+ case _O_TRUNC:
+ case _O_TRUNC | _O_EXCL: /* ignore EXCL w/o CREAT */
+ filecreate= TRUNCATE_EXISTING;
+ break;
+
+ case _O_CREAT | _O_TRUNC:
+ filecreate= CREATE_ALWAYS;
+ break;
+
+ default:
+ /* this can't happen ... all cases are covered */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode file attribute flags if _O_CREAT was specified */
+ fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */
+ if (oflag & _O_CREAT)
+ {
+ _umask((mask= _umask(0)));
+
+ if (!((pmode & ~mask) & _S_IWRITE))
+ fileattrib= FILE_ATTRIBUTE_READONLY;
+ }
+
+ /* Set temporary file (delete-on-close) attribute if requested. */
+ if (oflag & _O_TEMPORARY)
+ {
+ fileattrib|= FILE_FLAG_DELETE_ON_CLOSE;
+ fileaccess|= DELETE;
+ }
+
+ /* Set temporary file (delay-flush-to-disk) attribute if requested.*/
+ if (oflag & _O_SHORT_LIVED)
+ fileattrib|= FILE_ATTRIBUTE_TEMPORARY;
+
+ /* Set sequential or random access attribute if requested. */
+ if (oflag & _O_SEQUENTIAL)
+ fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN;
+ else if (oflag & _O_RANDOM)
+ fileattrib|= FILE_FLAG_RANDOM_ACCESS;
+
+ /* try to open/create the file */
+ if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
+ filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE)
+ {
+ /*
+ OS call to open/create file failed! map the error, release
+ the lock, and return -1. note that it's not necessary to
+ call _free_osfhnd (it hasn't been used yet).
+ */
+ my_osmaperr(GetLastError()); /* map error */
+ DBUG_RETURN(-1); /* return error to caller */
+ }
+
+ if ((fh= my_open_osfhandle(osfh,
+ oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1)
+ {
+ CloseHandle(osfh);
+ }
+
+ DBUG_RETURN(fh); /* return handle */
+}
+
+
+File my_win_open(const char *path, int flags)
+{
+ DBUG_ENTER("my_win_open");
+ DBUG_RETURN(my_win_sopen((char *) path, flags | _O_BINARY, _SH_DENYNO,
+ _S_IREAD | S_IWRITE));
+}
+
+
+int my_win_close(File fd)
+{
+ DBUG_ENTER("my_win_close");
+ if(CloseHandle(my_get_osfhandle(fd)))
+ {
+ invalidate_fd(fd);
+ DBUG_RETURN(0);
+ }
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+
+size_t my_win_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset)
+{
+ DWORD nBytesRead;
+ HANDLE hFile;
+ OVERLAPPED ov= {0};
+ LARGE_INTEGER li;
+
+ DBUG_ENTER("my_win_pread");
+
+ if(!Count)
+ DBUG_RETURN(0);
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+ li.QuadPart= offset;
+ ov.Offset= li.LowPart;
+ ov.OffsetHigh= li.HighPart;
+
+ if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, &ov))
+ {
+ DWORD lastError= GetLastError();
+ /*
+ ERROR_BROKEN_PIPE is returned when no more data coming
+ through e.g. a command pipe in windows : see MSDN on ReadFile.
+ */
+ if(lastError == ERROR_HANDLE_EOF || lastError == ERROR_BROKEN_PIPE)
+ DBUG_RETURN(0); /*return 0 at EOF*/
+ my_osmaperr(lastError);
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(nBytesRead);
+}
+
+
+size_t my_win_read(File Filedes, uchar *Buffer, size_t Count)
+{
+ DWORD nBytesRead;
+ HANDLE hFile;
+
+ DBUG_ENTER("my_win_read");
+ if(!Count)
+ DBUG_RETURN(0);
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+
+ if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, NULL))
+ {
+ DWORD lastError= GetLastError();
+ /*
+ ERROR_BROKEN_PIPE is returned when no more data coming
+ through e.g. a command pipe in windows : see MSDN on ReadFile.
+ */
+ if(lastError == ERROR_HANDLE_EOF || lastError == ERROR_BROKEN_PIPE)
+ DBUG_RETURN(0); /*return 0 at EOF*/
+ my_osmaperr(lastError);
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(nBytesRead);
+}
+
+
+size_t my_win_pwrite(File Filedes, const uchar *Buffer, size_t Count,
+ my_off_t offset)
+{
+ DWORD nBytesWritten;
+ HANDLE hFile;
+ OVERLAPPED ov= {0};
+ LARGE_INTEGER li;
+
+ DBUG_ENTER("my_win_pwrite");
+ DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count: %llu, offset: %llu",
+ Filedes, Buffer, (ulonglong)Count, (ulonglong)offset));
+
+ if(!Count)
+ DBUG_RETURN(0);
+
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+ li.QuadPart= offset;
+ ov.Offset= li.LowPart;
+ ov.OffsetHigh= li.HighPart;
+
+ if(!WriteFile(hFile, Buffer, (DWORD)Count, &nBytesWritten, &ov))
+ {
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+ }
+ else
+ DBUG_RETURN(nBytesWritten);
+}
+
+
+my_off_t my_win_lseek(File fd, my_off_t pos, int whence)
+{
+ LARGE_INTEGER offset;
+ LARGE_INTEGER newpos;
+
+ DBUG_ENTER("my_win_lseek");
+
+ /* Check compatibility of Windows and Posix seek constants */
+ compile_time_assert(FILE_BEGIN == SEEK_SET && FILE_CURRENT == SEEK_CUR
+ && FILE_END == SEEK_END);
+
+ offset.QuadPart= pos;
+ if(!SetFilePointerEx(my_get_osfhandle(fd), offset, &newpos, whence))
+ {
+ my_osmaperr(GetLastError());
+ newpos.QuadPart= -1;
+ }
+ DBUG_RETURN(newpos.QuadPart);
+}
+
+
+#ifndef FILE_WRITE_TO_END_OF_FILE
+#define FILE_WRITE_TO_END_OF_FILE 0xffffffff
+#endif
+size_t my_win_write(File fd, const uchar *Buffer, size_t Count)
+{
+ DWORD nWritten;
+ OVERLAPPED ov;
+ OVERLAPPED *pov= NULL;
+ HANDLE hFile;
+
+ DBUG_ENTER("my_win_write");
+ DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count %llu", fd, Buffer,
+ (ulonglong)Count));
+ if(my_get_open_flags(fd) & _O_APPEND)
+ {
+ /*
+ Atomic append to the end of file is is done by special initialization of
+ the OVERLAPPED structure. See MSDN WriteFile documentation for more info.
+ */
+ memset(&ov, 0, sizeof(ov));
+ ov.Offset= FILE_WRITE_TO_END_OF_FILE;
+ ov.OffsetHigh= -1;
+ pov= &ov;
+ }
+
+ hFile= my_get_osfhandle(fd);
+ if(!WriteFile(hFile, Buffer, (DWORD)Count, &nWritten, pov))
+ {
+ nWritten= (size_t)-1;
+ my_osmaperr(GetLastError());
+ }
+ DBUG_RETURN((size_t)nWritten);
+}
+
+
+int my_win_chsize(File fd, my_off_t newlength)
+{
+ HANDLE hFile;
+ LARGE_INTEGER length;
+ DBUG_ENTER("my_win_chsize");
+
+ hFile= (HANDLE) my_get_osfhandle(fd);
+ length.QuadPart= newlength;
+ if (!SetFilePointerEx(hFile, length , NULL , FILE_BEGIN))
+ goto err;
+ if (!SetEndOfFile(hFile))
+ goto err;
+ DBUG_RETURN(0);
+err:
+ my_osmaperr(GetLastError());
+ my_errno= errno;
+ DBUG_RETURN(-1);
+}
+
+
+/* Get the file descriptor for stdin,stdout or stderr */
+static File my_get_stdfile_descriptor(FILE *stream)
+{
+ HANDLE hFile;
+ DWORD nStdHandle;
+ DBUG_ENTER("my_get_stdfile_descriptor");
+
+ if(stream == stdin)
+ nStdHandle= STD_INPUT_HANDLE;
+ else if(stream == stdout)
+ nStdHandle= STD_OUTPUT_HANDLE;
+ else if(stream == stderr)
+ nStdHandle= STD_ERROR_HANDLE;
+ else
+ DBUG_RETURN(-1);
+
+ hFile= GetStdHandle(nStdHandle);
+ if(hFile != INVALID_HANDLE_VALUE)
+ DBUG_RETURN(my_open_osfhandle(hFile, 0));
+ DBUG_RETURN(-1);
+}
+
+
+File my_win_fileno(FILE *file)
+{
+ HANDLE hFile= (HANDLE)_get_osfhandle(fileno(file));
+ int retval= -1;
+ uint i;
+
+ DBUG_ENTER("my_win_fileno");
+
+ for(i= MY_FILE_MIN; i < my_file_limit; i++)
+ {
+ if(my_file_info[i].fhandle == hFile)
+ {
+ retval= i;
+ break;
+ }
+ }
+ if(retval == -1)
+ /* try std stream */
+ DBUG_RETURN(my_get_stdfile_descriptor(file));
+ DBUG_RETURN(retval);
+}
+
+
+FILE *my_win_fopen(const char *filename, const char *type)
+{
+ FILE *file;
+ int flags= 0;
+ DBUG_ENTER("my_win_open");
+
+ /*
+ If we are not creating, then we need to use my_access to make sure
+ the file exists since Windows doesn't handle files like "com1.sym"
+ very well
+ */
+ if (check_if_legal_filename(filename))
+ {
+ errno= EACCES;
+ DBUG_RETURN(NULL);
+ }
+
+ file= fopen(filename, type);
+ if(!file)
+ DBUG_RETURN(NULL);
+
+ if(strchr(type,'a') != NULL)
+ flags= O_APPEND;
+
+ /*
+ Register file handle in my_table_info.
+ Necessary for my_fileno()
+ */
+ if(my_open_osfhandle((HANDLE)_get_osfhandle(fileno(file)), flags) < 0)
+ {
+ fclose(file);
+ DBUG_RETURN(NULL);
+ }
+ DBUG_RETURN(file);
+}
+
+
+FILE * my_win_fdopen(File fd, const char *type)
+{
+ FILE *file;
+ int crt_fd;
+ int flags= 0;
+
+ DBUG_ENTER("my_win_fdopen");
+
+ if(strchr(type,'a') != NULL)
+ flags= O_APPEND;
+ /* Convert OS file handle to CRT file descriptor and then call fdopen*/
+ crt_fd= _open_osfhandle((intptr_t)my_get_osfhandle(fd), flags);
+ if(crt_fd < 0)
+ file= NULL;
+ else
+ file= fdopen(crt_fd, type);
+ DBUG_RETURN(file);
+}
+
+
+int my_win_fclose(FILE *file)
+{
+ File fd;
+
+ DBUG_ENTER("my_win_close");
+ fd= my_fileno(file);
+ if(fd < 0)
+ DBUG_RETURN(-1);
+ if(fclose(file) < 0)
+ DBUG_RETURN(-1);
+ invalidate_fd(fd);
+ DBUG_RETURN(0);
+}
+
+
+
+/*
+ Quick and dirty my_fstat() implementation for Windows.
+ Use CRT fstat on temporarily allocated file descriptor.
+ Patch file size, because size that fstat returns is not
+ reliable (may be outdated)
+*/
+int my_win_fstat(File fd, struct _stati64 *buf)
+{
+ int crt_fd;
+ int retval;
+ HANDLE hFile, hDup;
+
+ DBUG_ENTER("my_win_fstat");
+
+ hFile= my_get_osfhandle(fd);
+ if(!DuplicateHandle( GetCurrentProcess(), hFile, GetCurrentProcess(),
+ &hDup ,0,FALSE,DUPLICATE_SAME_ACCESS))
+ {
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+ }
+ if ((crt_fd= _open_osfhandle((intptr_t)hDup,0)) < 0)
+ DBUG_RETURN(-1);
+
+ retval= _fstati64(crt_fd, buf);
+ if(retval == 0)
+ {
+ /* File size returned by stat is not accurate (may be outdated), fix it*/
+ GetFileSizeEx(hDup, (PLARGE_INTEGER) (&(buf->st_size)));
+ }
+ _close(crt_fd);
+ DBUG_RETURN(retval);
+}
+
+
+
+int my_win_stat( const char *path, struct _stati64 *buf)
+{
+ DBUG_ENTER("my_win_stat");
+ if(_stati64( path, buf) == 0)
+ {
+ /* File size returned by stat is not accurate (may be outdated), fix it*/
+ WIN32_FILE_ATTRIBUTE_DATA data;
+ if (GetFileAttributesEx(path, GetFileExInfoStandard, &data))
+ {
+ LARGE_INTEGER li;
+ li.LowPart= data.nFileSizeLow;
+ li.HighPart= data.nFileSizeHigh;
+ buf->st_size= li.QuadPart;
+ }
+ DBUG_RETURN(0);
+ }
+ DBUG_RETURN(-1);
+}
+
+
+
+int my_win_fsync(File fd)
+{
+ DBUG_ENTER("my_win_fsync");
+ if(FlushFileBuffers(my_get_osfhandle(fd)))
+ DBUG_RETURN(0);
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+
+
+int my_win_dup(File fd)
+{
+ HANDLE hDup;
+ DBUG_ENTER("my_win_dup");
+ if (DuplicateHandle(GetCurrentProcess(), my_get_osfhandle(fd),
+ GetCurrentProcess(), &hDup, 0, FALSE, DUPLICATE_SAME_ACCESS))
+ {
+ DBUG_RETURN(my_open_osfhandle(hDup, my_get_open_flags(fd)));
+ }
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+#endif /*_WIN32*/
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index e94369bec32..9e8458b0799 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -14,33 +14,23 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*****************************************************************************
-** Simulation of posix threads calls for WIN95 and NT
+** Simulation of posix threads calls for Windows
*****************************************************************************/
-
+#if defined (_WIN32)
/* SAFE_MUTEX will not work until the thread structure is up to date */
#undef SAFE_MUTEX
-
#include "mysys_priv.h"
-#if defined(THREAD) && defined(__WIN__)
-#include <m_string.h>
-#undef getpid
#include <process.h>
+#include <signal.h>
-static pthread_mutex_t THR_LOCK_thread;
+static void install_sigabrt_handler(void);
-struct pthread_map
+struct thread_start_parameter
{
- HANDLE pthreadself;
pthread_handler func;
- void *param;
+ void *arg;
};
-void win_pthread_init(void)
-{
- pthread_mutex_init(&THR_LOCK_thread,MY_MUTEX_INIT_FAST);
-}
-
-
/**
Adapter to @c pthread_mutex_trylock()
@@ -62,79 +52,81 @@ win_pthread_mutex_trylock(pthread_mutex_t *mutex)
return EBUSY;
}
-
-/*
-** We have tried to use '_beginthreadex' instead of '_beginthread' here
-** but in this case the program leaks about 512 characters for each
-** created thread !
-** As we want to save the created thread handler for other threads to
-** use and to be returned by pthread_self() (instead of the Win32 pseudo
-** handler), we have to go trough pthread_start() to catch the returned handler
-** in the new thread.
-*/
-
-pthread_handler_t pthread_start(void *param)
+static unsigned int __stdcall pthread_start(void *p)
{
- pthread_handler func=((struct pthread_map *) param)->func;
- void *func_param=((struct pthread_map *) param)->param;
- my_thread_init(); /* Will always succeed in windows */
- pthread_mutex_lock(&THR_LOCK_thread); /* Wait for beginthread to return */
- win_pthread_self=((struct pthread_map *) param)->pthreadself;
- pthread_mutex_unlock(&THR_LOCK_thread);
- free((char*) param); /* Free param from create */
- pthread_exit((void*) (*func)(func_param));
- return 0; /* Safety */
+ struct thread_start_parameter *par= (struct thread_start_parameter *)p;
+ pthread_handler func= par->func;
+ void *arg= par->arg;
+ free(p);
+ (*func)(arg);
+ return 0;
}
int pthread_create(pthread_t *thread_id, pthread_attr_t *attr,
- pthread_handler func, void *param)
+ pthread_handler func, void *param)
{
- HANDLE hThread;
- struct pthread_map *map;
+ uintptr_t handle;
+ struct thread_start_parameter *par;
+ unsigned int stack_size;
DBUG_ENTER("pthread_create");
- if (!(map=malloc(sizeof(*map))))
- DBUG_RETURN(-1);
- map->func=func;
- map->param=param;
- pthread_mutex_lock(&THR_LOCK_thread);
-#ifdef __BORLANDC__
- hThread=(HANDLE)_beginthread((void(_USERENTRY *)(void *)) pthread_start,
- attr->dwStackSize ? attr->dwStackSize :
- 65535, (void*) map);
-#else
- hThread=(HANDLE)_beginthread((void( __cdecl *)(void *)) pthread_start,
- attr->dwStackSize ? attr->dwStackSize :
- 65535, (void*) map);
-#endif
- DBUG_PRINT("info", ("hThread=%lu",(long) hThread));
- *thread_id=map->pthreadself=hThread;
- pthread_mutex_unlock(&THR_LOCK_thread);
+ par= (struct thread_start_parameter *)malloc(sizeof(*par));
+ if (!par)
+ goto error_return;
- if (hThread == (HANDLE) -1)
- {
- int error=errno;
- DBUG_PRINT("error",
- ("Can't create thread to handle request (error %d)",error));
- DBUG_RETURN(error ? error : -1);
- }
- VOID(SetThreadPriority(hThread, attr->priority)) ;
+ par->func= func;
+ par->arg= param;
+ stack_size= attr?attr->dwStackSize:0;
+
+ handle= _beginthreadex(NULL, stack_size , pthread_start, par, 0, thread_id);
+ if (!handle)
+ goto error_return;
+ DBUG_PRINT("info", ("thread id=%u",*thread_id));
+
+ /* Do not need thread handle, close it */
+ CloseHandle((HANDLE)handle);
DBUG_RETURN(0);
+
+error_return:
+ DBUG_PRINT("error",
+ ("Can't create thread to handle request (error %d)",errno));
+ DBUG_RETURN(-1);
}
void pthread_exit(void *a)
{
- _endthread();
+ _endthreadex(0);
}
-/* This is neaded to get the macro pthread_setspecific to work */
-
-int win_pthread_setspecific(void *a,void *b,uint length)
+int pthread_join(pthread_t thread, void **value_ptr)
{
- memcpy(a,b,length);
+ DWORD ret;
+ HANDLE handle;
+
+ handle= OpenThread(SYNCHRONIZE, FALSE, thread);
+ if (!handle)
+ {
+ errno= EINVAL;
+ goto error_return;
+ }
+
+ ret= WaitForSingleObject(handle, INFINITE);
+
+ if(ret != WAIT_OBJECT_0)
+ {
+ errno= EINVAL;
+ goto error_return;
+ }
+
+ CloseHandle(handle);
return 0;
+
+error_return:
+ if(handle)
+ CloseHandle(handle);
+ return -1;
}
#endif
diff --git a/mysys/my_write.c b/mysys/my_write.c
index d7eb390bdd2..3eac1364f46 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -20,14 +20,14 @@
/* Write a chunk of bytes to a file */
-size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
+size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
{
- size_t writenbytes, written;
+ size_t writtenbytes, written;
uint errors;
DBUG_ENTER("my_write");
- DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d",
- Filedes, (long) Buffer, (ulong) Count, MyFlags));
- errors=0; written=0;
+ DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, Buffer, (ulong) Count, MyFlags));
+ errors= 0; written= 0;
/* The behavior of write(fd, buf, 0) is not portable */
if (unlikely(!Count))
@@ -35,17 +35,22 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
for (;;)
{
- if ((writenbytes= write(Filedes, Buffer, Count)) == Count)
+#ifdef _WIN32
+ writtenbytes= my_win_write(Filedes, Buffer, Count);
+#else
+ writtenbytes= write(Filedes, Buffer, Count);
+#endif
+ if (writtenbytes == Count)
break;
- if (writenbytes != (size_t) -1)
+ if (writtenbytes != (size_t) -1)
{ /* Safeguard */
- written+=writenbytes;
- Buffer+=writenbytes;
- Count-=writenbytes;
+ written+= writtenbytes;
+ Buffer+= writtenbytes;
+ Count-= writtenbytes;
}
- my_errno=errno;
+ my_errno= errno;
DBUG_PRINT("error",("Write only %ld bytes, error: %d",
- (long) writenbytes, my_errno));
+ (long) writtenbytes, my_errno));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -59,19 +64,19 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
continue;
}
- if ((writenbytes == 0 || writenbytes == (size_t) -1))
+ if ((writtenbytes == 0 || writtenbytes == (size_t) -1))
{
if (my_errno == EINTR)
{
DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld",
- (long) writenbytes));
+ (long) writtenbytes));
continue; /* Interrupted */
}
- if (!writenbytes && !errors++) /* Retry once */
+ if (!writtenbytes && !errors++) /* Retry once */
{
/* We may come here if the file quota is exeeded */
- errno=EFBIG; /* Assume this is the error */
+ errno= EFBIG; /* Assume this is the error */
continue;
}
}
@@ -92,5 +97,5 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
}
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Want only errors */
- DBUG_RETURN(writenbytes+written);
+ DBUG_RETURN(writtenbytes+written);
} /* my_write */
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 6e0959ae08c..4c4d6ea3598 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -42,3 +42,27 @@ extern pthread_mutex_t THR_LOCK_charset, THR_LOCK_time;
#endif
void my_error_unregister_all(void);
+
+#ifdef _WIN32
+/* my_winfile.c exports, should not be used outside mysys */
+extern File my_win_open(const char *path, int oflag);
+extern int my_win_close(File fd);
+extern size_t my_win_read(File fd, uchar *buffer, size_t count);
+extern size_t my_win_write(File fd, const uchar *buffer, size_t count);
+extern size_t my_win_pread(File fd, uchar *buffer, size_t count,
+ my_off_t offset);
+extern size_t my_win_pwrite(File fd, const uchar *buffer, size_t count,
+ my_off_t offset);
+extern my_off_t my_win_lseek(File fd, my_off_t pos, int whence);
+extern int my_win_chsize(File fd, my_off_t newlength);
+extern FILE* my_win_fopen(const char *filename, const char *type);
+extern File my_win_fclose(FILE *file);
+extern File my_win_fileno(FILE *file);
+extern FILE* my_win_fdopen(File Filedes, const char *type);
+extern int my_win_stat(const char *path, struct _stat64 *buf);
+extern int my_win_fstat(File fd, struct _stat64 *buf);
+extern int my_win_fsync(File fd);
+extern File my_win_dup(File fd);
+extern File my_win_sopen(const char *path, int oflag, int shflag, int perm);
+extern File my_open_osfhandle(HANDLE handle, int oflag);
+#endif
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 0e0e93cf220..4bb818b1b30 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -362,7 +362,7 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, void *param)
static inline my_bool
-have_old_read_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner)
+has_old_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner)
{
for ( ; data ; data=data->next)
{
@@ -572,7 +572,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner,
else if (!lock->write_wait.data ||
lock->write_wait.data->type <= TL_WRITE_LOW_PRIORITY ||
lock_type == TL_READ_HIGH_PRIORITY ||
- have_old_read_lock(lock->read.data, data->owner))
+ has_old_lock(lock->read.data, data->owner)) /* Has old read lock */
{ /* No important write-locks */
(*lock->read.last)=data; /* Add to running FIFO */
data->prev=lock->read.last;
@@ -642,14 +642,36 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner,
}
/*
- The following test will not work if the old lock was a
- TL_WRITE_ALLOW_WRITE, TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED in
- the same thread, but this will never happen within MySQL.
+ The idea is to allow us to get a lock at once if we already have
+ a write lock or if there is no pending write locks and if all
+ write locks are of TL_WRITE_ALLOW_WRITE type.
+
+ Note that, since lock requests for the same table are sorted in
+ such way that requests with higher thr_lock_type value come first,
+ lock being requested usually has equal or "weaker" type than one
+ which thread might have already acquired.
+ The exceptions are situations when:
+ - old lock type is TL_WRITE_ALLOW_READ and new lock type is
+ TL_WRITE_ALLOW_WRITE
+ - when old lock type is TL_WRITE_DELAYED
+ But these should never happen within MySQL.
+ Therefore it is OK to allow acquiring write lock on the table if
+ this thread already holds some write lock on it.
+
+ (INSERT INTO t1 VALUES (f1()), where f1() is stored function which
+ tries to update t1, is an example of statement which requests two
+ different types of write lock on the same table).
*/
- if (thr_lock_owner_equal(data->owner, lock->write.data->owner) ||
- (lock_type == TL_WRITE_ALLOW_WRITE &&
- !lock->write_wait.data &&
- lock->write.data->type == TL_WRITE_ALLOW_WRITE))
+ DBUG_ASSERT(! has_old_lock(lock->write.data, data->owner) ||
+ (lock_type <= lock->write.data->type &&
+ ! ((lock_type < TL_WRITE_ALLOW_READ &&
+ lock->write.data->type == TL_WRITE_ALLOW_READ) ||
+ lock->write.data->type == TL_WRITE_DELAYED)));
+
+ if ((lock_type == TL_WRITE_ALLOW_WRITE &&
+ ! lock->write_wait.data &&
+ lock->write.data->type == TL_WRITE_ALLOW_WRITE) ||
+ has_old_lock(lock->write.data, data->owner))
{
/*
We have already got a write lock or all locks are
@@ -998,6 +1020,7 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_OWNER *owner)
thr_multi_unlock(data,(uint) (pos-data));
DBUG_RETURN(result);
}
+ DEBUG_SYNC_C("thr_multi_lock_after_thr_lock");
#ifdef MAIN
printf("Thread: %s Got lock: 0x%lx type: %d\n",my_thread_name(),
(long) pos[0]->lock, pos[0]->type); fflush(stdout);
diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START
index 8f828f34bd1..414d577130e 100755
--- a/netware/BUILD/compile-netware-START
+++ b/netware/BUILD/compile-netware-START
@@ -22,6 +22,5 @@ base_configs=" \
--enable-local-infile \
--with-extra-charsets=all \
--prefix=N:/mysql \
- --without-mysqlmanager \
--without-man \
"
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index c5414cd46c7..fce67285a5f 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -26,7 +26,8 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
EXTRA_LTLIBRARIES = libdaemon_example.la
pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
-libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
+libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
+
libdaemon_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_SOURCES = daemon_example.cc
diff --git a/plugin/semisync/CMakeLists.txt b/plugin/semisync/CMakeLists.txt
new file mode 100644
index 00000000000..ad26298b0b7
--- /dev/null
+++ b/plugin/semisync/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This is CMakeLists.txt for semi-sync replication plugins
+
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+# Add common include directories
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
+ ${CMAKE_SOURCE_DIR}/sql
+ ${CMAKE_SOURCE_DIR}/regex
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include)
+
+SET(SEMISYNC_MASTER_SOURCES semisync.cc semisync_master.cc semisync_master_plugin.cc)
+SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc)
+
+ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
+ADD_LIBRARY(semisync_master SHARED ${SEMISYNC_MASTER_SOURCES})
+TARGET_LINK_LIBRARIES(semisync_master mysqlservices mysqld)
+ADD_LIBRARY(semisync_slave SHARED ${SEMISYNC_SLAVE_SOURCES})
+TARGET_LINK_LIBRARIES(semisync_slave mysqld)
+MESSAGE("build SEMISYNC as DLL")
diff --git a/plugin/semisync/Makefile.am b/plugin/semisync/Makefile.am
new file mode 100644
index 00000000000..8a10b9ac738
--- /dev/null
+++ b/plugin/semisync/Makefile.am
@@ -0,0 +1,38 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+## Makefile.am for semi-synchronous replication
+
+pkgplugindir = $(pkglibdir)/plugin
+INCLUDES = -I$(top_srcdir)/include \
+ -I$(top_srcdir)/sql \
+ -I$(top_srcdir)/regex \
+ -I$(srcdir)
+
+noinst_HEADERS = semisync.h semisync_master.h semisync_slave.h
+
+pkgplugin_LTLIBRARIES = libsemisync_master.la libsemisync_slave.la
+
+libsemisync_master_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
+libsemisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libsemisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libsemisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
+
+libsemisync_slave_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
+libsemisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libsemisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libsemisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
+
+EXTRA_DIST= CMakeLists.txt plug.in
diff --git a/plugin/semisync/configure.in b/plugin/semisync/configure.in
new file mode 100644
index 00000000000..894251258db
--- /dev/null
+++ b/plugin/semisync/configure.in
@@ -0,0 +1,9 @@
+# configure.in for semi-synchronous replication
+
+AC_INIT(mysql-semi-sync-plugin, 0.2)
+AM_INIT_AUTOMAKE
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
diff --git a/plugin/semisync/plug.in b/plugin/semisync/plug.in
new file mode 100644
index 00000000000..917c8950f02
--- /dev/null
+++ b/plugin/semisync/plug.in
@@ -0,0 +1,3 @@
+MYSQL_PLUGIN(semisync,[Semi-synchronous Replication Plugin],
+ [Semi-synchronous replication plugin.])
+MYSQL_PLUGIN_DYNAMIC(semisync, [libsemisync_master.la libsemisync_slave.la])
diff --git a/plugin/semisync/semisync.cc b/plugin/semisync/semisync.cc
new file mode 100644
index 00000000000..83c7791c14b
--- /dev/null
+++ b/plugin/semisync/semisync.cc
@@ -0,0 +1,30 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#include "semisync.h"
+
+const unsigned char ReplSemiSyncBase::kPacketMagicNum = 0xef;
+const unsigned char ReplSemiSyncBase::kPacketFlagSync = 0x01;
+
+
+const unsigned long Trace::kTraceGeneral = 0x0001;
+const unsigned long Trace::kTraceDetail = 0x0010;
+const unsigned long Trace::kTraceNetWait = 0x0020;
+const unsigned long Trace::kTraceFunction = 0x0040;
+
+const char ReplSemiSyncBase::kSyncHeader[2] =
+ {ReplSemiSyncBase::kPacketMagicNum, 0};
diff --git a/plugin/semisync/semisync.h b/plugin/semisync/semisync.h
new file mode 100644
index 00000000000..ced25c40534
--- /dev/null
+++ b/plugin/semisync/semisync.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#ifndef SEMISYNC_H
+#define SEMISYNC_H
+
+#define MYSQL_SERVER
+#define HAVE_REPLICATION
+#include <mysql_priv.h>
+#include <my_global.h>
+#include <my_pthread.h>
+#include <mysql/plugin.h>
+#include <replication.h>
+
+typedef struct st_mysql_show_var SHOW_VAR;
+typedef struct st_mysql_sys_var SYS_VAR;
+
+
+/**
+ This class is used to trace function calls and other process
+ information
+*/
+class Trace {
+public:
+ static const unsigned long kTraceFunction;
+ static const unsigned long kTraceGeneral;
+ static const unsigned long kTraceDetail;
+ static const unsigned long kTraceNetWait;
+
+ unsigned long trace_level_; /* the level for tracing */
+
+ inline void function_enter(const char *func_name)
+ {
+ if (trace_level_ & kTraceFunction)
+ sql_print_information("---> %s enter", func_name);
+ }
+ inline int function_exit(const char *func_name, int exit_code)
+ {
+ if (trace_level_ & kTraceFunction)
+ sql_print_information("<--- %s exit (%d)", func_name, exit_code);
+ return exit_code;
+ }
+
+ Trace()
+ :trace_level_(0L)
+ {}
+ Trace(unsigned long trace_level)
+ :trace_level_(trace_level)
+ {}
+};
+
+/**
+ Base class for semi-sync master and slave classes
+*/
+class ReplSemiSyncBase
+ :public Trace {
+public:
+ static const char kSyncHeader[2]; /* three byte packet header */
+
+ /* Constants in network packet header. */
+ static const unsigned char kPacketMagicNum;
+ static const unsigned char kPacketFlagSync;
+};
+
+/* The layout of a semisync slave reply packet:
+ 1 byte for the magic num
+ 8 bytes for the binlog positon
+ n bytes for the binlog filename, terminated with a '\0'
+*/
+#define REPLY_MAGIC_NUM_LEN 1
+#define REPLY_BINLOG_POS_LEN 8
+#define REPLY_BINLOG_NAME_LEN (FN_REFLEN + 1)
+#define REPLY_MAGIC_NUM_OFFSET 0
+#define REPLY_BINLOG_POS_OFFSET (REPLY_MAGIC_NUM_OFFSET + REPLY_MAGIC_NUM_LEN)
+#define REPLY_BINLOG_NAME_OFFSET (REPLY_BINLOG_POS_OFFSET + REPLY_BINLOG_POS_LEN)
+
+#endif /* SEMISYNC_H */
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
new file mode 100644
index 00000000000..c2e329e1fe4
--- /dev/null
+++ b/plugin/semisync/semisync_master.cc
@@ -0,0 +1,1269 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#include "semisync_master.h"
+
+#define TIME_THOUSAND 1000
+#define TIME_MILLION 1000000
+#define TIME_BILLION 1000000000
+
+/* This indicates whether semi-synchronous replication is enabled. */
+char rpl_semi_sync_master_enabled;
+unsigned long rpl_semi_sync_master_timeout;
+unsigned long rpl_semi_sync_master_trace_level;
+char rpl_semi_sync_master_status = 0;
+unsigned long rpl_semi_sync_master_yes_transactions = 0;
+unsigned long rpl_semi_sync_master_no_transactions = 0;
+unsigned long rpl_semi_sync_master_off_times = 0;
+unsigned long rpl_semi_sync_master_timefunc_fails = 0;
+unsigned long rpl_semi_sync_master_wait_timeouts = 0;
+unsigned long rpl_semi_sync_master_wait_sessions = 0;
+unsigned long rpl_semi_sync_master_wait_pos_backtraverse = 0;
+unsigned long rpl_semi_sync_master_avg_trx_wait_time = 0;
+unsigned long long rpl_semi_sync_master_trx_wait_num = 0;
+unsigned long rpl_semi_sync_master_avg_net_wait_time = 0;
+unsigned long long rpl_semi_sync_master_net_wait_num = 0;
+unsigned long rpl_semi_sync_master_clients = 0;
+unsigned long long rpl_semi_sync_master_net_wait_time = 0;
+unsigned long long rpl_semi_sync_master_trx_wait_time = 0;
+char rpl_semi_sync_master_wait_no_slave = 1;
+
+
+static int getWaitTime(const struct timeval& start_tv);
+
+#ifdef __WIN__
+static int gettimeofday(struct timeval *tv, void *tz)
+{
+ unsigned int ticks;
+ ticks= GetTickCount();
+ tv->tv_usec= ticks*1000;
+ tv->tv_sec= ticks/1000;
+
+ return 0;
+}
+#endif /* __WIN__ */
+
+/*******************************************************************************
+ *
+ * <ActiveTranx> class : manage all active transaction nodes
+ *
+ ******************************************************************************/
+
+ActiveTranx::ActiveTranx(pthread_mutex_t *lock,
+ unsigned long trace_level)
+ : Trace(trace_level),
+ num_entries_(max_connections << 1), /* Transaction hash table size
+ * is set to double the size
+ * of max_connections */
+ lock_(lock)
+{
+ /* No transactions are in the list initially. */
+ trx_front_ = NULL;
+ trx_rear_ = NULL;
+
+ /* Create the hash table to find a transaction's ending event. */
+ trx_htb_ = new TranxNode *[num_entries_];
+ for (int idx = 0; idx < num_entries_; ++idx)
+ trx_htb_[idx] = NULL;
+
+ sql_print_information("Semi-sync replication initialized for transactions.");
+}
+
+ActiveTranx::~ActiveTranx()
+{
+ delete [] trx_htb_;
+ trx_htb_ = NULL;
+ num_entries_ = 0;
+}
+
+unsigned int ActiveTranx::calc_hash(const unsigned char *key,
+ unsigned int length)
+{
+ unsigned int nr = 1, nr2 = 4;
+
+ /* The hash implementation comes from calc_hashnr() in mysys/hash.c. */
+ while (length--)
+ {
+ nr ^= (((nr & 63)+nr2)*((unsigned int) (unsigned char) *key++))+ (nr << 8);
+ nr2 += 3;
+ }
+ return((unsigned int) nr);
+}
+
+unsigned int ActiveTranx::get_hash_value(const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ unsigned int hash1 = calc_hash((const unsigned char *)log_file_name,
+ strlen(log_file_name));
+ unsigned int hash2 = calc_hash((const unsigned char *)(&log_file_pos),
+ sizeof(log_file_pos));
+
+ return (hash1 + hash2) % num_entries_;
+}
+
+ActiveTranx::TranxNode* ActiveTranx::alloc_tranx_node()
+{
+ MYSQL_THD thd= (MYSQL_THD)current_thd;
+ /* The memory allocated for TranxNode will be automatically freed at
+ the end of the command of current THD. And because
+ ha_autocommit_or_rollback() will always be called before that, so
+ we are sure that the node will be removed from the active list
+ before it get freed. */
+ TranxNode *trx_node = (TranxNode *)thd_alloc(thd, sizeof(TranxNode));
+ if (trx_node)
+ {
+ trx_node->log_name_[0] = '\0';
+ trx_node->log_pos_= 0;
+ trx_node->next_= 0;
+ trx_node->hash_next_= 0;
+ }
+ return trx_node;
+}
+
+int ActiveTranx::compare(const char *log_file_name1, my_off_t log_file_pos1,
+ const char *log_file_name2, my_off_t log_file_pos2)
+{
+ int cmp = strcmp(log_file_name1, log_file_name2);
+
+ if (cmp != 0)
+ return cmp;
+
+ if (log_file_pos1 > log_file_pos2)
+ return 1;
+ else if (log_file_pos1 < log_file_pos2)
+ return -1;
+ return 0;
+}
+
+int ActiveTranx::insert_tranx_node(const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ActiveTranx:insert_tranx_node";
+ TranxNode *ins_node;
+ int result = 0;
+ unsigned int hash_val;
+
+ function_enter(kWho);
+
+ ins_node = alloc_tranx_node();
+ if (!ins_node)
+ {
+ sql_print_error("%s: transaction node allocation failed for: (%s, %lu)",
+ kWho, log_file_name, (unsigned long)log_file_pos);
+ result = -1;
+ goto l_end;
+ }
+
+ /* insert the binlog position in the active transaction list. */
+ strcpy(ins_node->log_name_, log_file_name);
+ ins_node->log_pos_ = log_file_pos;
+
+ if (!trx_front_)
+ {
+ /* The list is empty. */
+ trx_front_ = trx_rear_ = ins_node;
+ }
+ else
+ {
+ int cmp = compare(ins_node, trx_rear_);
+ if (cmp > 0)
+ {
+ /* Compare with the tail first. If the transaction happens later in
+ * binlog, then make it the new tail.
+ */
+ trx_rear_->next_ = ins_node;
+ trx_rear_ = ins_node;
+ }
+ else
+ {
+ /* Otherwise, it is an error because the transaction should hold the
+ * mysql_bin_log.LOCK_log when appending events.
+ */
+ sql_print_error("%s: binlog write out-of-order, tail (%s, %lu), "
+ "new node (%s, %lu)", kWho,
+ trx_rear_->log_name_, (unsigned long)trx_rear_->log_pos_,
+ ins_node->log_name_, (unsigned long)ins_node->log_pos_);
+ result = -1;
+ goto l_end;
+ }
+ }
+
+ hash_val = get_hash_value(ins_node->log_name_, ins_node->log_pos_);
+ ins_node->hash_next_ = trx_htb_[hash_val];
+ trx_htb_[hash_val] = ins_node;
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: insert (%s, %lu) in entry(%u)", kWho,
+ ins_node->log_name_, (unsigned long)ins_node->log_pos_,
+ hash_val);
+
+ l_end:
+ return function_exit(kWho, result);
+}
+
+bool ActiveTranx::is_tranx_end_pos(const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ActiveTranx::is_tranx_end_pos";
+ function_enter(kWho);
+
+ unsigned int hash_val = get_hash_value(log_file_name, log_file_pos);
+ TranxNode *entry = trx_htb_[hash_val];
+
+ while (entry != NULL)
+ {
+ if (compare(entry, log_file_name, log_file_pos) == 0)
+ break;
+
+ entry = entry->hash_next_;
+ }
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: probe (%s, %lu) in entry(%u)", kWho,
+ log_file_name, (unsigned long)log_file_pos, hash_val);
+
+ function_exit(kWho, (entry != NULL));
+ return (entry != NULL);
+}
+
+int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ActiveTranx::::clear_active_tranx_nodes";
+ TranxNode *new_front;
+
+ function_enter(kWho);
+
+ if (log_file_name != NULL)
+ {
+ new_front = trx_front_;
+
+ while (new_front)
+ {
+ if (compare(new_front, log_file_name, log_file_pos) > 0)
+ break;
+ new_front = new_front->next_;
+ }
+ }
+ else
+ {
+ /* If log_file_name is NULL, clear everything. */
+ new_front = NULL;
+ }
+
+ if (new_front == NULL)
+ {
+ /* No active transaction nodes after the call. */
+
+ /* Clear the hash table. */
+ memset(trx_htb_, 0, num_entries_ * sizeof(TranxNode *));
+
+ /* Clear the active transaction list. */
+ if (trx_front_ != NULL)
+ {
+ trx_front_ = NULL;
+ trx_rear_ = NULL;
+ }
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: cleared all nodes", kWho);
+ }
+ else if (new_front != trx_front_)
+ {
+ TranxNode *curr_node, *next_node;
+
+ /* Delete all transaction nodes before the confirmation point. */
+ int n_frees = 0;
+ curr_node = trx_front_;
+ while (curr_node != new_front)
+ {
+ next_node = curr_node->next_;
+ n_frees++;
+
+ /* Remove the node from the hash table. */
+ unsigned int hash_val = get_hash_value(curr_node->log_name_, curr_node->log_pos_);
+ TranxNode **hash_ptr = &(trx_htb_[hash_val]);
+ while ((*hash_ptr) != NULL)
+ {
+ if ((*hash_ptr) == curr_node)
+ {
+ (*hash_ptr) = curr_node->hash_next_;
+ break;
+ }
+ hash_ptr = &((*hash_ptr)->hash_next_);
+ }
+
+ curr_node = next_node;
+ }
+
+ trx_front_ = new_front;
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: cleared %d nodes back until pos (%s, %lu)",
+ kWho, n_frees,
+ trx_front_->log_name_, (unsigned long)trx_front_->log_pos_);
+ }
+
+ return function_exit(kWho, 0);
+}
+
+
+/*******************************************************************************
+ *
+ * <ReplSemiSyncMaster> class: the basic code layer for sync-replication master.
+ * <ReplSemiSyncSlave> class: the basic code layer for sync-replication slave.
+ *
+ * The most important functions during semi-syn replication listed:
+ *
+ * Master:
+ * . reportReplyBinlog(): called by the binlog dump thread when it receives
+ * the slave's status information.
+ * . updateSyncHeader(): based on transaction waiting information, decide
+ * whether to request the slave to reply.
+ * . writeTraxInBinlog(): called by the transaction thread when it finishes
+ * writing all transaction events in binlog.
+ * . commitTrx(): transaction thread wait for the slave reply.
+ *
+ * Slave:
+ * . slaveReadSyncHeader(): read the semi-sync header from the master, get the
+ * sync status and get the payload for events.
+ * . slaveReply(): reply to the master about the replication progress.
+ *
+ ******************************************************************************/
+
+ReplSemiSyncMaster::ReplSemiSyncMaster()
+ : active_tranxs_(NULL),
+ init_done_(false),
+ reply_file_name_inited_(false),
+ reply_file_pos_(0L),
+ wait_file_name_inited_(false),
+ wait_file_pos_(0),
+ master_enabled_(false),
+ wait_timeout_(0L),
+ state_(0)
+{
+ strcpy(reply_file_name_, "");
+ strcpy(wait_file_name_, "");
+}
+
+int ReplSemiSyncMaster::initObject()
+{
+ int result;
+ const char *kWho = "ReplSemiSyncMaster::initObject";
+
+ if (init_done_)
+ {
+ fprintf(stderr, "%s called twice\n", kWho);
+ return 1;
+ }
+ init_done_ = true;
+
+ /* References to the parameter works after set_options(). */
+ setWaitTimeout(rpl_semi_sync_master_timeout);
+ setTraceLevel(rpl_semi_sync_master_trace_level);
+
+ /* Mutex initialization can only be done after MY_INIT(). */
+ pthread_mutex_init(&LOCK_binlog_, MY_MUTEX_INIT_FAST);
+ pthread_cond_init(&COND_binlog_send_, NULL);
+
+ if (rpl_semi_sync_master_enabled)
+ result = enableMaster();
+ else
+ result = disableMaster();
+
+ return result;
+}
+
+int ReplSemiSyncMaster::enableMaster()
+{
+ int result = 0;
+
+ /* Must have the lock when we do enable of disable. */
+ lock();
+
+ if (!getMasterEnabled())
+ {
+ active_tranxs_ = new ActiveTranx(&LOCK_binlog_, trace_level_);
+ if (active_tranxs_ != NULL)
+ {
+ commit_file_name_inited_ = false;
+ reply_file_name_inited_ = false;
+ wait_file_name_inited_ = false;
+
+ set_master_enabled(true);
+ state_ = true;
+ sql_print_information("Semi-sync replication enabled on the master.");
+ }
+ else
+ {
+ sql_print_error("Cannot allocate memory to enable semi-sync on the master.");
+ result = -1;
+ }
+ }
+
+ unlock();
+
+ return result;
+}
+
+int ReplSemiSyncMaster::disableMaster()
+{
+ /* Must have the lock when we do enable of disable. */
+ lock();
+
+ if (getMasterEnabled())
+ {
+ /* Switch off the semi-sync first so that waiting transaction will be
+ * waken up.
+ */
+ switch_off();
+
+ assert(active_tranxs_ != NULL);
+ delete active_tranxs_;
+ active_tranxs_ = NULL;
+
+ reply_file_name_inited_ = false;
+ wait_file_name_inited_ = false;
+ commit_file_name_inited_ = false;
+
+ set_master_enabled(false);
+ sql_print_information("Semi-sync replication disabled on the master.");
+ }
+
+ unlock();
+
+ return 0;
+}
+
+ReplSemiSyncMaster::~ReplSemiSyncMaster()
+{
+ if (init_done_)
+ {
+ pthread_mutex_destroy(&LOCK_binlog_);
+ pthread_cond_destroy(&COND_binlog_send_);
+ }
+
+ delete active_tranxs_;
+}
+
+void ReplSemiSyncMaster::lock()
+{
+ pthread_mutex_lock(&LOCK_binlog_);
+}
+
+void ReplSemiSyncMaster::unlock()
+{
+ pthread_mutex_unlock(&LOCK_binlog_);
+}
+
+void ReplSemiSyncMaster::cond_broadcast()
+{
+ pthread_cond_broadcast(&COND_binlog_send_);
+}
+
+int ReplSemiSyncMaster::cond_timewait(struct timespec *wait_time)
+{
+ const char *kWho = "ReplSemiSyncMaster::cond_timewait()";
+ int wait_res;
+
+ function_enter(kWho);
+ wait_res = pthread_cond_timedwait(&COND_binlog_send_,
+ &LOCK_binlog_, wait_time);
+ return function_exit(kWho, wait_res);
+}
+
+void ReplSemiSyncMaster::add_slave()
+{
+ lock();
+ rpl_semi_sync_master_clients++;
+ unlock();
+}
+
+void ReplSemiSyncMaster::remove_slave()
+{
+ lock();
+ rpl_semi_sync_master_clients--;
+
+ /* If user has chosen not to wait if no semi-sync slave available
+ and the last semi-sync slave exits, turn off semi-sync on master
+ immediately.
+ */
+ if (!rpl_semi_sync_master_wait_no_slave &&
+ rpl_semi_sync_master_clients == 0)
+ switch_off();
+ unlock();
+}
+
+bool ReplSemiSyncMaster::is_semi_sync_slave()
+{
+ int null_value;
+ long long val= 0;
+ get_user_var_int("rpl_semi_sync_slave", &val, &null_value);
+ return val;
+}
+
+int ReplSemiSyncMaster::reportReplyBinlog(uint32 server_id,
+ const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ReplSemiSyncMaster::reportReplyBinlog";
+ int cmp;
+ bool can_release_threads = false;
+ bool need_copy_send_pos = true;
+
+ if (!(getMasterEnabled()))
+ return 0;
+
+ function_enter(kWho);
+
+ lock();
+
+ /* This is the real check inside the mutex. */
+ if (!getMasterEnabled())
+ goto l_end;
+
+ if (!is_on())
+ /* We check to see whether we can switch semi-sync ON. */
+ try_switch_on(server_id, log_file_name, log_file_pos);
+
+ /* The position should increase monotonically, if there is only one
+ * thread sending the binlog to the slave.
+ * In reality, to improve the transaction availability, we allow multiple
+ * sync replication slaves. So, if any one of them get the transaction,
+ * the transaction session in the primary can move forward.
+ */
+ if (reply_file_name_inited_)
+ {
+ cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ reply_file_name_, reply_file_pos_);
+
+ /* If the requested position is behind the sending binlog position,
+ * would not adjust sending binlog position.
+ * We based on the assumption that there are multiple semi-sync slave,
+ * and at least one of them shou/ld be up to date.
+ * If all semi-sync slaves are behind, at least initially, the primary
+ * can find the situation after the waiting timeout. After that, some
+ * slaves should catch up quickly.
+ */
+ if (cmp < 0)
+ {
+ /* If the position is behind, do not copy it. */
+ need_copy_send_pos = false;
+ }
+ }
+
+ if (need_copy_send_pos)
+ {
+ strcpy(reply_file_name_, log_file_name);
+ reply_file_pos_ = log_file_pos;
+ reply_file_name_inited_ = true;
+
+ /* Remove all active transaction nodes before this point. */
+ assert(active_tranxs_ != NULL);
+ active_tranxs_->clear_active_tranx_nodes(log_file_name, log_file_pos);
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: Got reply at (%s, %lu)", kWho,
+ log_file_name, (unsigned long)log_file_pos);
+ }
+
+ if (rpl_semi_sync_master_wait_sessions > 0)
+ {
+ /* Let us check if some of the waiting threads doing a trx
+ * commit can now proceed.
+ */
+ cmp = ActiveTranx::compare(reply_file_name_, reply_file_pos_,
+ wait_file_name_, wait_file_pos_);
+ if (cmp >= 0)
+ {
+ /* Yes, at least one waiting thread can now proceed:
+ * let us release all waiting threads with a broadcast
+ */
+ can_release_threads = true;
+ wait_file_name_inited_ = false;
+ }
+ }
+
+ l_end:
+ unlock();
+
+ if (can_release_threads)
+ {
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: signal all waiting threads.", kWho);
+
+ cond_broadcast();
+ }
+
+ return function_exit(kWho, 0);
+}
+
+int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
+ my_off_t trx_wait_binlog_pos)
+{
+ const char *kWho = "ReplSemiSyncMaster::commitTrx";
+
+ function_enter(kWho);
+
+ if (getMasterEnabled() && trx_wait_binlog_name)
+ {
+ struct timeval start_tv;
+ struct timespec abstime;
+ int wait_result, start_time_err;
+ const char *old_msg= 0;
+
+ start_time_err = gettimeofday(&start_tv, 0);
+
+ /* Acquire the mutex. */
+ lock();
+
+ /* This must be called after acquired the lock */
+ old_msg= thd_enter_cond(NULL, &COND_binlog_send_, &LOCK_binlog_,
+ "Waiting for semi-sync ACK from slave");
+
+ /* This is the real check inside the mutex. */
+ if (!getMasterEnabled() || !is_on())
+ goto l_end;
+
+ if (trace_level_ & kTraceDetail)
+ {
+ sql_print_information("%s: wait pos (%s, %lu), repl(%d)\n", kWho,
+ trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos,
+ (int)is_on());
+ }
+
+ while (is_on())
+ {
+ if (reply_file_name_inited_)
+ {
+ int cmp = ActiveTranx::compare(reply_file_name_, reply_file_pos_,
+ trx_wait_binlog_name, trx_wait_binlog_pos);
+ if (cmp >= 0)
+ {
+ /* We have already sent the relevant binlog to the slave: no need to
+ * wait here.
+ */
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: Binlog reply is ahead (%s, %lu),",
+ kWho, reply_file_name_, (unsigned long)reply_file_pos_);
+ break;
+ }
+ }
+
+ /* Let us update the info about the minimum binlog position of waiting
+ * threads.
+ */
+ if (wait_file_name_inited_)
+ {
+ int cmp = ActiveTranx::compare(trx_wait_binlog_name, trx_wait_binlog_pos,
+ wait_file_name_, wait_file_pos_);
+ if (cmp <= 0)
+ {
+ /* This thd has a lower position, let's update the minimum info. */
+ strcpy(wait_file_name_, trx_wait_binlog_name);
+ wait_file_pos_ = trx_wait_binlog_pos;
+
+ rpl_semi_sync_master_wait_pos_backtraverse++;
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: move back wait position (%s, %lu),",
+ kWho, wait_file_name_, (unsigned long)wait_file_pos_);
+ }
+ }
+ else
+ {
+ strcpy(wait_file_name_, trx_wait_binlog_name);
+ wait_file_pos_ = trx_wait_binlog_pos;
+ wait_file_name_inited_ = true;
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: init wait position (%s, %lu),",
+ kWho, wait_file_name_, (unsigned long)wait_file_pos_);
+ }
+
+ if (start_time_err == 0)
+ {
+ int diff_usecs = start_tv.tv_usec + wait_timeout_ * TIME_THOUSAND;
+
+ /* Calcuate the waiting period. */
+#ifdef __WIN__
+ abstime.tv.i64 = (__int64)start_tv.tv_sec * TIME_MILLION * 10;
+ abstime.tv.i64 += (__int64)diff_usecs * 10;
+ abstime.max_timeout_msec= (long)wait_timeout_;
+#else
+ abstime.tv_sec = start_tv.tv_sec;
+ if (diff_usecs < TIME_MILLION)
+ {
+ abstime.tv_nsec = diff_usecs * TIME_THOUSAND;
+ }
+ else
+ {
+ while (diff_usecs >= TIME_MILLION)
+ {
+ abstime.tv_sec++;
+ diff_usecs -= TIME_MILLION;
+ }
+ abstime.tv_nsec = diff_usecs * TIME_THOUSAND;
+ }
+#endif /* __WIN__ */
+
+ /* In semi-synchronous replication, we wait until the binlog-dump
+ * thread has received the reply on the relevant binlog segment from the
+ * replication slave.
+ *
+ * Let us suspend this thread to wait on the condition;
+ * when replication has progressed far enough, we will release
+ * these waiting threads.
+ */
+ rpl_semi_sync_master_wait_sessions++;
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: wait %lu ms for binlog sent (%s, %lu)",
+ kWho, wait_timeout_,
+ wait_file_name_, (unsigned long)wait_file_pos_);
+
+ wait_result = cond_timewait(&abstime);
+ rpl_semi_sync_master_wait_sessions--;
+
+ if (wait_result != 0)
+ {
+ /* This is a real wait timeout. */
+ sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos: %lu), "
+ "semi-sync up to file %s, position %lu.",
+ trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos,
+ reply_file_name_, (unsigned long)reply_file_pos_);
+ rpl_semi_sync_master_wait_timeouts++;
+
+ /* switch semi-sync off */
+ switch_off();
+ }
+ else
+ {
+ int wait_time;
+
+ wait_time = getWaitTime(start_tv);
+ if (wait_time < 0)
+ {
+ if (trace_level_ & kTraceGeneral)
+ {
+ /* This is a time/gettimeofday function call error. */
+ sql_print_error("Replication semi-sync gettimeofday fail1 at "
+ "wait position (%s, %lu)",
+ trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos);
+ }
+ rpl_semi_sync_master_timefunc_fails++;
+ }
+ else
+ {
+ rpl_semi_sync_master_trx_wait_num++;
+ rpl_semi_sync_master_trx_wait_time += wait_time;
+ }
+ }
+ }
+ else
+ {
+ if (trace_level_ & kTraceGeneral)
+ {
+ /* This is a gettimeofday function call error. */
+ sql_print_error("Replication semi-sync gettimeofday fail2 at "
+ "wait position (%s, %lu)",
+ trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos);
+ }
+ rpl_semi_sync_master_timefunc_fails++;
+
+ /* switch semi-sync off */
+ switch_off();
+ }
+ }
+
+ l_end:
+ /*
+ At this point, the binlog file and position of this transaction
+ must have been removed from ActiveTranx.
+ */
+ assert(!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
+ trx_wait_binlog_pos));
+
+ /* Update the status counter. */
+ if (is_on())
+ rpl_semi_sync_master_yes_transactions++;
+ else
+ rpl_semi_sync_master_no_transactions++;
+
+ /* The lock held will be released by thd_exit_cond, so no need to
+ call unlock() here */
+ thd_exit_cond(NULL, old_msg);
+ }
+
+ return function_exit(kWho, 0);
+}
+
+/* Indicate that semi-sync replication is OFF now.
+ *
+ * What should we do when it is disabled? The problem is that we want
+ * the semi-sync replication enabled again when the slave catches up
+ * later. But, it is not that easy to detect that the slave has caught
+ * up. This is caused by the fact that MySQL's replication protocol is
+ * asynchronous, meaning that if the master does not use the semi-sync
+ * protocol, the slave would not send anything to the master.
+ * Still, if the master is sending (N+1)-th event, we assume that it is
+ * an indicator that the slave has received N-th event and earlier ones.
+ *
+ * If semi-sync is disabled, all transactions still update the wait
+ * position with the last position in binlog. But no transactions will
+ * wait for confirmations and the active transaction list would not be
+ * maintained. In binlog dump thread, updateSyncHeader() checks whether
+ * the current sending event catches up with last wait position. If it
+ * does match, semi-sync will be switched on again.
+ */
+int ReplSemiSyncMaster::switch_off()
+{
+ const char *kWho = "ReplSemiSyncMaster::switch_off";
+ int result;
+
+ function_enter(kWho);
+ state_ = false;
+
+ /* Clear the active transaction list. */
+ assert(active_tranxs_ != NULL);
+ result = active_tranxs_->clear_active_tranx_nodes(NULL, 0);
+
+ rpl_semi_sync_master_off_times++;
+ wait_file_name_inited_ = false;
+ reply_file_name_inited_ = false;
+ sql_print_information("Semi-sync replication switched OFF.");
+ cond_broadcast(); /* wake up all waiting threads */
+
+ return function_exit(kWho, result);
+}
+
+int ReplSemiSyncMaster::try_switch_on(int server_id,
+ const char *log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ReplSemiSyncMaster::try_switch_on";
+ bool semi_sync_on = false;
+
+ function_enter(kWho);
+
+ /* If the current sending event's position is larger than or equal to the
+ * 'largest' commit transaction binlog position, the slave is already
+ * catching up now and we can switch semi-sync on here.
+ * If commit_file_name_inited_ indicates there are no recent transactions,
+ * we can enable semi-sync immediately.
+ */
+ if (commit_file_name_inited_)
+ {
+ int cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ commit_file_name_, commit_file_pos_);
+ semi_sync_on = (cmp >= 0);
+ }
+ else
+ {
+ semi_sync_on = true;
+ }
+
+ if (semi_sync_on)
+ {
+ /* Switch semi-sync replication on. */
+ state_ = true;
+
+ sql_print_information("Semi-sync replication switched ON with slave (server_id: %d) "
+ "at (%s, %lu)",
+ server_id, log_file_name,
+ (unsigned long)log_file_pos);
+ }
+
+ return function_exit(kWho, 0);
+}
+
+int ReplSemiSyncMaster::reserveSyncHeader(unsigned char *header,
+ unsigned long size)
+{
+ const char *kWho = "ReplSemiSyncMaster::reserveSyncHeader";
+ function_enter(kWho);
+
+ int hlen=0;
+ if (!is_semi_sync_slave())
+ {
+ hlen= 0;
+ }
+ else
+ {
+ /* No enough space for the extra header, disable semi-sync master */
+ if (sizeof(kSyncHeader) > size)
+ {
+ sql_print_warning("No enough space in the packet "
+ "for semi-sync extra header, "
+ "semi-sync replication disabled");
+ disableMaster();
+ return 0;
+ }
+
+ /* Set the magic number and the sync status. By default, no sync
+ * is required.
+ */
+ memcpy(header, kSyncHeader, sizeof(kSyncHeader));
+ hlen= sizeof(kSyncHeader);
+ }
+ return function_exit(kWho, hlen);
+}
+
+int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet,
+ const char *log_file_name,
+ my_off_t log_file_pos,
+ uint32 server_id)
+{
+ const char *kWho = "ReplSemiSyncMaster::updateSyncHeader";
+ int cmp = 0;
+ bool sync = false;
+
+ /* If the semi-sync master is not enabled, or the slave is not a semi-sync
+ * target, do not request replies from the slave.
+ */
+ if (!getMasterEnabled() || !is_semi_sync_slave())
+ {
+ sync = false;
+ return 0;
+ }
+
+ function_enter(kWho);
+
+ lock();
+
+ /* This is the real check inside the mutex. */
+ if (!getMasterEnabled())
+ {
+ sync = false;
+ goto l_end;
+ }
+
+ if (is_on())
+ {
+ /* semi-sync is ON */
+ sync = false; /* No sync unless a transaction is involved. */
+
+ if (reply_file_name_inited_)
+ {
+ cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ reply_file_name_, reply_file_pos_);
+ if (cmp <= 0)
+ {
+ /* If we have already got the reply for the event, then we do
+ * not need to sync the transaction again.
+ */
+ goto l_end;
+ }
+ }
+
+ if (wait_file_name_inited_)
+ {
+ cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ wait_file_name_, wait_file_pos_);
+ }
+ else
+ {
+ cmp = 1;
+ }
+
+ /* If we are already waiting for some transaction replies which
+ * are later in binlog, do not wait for this one event.
+ */
+ if (cmp >= 0)
+ {
+ /*
+ * We only wait if the event is a transaction's ending event.
+ */
+ assert(active_tranxs_ != NULL);
+ sync = active_tranxs_->is_tranx_end_pos(log_file_name,
+ log_file_pos);
+ }
+ }
+ else
+ {
+ if (commit_file_name_inited_)
+ {
+ int cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ commit_file_name_, commit_file_pos_);
+ sync = (cmp >= 0);
+ }
+ else
+ {
+ sync = true;
+ }
+ }
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: server(%d), (%s, %lu) sync(%d), repl(%d)",
+ kWho, server_id, log_file_name,
+ (unsigned long)log_file_pos, sync, (int)is_on());
+
+ l_end:
+ unlock();
+
+ /* We do not need to clear sync flag because we set it to 0 when we
+ * reserve the packet header.
+ */
+ if (sync)
+ {
+ (packet)[2] = kPacketFlagSync;
+ }
+
+ return function_exit(kWho, 0);
+}
+
+int ReplSemiSyncMaster::writeTranxInBinlog(const char* log_file_name,
+ my_off_t log_file_pos)
+{
+ const char *kWho = "ReplSemiSyncMaster::writeTranxInBinlog";
+ int result = 0;
+
+ function_enter(kWho);
+
+ lock();
+
+ /* This is the real check inside the mutex. */
+ if (!getMasterEnabled())
+ goto l_end;
+
+ /* Update the 'largest' transaction commit position seen so far even
+ * though semi-sync is switched off.
+ * It is much better that we update commit_file_* here, instead of
+ * inside commitTrx(). This is mostly because updateSyncHeader()
+ * will watch for commit_file_* to decide whether to switch semi-sync
+ * on. The detailed reason is explained in function updateSyncHeader().
+ */
+ if (commit_file_name_inited_)
+ {
+ int cmp = ActiveTranx::compare(log_file_name, log_file_pos,
+ commit_file_name_, commit_file_pos_);
+ if (cmp > 0)
+ {
+ /* This is a larger position, let's update the maximum info. */
+ strcpy(commit_file_name_, log_file_name);
+ commit_file_pos_ = log_file_pos;
+ }
+ }
+ else
+ {
+ strcpy(commit_file_name_, log_file_name);
+ commit_file_pos_ = log_file_pos;
+ commit_file_name_inited_ = true;
+ }
+
+ if (is_on())
+ {
+ assert(active_tranxs_ != NULL);
+ if(active_tranxs_->insert_tranx_node(log_file_name, log_file_pos))
+ {
+ /*
+ if insert tranx_node failed, print a warning message
+ and turn off semi-sync
+ */
+ sql_print_warning("Semi-sync failed to insert tranx_node for binlog file: %s, position: %lu",
+ log_file_name, (ulong)log_file_pos);
+ switch_off();
+ }
+ }
+
+ l_end:
+ unlock();
+
+ return function_exit(kWho, result);
+}
+
+int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id,
+ const char *event_buf)
+{
+ const char *kWho = "ReplSemiSyncMaster::readSlaveReply";
+ const unsigned char *packet;
+ char log_file_name[FN_REFLEN];
+ my_off_t log_file_pos;
+ ulong packet_len;
+ int result = -1;
+
+ struct timeval start_tv;
+ int start_time_err= 0;
+ ulong trc_level = trace_level_;
+
+ function_enter(kWho);
+
+ assert((unsigned char)event_buf[1] == kPacketMagicNum);
+ if ((unsigned char)event_buf[2] != kPacketFlagSync)
+ {
+ /* current event does not require reply */
+ result = 0;
+ goto l_end;
+ }
+
+ if (trc_level & kTraceNetWait)
+ start_time_err = gettimeofday(&start_tv, 0);
+
+ /* We flush to make sure that the current event is sent to the network,
+ * instead of being buffered in the TCP/IP stack.
+ */
+ if (net_flush(net))
+ {
+ sql_print_error("Semi-sync master failed on net_flush() "
+ "before waiting for slave reply");
+ goto l_end;
+ }
+
+ net_clear(net, 0);
+ if (trc_level & kTraceDetail)
+ sql_print_information("%s: Wait for replica's reply", kWho);
+
+ /* Wait for the network here. Though binlog dump thread can indefinitely wait
+ * here, transactions would not wait indefintely.
+ * Transactions wait on binlog replies detected by binlog dump threads. If
+ * binlog dump threads wait too long, transactions will timeout and continue.
+ */
+ packet_len = my_net_read(net);
+
+ if (trc_level & kTraceNetWait)
+ {
+ if (start_time_err != 0)
+ {
+ sql_print_error("Semi-sync master wait for reply "
+ "gettimeofday fail to get start time");
+ rpl_semi_sync_master_timefunc_fails++;
+ }
+ else
+ {
+ int wait_time;
+
+ wait_time = getWaitTime(start_tv);
+ if (wait_time < 0)
+ {
+ sql_print_error("Semi-sync master wait for reply "
+ "gettimeofday fail to get wait time.");
+ rpl_semi_sync_master_timefunc_fails++;
+ }
+ else
+ {
+ rpl_semi_sync_master_net_wait_num++;
+ rpl_semi_sync_master_net_wait_time += wait_time;
+ }
+ }
+ }
+
+ if (packet_len == packet_error || packet_len < REPLY_BINLOG_NAME_OFFSET)
+ {
+ if (packet_len == packet_error)
+ sql_print_error("Read semi-sync reply network error: %s (errno: %d)",
+ net->last_error, net->last_errno);
+ else
+ sql_print_error("Read semi-sync reply length error: %s (errno: %d)",
+ net->last_error, net->last_errno);
+ goto l_end;
+ }
+
+ packet = net->read_pos;
+ if (packet[REPLY_MAGIC_NUM_OFFSET] != ReplSemiSyncMaster::kPacketMagicNum)
+ {
+ sql_print_error("Read semi-sync reply magic number error");
+ goto l_end;
+ }
+
+ log_file_pos = uint8korr(packet + REPLY_BINLOG_POS_OFFSET);
+ strcpy(log_file_name, (const char*)packet + REPLY_BINLOG_NAME_OFFSET);
+
+ if (trc_level & kTraceDetail)
+ sql_print_information("%s: Got reply (%s, %lu)",
+ kWho, log_file_name, (ulong)log_file_pos);
+
+ result = reportReplyBinlog(server_id, log_file_name, log_file_pos);
+
+ l_end:
+ return function_exit(kWho, result);
+}
+
+
+int ReplSemiSyncMaster::resetMaster()
+{
+ const char *kWho = "ReplSemiSyncMaster::resetMaster";
+ int result = 0;
+
+ function_enter(kWho);
+
+
+ lock();
+
+ state_ = getMasterEnabled()? 1 : 0;
+
+ wait_file_name_inited_ = false;
+ reply_file_name_inited_ = false;
+ commit_file_name_inited_ = false;
+
+ rpl_semi_sync_master_yes_transactions = 0;
+ rpl_semi_sync_master_no_transactions = 0;
+ rpl_semi_sync_master_off_times = 0;
+ rpl_semi_sync_master_timefunc_fails = 0;
+ rpl_semi_sync_master_wait_sessions = 0;
+ rpl_semi_sync_master_wait_pos_backtraverse = 0;
+ rpl_semi_sync_master_trx_wait_num = 0;
+ rpl_semi_sync_master_trx_wait_time = 0;
+ rpl_semi_sync_master_net_wait_num = 0;
+ rpl_semi_sync_master_net_wait_time = 0;
+
+ unlock();
+
+ return function_exit(kWho, result);
+}
+
+void ReplSemiSyncMaster::setExportStats()
+{
+ lock();
+
+ rpl_semi_sync_master_status = state_;
+ rpl_semi_sync_master_avg_trx_wait_time=
+ ((rpl_semi_sync_master_trx_wait_num) ?
+ (unsigned long)((double)rpl_semi_sync_master_trx_wait_time /
+ ((double)rpl_semi_sync_master_trx_wait_num)) : 0);
+ rpl_semi_sync_master_avg_net_wait_time=
+ ((rpl_semi_sync_master_net_wait_num) ?
+ (unsigned long)((double)rpl_semi_sync_master_net_wait_time /
+ ((double)rpl_semi_sync_master_net_wait_num)) : 0);
+
+ unlock();
+}
+
+/* Get the waiting time given the wait's staring time.
+ *
+ * Return:
+ * >= 0: the waiting time in microsecons(us)
+ * < 0: error in gettimeofday or time back traverse
+ */
+static int getWaitTime(const struct timeval& start_tv)
+{
+ unsigned long long start_usecs, end_usecs;
+ struct timeval end_tv;
+ int end_time_err;
+
+ /* Starting time in microseconds(us). */
+ start_usecs = start_tv.tv_sec * TIME_MILLION + start_tv.tv_usec;
+
+ /* Get the wait time interval. */
+ end_time_err = gettimeofday(&end_tv, 0);
+
+ /* Ending time in microseconds(us). */
+ end_usecs = end_tv.tv_sec * TIME_MILLION + end_tv.tv_usec;
+
+ if (end_time_err != 0 || end_usecs < start_usecs)
+ return -1;
+
+ return (int)(end_usecs - start_usecs);
+}
diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h
new file mode 100644
index 00000000000..bfb1cb74cd0
--- /dev/null
+++ b/plugin/semisync/semisync_master.h
@@ -0,0 +1,363 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#ifndef SEMISYNC_MASTER_H
+#define SEMISYNC_MASTER_H
+
+#include "semisync.h"
+
+/**
+ This class manages memory for active transaction list.
+
+ We record each active transaction with a TranxNode, each session
+ can have only one open transaction. Because of EVENT, the total
+ active transaction nodes can exceed the maximum allowed
+ connections.
+*/
+class ActiveTranx
+ :public Trace {
+private:
+ struct TranxNode {
+ char log_name_[FN_REFLEN];
+ my_off_t log_pos_;
+ struct TranxNode *next_; /* the next node in the sorted list */
+ struct TranxNode *hash_next_; /* the next node during hash collision */
+ };
+
+ /* These two record the active transaction list in sort order. */
+ TranxNode *trx_front_, *trx_rear_;
+
+ TranxNode **trx_htb_; /* A hash table on active transactions. */
+
+ int num_entries_; /* maximum hash table entries */
+ pthread_mutex_t *lock_; /* mutex lock */
+
+ inline void assert_lock_owner();
+
+ inline TranxNode* alloc_tranx_node();
+
+ inline unsigned int calc_hash(const unsigned char *key,unsigned int length);
+ unsigned int get_hash_value(const char *log_file_name, my_off_t log_file_pos);
+
+ int compare(const char *log_file_name1, my_off_t log_file_pos1,
+ const TranxNode *node2) {
+ return compare(log_file_name1, log_file_pos1,
+ node2->log_name_, node2->log_pos_);
+ }
+ int compare(const TranxNode *node1,
+ const char *log_file_name2, my_off_t log_file_pos2) {
+ return compare(node1->log_name_, node1->log_pos_,
+ log_file_name2, log_file_pos2);
+ }
+ int compare(const TranxNode *node1, const TranxNode *node2) {
+ return compare(node1->log_name_, node1->log_pos_,
+ node2->log_name_, node2->log_pos_);
+ }
+
+public:
+ ActiveTranx(pthread_mutex_t *lock, unsigned long trace_level);
+ ~ActiveTranx();
+
+ /* Insert an active transaction node with the specified position.
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int insert_tranx_node(const char *log_file_name, my_off_t log_file_pos);
+
+ /* Clear the active transaction nodes until(inclusive) the specified
+ * position.
+ * If log_file_name is NULL, everything will be cleared: the sorted
+ * list and the hash table will be reset to empty.
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int clear_active_tranx_nodes(const char *log_file_name,
+ my_off_t log_file_pos);
+
+ /* Given a position, check to see whether the position is an active
+ * transaction's ending position by probing the hash table.
+ */
+ bool is_tranx_end_pos(const char *log_file_name, my_off_t log_file_pos);
+
+ /* Given two binlog positions, compare which one is bigger based on
+ * (file_name, file_position).
+ */
+ static int compare(const char *log_file_name1, my_off_t log_file_pos1,
+ const char *log_file_name2, my_off_t log_file_pos2);
+
+};
+
+/**
+ The extension class for the master of semi-synchronous replication
+*/
+class ReplSemiSyncMaster
+ :public ReplSemiSyncBase {
+ private:
+ ActiveTranx *active_tranxs_; /* active transaction list: the list will
+ be cleared when semi-sync switches off. */
+
+ /* True when initObject has been called */
+ bool init_done_;
+
+ /* This cond variable is signaled when enough binlog has been sent to slave,
+ * so that a waiting trx can return the 'ok' to the client for a commit.
+ */
+ pthread_cond_t COND_binlog_send_;
+
+ /* Mutex that protects the following state variables and the active
+ * transaction list.
+ * Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are
+ * already holding LOCK_binlog_ because it can cause deadlocks.
+ */
+ pthread_mutex_t LOCK_binlog_;
+
+ /* This is set to true when reply_file_name_ contains meaningful data. */
+ bool reply_file_name_inited_;
+
+ /* The binlog name up to which we have received replies from any slaves. */
+ char reply_file_name_[FN_REFLEN];
+
+ /* The position in that file up to which we have the reply from any slaves. */
+ my_off_t reply_file_pos_;
+
+ /* This is set to true when we know the 'smallest' wait position. */
+ bool wait_file_name_inited_;
+
+ /* NULL, or the 'smallest' filename that a transaction is waiting for
+ * slave replies.
+ */
+ char wait_file_name_[FN_REFLEN];
+
+ /* The smallest position in that file that a trx is waiting for: the trx
+ * can proceed and send an 'ok' to the client when the master has got the
+ * reply from the slave indicating that it already got the binlog events.
+ */
+ my_off_t wait_file_pos_;
+
+ /* This is set to true when we know the 'largest' transaction commit
+ * position in the binlog file.
+ * We always maintain the position no matter whether semi-sync is switched
+ * on switched off. When a transaction wait timeout occurs, semi-sync will
+ * switch off. Binlog-dump thread can use the three fields to detect when
+ * slaves catch up on replication so that semi-sync can switch on again.
+ */
+ bool commit_file_name_inited_;
+
+ /* The 'largest' binlog filename that a commit transaction is seeing. */
+ char commit_file_name_[FN_REFLEN];
+
+ /* The 'largest' position in that file that a commit transaction is seeing. */
+ my_off_t commit_file_pos_;
+
+ /* All global variables which can be set by parameters. */
+ volatile bool master_enabled_; /* semi-sync is enabled on the master */
+ unsigned long wait_timeout_; /* timeout period(ms) during tranx wait */
+
+ bool state_; /* whether semi-sync is switched */
+
+ void lock();
+ void unlock();
+ void cond_broadcast();
+ int cond_timewait(struct timespec *wait_time);
+
+ /* Is semi-sync replication on? */
+ bool is_on() {
+ return (state_);
+ }
+
+ void set_master_enabled(bool enabled) {
+ master_enabled_ = enabled;
+ }
+
+ /* Switch semi-sync off because of timeout in transaction waiting. */
+ int switch_off();
+
+ /* Switch semi-sync on when slaves catch up. */
+ int try_switch_on(int server_id,
+ const char *log_file_name, my_off_t log_file_pos);
+
+ public:
+ ReplSemiSyncMaster();
+ ~ReplSemiSyncMaster();
+
+ bool getMasterEnabled() {
+ return master_enabled_;
+ }
+ void setTraceLevel(unsigned long trace_level) {
+ trace_level_ = trace_level;
+ if (active_tranxs_)
+ active_tranxs_->trace_level_ = trace_level;
+ }
+
+ /* Set the transaction wait timeout period, in milliseconds. */
+ void setWaitTimeout(unsigned long wait_timeout) {
+ wait_timeout_ = wait_timeout;
+ }
+
+ /* Initialize this class after MySQL parameters are initialized. this
+ * function should be called once at bootstrap time.
+ */
+ int initObject();
+
+ /* Enable the object to enable semi-sync replication inside the master. */
+ int enableMaster();
+
+ /* Enable the object to enable semi-sync replication inside the master. */
+ int disableMaster();
+
+ /* Add a semi-sync replication slave */
+ void add_slave();
+
+ /* Remove a semi-sync replication slave */
+ void remove_slave();
+
+ /* Is the slave servered by the thread requested semi-sync */
+ bool is_semi_sync_slave();
+
+ /* In semi-sync replication, reports up to which binlog position we have
+ * received replies from the slave indicating that it already get the events.
+ *
+ * Input:
+ * server_id - (IN) master server id number
+ * log_file_name - (IN) binlog file name
+ * end_offset - (IN) the offset in the binlog file up to which we have
+ * the replies from the slave
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int reportReplyBinlog(uint32 server_id,
+ const char* log_file_name,
+ my_off_t end_offset);
+
+ /* Commit a transaction in the final step. This function is called from
+ * InnoDB before returning from the low commit. If semi-sync is switch on,
+ * the function will wait to see whether binlog-dump thread get the reply for
+ * the events of the transaction. Remember that this is not a direct wait,
+ * instead, it waits to see whether the binlog-dump thread has reached the
+ * point. If the wait times out, semi-sync status will be switched off and
+ * all other transaction would not wait either.
+ *
+ * Input: (the transaction events' ending binlog position)
+ * trx_wait_binlog_name - (IN) ending position's file name
+ * trx_wait_binlog_pos - (IN) ending position's file offset
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int commitTrx(const char* trx_wait_binlog_name,
+ my_off_t trx_wait_binlog_pos);
+
+ /* Reserve space in the replication event packet header:
+ * . slave semi-sync off: 1 byte - (0)
+ * . slave semi-sync on: 3 byte - (0, 0xef, 0/1}
+ *
+ * Input:
+ * header - (IN) the header buffer
+ * size - (IN) size of the header buffer
+ *
+ * Return:
+ * size of the bytes reserved for header
+ */
+ int reserveSyncHeader(unsigned char *header, unsigned long size);
+
+ /* Update the sync bit in the packet header to indicate to the slave whether
+ * the master will wait for the reply of the event. If semi-sync is switched
+ * off and we detect that the slave is catching up, we switch semi-sync on.
+ *
+ * Input:
+ * packet - (IN) the packet containing the replication event
+ * log_file_name - (IN) the event ending position's file name
+ * log_file_pos - (IN) the event ending position's file offset
+ * server_id - (IN) master server id number
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int updateSyncHeader(unsigned char *packet,
+ const char *log_file_name,
+ my_off_t log_file_pos,
+ uint32 server_id);
+
+ /* Called when a transaction finished writing binlog events.
+ * . update the 'largest' transactions' binlog event position
+ * . insert the ending position in the active transaction list if
+ * semi-sync is on
+ *
+ * Input: (the transaction events' ending binlog position)
+ * log_file_name - (IN) transaction ending position's file name
+ * log_file_pos - (IN) transaction ending position's file offset
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int writeTranxInBinlog(const char* log_file_name, my_off_t log_file_pos);
+
+ /* Read the slave's reply so that we know how much progress the slave makes
+ * on receive replication events.
+ *
+ * Input:
+ * net - (IN) the connection to master
+ * server_id - (IN) master server id number
+ * event_buf - (IN) pointer to the event packet
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int readSlaveReply(NET *net, uint32 server_id, const char *event_buf);
+
+ /* Export internal statistics for semi-sync replication. */
+ void setExportStats();
+
+ /* 'reset master' command is issued from the user and semi-sync need to
+ * go off for that.
+ */
+ int resetMaster();
+};
+
+/* System and status variables for the master component */
+extern char rpl_semi_sync_master_enabled;
+extern char rpl_semi_sync_master_status;
+extern unsigned long rpl_semi_sync_master_clients;
+extern unsigned long rpl_semi_sync_master_timeout;
+extern unsigned long rpl_semi_sync_master_trace_level;
+extern unsigned long rpl_semi_sync_master_yes_transactions;
+extern unsigned long rpl_semi_sync_master_no_transactions;
+extern unsigned long rpl_semi_sync_master_off_times;
+extern unsigned long rpl_semi_sync_master_wait_timeouts;
+extern unsigned long rpl_semi_sync_master_timefunc_fails;
+extern unsigned long rpl_semi_sync_master_num_timeouts;
+extern unsigned long rpl_semi_sync_master_wait_sessions;
+extern unsigned long rpl_semi_sync_master_wait_pos_backtraverse;
+extern unsigned long rpl_semi_sync_master_avg_trx_wait_time;
+extern unsigned long rpl_semi_sync_master_avg_net_wait_time;
+extern unsigned long long rpl_semi_sync_master_net_wait_num;
+extern unsigned long long rpl_semi_sync_master_trx_wait_num;
+extern unsigned long long rpl_semi_sync_master_net_wait_time;
+extern unsigned long long rpl_semi_sync_master_trx_wait_time;
+
+/*
+ This indicates whether we should keep waiting if no semi-sync slave
+ is available.
+ 0 : stop waiting if detected no avaialable semi-sync slave.
+ 1 (default) : keep waiting until timeout even no available semi-sync slave.
+*/
+extern char rpl_semi_sync_master_wait_no_slave;
+
+#endif /* SEMISYNC_MASTER_H */
diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc
new file mode 100644
index 00000000000..efcb7172b28
--- /dev/null
+++ b/plugin/semisync/semisync_master_plugin.cc
@@ -0,0 +1,394 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#include "semisync_master.h"
+
+ReplSemiSyncMaster repl_semisync;
+
+int repl_semi_report_binlog_update(Binlog_storage_param *param,
+ const char *log_file,
+ my_off_t log_pos, uint32 flags)
+{
+ int error= 0;
+
+ if (repl_semisync.getMasterEnabled())
+ {
+ /*
+ Let us store the binlog file name and the position, so that
+ we know how long to wait for the binlog to the replicated to
+ the slave in synchronous replication.
+ */
+ error= repl_semisync.writeTranxInBinlog(log_file,
+ log_pos);
+ }
+
+ return error;
+}
+
+int repl_semi_request_commit(Trans_param *param)
+{
+ return 0;
+}
+
+int repl_semi_report_commit(Trans_param *param)
+{
+
+ bool is_real_trans= param->flags & TRANS_IS_REAL_TRANS;
+
+ if (is_real_trans && param->log_pos)
+ {
+ const char *binlog_name= param->log_file;
+ return repl_semisync.commitTrx(binlog_name, param->log_pos);
+ }
+ return 0;
+}
+
+int repl_semi_report_rollback(Trans_param *param)
+{
+ return repl_semi_report_commit(param);
+}
+
+int repl_semi_binlog_dump_start(Binlog_transmit_param *param,
+ const char *log_file,
+ my_off_t log_pos)
+{
+ bool semi_sync_slave= repl_semisync.is_semi_sync_slave();
+
+ if (semi_sync_slave)
+ {
+ /* One more semi-sync slave */
+ repl_semisync.add_slave();
+
+ /*
+ Let's assume this semi-sync slave has already received all
+ binlog events before the filename and position it requests.
+ */
+ repl_semisync.reportReplyBinlog(param->server_id, log_file, log_pos);
+ }
+ sql_print_information("Start %s binlog_dump to slave (server_id: %d), pos(%s, %lu)",
+ semi_sync_slave ? "semi-sync" : "asynchronous",
+ param->server_id, log_file, (unsigned long)log_pos);
+
+ return 0;
+}
+
+int repl_semi_binlog_dump_end(Binlog_transmit_param *param)
+{
+ bool semi_sync_slave= repl_semisync.is_semi_sync_slave();
+
+ sql_print_information("Stop %s binlog_dump to slave (server_id: %d)",
+ semi_sync_slave ? "semi-sync" : "asynchronous",
+ param->server_id);
+ if (semi_sync_slave)
+ {
+ /* One less semi-sync slave */
+ repl_semisync.remove_slave();
+ }
+ return 0;
+}
+
+int repl_semi_reserve_header(Binlog_transmit_param *param,
+ unsigned char *header,
+ unsigned long size, unsigned long *len)
+{
+ *len += repl_semisync.reserveSyncHeader(header, size);
+ return 0;
+}
+
+int repl_semi_before_send_event(Binlog_transmit_param *param,
+ unsigned char *packet, unsigned long len,
+ const char *log_file, my_off_t log_pos)
+{
+ return repl_semisync.updateSyncHeader(packet,
+ log_file,
+ log_pos,
+ param->server_id);
+}
+
+int repl_semi_after_send_event(Binlog_transmit_param *param,
+ const char *event_buf, unsigned long len)
+{
+ if (repl_semisync.is_semi_sync_slave())
+ {
+ THD *thd= current_thd;
+ /*
+ Possible errors in reading slave reply are ignored deliberately
+ because we do not want dump thread to quit on this. Error
+ messages are already reported.
+ */
+ (void) repl_semisync.readSlaveReply(&thd->net,
+ param->server_id, event_buf);
+ thd->clear_error();
+ }
+ return 0;
+}
+
+int repl_semi_reset_master(Binlog_transmit_param *param)
+{
+ if (repl_semisync.resetMaster())
+ return 1;
+ return 0;
+}
+
+/*
+ semisync system variables
+ */
+static void fix_rpl_semi_sync_master_timeout(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val);
+
+static void fix_rpl_semi_sync_master_trace_level(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val);
+
+static void fix_rpl_semi_sync_master_enabled(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val);
+
+static MYSQL_SYSVAR_BOOL(enabled, rpl_semi_sync_master_enabled,
+ PLUGIN_VAR_OPCMDARG,
+ "Enable semi-synchronous replication master (disabled by default). ",
+ NULL, // check
+ &fix_rpl_semi_sync_master_enabled, // update
+ 0);
+
+static MYSQL_SYSVAR_ULONG(timeout, rpl_semi_sync_master_timeout,
+ PLUGIN_VAR_OPCMDARG,
+ "The timeout value (in ms) for semi-synchronous replication in the master",
+ NULL, // check
+ fix_rpl_semi_sync_master_timeout, // update
+ 10000, 0, ~0L, 1);
+
+static MYSQL_SYSVAR_BOOL(wait_no_slave, rpl_semi_sync_master_wait_no_slave,
+ PLUGIN_VAR_OPCMDARG,
+ "Wait until timeout when no semi-synchronous replication slave available (enabled by default). ",
+ NULL, // check
+ NULL, // update
+ 1);
+
+static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_master_trace_level,
+ PLUGIN_VAR_OPCMDARG,
+ "The tracing level for semi-sync replication.",
+ NULL, // check
+ &fix_rpl_semi_sync_master_trace_level, // update
+ 32, 0, ~0L, 1);
+
+static SYS_VAR* semi_sync_master_system_vars[]= {
+ MYSQL_SYSVAR(enabled),
+ MYSQL_SYSVAR(timeout),
+ MYSQL_SYSVAR(wait_no_slave),
+ MYSQL_SYSVAR(trace_level),
+ NULL,
+};
+
+
+static void fix_rpl_semi_sync_master_timeout(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val)
+{
+ *(unsigned long *)ptr= *(unsigned long *)val;
+ repl_semisync.setWaitTimeout(rpl_semi_sync_master_timeout);
+ return;
+}
+
+static void fix_rpl_semi_sync_master_trace_level(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val)
+{
+ *(unsigned long *)ptr= *(unsigned long *)val;
+ repl_semisync.setTraceLevel(rpl_semi_sync_master_trace_level);
+ return;
+}
+
+static void fix_rpl_semi_sync_master_enabled(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val)
+{
+ *(char *)ptr= *(char *)val;
+ if (rpl_semi_sync_master_enabled)
+ {
+ if (repl_semisync.enableMaster() != 0)
+ rpl_semi_sync_master_enabled = false;
+ }
+ else
+ {
+ if (repl_semisync.disableMaster() != 0)
+ rpl_semi_sync_master_enabled = true;
+ }
+
+ return;
+}
+
+Trans_observer trans_observer = {
+ sizeof(Trans_observer), // len
+
+ repl_semi_report_commit, // after_commit
+ repl_semi_report_rollback, // after_rollback
+};
+
+Binlog_storage_observer storage_observer = {
+ sizeof(Binlog_storage_observer), // len
+
+ repl_semi_report_binlog_update, // report_update
+};
+
+Binlog_transmit_observer transmit_observer = {
+ sizeof(Binlog_transmit_observer), // len
+
+ repl_semi_binlog_dump_start, // start
+ repl_semi_binlog_dump_end, // stop
+ repl_semi_reserve_header, // reserve_header
+ repl_semi_before_send_event, // before_send_event
+ repl_semi_after_send_event, // after_send_event
+ repl_semi_reset_master, // reset
+};
+
+
+#define SHOW_FNAME(name) \
+ rpl_semi_sync_master_show_##name
+
+#define DEF_SHOW_FUNC(name, show_type) \
+ static int SHOW_FNAME(name)(MYSQL_THD thd, SHOW_VAR *var, char *buff) \
+ { \
+ repl_semisync.setExportStats(); \
+ var->type= show_type; \
+ var->value= (char *)&rpl_semi_sync_master_##name; \
+ return 0; \
+ }
+
+DEF_SHOW_FUNC(status, SHOW_BOOL)
+DEF_SHOW_FUNC(clients, SHOW_LONG)
+DEF_SHOW_FUNC(wait_sessions, SHOW_LONG)
+DEF_SHOW_FUNC(trx_wait_time, SHOW_LONGLONG)
+DEF_SHOW_FUNC(trx_wait_num, SHOW_LONGLONG)
+DEF_SHOW_FUNC(net_wait_time, SHOW_LONGLONG)
+DEF_SHOW_FUNC(net_wait_num, SHOW_LONGLONG)
+DEF_SHOW_FUNC(avg_net_wait_time, SHOW_LONG)
+DEF_SHOW_FUNC(avg_trx_wait_time, SHOW_LONG)
+
+
+/* plugin status variables */
+static SHOW_VAR semi_sync_master_status_vars[]= {
+ {"Rpl_semi_sync_master_status",
+ (char*) &SHOW_FNAME(status),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_clients",
+ (char*) &SHOW_FNAME(clients),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_yes_tx",
+ (char*) &rpl_semi_sync_master_yes_transactions,
+ SHOW_LONG},
+ {"Rpl_semi_sync_master_no_tx",
+ (char*) &rpl_semi_sync_master_no_transactions,
+ SHOW_LONG},
+ {"Rpl_semi_sync_master_wait_sessions",
+ (char*) &SHOW_FNAME(wait_sessions),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_no_times",
+ (char*) &rpl_semi_sync_master_off_times,
+ SHOW_LONG},
+ {"Rpl_semi_sync_master_timefunc_failures",
+ (char*) &rpl_semi_sync_master_timefunc_fails,
+ SHOW_LONG},
+ {"Rpl_semi_sync_master_wait_pos_backtraverse",
+ (char*) &rpl_semi_sync_master_wait_pos_backtraverse,
+ SHOW_LONG},
+ {"Rpl_semi_sync_master_tx_wait_time",
+ (char*) &SHOW_FNAME(trx_wait_time),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_tx_waits",
+ (char*) &SHOW_FNAME(trx_wait_num),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_tx_avg_wait_time",
+ (char*) &SHOW_FNAME(avg_trx_wait_time),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_net_wait_time",
+ (char*) &SHOW_FNAME(net_wait_time),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_net_waits",
+ (char*) &SHOW_FNAME(net_wait_num),
+ SHOW_FUNC},
+ {"Rpl_semi_sync_master_net_avg_wait_time",
+ (char*) &SHOW_FNAME(avg_net_wait_time),
+ SHOW_FUNC},
+ {NULL, NULL, SHOW_LONG},
+};
+
+
+static int semi_sync_master_plugin_init(void *p)
+{
+ if (repl_semisync.initObject())
+ return 1;
+ if (register_trans_observer(&trans_observer, p))
+ return 1;
+ if (register_binlog_storage_observer(&storage_observer, p))
+ return 1;
+ if (register_binlog_transmit_observer(&transmit_observer, p))
+ return 1;
+ return 0;
+}
+
+static int semi_sync_master_plugin_deinit(void *p)
+{
+ if (unregister_trans_observer(&trans_observer, p))
+ {
+ sql_print_error("unregister_trans_observer failed");
+ return 1;
+ }
+ if (unregister_binlog_storage_observer(&storage_observer, p))
+ {
+ sql_print_error("unregister_binlog_storage_observer failed");
+ return 1;
+ }
+ if (unregister_binlog_transmit_observer(&transmit_observer, p))
+ {
+ sql_print_error("unregister_binlog_transmit_observer failed");
+ return 1;
+ }
+ sql_print_information("unregister_replicator OK");
+ return 0;
+}
+
+struct Mysql_replication semi_sync_master_plugin= {
+ MYSQL_REPLICATION_INTERFACE_VERSION
+};
+
+/*
+ Plugin library descriptor
+*/
+mysql_declare_plugin(semi_sync_master)
+{
+ MYSQL_REPLICATION_PLUGIN,
+ &semi_sync_master_plugin,
+ "rpl_semi_sync_master",
+ "He Zhenxing",
+ "Semi-synchronous replication master",
+ PLUGIN_LICENSE_GPL,
+ semi_sync_master_plugin_init, /* Plugin Init */
+ semi_sync_master_plugin_deinit, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ semi_sync_master_status_vars, /* status variables */
+ semi_sync_master_system_vars, /* system variables */
+ NULL /* config options */
+}
+mysql_declare_plugin_end;
diff --git a/plugin/semisync/semisync_slave.cc b/plugin/semisync/semisync_slave.cc
new file mode 100644
index 00000000000..109577fb688
--- /dev/null
+++ b/plugin/semisync/semisync_slave.cc
@@ -0,0 +1,138 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#include "semisync_slave.h"
+
+char rpl_semi_sync_slave_enabled;
+char rpl_semi_sync_slave_status= 0;
+unsigned long rpl_semi_sync_slave_trace_level;
+
+int ReplSemiSyncSlave::initObject()
+{
+ int result= 0;
+ const char *kWho = "ReplSemiSyncSlave::initObject";
+
+ if (init_done_)
+ {
+ fprintf(stderr, "%s called twice\n", kWho);
+ return 1;
+ }
+ init_done_ = true;
+
+ /* References to the parameter works after set_options(). */
+ setSlaveEnabled(rpl_semi_sync_slave_enabled);
+ setTraceLevel(rpl_semi_sync_slave_trace_level);
+
+ return result;
+}
+
+int ReplSemiSyncSlave::slaveReadSyncHeader(const char *header,
+ unsigned long total_len,
+ bool *need_reply,
+ const char **payload,
+ unsigned long *payload_len)
+{
+ const char *kWho = "ReplSemiSyncSlave::slaveReadSyncHeader";
+ int read_res = 0;
+ function_enter(kWho);
+
+ if ((unsigned char)(header[0]) == kPacketMagicNum)
+ {
+ *need_reply = (header[1] & kPacketFlagSync);
+ *payload_len = total_len - 2;
+ *payload = header + 2;
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: reply - %d", kWho, *need_reply);
+ }
+ else
+ {
+ sql_print_error("Missing magic number for semi-sync packet, packet "
+ "len: %lu", total_len);
+ read_res = -1;
+ }
+
+ return function_exit(kWho, read_res);
+}
+
+int ReplSemiSyncSlave::slaveStart(Binlog_relay_IO_param *param)
+{
+ bool semi_sync= getSlaveEnabled();
+
+ sql_print_information("Slave I/O thread: Start %s replication to\
+ master '%s@%s:%d' in log '%s' at position %lu",
+ semi_sync ? "semi-sync" : "asynchronous",
+ param->user, param->host, param->port,
+ param->master_log_name[0] ? param->master_log_name : "FIRST",
+ (unsigned long)param->master_log_pos);
+
+ if (semi_sync && !rpl_semi_sync_slave_status)
+ rpl_semi_sync_slave_status= 1;
+ return 0;
+}
+
+int ReplSemiSyncSlave::slaveStop(Binlog_relay_IO_param *param)
+{
+ if (rpl_semi_sync_slave_status)
+ rpl_semi_sync_slave_status= 0;
+ if (mysql_reply)
+ mysql_close(mysql_reply);
+ mysql_reply= 0;
+ return 0;
+}
+
+int ReplSemiSyncSlave::slaveReply(MYSQL *mysql,
+ const char *binlog_filename,
+ my_off_t binlog_filepos)
+{
+ const char *kWho = "ReplSemiSyncSlave::slaveReply";
+ NET *net= &mysql->net;
+ uchar reply_buffer[REPLY_MAGIC_NUM_LEN
+ + REPLY_BINLOG_POS_LEN
+ + REPLY_BINLOG_NAME_LEN];
+ int reply_res, name_len = strlen(binlog_filename);
+
+ function_enter(kWho);
+
+ /* Prepare the buffer of the reply. */
+ reply_buffer[REPLY_MAGIC_NUM_OFFSET] = kPacketMagicNum;
+ int8store(reply_buffer + REPLY_BINLOG_POS_OFFSET, binlog_filepos);
+ memcpy(reply_buffer + REPLY_BINLOG_NAME_OFFSET,
+ binlog_filename,
+ name_len + 1 /* including trailing '\0' */);
+
+ if (trace_level_ & kTraceDetail)
+ sql_print_information("%s: reply (%s, %lu)", kWho,
+ binlog_filename, (ulong)binlog_filepos);
+
+ net_clear(net, 0);
+ /* Send the reply. */
+ reply_res = my_net_write(net, reply_buffer,
+ name_len + REPLY_BINLOG_NAME_OFFSET);
+ if (!reply_res)
+ {
+ reply_res = net_flush(net);
+ if (reply_res)
+ sql_print_error("Semi-sync slave net_flush() reply failed");
+ }
+ else
+ {
+ sql_print_error("Semi-sync slave send reply failed: %s (%d)",
+ net->last_error, net->last_errno);
+ }
+
+ return function_exit(kWho, reply_res);
+}
diff --git a/plugin/semisync/semisync_slave.h b/plugin/semisync/semisync_slave.h
new file mode 100644
index 00000000000..19ea43e2653
--- /dev/null
+++ b/plugin/semisync/semisync_slave.h
@@ -0,0 +1,96 @@
+/* Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#ifndef SEMISYNC_SLAVE_H
+#define SEMISYNC_SLAVE_H
+
+#include "semisync.h"
+
+/**
+ The extension class for the slave of semi-synchronous replication
+*/
+class ReplSemiSyncSlave
+ :public ReplSemiSyncBase {
+public:
+ ReplSemiSyncSlave()
+ :slave_enabled_(false)
+ {}
+ ~ReplSemiSyncSlave() {}
+
+ void setTraceLevel(unsigned long trace_level) {
+ trace_level_ = trace_level;
+ }
+
+ /* Initialize this class after MySQL parameters are initialized. this
+ * function should be called once at bootstrap time.
+ */
+ int initObject();
+
+ bool getSlaveEnabled() {
+ return slave_enabled_;
+ }
+ void setSlaveEnabled(bool enabled) {
+ slave_enabled_ = enabled;
+ }
+
+ /* A slave reads the semi-sync packet header and separate the metadata
+ * from the payload data.
+ *
+ * Input:
+ * header - (IN) packet header pointer
+ * total_len - (IN) total packet length: metadata + payload
+ * need_reply - (IN) whether the master is waiting for the reply
+ * payload - (IN) payload: the replication event
+ * payload_len - (IN) payload length
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int slaveReadSyncHeader(const char *header, unsigned long total_len, bool *need_reply,
+ const char **payload, unsigned long *payload_len);
+
+ /* A slave replies to the master indicating its replication process. It
+ * indicates that the slave has received all events before the specified
+ * binlog position.
+ *
+ * Input:
+ * mysql - (IN) the mysql network connection
+ * binlog_filename - (IN) the reply point's binlog file name
+ * binlog_filepos - (IN) the reply point's binlog file offset
+ *
+ * Return:
+ * 0: success; non-zero: error
+ */
+ int slaveReply(MYSQL *mysql, const char *binlog_filename,
+ my_off_t binlog_filepos);
+
+ int slaveStart(Binlog_relay_IO_param *param);
+ int slaveStop(Binlog_relay_IO_param *param);
+
+private:
+ /* True when initObject has been called */
+ bool init_done_;
+ bool slave_enabled_; /* semi-sycn is enabled on the slave */
+ MYSQL *mysql_reply; /* connection to send reply */
+};
+
+
+/* System and status variables for the slave component */
+extern char rpl_semi_sync_slave_enabled;
+extern unsigned long rpl_semi_sync_slave_trace_level;
+extern char rpl_semi_sync_slave_status;
+
+#endif /* SEMISYNC_SLAVE_H */
diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc
new file mode 100644
index 00000000000..0bd9e1b8b21
--- /dev/null
+++ b/plugin/semisync/semisync_slave_plugin.cc
@@ -0,0 +1,226 @@
+/* Copyright (C) 2007 Google Inc.
+ Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+
+#include "semisync_slave.h"
+
+ReplSemiSyncSlave repl_semisync;
+
+/*
+ indicate whether or not the slave should send a reply to the master.
+
+ This is set to true in repl_semi_slave_read_event if the current
+ event read is the last event of a transaction. And the value is
+ checked in repl_semi_slave_queue_event.
+*/
+bool semi_sync_need_reply= false;
+
+int repl_semi_reset_slave(Binlog_relay_IO_param *param)
+{
+ // TODO: reset semi-sync slave status here
+ return 0;
+}
+
+int repl_semi_slave_request_dump(Binlog_relay_IO_param *param,
+ uint32 flags)
+{
+ MYSQL *mysql= param->mysql;
+ MYSQL_RES *res= 0;
+ MYSQL_ROW row;
+ const char *query;
+
+ if (!repl_semisync.getSlaveEnabled())
+ return 0;
+
+ /* Check if master server has semi-sync plugin installed */
+ query= "SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'";
+ if (mysql_real_query(mysql, query, strlen(query)) ||
+ !(res= mysql_store_result(mysql)))
+ {
+ mysql_free_result(mysql_store_result(mysql));
+ sql_print_error("Execution failed on master: %s", query);
+ return 1;
+ }
+
+ row= mysql_fetch_row(res);
+ if (!row)
+ {
+ /* Master does not support semi-sync */
+ sql_print_warning("Master server does not support semi-sync, "
+ "fallback to asynchronous replication");
+ rpl_semi_sync_slave_status= 0;
+ return 0;
+ }
+
+ /*
+ Tell master dump thread that we want to do semi-sync
+ replication
+ */
+ query= "SET @rpl_semi_sync_slave= 1";
+ if (mysql_real_query(mysql, query, strlen(query)))
+ {
+ sql_print_error("Set 'rpl_semi_sync_slave=1' on master failed");
+ mysql_free_result(mysql_store_result(mysql));
+ return 1;
+ }
+ mysql_free_result(mysql_store_result(mysql));
+ rpl_semi_sync_slave_status= 1;
+ return 0;
+}
+
+int repl_semi_slave_read_event(Binlog_relay_IO_param *param,
+ const char *packet, unsigned long len,
+ const char **event_buf, unsigned long *event_len)
+{
+ if (rpl_semi_sync_slave_status)
+ return repl_semisync.slaveReadSyncHeader(packet, len,
+ &semi_sync_need_reply,
+ event_buf, event_len);
+ *event_buf= packet;
+ *event_len= len;
+ return 0;
+}
+
+int repl_semi_slave_queue_event(Binlog_relay_IO_param *param,
+ const char *event_buf,
+ unsigned long event_len,
+ uint32 flags)
+{
+ if (rpl_semi_sync_slave_status && semi_sync_need_reply)
+ {
+ /*
+ We deliberately ignore the error in slaveReply, such error
+ should not cause the slave IO thread to stop, and the error
+ messages are already reported.
+ */
+ (void) repl_semisync.slaveReply(param->mysql,
+ param->master_log_name,
+ param->master_log_pos);
+ }
+ return 0;
+}
+
+int repl_semi_slave_io_start(Binlog_relay_IO_param *param)
+{
+ return repl_semisync.slaveStart(param);
+}
+
+int repl_semi_slave_io_end(Binlog_relay_IO_param *param)
+{
+ return repl_semisync.slaveStop(param);
+}
+
+
+static void fix_rpl_semi_sync_slave_enabled(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val)
+{
+ *(char *)ptr= *(char *)val;
+ repl_semisync.setSlaveEnabled(rpl_semi_sync_slave_enabled != 0);
+ return;
+}
+
+static void fix_rpl_semi_sync_trace_level(MYSQL_THD thd,
+ SYS_VAR *var,
+ void *ptr,
+ const void *val)
+{
+ *(unsigned long *)ptr= *(unsigned long *)val;
+ repl_semisync.setTraceLevel(rpl_semi_sync_slave_trace_level);
+ return;
+}
+
+/* plugin system variables */
+static MYSQL_SYSVAR_BOOL(enabled, rpl_semi_sync_slave_enabled,
+ PLUGIN_VAR_OPCMDARG,
+ "Enable semi-synchronous replication slave (disabled by default). ",
+ NULL, // check
+ &fix_rpl_semi_sync_slave_enabled, // update
+ 0);
+
+static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_slave_trace_level,
+ PLUGIN_VAR_OPCMDARG,
+ "The tracing level for semi-sync replication.",
+ NULL, // check
+ &fix_rpl_semi_sync_trace_level, // update
+ 32, 0, ~0L, 1);
+
+static SYS_VAR* semi_sync_slave_system_vars[]= {
+ MYSQL_SYSVAR(enabled),
+ MYSQL_SYSVAR(trace_level),
+ NULL,
+};
+
+
+/* plugin status variables */
+static SHOW_VAR semi_sync_slave_status_vars[]= {
+ {"Rpl_semi_sync_slave_status",
+ (char*) &rpl_semi_sync_slave_status, SHOW_BOOL},
+ {NULL, NULL, SHOW_BOOL},
+};
+
+Binlog_relay_IO_observer relay_io_observer = {
+ sizeof(Binlog_relay_IO_observer), // len
+
+ repl_semi_slave_io_start, // start
+ repl_semi_slave_io_end, // stop
+ repl_semi_slave_request_dump, // request_transmit
+ repl_semi_slave_read_event, // after_read_event
+ repl_semi_slave_queue_event, // after_queue_event
+ repl_semi_reset_slave, // reset
+};
+
+static int semi_sync_slave_plugin_init(void *p)
+{
+ if (repl_semisync.initObject())
+ return 1;
+ if (register_binlog_relay_io_observer(&relay_io_observer, p))
+ return 1;
+ return 0;
+}
+
+static int semi_sync_slave_plugin_deinit(void *p)
+{
+ if (unregister_binlog_relay_io_observer(&relay_io_observer, p))
+ return 1;
+ return 0;
+}
+
+
+struct Mysql_replication semi_sync_slave_plugin= {
+ MYSQL_REPLICATION_INTERFACE_VERSION
+};
+
+/*
+ Plugin library descriptor
+*/
+mysql_declare_plugin(semi_sync_slave)
+{
+ MYSQL_REPLICATION_PLUGIN,
+ &semi_sync_slave_plugin,
+ "rpl_semi_sync_slave",
+ "He Zhenxing",
+ "Semi-synchronous replication slave",
+ PLUGIN_LICENSE_GPL,
+ semi_sync_slave_plugin_init, /* Plugin Init */
+ semi_sync_slave_plugin_deinit, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ semi_sync_slave_status_vars, /* status variables */
+ semi_sync_slave_system_vars, /* system variables */
+ NULL /* config options */
+}
+mysql_declare_plugin_end;
diff --git a/regex/CMakeLists.txt b/regex/CMakeLists.txt
index 2e3b18c7bb0..440be4d2f12 100755
--- a/regex/CMakeLists.txt
+++ b/regex/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index f0db25be79a..25cdae2b522 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -24,7 +24,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl
# Build comp_sql - used for embedding SQL in C or C++ programs
ADD_EXECUTABLE(comp_sql comp_sql.c)
-TARGET_LINK_LIBRARIES(comp_sql debug dbug mysys strings)
+TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings)
# Use comp_sql to build mysql_fix_privilege_tables_sql.c
GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION)
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 3b179957932..dd5edb699a0 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -134,7 +134,7 @@ then
exit 1
fi
-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host"
+cmd="$bindir/mysql --no-defaults --default-character-set=latin1 --force --user=$user --host=$host"
if test ! -z "$port"; then
cmd="$cmd --port=$port"
fi
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 20b7973cb4e..7e9b8a69677 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -313,7 +313,7 @@ then
cannot_find_file "$langdir/errmsg.sys"
exit 1
fi
- mysqld_opt="--language=$langdir"
+ mysqld_opt="--lc-messages-dir=$langdir/.."
fi
# Try to determine the hostname
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 923497b0ab2..48bca8ee2a9 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -13,7 +13,7 @@ set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
-CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
-- Remember for later if user table already existed
set @had_user_table= @@warning_count != 0;
@@ -22,7 +22,7 @@ set @had_user_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
-CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl char(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='MySQL plugins';
+CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins';
CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table';
@@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign
CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
-CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, 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') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
+CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, 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') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 9a3a3f7bb84..03136fe9361 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -21,9 +21,9 @@ DROP TABLE tmp_db;
-- from local machine if "users" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user;
set @current_hostname= @@hostname;
-INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
-REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
+REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 1844860c84d..8dc1ae94de0 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -229,6 +229,11 @@ SET GLOBAL slow_query_log = 'OFF';
ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL;
SET GLOBAL slow_query_log = @old_log_state;
+ALTER TABLE plugin
+ MODIFY name varchar(64) COLLATE utf8_general_ci NOT NULL DEFAULT '',
+ MODIFY dl varchar(128) COLLATE utf8_general_ci NOT NULL DEFAULT '',
+ CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
+
#
# Detect whether we had Create_view_priv
#
@@ -431,6 +436,9 @@ ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL
AFTER db_collation;
ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL;
+# Change comment from char(64) to text
+ALTER TABLE proc MODIFY comment
+ text collate utf8_bin NOT NULL;
#
# EVENT privilege
@@ -541,6 +549,18 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete
UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
+#
+# user.Create_tablespace_priv
+#
+
+SET @hadCreateTablespacePriv := 0;
+SELECT @hadCreateTablespacePriv :=1 FROM user WHERE Create_tablespace_priv LIKE '%';
+
+ALTER TABLE user ADD Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Trigger_priv;
+ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Trigger_priv;
+
+UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0;
+
# Activate the new, possible modified privilege tables
# This should not be needed, but gives us some extra testing that the above
# changes was correct
diff --git a/server-tools/CMakeLists.txt b/server-tools/CMakeLists.txt
deleted file mode 100644
index 3f02ba88f1d..00000000000
--- a/server-tools/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
-ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
- ${PROJECT_SOURCE_DIR}/extra/yassl/include)
-
-ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc
- instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
- mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
- thread_registry.cc user_map.cc imservice.cpp windowsservice.cpp
- user_management_commands.cc
- ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
- ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
- ../../libmysql/errmsg.c)
-
-ADD_DEPENDENCIES(mysqlmanager GenError)
-TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32)
diff --git a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt
deleted file mode 100755
index 2b9bce56ff7..00000000000
--- a/server-tools/instance-manager/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
-ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
- ${PROJECT_SOURCE_DIR}/extra/yassl/include)
-
-ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc
- instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
- mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
- thread_registry.cc user_map.cc IMService.cpp WindowsService.cpp
- user_management_commands.cc
- ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
- ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
- ../../libmysql/errmsg.c)
-
-ADD_DEPENDENCIES(mysqlmanager GenError)
-TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl zlib wsock32)
-
-IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker")
-ENDIF(EMBED_MANIFESTS)
diff --git a/server-tools/instance-manager/IMService.cpp b/server-tools/instance-manager/IMService.cpp
deleted file mode 100644
index feccaadbecc..00000000000
--- a/server-tools/instance-manager/IMService.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright (C) 2005 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include <winsock2.h>
-#include <signal.h>
-
-#include "IMService.h"
-
-#include "log.h"
-#include "manager.h"
-#include "options.h"
-
-static const char * const IM_SVC_USERNAME= NULL;
-static const char * const IM_SVC_PASSWORD= NULL;
-
-IMService::IMService(void)
- :WindowsService("MySqlManager", "MySQL Manager")
-{
-}
-
-IMService::~IMService(void)
-{
-}
-
-void IMService::Stop()
-{
- ReportStatus(SERVICE_STOP_PENDING);
-
- /* stop the IM work */
- raise(SIGTERM);
-}
-
-void IMService::Run(DWORD argc, LPTSTR *argv)
-{
- /* report to the SCM that we're about to start */
- ReportStatus((DWORD)SERVICE_START_PENDING);
-
- Options::load(argc, argv);
-
- /* init goes here */
- ReportStatus((DWORD)SERVICE_RUNNING);
-
- /* wait for main loop to terminate */
- (void) Manager::main();
- Options::cleanup();
-}
-
-void IMService::Log(const char *msg)
-{
- log_info(msg);
-}
-
-int IMService::main()
-{
- IMService winService;
-
- if (Options::Service::install_as_service)
- {
- if (winService.IsInstalled())
- {
- log_info("Service is already installed.");
- return 1;
- }
-
- if (winService.Install(IM_SVC_USERNAME, IM_SVC_PASSWORD))
- {
- log_info("Service installed successfully.");
- return 0;
- }
- else
- {
- log_error("Service failed to install.");
- return 1;
- }
- }
-
- if (Options::Service::remove_service)
- {
- if (!winService.IsInstalled())
- {
- log_info("Service is not installed.");
- return 1;
- }
-
- if (winService.Remove())
- {
- log_info("Service removed successfully.");
- return 0;
- }
- else
- {
- log_error("Service failed to remove.");
- return 1;
- }
- }
-
- log_info("Initializing Instance Manager service...");
-
- if (!winService.Init())
- {
- log_error("Service failed to initialize.");
-
- fprintf(stderr,
- "The service should be started by Windows Service Manager.\n"
- "The MySQL Manager should be started with '--standalone'\n"
- "to run from command line.");
-
- return 1;
- }
-
- return 0;
-}
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am
deleted file mode 100644
index 19c4ac8de19..00000000000
--- a/server-tools/instance-manager/Makefile.am
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (C) 2004 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-INCLUDES= @ZLIB_INCLUDES@ -I$(top_srcdir)/include \
- @openssl_includes@ -I$(top_builddir)/include
-
-DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER
-
-# As all autoconf variables depend from ${prefix} and being resolved only when
-# make is run, we can not put these defines to a header file (e.g. to
-# default_options.h, generated from default_options.h.in)
-# See automake/autoconf docs for details
-
-noinst_LTLIBRARIES= liboptions.la
-noinst_LIBRARIES= libnet.a
-
-liboptions_la_CXXFLAGS= $(CXXFLAGS) \
- -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \
- -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager.log" \
- -DDEFAULT_SOCKET_FILE_NAME="/tmp/mysqlmanager.sock" \
- -DDEFAULT_PASSWORD_FILE_NAME="/etc/mysqlmanager.passwd" \
- -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld$(EXEEXT)" \
- -DDEFAULT_CONFIG_FILE="my.cnf" \
- -DPROTOCOL_VERSION=@PROTOCOL_VERSION@
-
-liboptions_la_SOURCES= options.h options.cc priv.h priv.cc
-liboptions_la_LIBADD= $(top_builddir)/libmysql/get_password.lo
-
-# MySQL sometimes uses symlinks to reuse code
-# All symlinked files are grouped in libnet.a
-
-nodist_libnet_a_SOURCES= net_serv.cc client_settings.h
-libnet_a_LIBADD= $(top_builddir)/sql/password.$(OBJEXT) \
- $(top_builddir)/sql/pack.$(OBJEXT) \
- $(top_builddir)/sql/sql_state.$(OBJEXT) \
- $(top_builddir)/sql/mini_client_errors.$(OBJEXT)\
- $(top_builddir)/sql/client.$(OBJEXT)
-
-CLEANFILES= net_serv.cc client_settings.h
-
-net_serv.cc:
- rm -f net_serv.cc
- @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net_serv.cc
-
-client_settings.h:
- rm -f client_settings.h
- @LN_CP_F@ $(top_srcdir)/sql/client_settings.h client_settings.h
-
-libexec_PROGRAMS= mysqlmanager
-
-mysqlmanager_CXXFLAGS=
-
-mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
- manager.h manager.cc log.h log.cc \
- thread_registry.h thread_registry.cc \
- listener.h listener.cc protocol.h protocol.cc \
- mysql_connection.h mysql_connection.cc \
- user_map.h user_map.cc \
- messages.h messages.cc \
- commands.h commands.cc \
- instance.h instance.cc \
- instance_map.h instance_map.cc\
- instance_options.h instance_options.cc \
- buffer.h buffer.cc parse.cc parse.h \
- guardian.cc guardian.h \
- parse_output.cc parse_output.h \
- mysql_manager_error.h \
- portability.h \
- exit_codes.h \
- user_management_commands.h \
- user_management_commands.cc \
- angel.h \
- angel.cc
-
-mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \
- liboptions.la \
- libnet.a \
- $(top_builddir)/vio/libvio.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/strings/libmystrings.a \
- $(top_builddir)/dbug/libdbug.a \
- @openssl_libs@ @yassl_libs@ @ZLIB_LIBS@
-
-EXTRA_DIST = WindowsService.cpp WindowsService.h IMService.cpp \
- IMService.h CMakeLists.txt
-
-tags:
- ctags -R *.h *.cc
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/server-tools/instance-manager/README b/server-tools/instance-manager/README
deleted file mode 100644
index ac799775003..00000000000
--- a/server-tools/instance-manager/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Instance Manager - manage MySQL instances locally and remotely.
-
-File description:
- mysqlmanager.cc - entry point to the manager, main,
- options.{h,cc} - handle startup options
- manager.{h,cc} - manager process
- mysql_connection.{h,cc} - handle one connection with mysql client.
-
-See also instance manager architecture description in mysqlmanager.cc.
-
-
diff --git a/server-tools/instance-manager/WindowsService.cpp b/server-tools/instance-manager/WindowsService.cpp
deleted file mode 100644
index 14795e2225a..00000000000
--- a/server-tools/instance-manager/WindowsService.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Copyright (C) 2005 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include "my_global.h"
-#include <windows.h>
-#include "WindowsService.h"
-
-static WindowsService *gService;
-
-WindowsService::WindowsService(const char *p_serviceName,
- const char *p_displayName) :
- statusCheckpoint(0),
- serviceName(p_serviceName),
- displayName(p_displayName),
- inited(FALSE),
- dwAcceptedControls(SERVICE_ACCEPT_STOP),
- debugging(FALSE)
-{
- DBUG_ASSERT(serviceName != NULL);
-
- /* TODO: shouldn't we check displayName too (can it really be NULL)? */
-
- /* WindowsService is assumed to be singleton. Let's assure this. */
- DBUG_ASSERT(gService == NULL);
-
- gService= this;
-
- status.dwServiceType= SERVICE_WIN32_OWN_PROCESS;
- status.dwServiceSpecificExitCode= 0;
-}
-
-WindowsService::~WindowsService(void)
-{
-}
-
-BOOL WindowsService::Install(const char *username, const char *password)
-{
- bool ret_val= FALSE;
- SC_HANDLE newService;
- SC_HANDLE scm;
-
- if (IsInstalled())
- return TRUE;
-
- // determine the name of the currently executing file
- char szFilePath[_MAX_PATH];
- GetModuleFileName(NULL, szFilePath, sizeof(szFilePath));
-
- // open a connection to the SCM
- if (!(scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE)))
- return FALSE;
-
- newService= CreateService(scm, serviceName, displayName,
- SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
- SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
- szFilePath, NULL, NULL, NULL, username,
- password);
-
- if (newService)
- {
- CloseServiceHandle(newService);
- ret_val= TRUE;
- }
-
- CloseServiceHandle(scm);
- return ret_val;
-}
-
-BOOL WindowsService::Init()
-{
- DBUG_ASSERT(serviceName != NULL);
-
- if (inited)
- return TRUE;
-
- SERVICE_TABLE_ENTRY stb[] =
- {
- { (LPSTR)serviceName, (LPSERVICE_MAIN_FUNCTION) ServiceMain},
- { NULL, NULL }
- };
- inited= TRUE;
- return StartServiceCtrlDispatcher(stb); //register with the Service Manager
-}
-
-BOOL WindowsService::Remove()
-{
- bool ret_val= FALSE;
-
- if (!IsInstalled())
- return TRUE;
-
- // open a connection to the SCM
- SC_HANDLE scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE);
- if (!scm)
- return FALSE;
-
- SC_HANDLE service= OpenService(scm, serviceName, DELETE);
- if (service)
- {
- if (DeleteService(service))
- ret_val= TRUE;
- DWORD dw= ::GetLastError();
- CloseServiceHandle(service);
- }
-
- CloseServiceHandle(scm);
- return ret_val;
-}
-
-BOOL WindowsService::IsInstalled()
-{
- BOOL ret_val= FALSE;
-
- SC_HANDLE scm= ::OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
- SC_HANDLE serv_handle= ::OpenService(scm, serviceName, SERVICE_QUERY_STATUS);
-
- ret_val= serv_handle != NULL;
-
- ::CloseServiceHandle(serv_handle);
- ::CloseServiceHandle(scm);
-
- return ret_val;
-}
-
-void WindowsService::SetAcceptedControls(DWORD acceptedControls)
-{
- dwAcceptedControls= acceptedControls;
-}
-
-
-BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint,
- DWORD dwError)
-{
- if (debugging)
- return TRUE;
-
- if(currentState == SERVICE_START_PENDING)
- status.dwControlsAccepted= 0;
- else
- status.dwControlsAccepted= dwAcceptedControls;
-
- status.dwCurrentState= currentState;
- status.dwWin32ExitCode= dwError != 0 ?
- ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR;
- status.dwWaitHint= waitHint;
- status.dwServiceSpecificExitCode= dwError;
-
- if(currentState == SERVICE_RUNNING || currentState == SERVICE_STOPPED)
- {
- status.dwCheckPoint= 0;
- statusCheckpoint= 0;
- }
- else
- status.dwCheckPoint= ++statusCheckpoint;
-
- // Report the status of the service to the service control manager.
- BOOL result= SetServiceStatus(statusHandle, &status);
- if (!result)
- Log("ReportStatus failed");
-
- return result;
-}
-
-void WindowsService::RegisterAndRun(DWORD argc, LPTSTR *argv)
-{
- statusHandle= ::RegisterServiceCtrlHandler(serviceName, ControlHandler);
- if (statusHandle && ReportStatus(SERVICE_START_PENDING))
- Run(argc, argv);
- ReportStatus(SERVICE_STOPPED);
-}
-
-void WindowsService::HandleControlCode(DWORD opcode)
-{
- // Handle the requested control code.
- switch(opcode) {
- case SERVICE_CONTROL_STOP:
- // Stop the service.
- status.dwCurrentState= SERVICE_STOP_PENDING;
- Stop();
- break;
-
- case SERVICE_CONTROL_PAUSE:
- status.dwCurrentState= SERVICE_PAUSE_PENDING;
- Pause();
- break;
-
- case SERVICE_CONTROL_CONTINUE:
- status.dwCurrentState= SERVICE_CONTINUE_PENDING;
- Continue();
- break;
-
- case SERVICE_CONTROL_SHUTDOWN:
- Shutdown();
- break;
-
- case SERVICE_CONTROL_INTERROGATE:
- ReportStatus(status.dwCurrentState);
- break;
-
- default:
- // invalid control code
- break;
- }
-}
-
-void WINAPI WindowsService::ServiceMain(DWORD argc, LPTSTR *argv)
-{
- DBUG_ASSERT(gService != NULL);
-
- // register our service control handler:
- gService->RegisterAndRun(argc, argv);
-}
-
-void WINAPI WindowsService::ControlHandler(DWORD opcode)
-{
- DBUG_ASSERT(gService != NULL);
-
- return gService->HandleControlCode(opcode);
-}
diff --git a/server-tools/instance-manager/WindowsService.h b/server-tools/instance-manager/WindowsService.h
deleted file mode 100644
index 02a499e5f0c..00000000000
--- a/server-tools/instance-manager/WindowsService.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 2005 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#pragma once
-
-class WindowsService
-{
-protected:
- bool inited;
- const char *serviceName;
- const char *displayName;
- SERVICE_STATUS_HANDLE statusHandle;
- DWORD statusCheckpoint;
- SERVICE_STATUS status;
- DWORD dwAcceptedControls;
- bool debugging;
-
-public:
- WindowsService(const char *p_serviceName, const char *p_displayName);
- ~WindowsService(void);
-
- BOOL Install(const char *username, const char *password);
- BOOL Remove();
- BOOL Init();
- BOOL IsInstalled();
- void SetAcceptedControls(DWORD acceptedControls);
- void Debug(bool debugFlag) { debugging= debugFlag; }
-
-public:
- static void WINAPI ServiceMain(DWORD argc, LPTSTR *argv);
- static void WINAPI ControlHandler(DWORD CtrlType);
-
-protected:
- virtual void Run(DWORD argc, LPTSTR *argv)= 0;
- virtual void Stop() {}
- virtual void Shutdown() {}
- virtual void Pause() {}
- virtual void Continue() {}
- virtual void Log(const char *msg) {}
-
- BOOL ReportStatus(DWORD currentStatus, DWORD waitHint= 3000, DWORD dwError=0);
- void HandleControlCode(DWORD opcode);
- void RegisterAndRun(DWORD argc, LPTSTR *argv);
-};
diff --git a/server-tools/instance-manager/angel.cc b/server-tools/instance-manager/angel.cc
deleted file mode 100644
index 64515c8498c..00000000000
--- a/server-tools/instance-manager/angel.cc
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef __WIN__
-
-#include "angel.h"
-
-#include <sys/wait.h>
-/*
- sys/wait.h is needed for waitpid(). Unfortunately, there is no MySQL
- include file, that can serve for this. Include it before MySQL system
- headers so that we can change system defines if needed.
-*/
-
-#include "my_global.h"
-#include "my_alarm.h"
-#include "my_dir.h"
-#include "my_sys.h"
-
-/* Include other IM files. */
-
-#include "log.h"
-#include "manager.h"
-#include "options.h"
-#include "priv.h"
-
-/************************************************************************/
-
-enum { CHILD_OK= 0, CHILD_NEED_RESPAWN, CHILD_EXIT_ANGEL };
-
-static int log_fd;
-
-static volatile sig_atomic_t child_status= CHILD_OK;
-static volatile sig_atomic_t child_exit_code= 0;
-static volatile sig_atomic_t shutdown_request_signo= 0;
-
-
-/************************************************************************/
-/**
- Open log file.
-
- @return
- TRUE on error;
- FALSE on success.
-*************************************************************************/
-
-static bool open_log_file()
-{
- log_info("Angel: opening log file '%s'...",
- (const char *) Options::Daemon::log_file_name);
-
- log_fd= open(Options::Daemon::log_file_name,
- O_WRONLY | O_CREAT | O_APPEND | O_NOCTTY,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
-
- if (log_fd < 0)
- {
- log_error("Can not open log file '%s': %s.",
- (const char *) Options::Daemon::log_file_name,
- (const char *) strerror(errno));
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/************************************************************************/
-/**
- Detach the process from controlling tty.
-
- @return
- TRUE on error;
- FALSE on success.
-*************************************************************************/
-
-static bool detach_process()
-{
- /*
- Become a session leader (the goal is not to have a controlling tty).
-
- setsid() must succeed because child is guaranteed not to be a process
- group leader (it belongs to the process group of the parent).
-
- NOTE: if we now don't have a controlling tty we will not receive
- tty-related signals - no need to ignore them.
- */
-
- if (setsid() < 0)
- {
- log_error("setsid() failed: %s.", (const char *) strerror(errno));
- return -1;
- }
-
- /* Close STDIN. */
-
- log_info("Angel: preparing standard streams.");
-
- if (close(STDIN_FILENO) < 0)
- {
- log_error("Warning: can not close stdin (%s)."
- "Trying to continue...",
- (const char *) strerror(errno));
- }
-
- /* Dup STDOUT and STDERR to the log file. */
-
- if (dup2(log_fd, STDOUT_FILENO) < 0 ||
- dup2(log_fd, STDERR_FILENO) < 0)
- {
- log_error("Can not redirect stdout and stderr to the log file: %s.",
- (const char *) strerror(errno));
-
- return TRUE;
- }
-
- if (log_fd != STDOUT_FILENO && log_fd != STDERR_FILENO)
- {
- if (close(log_fd) < 0)
- {
- log_error("Can not close original log file handler (%d): %s. "
- "Trying to continue...",
- (int) log_fd,
- (const char *) strerror(errno));
- }
- }
-
- return FALSE;
-}
-
-
-/************************************************************************/
-/**
- Create PID file.
-
- @return
- TRUE on error;
- FALSE on success.
-*************************************************************************/
-
-static bool create_pid_file()
-{
- if (create_pid_file(Options::Daemon::angel_pid_file_name, getpid()))
- {
- log_error("Angel: can not create pid file (%s).",
- (const char *) Options::Daemon::angel_pid_file_name);
-
- return TRUE;
- }
-
- log_info("Angel: pid file (%s) created.",
- (const char *) Options::Daemon::angel_pid_file_name);
-
- return FALSE;
-}
-
-
-/************************************************************************/
-/**
- SIGCHLD handler.
-
- Reap child, analyze child exit code, and set child_status
- appropriately.
-*************************************************************************/
-
-extern "C" void reap_child(int);
-
-void reap_child(int __attribute__((unused)) signo)
-{
- /* NOTE: As we have only one child, no need to cycle waitpid(). */
-
- int exit_code;
-
- if (waitpid(0, &exit_code, WNOHANG) > 0)
- {
- child_exit_code= exit_code;
- child_status= exit_code ? CHILD_NEED_RESPAWN : CHILD_EXIT_ANGEL;
- }
-}
-
-
-/************************************************************************/
-/**
- SIGTERM, SIGHUP, SIGINT handler.
-
- Set termination status and return.
-*************************************************************************/
-
-extern "C" void terminate(int signo);
-void terminate(int signo)
-{
- shutdown_request_signo= signo;
-}
-
-
-/************************************************************************/
-/**
- Angel main loop.
-
- @return
- The function returns exit status for global main():
- 0 -- program completed successfully;
- !0 -- error occurred.
-*************************************************************************/
-
-static int angel_main_loop()
-{
- /*
- Install signal handlers.
-
- NOTE: Although signal handlers are needed only for parent process
- (IM-angel), we should install them before fork() in order to avoid race
- condition (i.e. to be sure, that IM-angel will receive SIGCHLD in any
- case).
- */
-
- sigset_t wait_for_signals_mask;
-
- struct sigaction sa_chld;
- struct sigaction sa_term;
- struct sigaction sa_chld_orig;
- struct sigaction sa_term_orig;
- struct sigaction sa_int_orig;
- struct sigaction sa_hup_orig;
-
- log_info("Angel: setting necessary signal actions...");
-
- sigemptyset(&wait_for_signals_mask);
-
- sigemptyset(&sa_chld.sa_mask);
- sa_chld.sa_handler= reap_child;
- sa_chld.sa_flags= SA_NOCLDSTOP;
-
- sigemptyset(&sa_term.sa_mask);
- sa_term.sa_handler= terminate;
- sa_term.sa_flags= 0;
-
- /* NOTE: sigaction() fails only if arguments are wrong. */
-
- sigaction(SIGCHLD, &sa_chld, &sa_chld_orig);
- sigaction(SIGTERM, &sa_term, &sa_term_orig);
- sigaction(SIGINT, &sa_term, &sa_int_orig);
- sigaction(SIGHUP, &sa_term, &sa_hup_orig);
-
- /* The main Angel loop. */
-
- while (true)
- {
- /* Spawn a new Manager. */
-
- log_info("Angel: forking Manager process...");
-
- switch (fork()) {
- case -1:
- log_error("Angel: can not fork IM-main: %s.",
- (const char *) strerror(errno));
-
- return -1;
-
- case 0:
- /*
- We are in child process, which will be IM-main:
- - Restore default signal actions to let the IM-main work with
- signals as he wishes;
- - Call Manager::main();
- */
-
- log_info("Angel: Manager process created successfully.");
-
- /* NOTE: sigaction() fails only if arguments are wrong. */
-
- sigaction(SIGCHLD, &sa_chld_orig, NULL);
- sigaction(SIGTERM, &sa_term_orig, NULL);
- sigaction(SIGINT, &sa_int_orig, NULL);
- sigaction(SIGHUP, &sa_hup_orig, NULL);
-
- log_info("Angel: executing Manager...");
-
- return Manager::main();
- }
-
- /* Wait for signals. */
-
- log_info("Angel: waiting for signals...");
-
- while (child_status == CHILD_OK && shutdown_request_signo == 0)
- sigsuspend(&wait_for_signals_mask);
-
- /* Exit if one of shutdown signals has been caught. */
-
- if (shutdown_request_signo)
- {
- log_info("Angel: received shutdown signal (%d). Exiting...",
- (int) shutdown_request_signo);
-
- return 0;
- }
-
- /* Manager process died. Respawn it if it was a failure. */
-
- if (child_status == CHILD_NEED_RESPAWN)
- {
- child_status= CHILD_OK;
-
- log_error("Angel: Manager exited abnormally (exit code: %d).",
- (int) child_exit_code);
-
- log_info("Angel: sleeping 1 second...");
-
- sleep(1); /* don't respawn too fast */
-
- log_info("Angel: respawning Manager...");
-
- continue;
- }
-
- /* Delete IM-angel PID file. */
-
- my_delete(Options::Daemon::angel_pid_file_name, MYF(0));
-
- /* IM-angel finished. */
-
- log_info("Angel: Manager exited normally. Exiting...");
-
- return 0;
- }
-}
-
-
-/************************************************************************/
-/**
- Angel main function.
-
- @return
- The function returns exit status for global main():
- 0 -- program completed successfully;
- !0 -- error occurred.
-*************************************************************************/
-
-int Angel::main()
-{
- log_info("Angel: started.");
-
- /* Open log file. */
-
- if (open_log_file())
- return -1;
-
- /* Fork a new process. */
-
- log_info("Angel: daemonizing...");
-
- switch (fork()) {
- case -1:
- /*
- This is the main Instance Manager process, fork() failed.
- Log an error and bail out with error code.
- */
-
- log_error("fork() failed: %s.", (const char *) strerror(errno));
- return -1;
-
- case 0:
- /* We are in child process. Continue Angel::main() execution. */
-
- break;
-
- default:
- /*
- We are in the parent process. Return 0 so that parent exits
- successfully.
- */
-
- log_info("Angel: exiting from the original process...");
-
- return 0;
- }
-
- /* Detach child from controlling tty. */
-
- if (detach_process())
- return -1;
-
- /* Create PID file. */
-
- if (create_pid_file())
- return -1;
-
- /* Start Angel main loop. */
-
- return angel_main_loop();
-}
-
-#endif // __WIN__
diff --git a/server-tools/instance-manager/buffer.cc b/server-tools/instance-manager/buffer.cc
deleted file mode 100644
index f197f42d009..00000000000
--- a/server-tools/instance-manager/buffer.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "buffer.h"
-#include <m_string.h>
-
-const uint Buffer::BUFFER_INITIAL_SIZE= 4096;
-const uint Buffer::MAX_BUFFER_SIZE= 16777216;
-
-/*
- Puts the given string to the buffer.
-
- SYNOPSIS
- append()
- position start position in the buffer
- string string to be put in the buffer
- len_arg the length of the string. This way we can avoid some
- strlens.
-
- DESCRIPTION
-
- The method puts a string into the buffer, starting from position .
- In the case when the buffer is too small it reallocs the buffer. The
- total size of the buffer is restricted with 16.
-
- RETURN
- 0 - ok
- 1 - got an error in reserve()
-*/
-
-int Buffer::append(size_t position, const char *string, size_t len_arg)
-{
- if (reserve(position, len_arg))
- return 1;
-
- strnmov((char*) buffer + position, string, len_arg);
- return 0;
-}
-
-
-/*
- Checks whether the current buffer size is ok to put a string of the length
- "len_arg" starting from "position" and reallocs it if no.
-
- SYNOPSIS
- reserve()
- position the number starting byte on the buffer to store a buffer
- len_arg the length of the string.
-
- DESCRIPTION
-
- The method checks whether it is possible to put a string of the "len_arg"
- length into the buffer, starting from "position" byte. In the case when the
- buffer is too small it reallocs the buffer. The total size of the buffer is
- restricted with 16 Mb.
-
- RETURN
- 0 - ok
- 1 - realloc error or we have come to the 16Mb barrier
-*/
-
-int Buffer::reserve(size_t position, size_t len_arg)
-{
- if (position + len_arg >= MAX_BUFFER_SIZE)
- goto err;
-
- if (position + len_arg >= buffer_size)
- {
- buffer= (uchar*) my_realloc(buffer,
- min(MAX_BUFFER_SIZE,
- max((uint) (buffer_size*1.5),
- position + len_arg)), MYF(0));
- if (!(buffer))
- goto err;
- buffer_size= (size_t) (buffer_size*1.5);
- }
- return 0;
-
-err:
- error= 1;
- return 1;
-}
-
-
-int Buffer::get_size()
-{
- return (uint) buffer_size;
-}
-
-
-int Buffer::is_error()
-{
- return error;
-}
diff --git a/server-tools/instance-manager/buffer.h b/server-tools/instance-manager/buffer.h
deleted file mode 100644
index 3bd7a714437..00000000000
--- a/server-tools/instance-manager/buffer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_BUFFER_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_BUFFER_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_sys.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-/*
- This class is a simple implementation of the buffer of varying size.
- It is used to store MySQL client-server protocol packets. This is why
- the maximum buffer size if 16Mb. (See internals manual section
- 7. MySQL Client/Server Protocol)
-*/
-
-class Buffer
-{
-private:
- static const uint BUFFER_INITIAL_SIZE;
- /* maximum buffer size is 16Mb */
- static const uint MAX_BUFFER_SIZE;
- size_t buffer_size;
- /* Error flag. Triggered if we get an error of some kind */
- int error;
-public:
- Buffer(size_t buffer_size_arg= BUFFER_INITIAL_SIZE)
- :buffer_size(buffer_size_arg), error(0)
- {
- /*
- As append() will invokes realloc() anyway, it's ok if malloc returns 0
- */
- if (!(buffer= (uchar*) my_malloc(buffer_size, MYF(0))))
- buffer_size= 0;
- }
-
- ~Buffer()
- {
- my_free(buffer, MYF(0));
- }
-
-public:
- uchar *buffer;
- int get_size();
- int is_error();
- int append(size_t position, const char *string, size_t len_arg);
- int reserve(size_t position, size_t len_arg);
-};
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_BUFFER_H */
diff --git a/server-tools/instance-manager/command.h b/server-tools/instance-manager/command.h
deleted file mode 100644
index 25d8c9849e8..00000000000
--- a/server-tools/instance-manager/command.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_COMMAND_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_COMMAND_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-/* Class responsible for allocation of IM commands. */
-
-class Guardian;
-class Instance_map;
-
-struct st_net;
-
-/*
- Command - entry point for any command.
- GangOf4: 'Command' design pattern
-*/
-
-class Command
-{
-public:
- Command();
- virtual ~Command();
-
- /*
- This operation incapsulates behaviour of the command.
-
- SYNOPSIS
- net The network connection to the client.
- connection_id Client connection ID
-
- RETURN
- 0 On success
- non 0 On error. Client error code is returned.
- */
- virtual int execute(st_net *net, ulong connection_id) = 0;
-
-protected:
- Guardian *guardian;
- Instance_map *instance_map;
-};
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_COMMAND_H */
diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc
deleted file mode 100644
index 56bd720b3e9..00000000000
--- a/server-tools/instance-manager/commands.cc
+++ /dev/null
@@ -1,1752 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "commands.h"
-
-#include <my_global.h>
-#include <m_ctype.h>
-#include <mysql.h>
-#include <my_dir.h>
-
-#include "buffer.h"
-#include "guardian.h"
-#include "instance_map.h"
-#include "log.h"
-#include "manager.h"
-#include "messages.h"
-#include "mysqld_error.h"
-#include "mysql_manager_error.h"
-#include "options.h"
-#include "priv.h"
-#include "protocol.h"
-
-/**************************************************************************
- {{{ Static functions.
-**************************************************************************/
-
-/**
- modify_defaults_to_im_error -- a map of error codes of
- mysys::modify_defaults_file() into Instance Manager error codes.
-*/
-
-static const int modify_defaults_to_im_error[]= { 0, ER_OUT_OF_RESOURCES,
- ER_ACCESS_OPTION_FILE };
-
-
-/**
- Parse version number from the version string.
-
- SYNOPSIS
- parse_version_number()
- version_str
- version
- version_size
-
- DESCRIPTION
- TODO
-
- TODO: Move this function to Instance_options and parse version number
- only once.
-
- NOTE: This function is used only in SHOW INSTANCE STATUS statement at the
- moment.
-*/
-
-static int parse_version_number(const char *version_str, char *version,
- uint version_size)
-{
- const char *start= version_str;
- const char *end;
-
- // skip garbage
- while (!my_isdigit(default_charset_info, *start))
- start++;
-
- end= start;
- // skip digits and dots
- while (my_isdigit(default_charset_info, *end) || *end == '.')
- end++;
-
- if ((uint)(end - start) >= version_size)
- return -1;
-
- strncpy(version, start, end-start);
- version[end-start]= '\0';
-
- return 0;
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
-
-/**************************************************************************
- Implementation of Instance_name.
-**************************************************************************/
-
-Instance_name::Instance_name(const LEX_STRING *name)
-{
- str.str= str_buffer;
- str.length= name->length;
-
- if (str.length > MAX_INSTANCE_NAME_SIZE - 1)
- str.length= MAX_INSTANCE_NAME_SIZE - 1;
-
- strmake(str.str, name->str, str.length);
-}
-
-/**************************************************************************
- Implementation of Show_instances.
-**************************************************************************/
-
-/**
- Implementation of SHOW INSTANCES statement.
-
- Possible error codes:
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Show_instances::execute(st_net *net, ulong /* connection_id */)
-{
- int err_code;
-
- if ((err_code= write_header(net)) ||
- (err_code= write_data(net)))
- return err_code;
-
- if (send_eof(net) || net_flush(net))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-int Show_instances::write_header(st_net *net)
-{
- LIST name, state;
- LEX_STRING name_field, state_field;
- LIST *field_list;
-
- name_field.str= (char *) "instance_name";
- name_field.length= DEFAULT_FIELD_LENGTH;
- name.data= &name_field;
-
- state_field.str= (char *) "state";
- state_field.length= DEFAULT_FIELD_LENGTH;
- state.data= &state_field;
-
- field_list= list_add(NULL, &state);
- field_list= list_add(field_list, &name);
-
- return send_fields(net, field_list) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-int Show_instances::write_data(st_net *net)
-{
- my_bool err_status= FALSE;
-
- Instance *instance;
- Instance_map::Iterator iterator(instance_map);
-
- instance_map->lock();
-
- while ((instance= iterator.next()))
- {
- Buffer send_buf; /* buffer for packets */
- size_t pos= 0;
-
- instance->lock();
-
- const char *instance_name= instance->options.instance_name.str;
- const char *state_name= instance->get_state_name();
-
- if (store_to_protocol_packet(&send_buf, instance_name, &pos) ||
- store_to_protocol_packet(&send_buf, state_name, &pos) ||
- my_net_write(net, send_buf.buffer, pos))
- {
- err_status= TRUE;
- }
-
- instance->unlock();
-
- if (err_status)
- break;
- }
-
- instance_map->unlock();
-
- return err_status ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-/**************************************************************************
- Implementation of Flush_instances.
-**************************************************************************/
-
-/**
- Implementation of FLUSH INSTANCES statement.
-
- Possible error codes:
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
- ER_THERE_IS_ACTIVE_INSTACE If there is an active instance
-*/
-
-int Flush_instances::execute(st_net *net, ulong connection_id)
-{
- int err_status= Manager::flush_instances();
-
- if (err_status)
- return err_status;
-
- return net_send_ok(net, connection_id, NULL) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-/**************************************************************************
- Implementation of Instance_cmd.
-**************************************************************************/
-
-Instance_cmd::Instance_cmd(const LEX_STRING *instance_name_arg):
- instance_name(instance_name_arg)
-{
- /*
- MT-NOTE: we can not make a search for Instance object here,
- because it can dissappear after releasing the lock.
- */
-}
-
-
-/**************************************************************************
- Implementation of Abstract_instance_cmd.
-**************************************************************************/
-
-Abstract_instance_cmd::Abstract_instance_cmd(
- const LEX_STRING *instance_name_arg)
- :Instance_cmd(instance_name_arg)
-{
-}
-
-
-int Abstract_instance_cmd::execute(st_net *net, ulong connection_id)
-{
- int err_code;
- Instance *instance;
-
- instance_map->lock();
-
- instance= instance_map->find(get_instance_name());
-
- if (!instance)
- {
- instance_map->unlock();
- return ER_BAD_INSTANCE_NAME;
- }
-
- instance->lock();
- instance_map->unlock();
-
- err_code= execute_impl(net, instance);
-
- instance->unlock();
-
- if (!err_code)
- err_code= send_ok_response(net, connection_id);
-
- return err_code;
-}
-
-
-/**************************************************************************
- Implementation of Show_instance_status.
-**************************************************************************/
-
-Show_instance_status::Show_instance_status(const LEX_STRING *instance_name_arg)
- :Abstract_instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of SHOW INSTANCE STATUS statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Show_instance_status::execute_impl(st_net *net, Instance *instance)
-{
- int err_code;
-
- if ((err_code= write_header(net)) ||
- (err_code= write_data(net, instance)))
- return err_code;
-
- return 0;
-}
-
-
-int Show_instance_status::send_ok_response(st_net *net,
- ulong /* connection_id */)
-{
- if (send_eof(net) || net_flush(net))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-int Show_instance_status::write_header(st_net *net)
-{
- LIST name, state, version, version_number, mysqld_compatible;
- LIST *field_list;
- LEX_STRING name_field, state_field, version_field,
- version_number_field, mysqld_compatible_field;
-
- /* Create list of the fileds to be passed to send_fields(). */
-
- name_field.str= (char *) "instance_name";
- name_field.length= DEFAULT_FIELD_LENGTH;
- name.data= &name_field;
-
- state_field.str= (char *) "state";
- state_field.length= DEFAULT_FIELD_LENGTH;
- state.data= &state_field;
-
- version_field.str= (char *) "version";
- version_field.length= MAX_VERSION_LENGTH;
- version.data= &version_field;
-
- version_number_field.str= (char *) "version_number";
- version_number_field.length= MAX_VERSION_LENGTH;
- version_number.data= &version_number_field;
-
- mysqld_compatible_field.str= (char *) "mysqld_compatible";
- mysqld_compatible_field.length= DEFAULT_FIELD_LENGTH;
- mysqld_compatible.data= &mysqld_compatible_field;
-
- field_list= list_add(NULL, &mysqld_compatible);
- field_list= list_add(field_list, &version);
- field_list= list_add(field_list, &version_number);
- field_list= list_add(field_list, &state);
- field_list= list_add(field_list, &name);
-
- return send_fields(net, field_list) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-int Show_instance_status::write_data(st_net *net, Instance *instance)
-{
- Buffer send_buf; /* buffer for packets */
- char version_num_buf[MAX_VERSION_LENGTH];
- size_t pos= 0;
-
- const char *state_name= instance->get_state_name();
- const char *version_tag= "unknown";
- const char *version_num= "unknown";
- const char *mysqld_compatible_status=
- instance->is_mysqld_compatible() ? "yes" : "no";
-
- if (instance->options.mysqld_version)
- {
- if (parse_version_number(instance->options.mysqld_version, version_num_buf,
- sizeof(version_num_buf)))
- return ER_OUT_OF_RESOURCES;
-
- version_num= version_num_buf;
- version_tag= instance->options.mysqld_version;
- }
-
- if (store_to_protocol_packet(&send_buf, get_instance_name()->str, &pos) ||
- store_to_protocol_packet(&send_buf, state_name, &pos) ||
- store_to_protocol_packet(&send_buf, version_num, &pos) ||
- store_to_protocol_packet(&send_buf, version_tag, &pos) ||
- store_to_protocol_packet(&send_buf, mysqld_compatible_status, &pos) ||
- my_net_write(net, send_buf.buffer, pos))
- {
- return ER_OUT_OF_RESOURCES;
- }
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Show_instance_options.
-**************************************************************************/
-
-Show_instance_options::Show_instance_options(
- const LEX_STRING *instance_name_arg)
- :Abstract_instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of SHOW INSTANCE OPTIONS statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Show_instance_options::execute_impl(st_net *net, Instance *instance)
-{
- int err_code;
-
- if ((err_code= write_header(net)) ||
- (err_code= write_data(net, instance)))
- return err_code;
-
- return 0;
-}
-
-
-int Show_instance_options::send_ok_response(st_net *net,
- ulong /* connection_id */)
-{
- if (send_eof(net) || net_flush(net))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-int Show_instance_options::write_header(st_net *net)
-{
- LIST name, option;
- LIST *field_list;
- LEX_STRING name_field, option_field;
-
- /* Create list of the fileds to be passed to send_fields(). */
-
- name_field.str= (char *) "option_name";
- name_field.length= DEFAULT_FIELD_LENGTH;
- name.data= &name_field;
-
- option_field.str= (char *) "value";
- option_field.length= DEFAULT_FIELD_LENGTH;
- option.data= &option_field;
-
- field_list= list_add(NULL, &option);
- field_list= list_add(field_list, &name);
-
- return send_fields(net, field_list) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-int Show_instance_options::write_data(st_net *net, Instance *instance)
-{
- Buffer send_buff; /* buffer for packets */
- size_t pos= 0;
-
- if (store_to_protocol_packet(&send_buff, "instance_name", &pos) ||
- store_to_protocol_packet(&send_buff, get_instance_name()->str, &pos) ||
- my_net_write(net, send_buff.buffer, pos))
- {
- return ER_OUT_OF_RESOURCES;
- }
-
- /* Loop through the options. */
-
- for (int i= 0; i < instance->options.get_num_options(); i++)
- {
- Named_value option= instance->options.get_option(i);
- const char *option_value= option.get_value()[0] ? option.get_value() : "";
-
- pos= 0;
-
- if (store_to_protocol_packet(&send_buff, option.get_name(), &pos) ||
- store_to_protocol_packet(&send_buff, option_value, &pos) ||
- my_net_write(net, send_buff.buffer, pos))
- {
- return ER_OUT_OF_RESOURCES;
- }
- }
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Start_instance.
-**************************************************************************/
-
-Start_instance::Start_instance(const LEX_STRING *instance_name_arg)
- :Abstract_instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of START INSTANCE statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_INSTANCE_MISCONFIGURED The instance configuration is invalid
- ER_INSTANCE_ALREADY_STARTED The instance is already started
- ER_CANNOT_START_INSTANCE The instance could not have been started
-
- TODO: as soon as this method operates only with Instance, we probably
- should introduce a new method (execute_stop_instance()) in Instance and
- just call it from here.
-*/
-
-int Start_instance::execute_impl(st_net * /* net */, Instance *instance)
-{
- if (!instance->is_configured())
- return ER_INSTANCE_MISCONFIGURED;
-
- if (instance->is_active())
- return ER_INSTANCE_ALREADY_STARTED;
-
- if (instance->start_mysqld())
- return ER_CANNOT_START_INSTANCE;
-
- instance->reset_stat();
- instance->set_state(Instance::NOT_STARTED);
-
- return 0;
-}
-
-
-int Start_instance::send_ok_response(st_net *net, ulong connection_id)
-{
- if (net_send_ok(net, connection_id, "Instance started"))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Stop_instance.
-**************************************************************************/
-
-Stop_instance::Stop_instance(const LEX_STRING *instance_name_arg)
- :Abstract_instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of STOP INSTANCE statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-
- TODO: as soon as this method operates only with Instance, we probably
- should introduce a new method (execute_stop_instance()) in Instance and
- just call it from here.
-*/
-
-int Stop_instance::execute_impl(st_net * /* net */, Instance *instance)
-{
- if (!instance->is_active())
- return ER_INSTANCE_IS_NOT_STARTED;
-
- instance->set_state(Instance::STOPPED);
-
- return instance->stop_mysqld() ? ER_STOP_INSTANCE : 0;
-}
-
-
-int Stop_instance::send_ok_response(st_net *net, ulong connection_id)
-{
- if (net_send_ok(net, connection_id, NULL))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation for Create_instance.
-**************************************************************************/
-
-Create_instance::Create_instance(const LEX_STRING *instance_name_arg)
- :Instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- This operation initializes Create_instance object.
-
- SYNOPSIS
- text [IN/OUT] a pointer to the text containing instance options.
-
- RETURN
- FALSE On success.
- TRUE On error.
-*/
-
-bool Create_instance::init(const char **text)
-{
- return options.init() || parse_args(text);
-}
-
-
-/**
- This operation parses CREATE INSTANCE options.
-
- SYNOPSIS
- text [IN/OUT] a pointer to the text containing instance options.
-
- RETURN
- FALSE On success.
- TRUE On syntax error.
-*/
-
-bool Create_instance::parse_args(const char **text)
-{
- size_t len;
-
- /* Check if we have something (and trim leading spaces). */
-
- get_word(text, &len, NONSPACE);
-
- if (len == 0)
- return FALSE; /* OK: no option. */
-
- /* Main parsing loop. */
-
- while (TRUE)
- {
- LEX_STRING option_name;
- char *option_name_str;
- char *option_value_str= NULL;
-
- /* Looking for option name. */
-
- get_word(text, &option_name.length, OPTION_NAME);
-
- if (option_name.length == 0)
- return TRUE; /* Syntax error: option name expected. */
-
- option_name.str= (char *) *text;
- *text+= option_name.length;
-
- /* Looking for equal sign. */
-
- skip_spaces(text);
-
- if (**text == '=')
- {
- ++(*text); /* Skip an equal sign. */
-
- /* Looking for option value. */
-
- skip_spaces(text);
-
- if (!**text)
- return TRUE; /* Syntax error: EOS when option value expected. */
-
- if (**text != '\'' && **text != '"')
- {
- /* Option value is a simple token. */
-
- LEX_STRING option_value;
-
- get_word(text, &option_value.length, ALPHANUM);
-
- if (option_value.length == 0)
- return TRUE; /* internal parser error. */
-
- option_value.str= (char *) *text;
- *text+= option_value.length;
-
- if (!(option_value_str= Named_value::alloc_str(&option_value)))
- return TRUE; /* out of memory during parsing. */
- }
- else
- {
- /* Option value is a string. */
-
- if (parse_option_value(*text, &len, &option_value_str))
- return TRUE; /* Syntax error: invalid string specification. */
-
- *text+= len;
- }
- }
-
- if (!option_value_str)
- {
- LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
-
- if (!(option_value_str= Named_value::alloc_str(&empty_str)))
- return TRUE; /* out of memory during parsing. */
- }
-
- if (!(option_name_str= Named_value::alloc_str(&option_name)))
- {
- Named_value::free_str(&option_value_str);
- return TRUE; /* out of memory during parsing. */
- }
-
- {
- Named_value option(option_name_str, option_value_str);
-
- if (options.add_element(&option))
- {
- option.free();
- return TRUE; /* out of memory during parsing. */
- }
- }
-
- skip_spaces(text);
-
- if (!**text)
- return FALSE; /* OK: end of options. */
-
- if (**text != ',')
- return TRUE; /* Syntax error: comma expected. */
-
- ++(*text);
- }
-}
-
-
-/**
- Implementation of CREATE INSTANCE statement.
-
- Possible error codes:
- ER_MALFORMED_INSTANCE_NAME Instance name is malformed
- ER_CREATE_EXISTING_INSTANCE There is an instance with the given name
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Create_instance::execute(st_net *net, ulong connection_id)
-{
- int err_code;
- Instance *instance;
-
- /* Check that the name is valid and there is no instance with such name. */
-
- if (!Instance::is_name_valid(get_instance_name()))
- return ER_MALFORMED_INSTANCE_NAME;
-
- /*
- NOTE: In order to prevent race condition, we should perform all operations
- on under acquired lock.
- */
-
- instance_map->lock();
-
- if (instance_map->find(get_instance_name()))
- {
- instance_map->unlock();
- return ER_CREATE_EXISTING_INSTANCE;
- }
-
- if ((err_code= instance_map->create_instance(get_instance_name(), &options)))
- {
- instance_map->unlock();
- return err_code;
- }
-
- instance= instance_map->find(get_instance_name());
- DBUG_ASSERT(instance);
-
- if ((err_code= create_instance_in_file(get_instance_name(), &options)))
- {
- instance_map->remove_instance(instance); /* instance is deleted here. */
-
- instance_map->unlock();
- return err_code;
- }
-
- /*
- CREATE INSTANCE must not lead to start instance, even if it guarded.
-
- TODO: The problem however is that if Instance Manager restarts after
- creating instance, the instance will be restarted (see also BUG#19718).
- */
-
- instance->set_state(Instance::STOPPED);
-
- /* That's all. */
-
- instance_map->unlock();
-
- /* Send the result. */
-
- if (net_send_ok(net, connection_id, NULL))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation for Drop_instance.
-**************************************************************************/
-
-Drop_instance::Drop_instance(const LEX_STRING *instance_name_arg)
- :Instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of DROP INSTANCE statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_DROP_ACTIVE_INSTANCE The specified instance is active
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Drop_instance::execute(st_net *net, ulong connection_id)
-{
- int err_code;
- Instance *instance;
-
- /* Lock Guardian, then Instance_map. */
-
- instance_map->lock();
-
- /* Find an instance. */
-
- instance= instance_map->find(get_instance_name());
-
- if (!instance)
- {
- instance_map->unlock();
- return ER_BAD_INSTANCE_NAME;
- }
-
- instance->lock();
-
- /* Check that the instance is offline. */
-
- if (instance->is_active())
- {
- instance->unlock();
- instance_map->unlock();
-
- return ER_DROP_ACTIVE_INSTANCE;
- }
-
- /* Try to remove instance from the file. */
-
- err_code= modify_defaults_file(Options::Main::config_file, NULL, NULL,
- get_instance_name()->str, MY_REMOVE_SECTION);
- DBUG_ASSERT(err_code >= 0 && err_code <= 2);
-
- if (err_code)
- {
- log_error("Can not remove instance '%s' from defaults file (%s). "
- "Original error code: %d.",
- (const char *) get_instance_name()->str,
- (const char *) Options::Main::config_file,
- (int) err_code);
-
- instance->unlock();
- instance_map->unlock();
-
- return modify_defaults_to_im_error[err_code];
- }
-
- /* Unlock the instance before destroy. */
-
- instance->unlock();
-
- /*
- Remove instance from the instance map
- (the instance will be also destroyed here).
- */
-
- instance_map->remove_instance(instance);
-
- /* Unlock the instance map. */
-
- instance_map->unlock();
-
- /* That's all: send ok. */
-
- if (net_send_ok(net, connection_id, "Instance dropped"))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation for Show_instance_log.
-**************************************************************************/
-
-Show_instance_log::Show_instance_log(const LEX_STRING *instance_name_arg,
- Log_type log_type_arg,
- uint size_arg, uint offset_arg)
- :Abstract_instance_cmd(instance_name_arg),
- log_type(log_type_arg),
- size(size_arg),
- offset(offset_arg)
-{
-}
-
-
-/**
- Implementation of SHOW INSTANCE LOG statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_OFFSET_ERROR We were requested to read negative number of
- bytes from the log
- ER_NO_SUCH_LOG The specified type of log is not available for
- the given instance
- ER_GUESS_LOGFILE IM wasn't able to figure out the log
- placement, while it is enabled. Probably user
- should specify the path to the logfile
- explicitly.
- ER_OPEN_LOGFILE Cannot open the logfile
- ER_READ_FILE Cannot read the logfile
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Show_instance_log::execute_impl(st_net *net, Instance *instance)
-{
- int err_code;
-
- if ((err_code= check_params(instance)))
- return err_code;
-
- if ((err_code= write_header(net)) ||
- (err_code= write_data(net, instance)))
- return err_code;
-
- return 0;
-}
-
-
-int Show_instance_log::send_ok_response(st_net *net,
- ulong /* connection_id */)
-{
- if (send_eof(net) || net_flush(net))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-int Show_instance_log::check_params(Instance *instance)
-{
- const char *logpath= instance->options.logs[log_type];
-
- /* Cannot read negative number of bytes. */
-
- if (offset > size)
- return ER_OFFSET_ERROR;
-
- /* Instance has no such log. */
-
- if (logpath == NULL)
- return ER_NO_SUCH_LOG;
-
- if (*logpath == '\0')
- return ER_GUESS_LOGFILE;
-
- return 0;
-}
-
-
-int Show_instance_log::write_header(st_net *net)
-{
- LIST name;
- LIST *field_list;
- LEX_STRING name_field;
-
- /* Create list of the fields to be passed to send_fields(). */
-
- name_field.str= (char *) "Log";
- name_field.length= DEFAULT_FIELD_LENGTH;
-
- name.data= &name_field;
-
- field_list= list_add(NULL, &name);
-
- return send_fields(net, field_list) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-int Show_instance_log::write_data(st_net *net, Instance *instance)
-{
- Buffer send_buff; /* buffer for packets */
- size_t pos= 0;
-
- const char *logpath= instance->options.logs[log_type];
- File fd;
-
- size_t buff_size;
- size_t read_len;
-
- MY_STAT file_stat;
- Buffer read_buff;
-
- if ((fd= my_open(logpath, O_RDONLY | O_BINARY, MYF(MY_WME))) <= 0)
- return ER_OPEN_LOGFILE;
-
- /* my_fstat doesn't use the flag parameter */
- if (my_fstat(fd, &file_stat, MYF(0)))
- {
- close(fd);
- return ER_OUT_OF_RESOURCES;
- }
-
- /* calculate buffer size */
- buff_size= (size - offset);
-
- read_buff.reserve(0, buff_size);
-
- /* read in one chunk */
- read_len= (int)my_seek(fd, file_stat.st_size - size, MY_SEEK_SET, MYF(0));
-
- if ((read_len= my_read(fd, read_buff.buffer, buff_size, MYF(0))) ==
- MY_FILE_ERROR)
- {
- close(fd);
- return ER_READ_FILE;
- }
-
- close(fd);
-
- if (store_to_protocol_packet(&send_buff, (char*) read_buff.buffer, &pos,
- read_len) ||
- my_net_write(net, send_buff.buffer, pos))
- {
- return ER_OUT_OF_RESOURCES;
- }
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Show_instance_log_files.
-**************************************************************************/
-
-Show_instance_log_files::Show_instance_log_files
- (const LEX_STRING *instance_name_arg)
- :Abstract_instance_cmd(instance_name_arg)
-{
-}
-
-
-/**
- Implementation of SHOW INSTANCE LOG FILES statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Show_instance_log_files::execute_impl(st_net *net, Instance *instance)
-{
- int err_code;
-
- if ((err_code= write_header(net)) ||
- (err_code= write_data(net, instance)))
- return err_code;
-
- return 0;
-}
-
-
-int Show_instance_log_files::send_ok_response(st_net *net,
- ulong /* connection_id */)
-{
- if (send_eof(net) || net_flush(net))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-int Show_instance_log_files::write_header(st_net *net)
-{
- LIST name, path, size;
- LIST *field_list;
- LEX_STRING name_field, path_field, size_field;
-
- /* Create list of the fileds to be passed to send_fields(). */
-
- name_field.str= (char *) "Logfile";
- name_field.length= DEFAULT_FIELD_LENGTH;
- name.data= &name_field;
-
- path_field.str= (char *) "Path";
- path_field.length= DEFAULT_FIELD_LENGTH;
- path.data= &path_field;
-
- size_field.str= (char *) "File size";
- size_field.length= DEFAULT_FIELD_LENGTH;
- size.data= &size_field;
-
- field_list= list_add(NULL, &size);
- field_list= list_add(field_list, &path);
- field_list= list_add(field_list, &name);
-
- return send_fields(net, field_list) ? ER_OUT_OF_RESOURCES : 0;
-}
-
-
-int Show_instance_log_files::write_data(st_net *net, Instance *instance)
-{
- Buffer send_buff; /* buffer for packets */
-
- /*
- We have alike structure in instance_options.cc. We use such to be able
- to loop through the options, which we need to handle in some common way.
- */
- struct log_files_st
- {
- const char *name;
- const char *value;
- } logs[]=
- {
- {"ERROR LOG", instance->options.logs[IM_LOG_ERROR]},
- {"GENERAL LOG", instance->options.logs[IM_LOG_GENERAL]},
- {"SLOW LOG", instance->options.logs[IM_LOG_SLOW]},
- {NULL, NULL}
- };
- struct log_files_st *log_files;
-
- for (log_files= logs; log_files->name; log_files++)
- {
- if (!log_files->value)
- continue;
-
- struct stat file_stat;
- /*
- Save some more space for the log file names. In fact all
- we need is strlen("GENERAL_LOG") + 1
- */
- enum { LOG_NAME_BUFFER_SIZE= 20 };
- char buff[LOG_NAME_BUFFER_SIZE];
-
- size_t pos= 0;
-
- const char *log_path= "";
- const char *log_size= "0";
-
- if (!stat(log_files->value, &file_stat) &&
- MY_S_ISREG(file_stat.st_mode))
- {
- int10_to_str(file_stat.st_size, buff, 10);
-
- log_path= log_files->value;
- log_size= buff;
- }
-
- if (store_to_protocol_packet(&send_buff, log_files->name, &pos) ||
- store_to_protocol_packet(&send_buff, log_path, &pos) ||
- store_to_protocol_packet(&send_buff, log_size, &pos) ||
- my_net_write(net, send_buff.buffer, pos))
- return ER_OUT_OF_RESOURCES;
- }
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Abstract_option_cmd.
-**************************************************************************/
-
-/**
- Instance_options_list -- a data class representing a list of options for
- some instance.
-*/
-
-class Instance_options_list
-{
-public:
- Instance_options_list(const LEX_STRING *instance_name_arg);
-
-public:
- bool init();
-
- const LEX_STRING *get_instance_name() const
- {
- return instance_name.get_str();
- }
-
-public:
- /*
- This member is set and used only in Abstract_option_cmd::execute_impl().
- Normally it is not used (and should not).
-
- The problem is that construction and execution of commands are made not
- in one transaction (not under one lock session). So, we can not initialize
- instance in constructor and use it in execution.
- */
- Instance *instance;
-
- Named_value_arr options;
-
-private:
- Instance_name instance_name;
-};
-
-
-/**************************************************************************/
-
-Instance_options_list::Instance_options_list(
- const LEX_STRING *instance_name_arg)
- :instance(NULL),
- instance_name(instance_name_arg)
-{
-}
-
-
-bool Instance_options_list::init()
-{
- return options.init();
-}
-
-
-/**************************************************************************/
-
-C_MODE_START
-
-static uchar* get_item_key(const uchar* item, size_t* len,
- my_bool __attribute__((unused)) t)
-{
- const Instance_options_list *lst= (const Instance_options_list *) item;
- *len= lst->get_instance_name()->length;
- return (uchar *) lst->get_instance_name()->str;
-}
-
-static void delete_item(void *item)
-{
- delete (Instance_options_list *) item;
-}
-
-C_MODE_END
-
-
-/**************************************************************************/
-
-Abstract_option_cmd::Abstract_option_cmd()
- :initialized(FALSE)
-{
-}
-
-
-Abstract_option_cmd::~Abstract_option_cmd()
-{
- if (initialized)
- hash_free(&instance_options_map);
-}
-
-
-bool Abstract_option_cmd::add_option(const LEX_STRING *instance_name,
- Named_value *option)
-{
- Instance_options_list *lst= get_instance_options_list(instance_name);
-
- if (!lst)
- return TRUE;
-
- lst->options.add_element(option);
-
- return FALSE;
-}
-
-
-bool Abstract_option_cmd::init(const char **text)
-{
- static const int INITIAL_HASH_SIZE= 16;
-
- if (hash_init(&instance_options_map, default_charset_info,
- INITIAL_HASH_SIZE, 0, 0, get_item_key, delete_item, 0))
- return TRUE;
-
- if (parse_args(text))
- return TRUE;
-
- initialized= TRUE;
-
- return FALSE;
-}
-
-
-/**
- Correct the option file. The "skip" option is used to remove the found
- option.
-
- SYNOPSIS
- Abstract_option_cmd::correct_file()
- skip Skip the option, being searched while writing the result file.
- That is, to delete it.
-
- RETURN
- 0 Success
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
- ER_ACCESS_OPTION_FILE Cannot access the option file
-*/
-
-int Abstract_option_cmd::correct_file(Instance *instance, Named_value *option,
- bool skip)
-{
- int err_code= modify_defaults_file(Options::Main::config_file,
- option->get_name(),
- option->get_value(),
- instance->get_name()->str,
- skip);
-
- DBUG_ASSERT(err_code >= 0 && err_code <= 2);
-
- if (err_code)
- {
- log_error("Can not modify option (%s) in defaults file (%s). "
- "Original error code: %d.",
- (const char *) option->get_name(),
- (const char *) Options::Main::config_file,
- (int) err_code);
- }
-
- return modify_defaults_to_im_error[err_code];
-}
-
-
-/**
- Lock Instance Map and call execute_impl().
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance with the given name does not exist
- ER_INCOMPATIBLE_OPTION The specified option can not be set for
- mysqld-compatible instance
- ER_INSTANCE_IS_ACTIVE The specified instance is active
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Abstract_option_cmd::execute(st_net *net, ulong connection_id)
-{
- int err_code;
-
- instance_map->lock();
-
- err_code= execute_impl(net, connection_id);
-
- instance_map->unlock();
-
- return err_code;
-}
-
-
-Instance_options_list *
-Abstract_option_cmd::get_instance_options_list(const LEX_STRING *instance_name)
-{
- Instance_options_list *lst=
- (Instance_options_list *) hash_search(&instance_options_map,
- (uchar *) instance_name->str,
- instance_name->length);
-
- if (!lst)
- {
- lst= new Instance_options_list(instance_name);
-
- if (!lst)
- return NULL;
-
- if (lst->init() || my_hash_insert(&instance_options_map, (uchar *) lst))
- {
- delete lst;
- return NULL;
- }
- }
-
- return lst;
-}
-
-
-/**
- Skeleton implementation of option-management command.
-
- MT-NOTE: Instance Map is locked before calling this operation.
-*/
-int Abstract_option_cmd::execute_impl(st_net *net, ulong connection_id)
-{
- int err_code= 0;
-
- /* Check that all the specified instances exist and are offline. */
-
- for (uint i= 0; i < instance_options_map.records; ++i)
- {
- Instance_options_list *lst=
- (Instance_options_list *) hash_element(&instance_options_map, i);
-
- bool instance_is_active;
-
- lst->instance= instance_map->find(lst->get_instance_name());
-
- if (!lst->instance)
- return ER_BAD_INSTANCE_NAME;
-
- lst->instance->lock();
- instance_is_active= lst->instance->is_active();
- lst->instance->unlock();
-
- if (instance_is_active)
- return ER_INSTANCE_IS_ACTIVE;
- }
-
- /* Perform command-specific (SET/UNSET) actions. */
-
- for (uint i= 0; i < instance_options_map.records; ++i)
- {
- Instance_options_list *lst=
- (Instance_options_list *) hash_element(&instance_options_map, i);
-
- lst->instance->lock();
-
- for (int j= 0; j < lst->options.get_size(); ++j)
- {
- Named_value option= lst->options.get_element(j);
- err_code= process_option(lst->instance, &option);
-
- if (err_code)
- break;
- }
-
- lst->instance->unlock();
-
- if (err_code)
- break;
- }
-
- if (err_code == 0)
- net_send_ok(net, connection_id, NULL);
-
- return err_code;
-}
-
-
-/**************************************************************************
- Implementation of Set_option.
-**************************************************************************/
-
-/**
- This operation parses SET options.
-
- SYNOPSIS
- text [IN/OUT] a pointer to the text containing options.
-
- RETURN
- FALSE On success.
- TRUE On syntax error.
-*/
-
-bool Set_option::parse_args(const char **text)
-{
- size_t len;
-
- /* Check if we have something (and trim leading spaces). */
-
- get_word(text, &len, NONSPACE);
-
- if (len == 0)
- return TRUE; /* Syntax error: no option. */
-
- /* Main parsing loop. */
-
- while (TRUE)
- {
- LEX_STRING instance_name;
- LEX_STRING option_name;
- char *option_name_str;
- char *option_value_str= NULL;
-
- /* Looking for instance name. */
-
- get_word(text, &instance_name.length, ALPHANUM);
-
- if (instance_name.length == 0)
- return TRUE; /* Syntax error: instance name expected. */
-
- instance_name.str= (char *) *text;
- *text+= instance_name.length;
-
- skip_spaces(text);
-
- /* Check the the delimiter is a dot. */
-
- if (**text != '.')
- return TRUE; /* Syntax error: dot expected. */
-
- ++(*text);
-
- /* Looking for option name. */
-
- get_word(text, &option_name.length, OPTION_NAME);
-
- if (option_name.length == 0)
- return TRUE; /* Syntax error: option name expected. */
-
- option_name.str= (char *) *text;
- *text+= option_name.length;
-
- /* Looking for equal sign. */
-
- skip_spaces(text);
-
- if (**text == '=')
- {
- ++(*text); /* Skip an equal sign. */
-
- /* Looking for option value. */
-
- skip_spaces(text);
-
- if (!**text)
- return TRUE; /* Syntax error: EOS when option value expected. */
-
- if (**text != '\'' && **text != '"')
- {
- /* Option value is a simple token. */
-
- LEX_STRING option_value;
-
- get_word(text, &option_value.length, ALPHANUM);
-
- if (option_value.length == 0)
- return TRUE; /* internal parser error. */
-
- option_value.str= (char *) *text;
- *text+= option_value.length;
-
- if (!(option_value_str= Named_value::alloc_str(&option_value)))
- return TRUE; /* out of memory during parsing. */
- }
- else
- {
- /* Option value is a string. */
-
- if (parse_option_value(*text, &len, &option_value_str))
- return TRUE; /* Syntax error: invalid string specification. */
-
- *text+= len;
- }
- }
-
- if (!option_value_str)
- {
- LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
-
- if (!(option_value_str= Named_value::alloc_str(&empty_str)))
- return TRUE; /* out of memory during parsing. */
- }
-
- if (!(option_name_str= Named_value::alloc_str(&option_name)))
- {
- Named_value::free_str(&option_name_str);
- return TRUE; /* out of memory during parsing. */
- }
-
- {
- Named_value option(option_name_str, option_value_str);
-
- if (add_option(&instance_name, &option))
- {
- option.free();
- return TRUE; /* out of memory during parsing. */
- }
- }
-
- skip_spaces(text);
-
- if (!**text)
- return FALSE; /* OK: end of options. */
-
- if (**text != ',')
- return TRUE; /* Syntax error: comma expected. */
-
- ++(*text); /* Skip a comma. */
- }
-}
-
-
-int Set_option::process_option(Instance *instance, Named_value *option)
-{
- /* Check that the option is valid. */
-
- if (instance->is_mysqld_compatible() &&
- Instance_options::is_option_im_specific(option->get_name()))
- {
- log_error("IM-option (%s) can not be used "
- "in the configuration of mysqld-compatible instance (%s).",
- (const char *) option->get_name(),
- (const char *) instance->get_name()->str);
- return ER_INCOMPATIBLE_OPTION;
- }
-
- /* Update the configuration file. */
-
- int err_code= correct_file(instance, option, FALSE);
-
- if (err_code)
- return err_code;
-
- /* Update the internal cache. */
-
- if (instance->options.set_option(option))
- return ER_OUT_OF_RESOURCES;
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Unset_option.
-**************************************************************************/
-
-/**
- This operation parses UNSET options.
-
- SYNOPSIS
- text [IN/OUT] a pointer to the text containing options.
-
- RETURN
- FALSE On success.
- TRUE On syntax error.
-*/
-
-bool Unset_option::parse_args(const char **text)
-{
- size_t len;
-
- /* Check if we have something (and trim leading spaces). */
-
- get_word(text, &len, NONSPACE);
-
- if (len == 0)
- return TRUE; /* Syntax error: no option. */
-
- /* Main parsing loop. */
-
- while (TRUE)
- {
- LEX_STRING instance_name;
- LEX_STRING option_name;
- char *option_name_str;
- char *option_value_str;
-
- /* Looking for instance name. */
-
- get_word(text, &instance_name.length, ALPHANUM);
-
- if (instance_name.length == 0)
- return TRUE; /* Syntax error: instance name expected. */
-
- instance_name.str= (char *) *text;
- *text+= instance_name.length;
-
- skip_spaces(text);
-
- /* Check the the delimiter is a dot. */
-
- if (**text != '.')
- return TRUE; /* Syntax error: dot expected. */
-
- ++(*text); /* Skip a dot. */
-
- /* Looking for option name. */
-
- get_word(text, &option_name.length, OPTION_NAME);
-
- if (option_name.length == 0)
- return TRUE; /* Syntax error: option name expected. */
-
- option_name.str= (char *) *text;
- *text+= option_name.length;
-
- if (!(option_name_str= Named_value::alloc_str(&option_name)))
- return TRUE; /* out of memory during parsing. */
-
- {
- LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
-
- if (!(option_value_str= Named_value::alloc_str(&empty_str)))
- {
- Named_value::free_str(&option_name_str);
- return TRUE;
- }
- }
-
- {
- Named_value option(option_name_str, option_value_str);
-
- if (add_option(&instance_name, &option))
- {
- option.free();
- return TRUE; /* out of memory during parsing. */
- }
- }
-
- skip_spaces(text);
-
- if (!**text)
- return FALSE; /* OK: end of options. */
-
- if (**text != ',')
- return TRUE; /* Syntax error: comma expected. */
-
- ++(*text); /* Skip a comma. */
- }
-}
-
-
-/**
- Implementation of UNSET statement.
-
- Possible error codes:
- ER_BAD_INSTANCE_NAME The instance name specified is not valid
- ER_INSTANCE_IS_ACTIVE The specified instance is active
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
-*/
-
-int Unset_option::process_option(Instance *instance, Named_value *option)
-{
- /* Update the configuration file. */
-
- int err_code= correct_file(instance, option, TRUE);
-
- if (err_code)
- return err_code;
-
- /* Update the internal cache. */
-
- instance->options.unset_option(option->get_name());
-
- return 0;
-}
-
-
-/**************************************************************************
- Implementation of Syntax_error.
-**************************************************************************/
-
-int Syntax_error::execute(st_net * /* net */, ulong /* connection_id */)
-{
- return ER_SYNTAX_ERROR;
-}
diff --git a/server-tools/instance-manager/commands.h b/server-tools/instance-manager/commands.h
deleted file mode 100644
index 5c2b2f9bbb7..00000000000
--- a/server-tools/instance-manager/commands.h
+++ /dev/null
@@ -1,393 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_COMMANDS_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_COMMANDS_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
-#include <hash.h>
-
-#include "command.h"
-#include "instance.h"
-#include "parse.h"
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-
-/**
- Print all instances of this instance manager.
- Grammar: SHOW INSTANCES
-*/
-
-class Show_instances: public Command
-{
-public:
- Show_instances()
- { }
-
-public:
- int execute(st_net *net, ulong connection_id);
-
-private:
- int write_header(st_net *net);
- int write_data(st_net *net);
-};
-
-
-/**
- Reread configuration file and refresh internal cache.
- Grammar: FLUSH INSTANCES
-*/
-
-class Flush_instances: public Command
-{
-public:
- Flush_instances()
- { }
-
-public:
- int execute(st_net *net, ulong connection_id);
-};
-
-
-/**
- Base class for Instance-specific commands
- (commands that operate on one instance).
-
- Instance_cmd extends Command class by:
- - an attribute for storing instance name;
- - code to initialize instance name in constructor;
- - an accessor to get instance name.
-*/
-
-class Instance_cmd : public Command
-{
-public:
- Instance_cmd(const LEX_STRING *instance_name_arg);
-
-protected:
- inline const LEX_STRING *get_instance_name() const
- {
- return instance_name.get_str();
- }
-
-private:
- Instance_name instance_name;
-};
-
-
-/**
- Abstract class for Instance-specific commands.
-
- Abstract_instance_cmd extends Instance_cmd by providing a common
- framework for writing command-implementations. Basically, the class
- implements Command::execute() pure virtual function in the following
- way:
- - Lock Instance_map;
- - Get an instance by name. Return an error, if there is no such
- instance;
- - Lock the instance;
- - Unlock Instance_map;
- - Call execute_impl(), which should be implemented in derived class;
- - Unlock the instance;
- - Send response to the client and return error status.
-*/
-
-class Abstract_instance_cmd: public Instance_cmd
-{
-public:
- Abstract_instance_cmd(const LEX_STRING *instance_name_arg);
-
-public:
- virtual int execute(st_net *net, ulong connection_id);
-
-protected:
- /**
- This operation is intended to contain command-specific implementation.
-
- MT-NOTE: this operation is called under acquired Instance's lock.
- */
- virtual int execute_impl(st_net *net, Instance *instance) = 0;
-
- /**
- This operation is invoked on successful return of execute_impl() and is
- intended to send closing data.
-
- MT-NOTE: this operation is called under released Instance's lock.
- */
- virtual int send_ok_response(st_net *net, ulong connection_id) = 0;
-};
-
-
-/**
- Print status of an instance.
- Grammar: SHOW INSTANCE STATUS <instance_name>
-*/
-
-class Show_instance_status: public Abstract_instance_cmd
-{
-public:
- Show_instance_status(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-
-private:
- int write_header(st_net *net);
- int write_data(st_net *net, Instance *instance);
-};
-
-
-/**
- Print options of chosen instance.
- Grammar: SHOW INSTANCE OPTIONS <instance_name>
-*/
-
-class Show_instance_options: public Abstract_instance_cmd
-{
-public:
- Show_instance_options(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-
-private:
- int write_header(st_net *net);
- int write_data(st_net *net, Instance *instance);
-};
-
-
-/**
- Start an instance.
- Grammar: START INSTANCE <instance_name>
-*/
-
-class Start_instance: public Abstract_instance_cmd
-{
-public:
- Start_instance(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-};
-
-
-/**
- Stop an instance.
- Grammar: STOP INSTANCE <instance_name>
-*/
-
-class Stop_instance: public Abstract_instance_cmd
-{
-public:
- Stop_instance(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-};
-
-
-/**
- Create an instance.
- Grammar: CREATE INSTANCE <instance_name> [<options>]
-*/
-
-class Create_instance: public Instance_cmd
-{
-public:
- Create_instance(const LEX_STRING *instance_name_arg);
-
-public:
- bool init(const char **text);
-
-protected:
- virtual int execute(st_net *net, ulong connection_id);
-
-private:
- bool parse_args(const char **text);
-
-private:
- Named_value_arr options;
-};
-
-
-/**
- Drop an instance.
- Grammar: DROP INSTANCE <instance_name>
-
- Operation is permitted only if the instance is stopped. On successful
- completion the instance section is removed from config file and the instance
- is removed from the instance map.
-*/
-
-class Drop_instance: public Instance_cmd
-{
-public:
- Drop_instance(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute(st_net *net, ulong connection_id);
-};
-
-
-/**
- Print requested part of the log.
- Grammar:
- SHOW <instance_name> LOG {ERROR | SLOW | GENERAL} size[, offset_from_end]
-*/
-
-class Show_instance_log: public Abstract_instance_cmd
-{
-public:
- Show_instance_log(const LEX_STRING *instance_name_arg,
- Log_type log_type_arg, uint size_arg, uint offset_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-
-private:
- int check_params(Instance *instance);
- int write_header(st_net *net);
- int write_data(st_net *net, Instance *instance);
-
-private:
- Log_type log_type;
- uint size;
- uint offset;
-};
-
-
-/**
- Shows the list of the log files, used by an instance.
- Grammar: SHOW <instance_name> LOG FILES
-*/
-
-class Show_instance_log_files: public Abstract_instance_cmd
-{
-public:
- Show_instance_log_files(const LEX_STRING *instance_name_arg);
-
-protected:
- virtual int execute_impl(st_net *net, Instance *instance);
- virtual int send_ok_response(st_net *net, ulong connection_id);
-
-private:
- int write_header(st_net *net);
- int write_data(st_net *net, Instance *instance);
-};
-
-
-/**
- Abstract class for option-management commands.
-*/
-
-class Instance_options_list;
-
-class Abstract_option_cmd: public Command
-{
-public:
- ~Abstract_option_cmd();
-
-public:
- bool add_option(const LEX_STRING *instance_name, Named_value *option);
-
-public:
- bool init(const char **text);
-
- virtual int execute(st_net *net, ulong connection_id);
-
-protected:
- Abstract_option_cmd();
-
- int correct_file(Instance *instance, Named_value *option, bool skip);
-
-protected:
- virtual bool parse_args(const char **text) = 0;
- virtual int process_option(Instance *instance, Named_value *option) = 0;
-
-private:
- Instance_options_list *
- get_instance_options_list(const LEX_STRING *instance_name);
-
- int execute_impl(st_net *net, ulong connection_id);
-
-private:
- HASH instance_options_map;
- bool initialized;
-};
-
-
-/**
- Set an option for the instance.
- Grammar: SET instance_name.option[=option_value][, ...]
-*/
-
-class Set_option: public Abstract_option_cmd
-{
-public:
- Set_option()
- { }
-
-protected:
- virtual bool parse_args(const char **text);
- virtual int process_option(Instance *instance, Named_value *option);
-};
-
-
-/**
- Remove option of the instance.
- Grammar: UNSET instance_name.option[, ...]
-*/
-
-class Unset_option: public Abstract_option_cmd
-{
-public:
- Unset_option()
- { }
-
-protected:
- virtual bool parse_args(const char **text);
- virtual int process_option(Instance *instance, Named_value *option);
-};
-
-
-/**
- Syntax error command.
-
- This command is issued if parser reported a syntax error. We need it to
- distinguish between syntax error and internal parser error. E.g. parsing
- failed because we hadn't had enought memory. In the latter case the parser
- just returns NULL.
-*/
-
-class Syntax_error: public Command
-{
-public:
- Syntax_error()
- { }
-
-public:
- int execute(st_net *net, ulong connection_id);
-};
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_COMMANDS_H */
diff --git a/server-tools/instance-manager/exit_codes.h b/server-tools/instance-manager/exit_codes.h
deleted file mode 100644
index 1609debd8f9..00000000000
--- a/server-tools/instance-manager/exit_codes.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_EXIT_CODES_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_EXIT_CODES_H
-
-/*
- Copyright (C) 2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- This file contains a list of exit codes, which are used when Instance
- Manager is working in user-management mode.
-*/
-
-const int ERR_OK = 0;
-
-const int ERR_OUT_OF_MEMORY = 1;
-const int ERR_INVALID_USAGE = 2;
-const int ERR_INTERNAL_ERROR = 3;
-const int ERR_IO_ERROR = 4;
-const int ERR_PASSWORD_FILE_CORRUPTED = 5;
-const int ERR_PASSWORD_FILE_DOES_NOT_EXIST = 6;
-
-const int ERR_CAN_NOT_READ_USER_NAME = 10;
-const int ERR_CAN_NOT_READ_PASSWORD = 11;
-const int ERR_USER_ALREADY_EXISTS = 12;
-const int ERR_USER_NOT_FOUND = 13;
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_EXIT_CODES_H
diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc
deleted file mode 100644
index b49b0ec0a00..00000000000
--- a/server-tools/instance-manager/guardian.cc
+++ /dev/null
@@ -1,496 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "guardian.h"
-#include <string.h>
-#include <sys/types.h>
-#include <signal.h>
-
-#include "instance.h"
-#include "instance_map.h"
-#include "log.h"
-#include "mysql_manager_error.h"
-#include "options.h"
-
-
-/*************************************************************************
- {{{ Constructor & destructor.
-*************************************************************************/
-
-/**
- Guardian constructor.
-
- SYNOPSIS
- Guardian()
- thread_registry_arg
- instance_map_arg
-
- DESCRIPTION
- Nominal contructor intended for assigning references and initialize
- trivial objects. Real initialization is made by init() method.
-*/
-
-Guardian::Guardian(Thread_registry *thread_registry_arg,
- Instance_map *instance_map_arg)
- :shutdown_requested(FALSE),
- stopped(FALSE),
- thread_registry(thread_registry_arg),
- instance_map(instance_map_arg)
-{
- pthread_mutex_init(&LOCK_guardian, 0);
- pthread_cond_init(&COND_guardian, 0);
-}
-
-
-Guardian::~Guardian()
-{
- /*
- NOTE: it's necessary to synchronize here, because Guiardian thread can be
- still alive an hold the mutex (because it is detached and we have no
- control over it).
- */
-
- lock();
- unlock();
-
- pthread_mutex_destroy(&LOCK_guardian);
- pthread_cond_destroy(&COND_guardian);
-}
-
-/*************************************************************************
- }}}
-*************************************************************************/
-
-
-/**
- Send request to stop Guardian.
-
- SYNOPSIS
- request_shutdown()
-*/
-
-void Guardian::request_shutdown()
-{
- stop_instances();
-
- lock();
- shutdown_requested= TRUE;
- unlock();
-
- ping();
-}
-
-
-/**
- Process an instance.
-
- SYNOPSIS
- process_instance()
- instance a pointer to the instance for processing
-
- MT-NOTE:
- - the given instance must be locked before calling this operation;
- - Guardian must be locked before calling this operation.
-*/
-
-void Guardian::process_instance(Instance *instance)
-{
- int restart_retry= 100;
- time_t current_time= time(NULL);
-
- if (instance->get_state() == Instance::STOPPING)
- {
- /* This brach is executed during shutdown. */
-
- /* This returns TRUE if and only if an instance was stopped for sure. */
- if (instance->is_crashed())
- {
- log_info("Guardian: '%s' stopped.",
- (const char *) instance->get_name()->str);
-
- instance->set_state(Instance::STOPPED);
- }
- else if ((uint) (current_time - instance->last_checked) >=
- instance->options.get_shutdown_delay())
- {
- log_info("Guardian: '%s' hasn't stopped within %d secs.",
- (const char *) instance->get_name()->str,
- (int) instance->options.get_shutdown_delay());
-
- instance->kill_mysqld(SIGKILL);
-
- log_info("Guardian: pretend that '%s' is killed.",
- (const char *) instance->get_name()->str);
-
- instance->set_state(Instance::STOPPED);
- }
- else
- {
- log_info("Guardian: waiting for '%s' to stop (%d secs left).",
- (const char *) instance->get_name()->str,
- (int) (instance->options.get_shutdown_delay() -
- current_time + instance->last_checked));
- }
-
- return;
- }
-
- if (instance->is_mysqld_running())
- {
- /* The instance can be contacted on it's port */
-
- /* If STARTING also check that pidfile has been created */
- if (instance->get_state() == Instance::STARTING &&
- instance->options.load_pid() == 0)
- {
- /* Pid file not created yet, don't go to STARTED state yet */
- }
- else if (instance->get_state() != Instance::STARTED)
- {
- /* clear status fields */
- log_info("Guardian: '%s' is running, set state to STARTED.",
- (const char *) instance->options.instance_name.str);
- instance->reset_stat();
- instance->set_state(Instance::STARTED);
- }
- }
- else
- {
- switch (instance->get_state()) {
- case Instance::NOT_STARTED:
- log_info("Guardian: starting '%s'...",
- (const char *) instance->options.instance_name.str);
-
- /* NOTE: set state to STARTING _before_ start() is called. */
- instance->set_state(Instance::STARTING);
- instance->last_checked= current_time;
-
- instance->start_mysqld();
-
- return;
-
- case Instance::STARTED: /* fallthrough */
- case Instance::STARTING: /* let the instance start or crash */
- if (!instance->is_crashed())
- return;
-
- instance->crash_moment= current_time;
- instance->last_checked= current_time;
- instance->set_state(Instance::JUST_CRASHED);
- /* fallthrough -- restart an instance immediately */
-
- case Instance::JUST_CRASHED:
- if (current_time - instance->crash_moment <= 2)
- {
- if (instance->is_crashed())
- {
- instance->start_mysqld();
- log_info("Guardian: starting '%s'...",
- (const char *) instance->options.instance_name.str);
- }
- }
- else
- instance->set_state(Instance::CRASHED);
-
- return;
-
- case Instance::CRASHED: /* just regular restarts */
- if ((ulong) (current_time - instance->last_checked) <=
- (ulong) Options::Main::monitoring_interval)
- return;
-
- if (instance->restart_counter < restart_retry)
- {
- if (instance->is_crashed())
- {
- instance->start_mysqld();
- instance->last_checked= current_time;
-
- log_info("Guardian: restarting '%s'...",
- (const char *) instance->options.instance_name.str);
- }
- }
- else
- {
- log_info("Guardian: can not start '%s'. "
- "Abandoning attempts to (re)start it",
- (const char *) instance->options.instance_name.str);
-
- instance->set_state(Instance::CRASHED_AND_ABANDONED);
- }
-
- return;
-
- case Instance::CRASHED_AND_ABANDONED:
- return; /* do nothing */
-
- default:
- DBUG_ASSERT(0);
- }
- }
-}
-
-
-/**
- Main function of Guardian thread.
-
- SYNOPSIS
- run()
-
- DESCRIPTION
- Check for all guarded instances and restart them if needed.
-*/
-
-void Guardian::run()
-{
- struct timespec timeout;
-
- log_info("Guardian: started.");
-
- thread_registry->register_thread(&thread_info);
-
- /* Loop, until all instances were shut down at the end. */
-
- while (true)
- {
- Instance_map::Iterator instances_it(instance_map);
- Instance *instance;
- bool all_instances_stopped= TRUE;
-
- instance_map->lock();
-
- while ((instance= instances_it.next()))
- {
- instance->lock();
-
- if (!instance->is_guarded() ||
- instance->get_state() == Instance::STOPPED)
- {
- instance->unlock();
- continue;
- }
-
- process_instance(instance);
-
- if (instance->get_state() != Instance::STOPPED)
- all_instances_stopped= FALSE;
-
- instance->unlock();
- }
-
- instance_map->unlock();
-
- lock();
-
- if (shutdown_requested && all_instances_stopped)
- {
- log_info("Guardian: all guarded mysqlds stopped.");
-
- stopped= TRUE;
- unlock();
- break;
- }
-
- set_timespec(timeout, Options::Main::monitoring_interval);
-
- thread_registry->cond_timedwait(&thread_info, &COND_guardian,
- &LOCK_guardian, &timeout);
- unlock();
- }
-
- log_info("Guardian: stopped.");
-
- /* Now, when the Guardian is stopped we can stop the IM. */
-
- thread_registry->unregister_thread(&thread_info);
- thread_registry->request_shutdown();
-
- log_info("Guardian: finished.");
-}
-
-
-/**
- Return the value of stopped flag.
-*/
-
-bool Guardian::is_stopped()
-{
- int var;
-
- lock();
- var= stopped;
- unlock();
-
- return var;
-}
-
-
-/**
- Wake up Guardian thread.
-
- MT-NOTE: though usually the mutex associated with condition variable should
- be acquired before signalling the variable, here this is not needed.
- Signalling under locked mutex is used to avoid lost signals. In the current
- logic however locking mutex does not guarantee that the signal will not be
- lost.
-*/
-
-void Guardian::ping()
-{
- pthread_cond_signal(&COND_guardian);
-}
-
-
-/**
- Prepare list of instances.
-
- SYNOPSIS
- init()
-
- MT-NOTE: Instance Map must be locked before calling the operation.
-*/
-
-void Guardian::init()
-{
- Instance *instance;
- Instance_map::Iterator iterator(instance_map);
-
- while ((instance= iterator.next()))
- {
- instance->lock();
-
- instance->reset_stat();
- instance->set_state(Instance::NOT_STARTED);
-
- instance->unlock();
- }
-}
-
-
-/**
- An internal method which is called at shutdown to unregister instances and
- attempt to stop them if requested.
-
- SYNOPSIS
- stop_instances()
-
- DESCRIPTION
- Loops through the guarded_instances list and prepares them for shutdown.
- For each instance we issue a stop command and change the state
- accordingly.
-
- NOTE
- Guardian object should be locked by the caller.
-
-*/
-
-void Guardian::stop_instances()
-{
- static const int NUM_STOP_ATTEMPTS = 100;
-
- Instance_map::Iterator instances_it(instance_map);
- Instance *instance;
-
- instance_map->lock();
-
- while ((instance= instances_it.next()))
- {
- instance->lock();
-
- if (!instance->is_guarded() ||
- instance->get_state() == Instance::STOPPED)
- {
- instance->unlock();
- continue;
- }
-
- /*
- If instance is running or was running (and now probably hanging),
- request stop.
- */
-
- if (instance->is_mysqld_running() ||
- instance->get_state() == Instance::STARTED)
- {
- instance->set_state(Instance::STOPPING);
- instance->last_checked= time(NULL);
- }
- else
- {
- /* Otherwise mark it as STOPPED. */
- instance->set_state(Instance::STOPPED);
- }
-
- /* Request mysqld to stop. */
-
- bool instance_stopped= FALSE;
-
- for (int cur_attempt= 0; cur_attempt < NUM_STOP_ATTEMPTS; ++cur_attempt)
- {
- if (!instance->kill_mysqld(SIGTERM))
- {
- instance_stopped= TRUE;
- break;
- }
-
- if (!instance->is_active())
- {
- instance_stopped= TRUE;
- break;
- }
-
- /* Sleep for 0.3 sec and check again. */
-
- my_sleep(300000);
- }
-
- /*
- Abort if we failed to stop mysqld instance. That should not happen,
- but if it happened, we don't know what to do and prefer to have clear
- failure with coredump.
- */
-
- DBUG_ASSERT(instance_stopped);
-
- instance->unlock();
- }
-
- instance_map->unlock();
-}
-
-
-/**
- Lock Guardian.
-*/
-
-void Guardian::lock()
-{
- pthread_mutex_lock(&LOCK_guardian);
-}
-
-
-/**
- Unlock Guardian.
-*/
-
-void Guardian::unlock()
-{
- pthread_mutex_unlock(&LOCK_guardian);
-}
diff --git a/server-tools/instance-manager/guardian.h b/server-tools/instance-manager/guardian.h
deleted file mode 100644
index d78058a6fc5..00000000000
--- a/server-tools/instance-manager/guardian.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_GUARDIAN_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_GUARDIAN_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <my_list.h>
-
-#include "thread_registry.h"
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-class Instance;
-class Instance_map;
-class Thread_registry;
-
-/**
- The guardian thread is responsible for monitoring and restarting of guarded
- instances.
-*/
-
-class Guardian: public Thread
-{
-public:
- Guardian(Thread_registry *thread_registry_arg,
- Instance_map *instance_map_arg);
- ~Guardian();
-
- void init();
-
-public:
- void request_shutdown();
-
- bool is_stopped();
-
- void lock();
- void unlock();
-
- void ping();
-
-protected:
- virtual void run();
-
-private:
- void stop_instances();
-
- void process_instance(Instance *instance);
-
-private:
- /*
- LOCK_guardian protectes the members in this section:
- - shutdown_requested;
- - stopped;
-
- Also, it is used for COND_guardian.
- */
- pthread_mutex_t LOCK_guardian;
-
- /*
- Guardian's main loop waits on this condition. So, it should be signalled
- each time, when instance state has been changed and we want Guardian to
- wake up.
-
- TODO: Change this to having data-scoped conditions, i.e. conditions,
- which indicate that some data has been changed.
- */
- pthread_cond_t COND_guardian;
-
- /*
- This variable is set to TRUE, when Manager thread is shutting down.
- The flag is used by Guardian thread to understand that it's time to
- finish.
- */
- bool shutdown_requested;
-
- /*
- This flag is set to TRUE on shutdown by Guardian thread, when all guarded
- mysqlds are stopped.
-
- The flag is used in the Manager thread to wait for Guardian to stop all
- mysqlds.
- */
- bool stopped;
-
- Thread_info thread_info;
- Thread_registry *thread_registry;
- Instance_map *instance_map;
-
-private:
- Guardian(const Guardian &);
- Guardian&operator =(const Guardian &);
-};
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_GUARDIAN_H */
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
deleted file mode 100644
index 1ad728d40eb..00000000000
--- a/server-tools/instance-manager/instance.cc
+++ /dev/null
@@ -1,944 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include <my_global.h>
-#include <mysql.h>
-
-#include <signal.h>
-#ifndef __WIN__
-#include <sys/wait.h>
-#endif
-
-#include "manager.h"
-#include "guardian.h"
-#include "instance.h"
-#include "log.h"
-#include "mysql_manager_error.h"
-#include "portability.h"
-#include "priv.h"
-#include "thread_registry.h"
-#include "instance_map.h"
-
-
-/*************************************************************************
- {{{ Platform-specific functions.
-*************************************************************************/
-
-#ifndef __WIN__
-typedef pid_t My_process_info;
-#else
-typedef PROCESS_INFORMATION My_process_info;
-#endif
-
-/*
- Wait for an instance
-
- SYNOPSIS
- wait_process()
- pi Pointer to the process information structure
- (platform-dependent).
-
- RETURN
- 0 - Success
- 1 - Error
-*/
-
-#ifndef __WIN__
-static int wait_process(My_process_info *pi)
-{
- /*
- Here we wait for the child created. This process differs for systems
- running LinuxThreads and POSIX Threads compliant systems. This is because
- according to POSIX we could wait() for a child in any thread of the
- process. While LinuxThreads require that wait() is called by the thread,
- which created the child.
- On the other hand we could not expect mysqld to return the pid, we
- got in from fork(), to wait4() fucntion when running on LinuxThreads.
- This is because MySQL shutdown thread is not the one, which was created
- by our fork() call.
- So basically we have two options: whether the wait() call returns only in
- the creator thread, but we cannot use waitpid() since we have no idea
- which pid we should wait for (in fact it should be the pid of shutdown
- thread, but we don't know this one). Or we could use waitpid(), but
- couldn't use wait(), because it could return in any wait() in the program.
- */
-
- if (Manager::is_linux_threads())
- wait(NULL); /* LinuxThreads were detected */
- else
- waitpid(*pi, NULL, 0);
-
- return 0;
-}
-#else
-static int wait_process(My_process_info *pi)
-{
- /* Wait until child process exits. */
- WaitForSingleObject(pi->hProcess, INFINITE);
-
- DWORD exitcode;
- ::GetExitCodeProcess(pi->hProcess, &exitcode);
-
- /* Close process and thread handles. */
- CloseHandle(pi->hProcess);
- CloseHandle(pi->hThread);
-
- /*
- GetExitCodeProces returns zero on failure. We should revert this value
- to report an error.
- */
- return (!exitcode);
-}
-#endif
-
-/*
- Launch an instance
-
- SYNOPSIS
- start_process()
- instance_options Pointer to the options of the instance to be
- launched.
- pi Pointer to the process information structure
- (platform-dependent).
-
- RETURN
- FALSE - Success
- TRUE - Cannot create an instance
-*/
-
-#ifndef __WIN__
-static bool start_process(Instance_options *instance_options,
- My_process_info *pi)
-{
-#ifndef __QNX__
- *pi= fork();
-#else
- /*
- On QNX one cannot use fork() in multithreaded environment and we
- should use spawn() or one of it's siblings instead.
- Here we use spawnv(), which is a combination of fork() and execv()
- in one call. It returns the pid of newly created process (>0) or -1
- */
- *pi= spawnv(P_NOWAIT, instance_options->mysqld_path, instance_options->argv);
-#endif
-
- switch (*pi) {
- case 0: /* never happens on QNX */
- execv(instance_options->mysqld_path.str, instance_options->argv);
- /* exec never returns */
- exit(1);
- case -1:
- log_error("Instance '%s': can not start mysqld: fork() failed.",
- (const char *) instance_options->instance_name.str);
- return TRUE;
- }
-
- return FALSE;
-}
-#else
-static bool start_process(Instance_options *instance_options,
- My_process_info *pi)
-{
- STARTUPINFO si;
-
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb= sizeof(STARTUPINFO);
- ZeroMemory(pi, sizeof(PROCESS_INFORMATION));
-
- int cmdlen= 0;
- for (int i= 0; instance_options->argv[i] != 0; i++)
- cmdlen+= (uint) strlen(instance_options->argv[i]) + 3;
- cmdlen++; /* make room for the null */
-
- char *cmdline= new char[cmdlen];
- if (cmdline == NULL)
- return TRUE;
-
- cmdline[0]= 0;
- for (int i= 0; instance_options->argv[i] != 0; i++)
- {
- strcat(cmdline, "\"");
- strcat(cmdline, instance_options->argv[i]);
- strcat(cmdline, "\" ");
- }
-
- /* Start the child process */
- BOOL result=
- CreateProcess(NULL, /* Put it all in cmdline */
- cmdline, /* Command line */
- NULL, /* Process handle not inheritable */
- NULL, /* Thread handle not inheritable */
- FALSE, /* Set handle inheritance to FALSE */
- 0, /* No creation flags */
- NULL, /* Use parent's environment block */
- NULL, /* Use parent's starting directory */
- &si, /* Pointer to STARTUPINFO structure */
- pi); /* Pointer to PROCESS_INFORMATION structure */
- delete cmdline;
-
- return !result;
-}
-#endif
-
-#ifdef __WIN__
-
-BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode)
-{
- DWORD dwTID, dwCode, dwErr= 0;
- HANDLE hProcessDup= INVALID_HANDLE_VALUE;
- HANDLE hRT= NULL;
- HINSTANCE hKernel= GetModuleHandle("Kernel32");
- BOOL bSuccess= FALSE;
-
- BOOL bDup= DuplicateHandle(GetCurrentProcess(),
- hProcess, GetCurrentProcess(), &hProcessDup,
- PROCESS_ALL_ACCESS, FALSE, 0);
-
- // Detect the special case where the process is
- // already dead...
- if (GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) &&
- (dwCode == STILL_ACTIVE))
- {
- FARPROC pfnExitProc;
-
- pfnExitProc= GetProcAddress(hKernel, "ExitProcess");
-
- hRT= CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0,
- (LPTHREAD_START_ROUTINE)pfnExitProc,
- (PVOID)uExitCode, 0, &dwTID);
-
- if (hRT == NULL)
- dwErr= GetLastError();
- }
- else
- dwErr= ERROR_PROCESS_ABORTED;
-
- if (hRT)
- {
- // Must wait process to terminate to
- // guarantee that it has exited...
- WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE);
-
- CloseHandle(hRT);
- bSuccess= TRUE;
- }
-
- if (bDup)
- CloseHandle(hProcessDup);
-
- if (!bSuccess)
- SetLastError(dwErr);
-
- return bSuccess;
-}
-
-int kill(pid_t pid, int signum)
-{
- HANDLE processhandle= ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
- if (signum == SIGTERM)
- ::SafeTerminateProcess(processhandle, 0);
- else
- ::TerminateProcess(processhandle, -1);
- return 0;
-}
-#endif
-
-/*************************************************************************
- }}}
-*************************************************************************/
-
-
-/*************************************************************************
- {{{ Static constants.
-*************************************************************************/
-
-const LEX_STRING
-Instance::DFLT_INSTANCE_NAME= { C_STRING_WITH_LEN("mysqld") };
-
-/*************************************************************************
- }}}
-*************************************************************************/
-
-
-/*************************************************************************
- {{{ Instance Monitor thread.
-*************************************************************************/
-
-/**
- Proxy thread is a simple way to avoid all pitfalls of the threads
- implementation in the OS (e.g. LinuxThreads). With such a thread we
- don't have to process SIGCHLD, which is a tricky business if we want
- to do it in a portable way.
-
- Instance Monitor Thread forks a child process, execs mysqld and waits for
- the child to die.
-
- Instance Monitor assumes that the monitoring instance will not be dropped.
- This is guaranteed by having flag monitoring_thread_active and
- Instance::is_active() operation.
-*/
-
-class Instance_monitor: public Thread
-{
-public:
- Instance_monitor(Instance *instance_arg) :instance(instance_arg) {}
-protected:
- virtual void run();
- void start_and_monitor_instance();
-private:
- Instance *instance;
-};
-
-
-void Instance_monitor::run()
-{
- start_and_monitor_instance();
- delete this;
-}
-
-
-void Instance_monitor::start_and_monitor_instance()
-{
- Thread_registry *thread_registry= Manager::get_thread_registry();
- Guardian *guardian= Manager::get_guardian();
-
- My_process_info mysqld_process_info;
- Thread_info monitor_thread_info;
-
- log_info("Instance '%s': Monitor: started.",
- (const char *) instance->get_name()->str);
-
- /*
- For guarded instance register the thread in Thread_registry to wait for
- the thread to stop on shutdown (nonguarded instances are not stopped on
- shutdown, so the thread will no finish).
- */
-
- if (instance->is_guarded())
- {
- thread_registry->register_thread(&monitor_thread_info, FALSE);
- }
-
- /* Starting mysqld. */
-
- log_info("Instance '%s': Monitor: starting mysqld...",
- (const char *) instance->get_name()->str);
-
- if (start_process(&instance->options, &mysqld_process_info))
- {
- instance->lock();
- instance->monitoring_thread_active= FALSE;
- instance->unlock();
-
- return;
- }
-
- /* Waiting for mysqld to die. */
-
- log_info("Instance '%s': Monitor: waiting for mysqld to stop...",
- (const char *) instance->get_name()->str);
-
- wait_process(&mysqld_process_info); /* Don't check for return value. */
-
- log_info("Instance '%s': Monitor: mysqld stopped.",
- (const char *) instance->get_name()->str);
-
- /* Update instance status. */
-
- instance->lock();
-
- if (instance->is_guarded())
- thread_registry->unregister_thread(&monitor_thread_info);
-
- instance->crashed= TRUE;
- instance->monitoring_thread_active= FALSE;
-
- log_info("Instance '%s': Monitor: finished.",
- (const char *) instance->get_name()->str);
-
- instance->unlock();
-
- /* Wake up guardian. */
-
- guardian->ping();
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
-
-
-/**************************************************************************
- {{{ Static operations.
-**************************************************************************/
-
-/**
- The operation is intended to check whether string is a well-formed
- instance name or not.
-
- SYNOPSIS
- is_name_valid()
- name string to check
-
- RETURN
- TRUE string is a valid instance name
- FALSE string is not a valid instance name
-
- TODO: Move to Instance_name class: Instance_name::is_valid().
-*/
-
-bool Instance::is_name_valid(const LEX_STRING *name)
-{
- const char *name_suffix= name->str + DFLT_INSTANCE_NAME.length;
-
- if (strncmp(name->str, Instance::DFLT_INSTANCE_NAME.str,
- Instance::DFLT_INSTANCE_NAME.length) != 0)
- return FALSE;
-
- return *name_suffix == 0 || my_isdigit(default_charset_info, *name_suffix);
-}
-
-
-/**
- The operation is intended to check if the given instance name is
- mysqld-compatible or not.
-
- SYNOPSIS
- is_mysqld_compatible_name()
- name name to check
-
- RETURN
- TRUE name is mysqld-compatible
- FALSE otherwise
-
- TODO: Move to Instance_name class: Instance_name::is_mysqld_compatible().
-*/
-
-bool Instance::is_mysqld_compatible_name(const LEX_STRING *name)
-{
- return strcmp(name->str, DFLT_INSTANCE_NAME.str) == 0;
-}
-
-
-/**
- Return client state name. Must not be used outside the class.
- Use Instance::get_state_name() instead.
-*/
-
-const char * Instance::get_instance_state_name(enum_instance_state state)
-{
- switch (state) {
- case STOPPED:
- return "offline";
-
- case NOT_STARTED:
- return "not started";
-
- case STARTING:
- return "starting";
-
- case STARTED:
- return "online";
-
- case JUST_CRASHED:
- return "failed";
-
- case CRASHED:
- return "crashed";
-
- case CRASHED_AND_ABANDONED:
- return "abandoned";
-
- case STOPPING:
- return "stopping";
- }
-
- return NULL; /* just to ignore compiler warning. */
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
-
-
-/**************************************************************************
- {{{ Initialization & deinitialization.
-**************************************************************************/
-
-Instance::Instance()
- :monitoring_thread_active(FALSE),
- crashed(FALSE),
- configured(FALSE),
- /* mysqld_compatible is initialized in init() */
- state(NOT_STARTED),
- restart_counter(0),
- crash_moment(0),
- last_checked(0)
-{
- pthread_mutex_init(&LOCK_instance, 0);
-}
-
-
-Instance::~Instance()
-{
- log_info("Instance '%s': destroying...", (const char *) get_name()->str);
-
- pthread_mutex_destroy(&LOCK_instance);
-}
-
-
-/**
- Initialize instance options.
-
- SYNOPSIS
- init()
- name_arg name of the instance
-
- RETURN:
- FALSE - ok
- TRUE - error
-*/
-
-bool Instance::init(const LEX_STRING *name_arg)
-{
- mysqld_compatible= is_mysqld_compatible_name(name_arg);
-
- return options.init(name_arg);
-}
-
-
-/**
- @brief Complete instance options initialization.
-
- @return Error status.
- @retval FALSE ok
- @retval TRUE error
-*/
-
-bool Instance::complete_initialization()
-{
- configured= ! options.complete_initialization();
- return !configured;
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
-
-
-/**************************************************************************
- {{{ Instance: public interface implementation.
-**************************************************************************/
-
-/**
- Determine if there is some activity with the instance.
-
- SYNOPSIS
- is_active()
-
- DESCRIPTION
- An instance is active if one of the following conditions is true:
- - Instance-monitoring thread is running;
- - Instance is guarded and its state is other than STOPPED;
- - Corresponding mysqld-server accepts connections.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- RETURN
- TRUE - instance is active
- FALSE - otherwise.
-*/
-
-bool Instance::is_active()
-{
- if (monitoring_thread_active)
- return TRUE;
-
- if (is_guarded() && get_state() != STOPPED)
- return TRUE;
-
- return is_mysqld_running();
-}
-
-
-/**
- Determine if mysqld is accepting connections.
-
- SYNOPSIS
- is_mysqld_running()
-
- DESCRIPTION
- Try to connect to mysqld with fake login/password to check whether it is
- accepting connections or not.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- RETURN
- TRUE - mysqld is alive and accept connections
- FALSE - otherwise.
-*/
-
-bool Instance::is_mysqld_running()
-{
- MYSQL mysql;
- uint port= options.get_mysqld_port(); /* 0 if not specified. */
- const char *socket= NULL;
- static const char *password= "check_connection";
- static const char *username= "MySQL_Instance_Manager";
- static const char *access_denied_message= "Access denied for user";
- bool return_val;
-
- if (options.mysqld_socket)
- socket= options.mysqld_socket;
-
- /* no port was specified => instance falled back to default value */
- if (!port && !options.mysqld_socket)
- port= SERVER_DEFAULT_PORT;
-
- mysql_init(&mysql);
- /* try to connect to a server with a fake username/password pair */
- if (mysql_real_connect(&mysql, LOCAL_HOST, username,
- password,
- NullS, port,
- socket, 0))
- {
- /*
- We have successfully connected to the server using fake
- username/password. Write a warning to the logfile.
- */
- log_error("Instance '%s': was able to log into mysqld.",
- (const char *) get_name()->str);
- return_val= TRUE; /* server is alive */
- }
- else
- return_val= test(!strncmp(access_denied_message, mysql_error(&mysql),
- sizeof(access_denied_message) - 1));
-
- mysql_close(&mysql);
-
- return return_val;
-}
-
-
-/**
- @brief Start mysqld.
-
- Reset flags and start Instance Monitor thread, which will start mysqld.
-
- @note Instance must be locked before calling the operation.
-
- @return Error status code
- @retval FALSE Ok
- @retval TRUE Could not start instance
-*/
-
-bool Instance::start_mysqld()
-{
- Instance_monitor *instance_monitor;
-
- if (!configured)
- return TRUE;
-
- /*
- Prepare instance to start Instance Monitor thread.
-
- NOTE: It's important to set these actions here in order to avoid
- race conditions -- these actions must be done under acquired lock on
- Instance.
- */
-
- crashed= FALSE;
- monitoring_thread_active= TRUE;
-
- remove_pid();
-
- /* Create and start the Instance Monitor thread. */
-
- instance_monitor= new Instance_monitor(this);
-
- if (instance_monitor == NULL || instance_monitor->start(Thread::DETACHED))
- {
- delete instance_monitor;
- monitoring_thread_active= FALSE;
-
- log_error("Instance '%s': can not create instance monitor thread.",
- (const char *) get_name()->str);
-
- return TRUE;
- }
-
- ++restart_counter;
-
- /* The Instance Monitor thread will delete itself when it's finished. */
-
- return FALSE;
-}
-
-
-/**
- Stop mysqld.
-
- SYNOPSIS
- stop_mysqld()
-
- DESCRIPTION
- Try to stop mysqld gracefully. Otherwise kill it with SIGKILL.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- RETURN
- FALSE - ok
- TRUE - could not stop the instance
-*/
-
-bool Instance::stop_mysqld()
-{
- log_info("Instance '%s': stopping mysqld...",
- (const char *) get_name()->str);
-
- kill_mysqld(SIGTERM);
-
- if (!wait_for_stop())
- {
- log_info("Instance '%s': mysqld stopped gracefully.",
- (const char *) get_name()->str);
- return FALSE;
- }
-
- log_info("Instance '%s': mysqld failed to stop gracefully within %d seconds.",
- (const char *) get_name()->str,
- (int) options.get_shutdown_delay());
-
- log_info("Instance'%s': killing mysqld...",
- (const char *) get_name()->str);
-
- kill_mysqld(SIGKILL);
-
- if (!wait_for_stop())
- {
- log_info("Instance '%s': mysqld has been killed.",
- (const char *) get_name()->str);
- return FALSE;
- }
-
- log_info("Instance '%s': can not kill mysqld within %d seconds.",
- (const char *) get_name()->str,
- (int) options.get_shutdown_delay());
-
- return TRUE;
-}
-
-
-/**
- Send signal to mysqld.
-
- SYNOPSIS
- kill_mysqld()
-
- DESCRIPTION
- Load pid from the pid file and send the given signal to that process.
- If the signal is SIGKILL, remove the pid file after sending the signal.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- TODO
- This too low-level and OS-specific operation for public interface.
- Also, it has some implicit behaviour for SIGKILL signal. Probably, we
- should have the following public operations instead:
- - start_mysqld() -- as is;
- - stop_mysqld -- request mysqld to shutdown gracefully (send SIGTERM);
- don't wait for complete shutdown;
- - wait_for_stop() (or join_mysqld()) -- wait for mysqld to stop within
- time interval;
- - kill_mysqld() -- request to terminate mysqld; don't wait for
- completion.
- These operations should also be used in Guardian to manage instances.
-*/
-
-bool Instance::kill_mysqld(int signum)
-{
- pid_t mysqld_pid= options.load_pid();
-
- if (mysqld_pid == 0)
- {
- log_info("Instance '%s': no pid file to send a signal (%d).",
- (const char *) get_name()->str,
- (int) signum);
- return TRUE;
- }
-
- log_info("Instance '%s': sending %d to %d...",
- (const char *) get_name()->str,
- (int) signum,
- (int) mysqld_pid);
-
- if (kill(mysqld_pid, signum))
- {
- log_info("Instance '%s': kill() failed.",
- (const char *) get_name()->str);
- return TRUE;
- }
-
- /* Kill suceeded */
- if (signum == SIGKILL) /* really killed instance with SIGKILL */
- {
- log_error("Instance '%s': killed.",
- (const char *) options.instance_name.str);
-
- /* After sucessful hard kill the pidfile need to be removed */
- options.unlink_pidfile();
- }
-
- return FALSE;
-}
-
-
-/**
- Lock instance.
-*/
-
-void Instance::lock()
-{
- pthread_mutex_lock(&LOCK_instance);
-}
-
-
-/**
- Unlock instance.
-*/
-
-void Instance::unlock()
-{
- pthread_mutex_unlock(&LOCK_instance);
-}
-
-
-/**
- Return instance state name.
-
- SYNOPSIS
- get_state_name()
-
- DESCRIPTION
- The operation returns user-friendly state name. The operation can be
- used both for guarded and non-guarded instances.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- TODO: Replace with the static get_state_name(state_code) function.
-*/
-
-const char *Instance::get_state_name()
-{
- if (!is_configured())
- return "misconfigured";
-
- if (is_guarded())
- {
- /* The instance is managed by Guardian: we can report precise state. */
-
- return get_instance_state_name(get_state());
- }
-
- /* The instance is not managed by Guardian: we can report status only. */
-
- return is_active() ? "online" : "offline";
-}
-
-
-/**
- Reset statistics.
-
- SYNOPSIS
- reset_stat()
-
- DESCRIPTION
- The operation resets statistics used for guarding the instance.
-
- MT-NOTE: instance must be locked before calling the operation.
-
- TODO: Make private.
-*/
-
-void Instance::reset_stat()
-{
- restart_counter= 0;
- crash_moment= 0;
- last_checked= 0;
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
-
-
-/**************************************************************************
- {{{ Instance: implementation of private operations.
-**************************************************************************/
-
-/**
- Remove pid file.
-*/
-
-void Instance::remove_pid()
-{
- int mysqld_pid= options.load_pid();
-
- if (mysqld_pid == 0)
- return;
-
- if (options.unlink_pidfile())
- {
- log_error("Instance '%s': can not unlink pid file.",
- (const char *) options.instance_name.str);
- }
-}
-
-
-/**
- Wait for mysqld to stop within shutdown interval.
-*/
-
-bool Instance::wait_for_stop()
-{
- int start_time= (int) time(NULL);
- int finish_time= start_time + options.get_shutdown_delay();
-
- log_info("Instance '%s': waiting for mysqld to stop "
- "(timeout: %d seconds)...",
- (const char *) get_name()->str,
- (int) options.get_shutdown_delay());
-
- while (true)
- {
- if (options.load_pid() == 0 && !is_mysqld_running())
- return FALSE;
-
- if (time(NULL) >= finish_time)
- return TRUE;
-
- /* Sleep for 0.3 sec and check again. */
-
- my_sleep(300000);
- }
-}
-
-/**************************************************************************
- }}}
-**************************************************************************/
diff --git a/server-tools/instance-manager/instance.h b/server-tools/instance-manager/instance.h
deleted file mode 100644
index aa9c923cba1..00000000000
--- a/server-tools/instance-manager/instance.h
+++ /dev/null
@@ -1,273 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <m_string.h>
-
-#include "instance_options.h"
-#include "priv.h"
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-class Instance_map;
-class Thread_registry;
-
-
-/**
- Instance_name -- the class represents instance name -- a string of length
- less than MAX_INSTANCE_NAME_SIZE.
-
- Generally, this is just a string with self-memory-management and should be
- eliminated in the future.
-*/
-
-class Instance_name
-{
-public:
- Instance_name(const LEX_STRING *name);
-
-public:
- inline const LEX_STRING *get_str() const
- {
- return &str;
- }
-
- inline const char *get_c_str() const
- {
- return str.str;
- }
-
- inline uint get_length() const
- {
- return str.length;
- }
-
-private:
- LEX_STRING str;
- char str_buffer[MAX_INSTANCE_NAME_SIZE];
-};
-
-
-class Instance
-{
-public:
- /* States of an instance. */
- enum enum_instance_state
- {
- STOPPED,
- NOT_STARTED,
- STARTING,
- STARTED,
- JUST_CRASHED,
- CRASHED,
- CRASHED_AND_ABANDONED,
- STOPPING
- };
-
-public:
- /**
- The constant defines name of the default mysqld-instance ("mysqld").
- */
- static const LEX_STRING DFLT_INSTANCE_NAME;
-
-public:
- static bool is_name_valid(const LEX_STRING *name);
- static bool is_mysqld_compatible_name(const LEX_STRING *name);
-
-public:
- Instance();
- ~Instance();
-
- bool init(const LEX_STRING *name_arg);
- bool complete_initialization();
-
-public:
- bool is_active();
-
- bool is_mysqld_running();
-
- bool start_mysqld();
- bool stop_mysqld();
- bool kill_mysqld(int signo);
-
- void lock();
- void unlock();
-
- const char *get_state_name();
-
- void reset_stat();
-
-public:
- /**
- The operation is intended to check if the instance is mysqld-compatible
- or not.
- */
- inline bool is_mysqld_compatible() const;
-
- /**
- The operation is intended to check if the instance is configured properly
- or not. Misconfigured instances are not managed.
- */
- inline bool is_configured() const;
-
- /**
- The operation returns TRUE if the instance is guarded and FALSE otherwise.
- */
- inline bool is_guarded() const;
-
- /**
- The operation returns name of the instance.
- */
- inline const LEX_STRING *get_name() const;
-
- /**
- The operation returns the current state of the instance.
-
- NOTE: At the moment should be used only for guarded instances.
- */
- inline enum_instance_state get_state() const;
-
- /**
- The operation changes the state of the instance.
-
- NOTE: At the moment should be used only for guarded instances.
- TODO: Make private.
- */
- inline void set_state(enum_instance_state new_state);
-
- /**
- The operation returns crashed flag.
- */
- inline bool is_crashed();
-
-public:
- /**
- This attributes contains instance options.
-
- TODO: Make private.
- */
- Instance_options options;
-
-private:
- /**
- monitoring_thread_active is TRUE if there is a thread that monitors the
- corresponding mysqld-process.
- */
- bool monitoring_thread_active;
-
- /**
- crashed is TRUE when corresponding mysqld-process has been died after
- start.
- */
- bool crashed;
-
- /**
- configured is TRUE when the instance is configured and FALSE otherwise.
- Misconfigured instances are not managed.
- */
- bool configured;
-
- /*
- mysqld_compatible specifies whether the instance is mysqld-compatible
- or not. Mysqld-compatible instances can contain only mysqld-specific
- options. At the moment an instance is mysqld-compatible if its name is
- "mysqld".
-
- The idea is that [mysqld] section should contain only mysqld-specific
- options (no Instance Manager-specific options) to be readable by mysqld
- program.
- */
- bool mysqld_compatible;
-
- /*
- Mutex protecting the instance.
- */
- pthread_mutex_t LOCK_instance;
-
-private:
- /* Guarded-instance attributes. */
-
- /* state of an instance (i.e. STARTED, CRASHED, etc.) */
- enum_instance_state state;
-
-public:
- /* the amount of attemts to restart instance (cleaned up at success) */
- int restart_counter;
-
- /* triggered at a crash */
- time_t crash_moment;
-
- /* General time field. Used to provide timeouts (at shutdown and restart) */
- time_t last_checked;
-
-private:
- static const char *get_instance_state_name(enum_instance_state state);
-
-private:
- void remove_pid();
-
- bool wait_for_stop();
-
-private:
- friend class Instance_monitor;
-};
-
-
-inline bool Instance::is_mysqld_compatible() const
-{
- return mysqld_compatible;
-}
-
-
-inline bool Instance::is_configured() const
-{
- return configured;
-}
-
-
-inline bool Instance::is_guarded() const
-{
- return !options.nonguarded;
-}
-
-
-inline const LEX_STRING *Instance::get_name() const
-{
- return &options.instance_name;
-}
-
-
-inline Instance::enum_instance_state Instance::get_state() const
-{
- return state;
-}
-
-
-inline void Instance::set_state(enum_instance_state new_state)
-{
- state= new_state;
-}
-
-
-inline bool Instance::is_crashed()
-{
- return crashed;
-}
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H */
diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc
deleted file mode 100644
index b137370b50a..00000000000
--- a/server-tools/instance-manager/instance_map.cc
+++ /dev/null
@@ -1,649 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "instance_map.h"
-
-#include <my_global.h>
-#include <m_ctype.h>
-#include <mysql_com.h>
-
-#include "buffer.h"
-#include "instance.h"
-#include "log.h"
-#include "mysqld_error.h"
-#include "mysql_manager_error.h"
-#include "options.h"
-#include "priv.h"
-
-C_MODE_START
-
-/**
- HASH-routines: get key of instance for storing in hash.
-*/
-
-static uchar* get_instance_key(const uchar* u, size_t* len,
- my_bool __attribute__((unused)) t)
-{
- const Instance *instance= (const Instance *) u;
- *len= instance->options.instance_name.length;
- return (uchar *) instance->options.instance_name.str;
-}
-
-/**
- HASH-routines: cleanup handler.
-*/
-
-static void delete_instance(void *u)
-{
- Instance *instance= (Instance *) u;
- delete instance;
-}
-
-/**
- The option handler to pass to the process_default_option_files function.
-
- SYNOPSIS
- process_option()
- ctx Handler context. Here it is an instance_map structure.
- group_name The name of the group the option belongs to.
- option The very option to be processed. It is already
- prepared to be used in argv (has -- prefix)
-
- DESCRIPTION
-
- This handler checks whether a group is an instance group and adds
- an option to the appropriate instance class. If this is the first
- occurence of an instance name, we'll also create the instance
- with such name and add it to the instance map.
-
- RETURN
- 0 - ok
- 1 - error occured
-*/
-
-static int process_option(void *ctx, const char *group, const char *option)
-{
- Instance_map *map= (Instance_map*) ctx;
- LEX_STRING group_str;
-
- group_str.str= (char *) group;
- group_str.length= strlen(group);
-
- return map->process_one_option(&group_str, option);
-}
-
-C_MODE_END
-
-
-/**
- Parse option string.
-
- SYNOPSIS
- parse_option()
- option_str [IN] option string (e.g. "--name=value")
- option_name_buf [OUT] parsed name of the option.
- Must be of (MAX_OPTION_LEN + 1) size.
- option_value_buf [OUT] parsed value of the option.
- Must be of (MAX_OPTION_LEN + 1) size.
-
- DESCRIPTION
- This is an auxiliary function and should not be used externally. It is
- intended to parse whole option string into option name and option value.
-*/
-
-static void parse_option(const char *option_str,
- char *option_name_buf,
- char *option_value_buf)
-{
- const char *eq_pos;
- const char *ptr= option_str;
-
- while (*ptr == '-')
- ++ptr;
-
- strmake(option_name_buf, ptr, MAX_OPTION_LEN + 1);
-
- eq_pos= strchr(ptr, '=');
- if (eq_pos)
- {
- option_name_buf[eq_pos - ptr]= 0;
- strmake(option_value_buf, eq_pos + 1, MAX_OPTION_LEN + 1);
- }
- else
- {
- option_value_buf[0]= 0;
- }
-}
-
-
-/**
- Process one option from the configuration file.
-
- SYNOPSIS
- Instance_map::process_one_option()
- group group name
- option option string (e.g. "--name=value")
-
- DESCRIPTION
- This is an auxiliary function and should not be used externally.
- It is used only by flush_instances(), which pass it to
- process_option(). The caller ensures proper locking
- of the instance map object.
-*/
- /*
- Process a given option and assign it to appropricate instance. This is
- required for the option handler, passed to my_search_option_files().
- */
-
-int Instance_map::process_one_option(const LEX_STRING *group,
- const char *option)
-{
- Instance *instance= NULL;
-
- if (!Instance::is_name_valid(group))
- {
- /*
- Current section name is not a valid instance name.
- We should skip it w/o error.
- */
- return 0;
- }
-
- if (!(instance= (Instance *) hash_search(&hash, (uchar *) group->str,
- group->length)))
- {
- if (!(instance= new Instance()))
- return 1;
-
- if (instance->init(group) || add_instance(instance))
- {
- delete instance;
- return 1;
- }
-
- if (instance->is_mysqld_compatible())
- log_info("Warning: instance name '%s' is mysqld-compatible.",
- (const char *) group->str);
-
- log_info("mysqld instance '%s' has been added successfully.",
- (const char *) group->str);
- }
-
- if (option)
- {
- char option_name[MAX_OPTION_LEN + 1];
- char option_value[MAX_OPTION_LEN + 1];
-
- parse_option(option, option_name, option_value);
-
- if (instance->is_mysqld_compatible() &&
- Instance_options::is_option_im_specific(option_name))
- {
- log_info("Warning: configuration of mysqld-compatible instance '%s' "
- "contains IM-specific option '%s'. "
- "This breaks backward compatibility for the configuration file.",
- (const char *) group->str,
- (const char *) option_name);
- }
-
- Named_value option(option_name, option_value);
-
- if (instance->options.set_option(&option))
- return 1; /* the instance'll be deleted when we destroy the map */
- }
-
- return 0;
-}
-
-
-/**
- Instance_map constructor.
-*/
-
-Instance_map::Instance_map()
-{
- pthread_mutex_init(&LOCK_instance_map, 0);
-}
-
-
-/**
- Initialize Instance_map internals.
-*/
-
-bool Instance_map::init()
-{
- return hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
- get_instance_key, delete_instance, 0);
-}
-
-
-/**
- Reset Instance_map data.
-*/
-
-bool Instance_map::reset()
-{
- hash_free(&hash);
- return init();
-}
-
-
-/**
- Instance_map destructor.
-*/
-
-Instance_map::~Instance_map()
-{
- lock();
-
- /*
- NOTE: it's necessary to synchronize on each instance before removal,
- because Instance-monitoring thread can be still alive an hold the mutex
- (because it is detached and we have no control over it).
- */
-
- while (true)
- {
- Iterator it(this);
- Instance *instance= it.next();
-
- if (!instance)
- break;
-
- instance->lock();
- instance->unlock();
-
- remove_instance(instance);
- }
-
- hash_free(&hash);
- unlock();
-
- pthread_mutex_destroy(&LOCK_instance_map);
-}
-
-
-/**
- Lock Instance_map.
-*/
-
-void Instance_map::lock()
-{
- pthread_mutex_lock(&LOCK_instance_map);
-}
-
-
-/**
- Unlock Instance_map.
-*/
-
-void Instance_map::unlock()
-{
- pthread_mutex_unlock(&LOCK_instance_map);
-}
-
-
-/**
- Check if there is an active instance or not.
-*/
-
-bool Instance_map::is_there_active_instance()
-{
- Instance *instance;
- Iterator iterator(this);
-
- while ((instance= iterator.next()))
- {
- bool active_instance_found;
-
- instance->lock();
- active_instance_found= instance->is_active();
- instance->unlock();
-
- if (active_instance_found)
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/**
- Add an instance into the internal hash.
-
- MT-NOTE: Instance Map must be locked before calling the operation.
-*/
-
-int Instance_map::add_instance(Instance *instance)
-{
- return my_hash_insert(&hash, (uchar *) instance);
-}
-
-
-/**
- Remove instance from the internal hash.
-
- MT-NOTE: Instance Map must be locked before calling the operation.
-*/
-
-int Instance_map::remove_instance(Instance *instance)
-{
- return hash_delete(&hash, (uchar *) instance);
-}
-
-
-/**
- Create a new instance and register it in the internal hash.
-
- MT-NOTE: Instance Map must be locked before calling the operation.
-*/
-
-int Instance_map::create_instance(const LEX_STRING *instance_name,
- const Named_value_arr *options)
-{
- Instance *instance= new Instance();
-
- if (!instance)
- {
- log_error("Can not allocate instance (name: '%s').",
- (const char *) instance_name->str);
- return ER_OUT_OF_RESOURCES;
- }
-
- if (instance->init(instance_name))
- {
- log_error("Can not initialize instance (name: '%s').",
- (const char *) instance_name->str);
- delete instance;
- return ER_OUT_OF_RESOURCES;
- }
-
- for (int i= 0; options && i < options->get_size(); ++i)
- {
- Named_value option= options->get_element(i);
-
- if (instance->is_mysqld_compatible() &&
- Instance_options::is_option_im_specific(option.get_name()))
- {
- log_error("IM-option (%s) can not be used "
- "in configuration of mysqld-compatible instance (%s).",
- (const char *) option.get_name(),
- (const char *) instance_name->str);
- delete instance;
- return ER_INCOMPATIBLE_OPTION;
- }
-
- instance->options.set_option(&option);
- }
-
- if (instance->is_mysqld_compatible())
- log_info("Warning: instance name '%s' is mysqld-compatible.",
- (const char *) instance_name->str);
-
- if (instance->complete_initialization())
- {
- log_error("Can not complete initialization of instance (name: '%s').",
- (const char *) instance_name->str);
- delete instance;
- return ER_OUT_OF_RESOURCES;
- /* TODO: return more appropriate error code in this case. */
- }
-
- if (add_instance(instance))
- {
- log_error("Can not register instance (name: '%s').",
- (const char *) instance_name->str);
- delete instance;
- return ER_OUT_OF_RESOURCES;
- }
-
- return 0;
-}
-
-
-/**
- Return a pointer to the instance or NULL, if there is no such instance.
-
- MT-NOTE: Instance Map must be locked before calling the operation.
-*/
-
-Instance * Instance_map::find(const LEX_STRING *name)
-{
- return (Instance *) hash_search(&hash, (uchar *) name->str, name->length);
-}
-
-
-/**
- Init instances command line arguments after all options have been loaded.
-*/
-
-bool Instance_map::complete_initialization()
-{
- bool mysqld_found;
-
- /* Complete initialization of all registered instances. */
-
- for (uint i= 0; i < hash.records; ++i)
- {
- Instance *instance= (Instance *) hash_element(&hash, i);
-
- if (instance->complete_initialization())
- return TRUE;
- }
-
- /* That's all if we are runnning in an ordinary mode. */
-
- if (!Options::Main::mysqld_safe_compatible)
- return FALSE;
-
- /* In mysqld-compatible mode we must ensure that there 'mysqld' instance. */
-
- mysqld_found= find(&Instance::DFLT_INSTANCE_NAME) != NULL;
-
- if (mysqld_found)
- return FALSE;
-
- if (create_instance(&Instance::DFLT_INSTANCE_NAME, NULL))
- {
- log_error("Can not create default instance.");
- return TRUE;
- }
-
- switch (create_instance_in_file(&Instance::DFLT_INSTANCE_NAME, NULL))
- {
- case 0:
- case ER_CONF_FILE_DOES_NOT_EXIST:
- /*
- Continue if the instance has been added to the config file
- successfully, or the config file just does not exist.
- */
- break;
-
- default:
- log_error("Can not add default instance to the config file.");
-
- Instance *instance= find(&Instance::DFLT_INSTANCE_NAME);
-
- if (instance)
- remove_instance(instance); /* instance is deleted here. */
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/**
- Load options from config files and create appropriate instance
- structures.
-*/
-
-int Instance_map::load()
-{
- int argc= 1;
- /* this is a dummy variable for search_option_files() */
- uint args_used= 0;
- const char *argv_options[3];
- char **argv= (char **) &argv_options;
- char defaults_file_arg[FN_REFLEN];
-
- /* the name of the program may be orbitrary here in fact */
- argv_options[0]= "mysqlmanager";
-
- /*
- If the option file was forced by the user when starting
- the IM with --defaults-file=xxxx, make sure it is also
- passed as --defaults-file, not only as Options::config_file.
- This is important for option files given with relative path:
- e.g. --defaults-file=my.cnf.
- Otherwise my_search_option_files will treat "my.cnf" as a group
- name and start looking for files named "my.cnf.cnf" in all
- default dirs. Which is not what we want.
- */
- if (Options::Main::is_forced_default_file)
- {
- snprintf(defaults_file_arg, FN_REFLEN, "--defaults-file=%s",
- Options::Main::config_file);
-
- argv_options[1]= defaults_file_arg;
- argv_options[2]= '\0';
-
- argc= 2;
- }
- else
- argv_options[1]= '\0';
-
- /*
- If the routine failed, we'll simply fallback to defaults in
- complete_initialization().
- */
- if (my_search_option_files(Options::Main::config_file, &argc,
- (char ***) &argv, &args_used,
- process_option, (void*) this,
- Options::default_directories))
- log_info("Falling back to compiled-in defaults.");
-
- return complete_initialization();
-}
-
-
-/*************************************************************************
- {{{ Instance_map::Iterator implementation.
-*************************************************************************/
-
-void Instance_map::Iterator::go_to_first()
-{
- current_instance=0;
-}
-
-
-Instance *Instance_map::Iterator::next()
-{
- if (current_instance < instance_map->hash.records)
- return (Instance *) hash_element(&instance_map->hash, current_instance++);
-
- return NULL;
-}
-
-/*************************************************************************
- }}}
-*************************************************************************/
-
-
-/**
- Create a new configuration section for mysqld-instance in the config file.
-
- SYNOPSIS
- create_instance_in_file()
- instance_name mysqld-instance name
- options options for the new mysqld-instance
-
- RETURN
- 0 On success
- ER_CONF_FILE_DOES_NOT_EXIST If config file does not exist
- ER_ACCESS_OPTION_FILE If config file is not writable or some I/O
- error ocurred during writing configuration
-*/
-
-int create_instance_in_file(const LEX_STRING *instance_name,
- const Named_value_arr *options)
-{
- File cnf_file;
-
- if (my_access(Options::Main::config_file, W_OK))
- {
- log_error("Configuration file (%s) does not exist.",
- (const char *) Options::Main::config_file);
- return ER_CONF_FILE_DOES_NOT_EXIST;
- }
-
- cnf_file= my_open(Options::Main::config_file, O_WRONLY | O_APPEND, MYF(0));
-
- if (cnf_file <= 0)
- {
- log_error("Can not open configuration file (%s): %s.",
- (const char *) Options::Main::config_file,
- (const char *) strerror(errno));
- return ER_ACCESS_OPTION_FILE;
- }
-
- if (my_write(cnf_file, (uchar*)NEWLINE, NEWLINE_LEN, MYF(MY_NABP)) ||
- my_write(cnf_file, (uchar*)"[", 1, MYF(MY_NABP)) ||
- my_write(cnf_file, (uchar*)instance_name->str, instance_name->length,
- MYF(MY_NABP)) ||
- my_write(cnf_file, (uchar*)"]", 1, MYF(MY_NABP)) ||
- my_write(cnf_file, (uchar*)NEWLINE, NEWLINE_LEN, MYF(MY_NABP)))
- {
- log_error("Can not write to configuration file (%s): %s.",
- (const char *) Options::Main::config_file,
- (const char *) strerror(errno));
- my_close(cnf_file, MYF(0));
- return ER_ACCESS_OPTION_FILE;
- }
-
- for (int i= 0; options && i < options->get_size(); ++i)
- {
- char option_str[MAX_OPTION_STR_LEN];
- char *ptr;
- int option_str_len;
- Named_value option= options->get_element(i);
-
- ptr= strxnmov(option_str, MAX_OPTION_LEN + 1, option.get_name(), NullS);
-
- if (option.get_value()[0])
- ptr= strxnmov(ptr, MAX_OPTION_LEN + 2, "=", option.get_value(), NullS);
-
- option_str_len= ptr - option_str;
-
- if (my_write(cnf_file, (uchar*)option_str, option_str_len, MYF(MY_NABP)) ||
- my_write(cnf_file, (uchar*)NEWLINE, NEWLINE_LEN, MYF(MY_NABP)))
- {
- log_error("Can not write to configuration file (%s): %s.",
- (const char *) Options::Main::config_file,
- (const char *) strerror(errno));
- my_close(cnf_file, MYF(0));
- return ER_ACCESS_OPTION_FILE;
- }
- }
-
- my_close(cnf_file, MYF(0));
-
- return 0;
-}
diff --git a/server-tools/instance-manager/instance_map.h b/server-tools/instance-manager/instance_map.h
deleted file mode 100644
index af2f1868195..00000000000
--- a/server-tools/instance-manager/instance_map.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
-#include <hash.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-class Guardian;
-class Instance;
-class Named_value_arr;
-class Thread_registry;
-
-extern int load_all_groups(char ***groups, const char *filename);
-extern void free_groups(char **groups);
-
-extern int create_instance_in_file(const LEX_STRING *instance_name,
- const Named_value_arr *options);
-
-
-/**
- Instance_map - stores all existing instances
-*/
-
-class Instance_map
-{
-public:
- /**
- Instance_map iterator
- */
-
- class Iterator
- {
- private:
- uint current_instance;
- Instance_map *instance_map;
- public:
- Iterator(Instance_map *instance_map_arg) :
- current_instance(0), instance_map(instance_map_arg)
- {}
-
- void go_to_first();
- Instance *next();
- };
-
-public:
- Instance *find(const LEX_STRING *name);
-
- bool is_there_active_instance();
-
- void lock();
- void unlock();
-
- bool init();
- bool reset();
-
- int load();
-
- int process_one_option(const LEX_STRING *group, const char *option);
-
- int add_instance(Instance *instance);
-
- int remove_instance(Instance *instance);
-
- int create_instance(const LEX_STRING *instance_name,
- const Named_value_arr *options);
-
-public:
- Instance_map();
- ~Instance_map();
-
-private:
- bool complete_initialization();
-
-private:
- enum { START_HASH_SIZE = 16 };
- pthread_mutex_t LOCK_instance_map;
- HASH hash;
-
-private:
- friend class Iterator;
-};
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H */
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc
deleted file mode 100644
index 8b96d6f0f96..00000000000
--- a/server-tools/instance-manager/instance_options.cc
+++ /dev/null
@@ -1,753 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "instance_options.h"
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
-
-#include <signal.h>
-
-#include "buffer.h"
-#include "instance.h"
-#include "log.h"
-#include "options.h"
-#include "parse_output.h"
-#include "priv.h"
-
-
-/* Create "mysqld ..." command in the buffer */
-
-static inline bool create_mysqld_command(Buffer *buf,
- const LEX_STRING *mysqld_path,
- const LEX_STRING *option)
-{
- int position= 0;
-
- if (buf->get_size()) /* malloc succeeded */
- {
-#ifdef __WIN__
- buf->append(position++, "\"", 1);
-#endif
- buf->append(position, mysqld_path->str, mysqld_path->length);
- position+= mysqld_path->length;
-#ifdef __WIN__
- buf->append(position++, "\"", 1);
-#endif
- /* here the '\0' character is copied from the option string */
- buf->append(position, option->str, option->length + 1);
-
- return buf->is_error() ? TRUE : FALSE;
- }
- return TRUE;
-}
-
-static inline bool is_path_separator(char ch)
-{
-#if defined(__WIN__) || defined(__NETWARE__)
- /* On windows and netware more delimiters are possible */
- return ch == FN_LIBCHAR || ch == FN_DEVCHAR || ch == '/';
-#else
- return ch == FN_LIBCHAR; /* Unixes */
-#endif
-}
-
-
-static char *find_last_path_separator(char *path, uint length)
-{
- while (length)
- {
- if (is_path_separator(path[length]))
- return path + length;
- length--;
- }
- return NULL; /* No path separator found */
-}
-
-
-
-bool Instance_options::is_option_im_specific(const char *option_name)
-{
- static const char *IM_SPECIFIC_OPTIONS[] =
- {
- "nonguarded",
- "mysqld-path",
- "shutdown-delay",
- NULL
- };
-
- for (int i= 0; IM_SPECIFIC_OPTIONS[i]; ++i)
- {
- if (!strcmp(option_name, IM_SPECIFIC_OPTIONS[i]))
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-Instance_options::Instance_options()
- :mysqld_version(NULL), mysqld_socket(NULL), mysqld_datadir(NULL),
- mysqld_pid_file(NULL),
- nonguarded(NULL),
- mysqld_port(NULL),
- mysqld_port_val(0),
- shutdown_delay(NULL),
- shutdown_delay_val(0),
- filled_default_options(0)
-{
- mysqld_path.str= NULL;
- mysqld_path.length= 0;
-
- mysqld_real_path.str= NULL;
- mysqld_real_path.length= 0;
-
- memset(logs, 0, sizeof(logs));
-}
-
-
-/*
- Get compiled-in value of default_option
-
- SYNOPSIS
- get_default_option()
- result buffer to put found value
- result_len buffer size
- option_name the name of the option, prefixed with "--"
-
- DESCRIPTION
-
- Get compile-in value of requested option from server
-
- RETURN
- 0 - ok
- 1 - error occured
-*/
-
-
-int Instance_options::get_default_option(char *result, size_t result_len,
- const char *option_name)
-{
- int rc= 1;
- LEX_STRING verbose_option=
- { C_STRING_WITH_LEN(" --no-defaults --verbose --help") };
-
- /* reserve space for the path + option + final '\0' */
- Buffer cmd(mysqld_path.length + verbose_option.length + 1);
-
- if (create_mysqld_command(&cmd, &mysqld_path, &verbose_option))
- goto err;
-
- /* +2 eats first "--" from the option string (E.g. "--datadir") */
- rc= parse_output_and_get_value((char*) cmd.buffer,
- option_name + 2, strlen(option_name + 2),
- result, result_len, GET_VALUE);
-err:
- return rc;
-}
-
-
-/*
- Fill mysqld_version option (used at initialization stage)
-
- SYNOPSIS
- fill_instance_version()
-
- DESCRIPTION
-
- Get mysqld version string from "mysqld --version" output.
-
- RETURN
- FALSE - ok
- TRUE - error occured
-*/
-
-bool Instance_options::fill_instance_version()
-{
- char result[MAX_VERSION_LENGTH];
- LEX_STRING version_option=
- { C_STRING_WITH_LEN(" --no-defaults --version") };
- Buffer cmd(mysqld_path.length + version_option.length + 1);
-
- if (create_mysqld_command(&cmd, &mysqld_path, &version_option))
- {
- log_error("Failed to get version of '%s': out of memory.",
- (const char *) mysqld_path.str);
- return TRUE;
- }
-
- bzero(result, MAX_VERSION_LENGTH);
-
- if (parse_output_and_get_value((char*) cmd.buffer, STRING_WITH_LEN("Ver"),
- result, MAX_VERSION_LENGTH, GET_LINE))
- {
- log_error("Failed to get version of '%s': unexpected output.",
- (const char *) mysqld_path.str);
- return TRUE;
- }
-
- DBUG_ASSERT(*result != '\0');
-
- {
- char *start;
-
- /* trim leading whitespaces */
- start= result;
- while (my_isspace(default_charset_info, *start))
- ++start;
-
- mysqld_version= strdup_root(&alloc, start);
- }
-
- return FALSE;
-}
-
-
-/*
- Fill mysqld_real_path
-
- SYNOPSIS
- fill_mysqld_real_path()
-
- DESCRIPTION
-
- Get the real path to mysqld from "mysqld --help" output.
- Will print the realpath of mysqld between "Usage: " and "[OPTIONS]"
-
- This is needed if the mysqld_path variable is pointing at a
- script(for example libtool) or a symlink.
-
- RETURN
- FALSE - ok
- TRUE - error occured
-*/
-
-bool Instance_options::fill_mysqld_real_path()
-{
- char result[FN_REFLEN];
- LEX_STRING help_option=
- { C_STRING_WITH_LEN(" --no-defaults --help") };
- Buffer cmd(mysqld_path.length + help_option.length);
-
- if (create_mysqld_command(&cmd, &mysqld_path, &help_option))
- {
- log_error("Failed to get real path of '%s': out of memory.",
- (const char *) mysqld_path.str);
- return TRUE;
- }
-
- bzero(result, FN_REFLEN);
-
- if (parse_output_and_get_value((char*) cmd.buffer,
- STRING_WITH_LEN("Usage: "),
- result, FN_REFLEN,
- GET_LINE))
- {
- log_error("Failed to get real path of '%s': unexpected output.",
- (const char *) mysqld_path.str);
- return TRUE;
- }
-
- DBUG_ASSERT(*result != '\0');
-
- {
- char* options_str;
- /* chop the path of at [OPTIONS] */
- if ((options_str= strstr(result, "[OPTIONS]")))
- *options_str= '\0';
- mysqld_real_path.str= strdup_root(&alloc, result);
- mysqld_real_path.length= strlen(mysqld_real_path.str);
- }
-
- return FALSE;
-}
-
-
-/*
- Fill various log options
-
- SYNOPSIS
- fill_log_options()
-
- DESCRIPTION
-
- Compute paths to enabled log files. If the path is not specified in the
- instance explicitly (I.e. log=/home/user/mysql.log), we try to guess the
- file name and placement.
-
- RETURN
- FALSE - ok
- TRUE - error occured
-*/
-
-bool Instance_options::fill_log_options()
-{
- Buffer buff;
- enum { MAX_LOG_OPTION_LENGTH= 256 };
- char datadir[MAX_LOG_OPTION_LENGTH];
- char hostname[MAX_LOG_OPTION_LENGTH];
- uint hostname_length;
- struct log_files_st
- {
- const char *name;
- uint length;
- char **value;
- const char *default_suffix;
- } logs_st[]=
- {
- {"--log-error", 11, &(logs[IM_LOG_ERROR]), ".err"},
- {"--log", 5, &(logs[IM_LOG_GENERAL]), ".log"},
- {"--log-slow-queries", 18, &(logs[IM_LOG_SLOW]), "-slow.log"},
- {NULL, 0, NULL, NULL}
- };
- struct log_files_st *log_files;
-
- /* compute hostname and datadir for the instance */
- if (mysqld_datadir == NULL)
- {
- if (get_default_option(datadir, MAX_LOG_OPTION_LENGTH, "--datadir"))
- return TRUE;
- }
- else
- {
- /* below is safe, as --datadir always has a value */
- strmake(datadir, mysqld_datadir, MAX_LOG_OPTION_LENGTH - 1);
- }
-
- if (gethostname(hostname,sizeof(hostname)-1) < 0)
- strmov(hostname, "mysql");
-
- hostname[MAX_LOG_OPTION_LENGTH - 1]= 0; /* Safety */
- hostname_length= strlen(hostname);
-
-
- for (log_files= logs_st; log_files->name; log_files++)
- {
- for (int i=0; (argv[i] != 0); i++)
- {
- if (!strncmp(argv[i], log_files->name, log_files->length))
- {
- /*
- This is really log_files->name option if and only if it is followed
- by '=', '\0' or space character. This way we can distinguish such
- options as '--log' and '--log-bin'. This is checked in the following
- two statements.
- */
- if (argv[i][log_files->length] == '\0' ||
- my_isspace(default_charset_info, argv[i][log_files->length]))
- {
- char full_name[MAX_LOG_OPTION_LENGTH];
-
- fn_format(full_name, hostname, datadir, "",
- MY_UNPACK_FILENAME | MY_SAFE_PATH);
-
-
- if ((MAX_LOG_OPTION_LENGTH - strlen(full_name)) <=
- strlen(log_files->default_suffix))
- return TRUE;
-
- strmov(full_name + strlen(full_name), log_files->default_suffix);
-
- /*
- If there were specified two identical logfiles options,
- we would loose some memory in MEM_ROOT here. However
- this situation is not typical.
- */
- *(log_files->value)= strdup_root(&alloc, full_name);
- }
-
- if (argv[i][log_files->length] == '=')
- {
- char full_name[MAX_LOG_OPTION_LENGTH];
-
- fn_format(full_name, argv[i] +log_files->length + 1,
- datadir, "", MY_UNPACK_FILENAME | MY_SAFE_PATH);
-
- if (!(*(log_files->value)= strdup_root(&alloc, full_name)))
- return TRUE;
- }
- }
- }
- }
-
- return FALSE;
-}
-
-
-/*
- Get the full pid file name with path
-
- SYNOPSIS
- get_pid_filaname()
- result buffer to sotre the pidfile value
-
- IMPLEMENTATION
- Get the data directory, then get the pid filename
- (which is always set for an instance), then load the
- full path with my_load_path(). It takes into account
- whether it is already an absolute path or it should be
- prefixed with the datadir and so on.
-
- RETURN
- 0 - ok
- 1 - error occured
-*/
-
-int Instance_options::get_pid_filename(char *result)
-{
- char datadir[MAX_PATH_LEN];
-
- if (mysqld_datadir == NULL)
- {
- /* we might get an error here if we have wrong path to the mysqld binary */
- if (get_default_option(datadir, sizeof(datadir), "--datadir"))
- return 1;
- }
- else
- strxnmov(datadir, MAX_PATH_LEN - 1, mysqld_datadir, "/", NullS);
-
- /* get the full path to the pidfile */
- my_load_path(result, mysqld_pid_file, datadir);
- return 0;
-}
-
-
-int Instance_options::unlink_pidfile()
-{
- return unlink(pid_file_with_path);
-}
-
-
-pid_t Instance_options::load_pid()
-{
- FILE *pid_file_stream;
-
- /* get the pid */
- if ((pid_file_stream= my_fopen(pid_file_with_path,
- O_RDONLY | O_BINARY, MYF(0))) != NULL)
- {
- pid_t pid;
-
- if (fscanf(pid_file_stream, "%i", &pid) != 1)
- pid= -1;
- my_fclose(pid_file_stream, MYF(0));
- return pid;
- }
- return 0;
-}
-
-
-bool Instance_options::complete_initialization()
-{
- int arg_idx;
- const char *tmp;
- char *end;
- char bin_name_firstchar;
-
- if (!mysqld_path.str)
- {
- /*
- Need to copy the path to allocated memory, as convert_dirname() might
- need to change it
- */
- mysqld_path.str= strdup_root(&alloc, Options::Main::default_mysqld_path);
- if (!mysqld_path.str)
- return TRUE;
- }
-
- mysqld_path.length= strlen(mysqld_path.str);
-
- /*
- If we found path with no slashes (end == NULL), we should not call
- convert_dirname() at all. As we have got relative path to the binary.
- That is, user supposes that mysqld resides in the same dir as
- mysqlmanager.
- */
- if ((end= find_last_path_separator(mysqld_path.str, mysqld_path.length)))
- {
- bin_name_firstchar= end[1];
-
- /*
- Below we will conver the path to mysqld in the case, it was given
- in a format of another OS (e.g. uses '/' instead of '\' etc).
- Here we strip the path to get rid of the binary name ("mysqld"),
- we do it by removing first letter of the binary name (e.g. 'm'
- in "mysqld"). Later we put it back.
- */
- end[1]= 0;
-
- /* convert dirname to the format of current OS */
- convert_dirname((char*)mysqld_path.str, mysqld_path.str, NullS);
-
- /* put back the first character of the binary name*/
- end[1]= bin_name_firstchar;
- }
-
- if (mysqld_port)
- mysqld_port_val= atoi(mysqld_port);
-
- if (shutdown_delay)
- shutdown_delay_val= atoi(shutdown_delay);
-
- if (!(tmp= strdup_root(&alloc, "--no-defaults")))
- return TRUE;
-
- if (!mysqld_pid_file)
- {
- char pidfilename[MAX_PATH_LEN];
- char hostname[MAX_PATH_LEN];
-
- /*
- If we created only one istance [mysqld], because no config. files were
- found, we would like to model mysqld pid file values.
- */
-
- if (!gethostname(hostname, sizeof(hostname) - 1))
- {
- if (Instance::is_mysqld_compatible_name(&instance_name))
- strxnmov(pidfilename, MAX_PATH_LEN - 1, hostname, ".pid", NullS);
- else
- strxnmov(pidfilename, MAX_PATH_LEN - 1, instance_name.str, "-",
- hostname, ".pid", NullS);
- }
- else
- {
- if (Instance::is_mysqld_compatible_name(&instance_name))
- strxnmov(pidfilename, MAX_PATH_LEN - 1, "mysql", ".pid", NullS);
- else
- strxnmov(pidfilename, MAX_PATH_LEN - 1, instance_name.str, ".pid",
- NullS);
- }
-
- Named_value option((char *) "pid-file", pidfilename);
-
- set_option(&option);
- }
-
- if (get_pid_filename(pid_file_with_path))
- return TRUE;
-
- /* we need to reserve space for the final zero + possible default options */
- if (!(argv= (char**)
- alloc_root(&alloc, (get_num_options() + 1
- + MAX_NUMBER_OF_DEFAULT_OPTIONS) * sizeof(char*))))
- return TRUE;
- filled_default_options= 0;
-
- /* the path must be first in the argv */
- if (add_to_argv(mysqld_path.str))
- return TRUE;
-
- if (add_to_argv(tmp))
- return TRUE;
-
- arg_idx= filled_default_options;
- for (int opt_idx= 0; opt_idx < get_num_options(); ++opt_idx)
- {
- char option_str[MAX_OPTION_STR_LEN];
- Named_value option= get_option(opt_idx);
-
- if (is_option_im_specific(option.get_name()))
- continue;
-
- char *ptr= strxnmov(option_str, MAX_OPTION_LEN + 3, "--", option.get_name(),
- NullS);
-
- if (option.get_value()[0])
- strxnmov(ptr, MAX_OPTION_LEN + 2, "=", option.get_value(), NullS);
-
- argv[arg_idx++]= strdup_root(&alloc, option_str);
- }
-
- argv[arg_idx]= 0;
-
- if (fill_log_options() || fill_mysqld_real_path() || fill_instance_version())
- return TRUE;
-
- return FALSE;
-}
-
-
-bool Instance_options::set_option(Named_value *option)
-{
- bool err_status;
- int idx= find_option(option->get_name());
- char *option_name_str;
- char *option_value_str;
-
- if (!(option_name_str= Named_value::alloc_str(option->get_name())))
- return TRUE;
-
- if (!(option_value_str= Named_value::alloc_str(option->get_value())))
- {
- Named_value::free_str(&option_name_str);
- return TRUE;
- }
-
- Named_value option_copy(option_name_str, option_value_str);
-
- if (idx < 0)
- err_status= options.add_element(&option_copy);
- else
- err_status= options.replace_element(idx, &option_copy);
-
- if (!err_status)
- update_var(option_copy.get_name(), option_copy.get_value());
- else
- option_copy.free();
-
- return err_status;
-}
-
-
-void Instance_options::unset_option(const char *option_name)
-{
- int idx= find_option(option_name);
-
- if (idx < 0)
- return; /* the option has not been set. */
-
- options.remove_element(idx);
-
- update_var(option_name, NULL);
-}
-
-
-void Instance_options::update_var(const char *option_name,
- const char *option_value)
-{
- struct options_st
- {
- const char *name;
- uint name_len;
- const char **var;
- } options_def[]=
- {
- {"socket", 6, &mysqld_socket},
- {"port", 4, &mysqld_port},
- {"datadir", 7, &mysqld_datadir},
- {"pid-file", 8, &mysqld_pid_file},
- {"nonguarded", 10, &nonguarded},
- {"mysqld-path", 11, (const char **) &mysqld_path.str},
- {"shutdown-delay", 14, &shutdown_delay},
- {NULL, 0, NULL}
- };
-
- for (options_st *opt= options_def; opt->name; ++opt)
- {
- if (!strncmp(opt->name, option_name, opt->name_len))
- {
- *(opt->var)= option_value;
- break;
- }
- }
-}
-
-
-int Instance_options::find_option(const char *option_name)
-{
- for (int i= 0; i < get_num_options(); i++)
- {
- if (!strcmp(get_option(i).get_name(), option_name))
- return i;
- }
-
- return -1;
-}
-
-
-int Instance_options::add_to_argv(const char* option)
-{
- DBUG_ASSERT(filled_default_options < MAX_NUMBER_OF_DEFAULT_OPTIONS);
-
- if (option)
- argv[filled_default_options++]= (char*) option;
- return 0;
-}
-
-
-/* function for debug purposes */
-void Instance_options::print_argv()
-{
- int i;
-
- printf("printing out an instance %s argv:\n",
- (const char *) instance_name.str);
-
- for (i=0; argv[i] != NULL; i++)
- printf("argv: %s\n", argv[i]);
-}
-
-
-/*
- We execute this function to initialize some options.
-
- RETURN
- FALSE - ok
- TRUE - memory allocation error
-*/
-
-bool Instance_options::init(const LEX_STRING *instance_name_arg)
-{
- instance_name.length= instance_name_arg->length;
-
- init_alloc_root(&alloc, MEM_ROOT_BLOCK_SIZE, 0);
-
- if (options.init())
- return TRUE;
-
- if (!(instance_name.str= strmake_root(&alloc, instance_name_arg->str,
- instance_name_arg->length)))
- return TRUE;
-
- return FALSE;
-}
-
-
-Instance_options::~Instance_options()
-{
- free_root(&alloc, MYF(0));
-}
-
-
-uint Instance_options::get_shutdown_delay() const
-{
- static const uint DEFAULT_SHUTDOWN_DELAY= 35;
-
- /*
- NOTE: it is important to check shutdown_delay here, but use
- shutdown_delay_val. The idea is that if the option is unset,
- shutdown_delay will be NULL, but shutdown_delay_val will not be reset.
- */
-
- return shutdown_delay ? shutdown_delay_val : DEFAULT_SHUTDOWN_DELAY;
-}
-
-int Instance_options::get_mysqld_port() const
-{
- /*
- NOTE: it is important to check mysqld_port here, but use mysqld_port_val.
- The idea is that if the option is unset, mysqld_port will be NULL, but
- mysqld_port_val will not be reset.
- */
-
- return mysqld_port ? mysqld_port_val : 0;
-}
-
diff --git a/server-tools/instance-manager/instance_options.h b/server-tools/instance-manager/instance_options.h
deleted file mode 100644
index b0503815036..00000000000
--- a/server-tools/instance-manager/instance_options.h
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_OPTIONS_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_OPTIONS_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_sys.h>
-
-#include "parse.h"
-#include "portability.h" /* for pid_t on Win32 */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-
-/*
- This class contains options of an instance and methods to operate them.
-
- We do not provide this class with the means of synchronization as it is
- supposed that options for instances are all loaded at once during the
- instance_map initilization and we do not change them later. This way we
- don't have to synchronize between threads.
-*/
-
-class Instance_options
-{
-public:
- /* The operation is used to check if the option is IM-specific or not. */
- static bool is_option_im_specific(const char *option_name);
-
-public:
- Instance_options();
- ~Instance_options();
-
- bool complete_initialization();
-
- bool set_option(Named_value *option);
- void unset_option(const char *option_name);
-
- inline int get_num_options() const;
- inline Named_value get_option(int idx) const;
-
-public:
- bool init(const LEX_STRING *instance_name_arg);
- pid_t load_pid();
- int get_pid_filename(char *result);
- int unlink_pidfile();
- void print_argv();
-
- uint get_shutdown_delay() const;
- int get_mysqld_port() const;
-
-public:
- /*
- We need this value to be greater or equal then FN_REFLEN found in
- my_global.h to use my_load_path()
- */
- enum { MAX_PATH_LEN= 512 };
- enum { MAX_NUMBER_OF_DEFAULT_OPTIONS= 2 };
- char pid_file_with_path[MAX_PATH_LEN];
- char **argv;
- /*
- Here we cache the version string, obtained from mysqld --version.
- In the case when mysqld binary is not found we get NULL here.
- */
- const char *mysqld_version;
- /* We need the some options, so we store them as a separate pointers */
- const char *mysqld_socket;
- const char *mysqld_datadir;
- const char *mysqld_pid_file;
- LEX_STRING instance_name;
- LEX_STRING mysqld_path;
- LEX_STRING mysqld_real_path;
- const char *nonguarded;
- /* log enums are defined in parse.h */
- char *logs[3];
-
-private:
- bool fill_log_options();
- bool fill_instance_version();
- bool fill_mysqld_real_path();
- int add_to_argv(const char *option);
- int get_default_option(char *result, size_t result_len,
- const char *option_name);
-
- void update_var(const char *option_name, const char *option_value);
- int find_option(const char *option_name);
-
-private:
- const char *mysqld_port;
- uint mysqld_port_val;
- const char *shutdown_delay;
- uint shutdown_delay_val;
-
- uint filled_default_options;
- MEM_ROOT alloc;
-
- Named_value_arr options;
-};
-
-
-inline int Instance_options::get_num_options() const
-{
- return options.get_size();
-}
-
-
-inline Named_value Instance_options::get_option(int idx) const
-{
- return options.get_element(idx);
-}
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_OPTIONS_H */
diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc
deleted file mode 100644
index 4d8a33e7db1..00000000000
--- a/server-tools/instance-manager/listener.cc
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "listener.h"
-
-#include <my_global.h>
-#include <mysql.h>
-#include <violite.h>
-
-#include <sys/stat.h>
-#ifndef __WIN__
-#include <sys/un.h>
-#endif
-
-#include "log.h"
-#include "mysql_connection.h"
-#include "options.h"
-#include "portability.h"
-#include "priv.h"
-#include "thread_registry.h"
-
-
-static void set_non_blocking(int socket)
-{
-#ifndef __WIN__
- int flags= fcntl(socket, F_GETFL, 0);
- fcntl(socket, F_SETFL, flags | O_NONBLOCK);
-#else
- u_long arg= 1;
- ioctlsocket(socket, FIONBIO, &arg);
-#endif
-}
-
-
-static void set_no_inherit(int socket)
-{
-#ifndef __WIN__
- int flags= fcntl(socket, F_GETFD, 0);
- fcntl(socket, F_SETFD, flags | FD_CLOEXEC);
-#endif
-}
-
-const int Listener::LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */
-
-Listener::Listener(Thread_registry *thread_registry_arg,
- User_map *user_map_arg)
- :thread_registry(thread_registry_arg),
- user_map(user_map_arg),
- total_connection_count(0),
- num_sockets(0)
-{
-}
-
-
-/*
- Listener::run() - listen all supported sockets and spawn a thread
- to handle incoming connection.
- Using 'die' in case of syscall failure is OK now - we don't hold any
- resources and 'die' kills the signal thread automatically. To be rewritten
- one day.
- See also comments in mysqlmanager.cc to picture general Instance Manager
- architecture.
-*/
-
-void Listener::run()
-{
- int i, n= 0;
-
-#ifndef __WIN__
- struct sockaddr_un unix_socket_address;
-#endif
-
- log_info("Listener: started.");
-
- thread_registry->register_thread(&thread_info);
-
- FD_ZERO(&read_fds);
-
- /* I. prepare 'listen' sockets */
- if (create_tcp_socket())
- goto err;
-
-#ifndef __WIN__
- if (create_unix_socket(unix_socket_address))
- goto err;
-#endif
-
- /* II. Listen sockets and spawn childs */
- for (i= 0; i < num_sockets; i++)
- n= max(n, sockets[i]);
- n++;
-
- timeval tv;
- while (!thread_registry->is_shutdown())
- {
- fd_set read_fds_arg= read_fds;
- /*
- We should reintialize timer as on linux it is modified
- to reflect amount of time not slept.
- */
- tv.tv_sec= 0;
- tv.tv_usec= 100000;
-
- /*
- When using valgrind 2.0 this syscall doesn't get kicked off by a
- signal during shutdown. This results in failing assert
- (Thread_registry::~Thread_registry). Valgrind 2.2 works fine.
- */
- int rc= select(n, &read_fds_arg, 0, 0, &tv);
-
- if (rc == 0 || rc == -1)
- {
- if (rc == -1 && errno != EINTR)
- log_error("Listener: select() failed: %s.",
- (const char *) strerror(errno));
- continue;
- }
-
-
- for (int socket_index= 0; socket_index < num_sockets; socket_index++)
- {
- /* Assuming that rc > 0 as we asked to wait forever */
- if (FD_ISSET(sockets[socket_index], &read_fds_arg))
- {
- int client_fd= accept(sockets[socket_index], 0, 0);
- /* accept may return -1 (failure or spurious wakeup) */
- if (client_fd >= 0) // connection established
- {
- set_no_inherit(client_fd);
-
- struct st_vio *vio=
- vio_new(client_fd,
- socket_index == 0 ? VIO_TYPE_SOCKET : VIO_TYPE_TCPIP,
- socket_index == 0 ? 1 : 0);
-
- if (vio != NULL)
- handle_new_mysql_connection(vio);
- else
- {
- shutdown(client_fd, SHUT_RDWR);
- closesocket(client_fd);
- }
- }
- }
- }
- }
-
- /* III. Release all resources and exit */
-
- log_info("Listener: shutdown requested, exiting...");
-
- for (i= 0; i < num_sockets; i++)
- closesocket(sockets[i]);
-
-#ifndef __WIN__
- unlink(unix_socket_address.sun_path);
-#endif
-
- thread_registry->unregister_thread(&thread_info);
-
- log_info("Listener: finished.");
- return;
-
-err:
- log_error("Listener: failed to initialize. Initiate shutdown...");
-
- // we have to close the ip sockets in case of error
- for (i= 0; i < num_sockets; i++)
- closesocket(sockets[i]);
-
- thread_registry->set_error_status();
- thread_registry->unregister_thread(&thread_info);
- thread_registry->request_shutdown();
- return;
-}
-
-int Listener::create_tcp_socket()
-{
- /* value to be set by setsockopt */
- int arg= 1;
-
- int ip_socket= socket(AF_INET, SOCK_STREAM, 0);
- if (ip_socket == INVALID_SOCKET)
- {
- log_error("Listener: socket(AF_INET) failed: %s.",
- (const char *) strerror(errno));
- return -1;
- }
-
- struct sockaddr_in ip_socket_address;
- bzero(&ip_socket_address, sizeof(ip_socket_address));
-
- ulong im_bind_addr;
- if (Options::Main::bind_address != 0)
- {
- im_bind_addr= (ulong) inet_addr(Options::Main::bind_address);
-
- if (im_bind_addr == (ulong) INADDR_NONE)
- im_bind_addr= htonl(INADDR_ANY);
- }
- else
- im_bind_addr= htonl(INADDR_ANY);
- uint im_port= Options::Main::port_number;
-
- ip_socket_address.sin_family= AF_INET;
- ip_socket_address.sin_addr.s_addr= im_bind_addr;
-
-
- ip_socket_address.sin_port= (unsigned short)
- htons((unsigned short) im_port);
-
- setsockopt(ip_socket, SOL_SOCKET, SO_REUSEADDR, (char*) &arg, sizeof(arg));
- if (bind(ip_socket, (struct sockaddr *) &ip_socket_address,
- sizeof(ip_socket_address)))
- {
- log_error("Listener: bind(ip socket) failed: %s.",
- (const char *) strerror(errno));
- closesocket(ip_socket);
- return -1;
- }
-
- if (listen(ip_socket, LISTEN_BACK_LOG_SIZE))
- {
- log_error("Listener: listen(ip socket) failed: %s.",
- (const char *) strerror(errno));
- closesocket(ip_socket);
- return -1;
- }
-
- /* set the socket nonblocking */
- set_non_blocking(ip_socket);
-
- /* make sure that instances won't be listening our sockets */
- set_no_inherit(ip_socket);
-
- FD_SET(ip_socket, &read_fds);
- sockets[num_sockets++]= ip_socket;
- log_info("Listener: accepting connections on ip socket (port: %d)...",
- (int) im_port);
- return 0;
-}
-
-#ifndef __WIN__
-int Listener::
-create_unix_socket(struct sockaddr_un &unix_socket_address)
-{
- int unix_socket= socket(AF_UNIX, SOCK_STREAM, 0);
- if (unix_socket == INVALID_SOCKET)
- {
- log_error("Listener: socket(AF_UNIX) failed: %s.",
- (const char *) strerror(errno));
- return -1;
- }
-
- bzero(&unix_socket_address, sizeof(unix_socket_address));
-
- unix_socket_address.sun_family= AF_UNIX;
- strmake(unix_socket_address.sun_path, Options::Main::socket_file_name,
- sizeof(unix_socket_address.sun_path));
- unlink(unix_socket_address.sun_path); // in case we have stale socket file
-
- /*
- POSIX specifies default permissions for a pathname created by bind
- to be 0777. We need everybody to have access to the socket.
- */
- mode_t old_mask= umask(0);
- if (bind(unix_socket, (struct sockaddr *) &unix_socket_address,
- sizeof(unix_socket_address)))
- {
- log_error("Listener: bind(unix socket) failed for '%s': %s.",
- (const char *) unix_socket_address.sun_path,
- (const char *) strerror(errno));
- close(unix_socket);
- return -1;
- }
-
- umask(old_mask);
-
- if (listen(unix_socket, LISTEN_BACK_LOG_SIZE))
- {
- log_error("Listener: listen(unix socket) failed: %s.",
- (const char *) strerror(errno));
- close(unix_socket);
- return -1;
- }
-
- /* set the socket nonblocking */
- set_non_blocking(unix_socket);
-
- /* make sure that instances won't be listening our sockets */
- set_no_inherit(unix_socket);
-
- log_info("Listener: accepting connections on unix socket '%s'...",
- (const char *) unix_socket_address.sun_path);
- sockets[num_sockets++]= unix_socket;
- FD_SET(unix_socket, &read_fds);
- return 0;
-}
-#endif
-
-
-/*
- Create new mysql connection. Created thread is responsible for deletion of
- the Mysql_connection and Vio instances passed to it.
- SYNOPSIS
- handle_new_mysql_connection()
-*/
-
-void Listener::handle_new_mysql_connection(struct st_vio *vio)
-{
- Mysql_connection *mysql_connection=
- new Mysql_connection(thread_registry, user_map,
- vio, ++total_connection_count);
- if (mysql_connection == NULL || mysql_connection->start(Thread::DETACHED))
- {
- log_error("Listener: can not start connection handler.");
- delete mysql_connection;
- vio_delete(vio);
- }
- /* The connection will delete itself when the thread is finished */
-}
diff --git a/server-tools/instance-manager/listener.h b/server-tools/instance-manager/listener.h
deleted file mode 100644
index 964fb361fb5..00000000000
--- a/server-tools/instance-manager/listener.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_LISTENER_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_LISTENER_H
-
-#include "thread_registry.h"
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-class Thread_registry;
-class User_map;
-
-/**
- Listener - a thread listening on sockets and spawning
- connection threads.
-*/
-
-class Listener: public Thread
-{
-public:
- Listener(Thread_registry *thread_registry_arg, User_map *user_map_arg);
-
-protected:
- virtual void run();
-
-private:
- static const int LISTEN_BACK_LOG_SIZE;
-
-private:
- Thread_info thread_info;
- Thread_registry *thread_registry;
- User_map *user_map;
-
- ulong total_connection_count;
-
- int sockets[2];
- int num_sockets;
- fd_set read_fds;
-
-private:
- void handle_new_mysql_connection(struct st_vio *vio);
- int create_tcp_socket();
- int create_unix_socket(struct sockaddr_un &unix_socket_address);
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_LISTENER_H
diff --git a/server-tools/instance-manager/log.cc b/server-tools/instance-manager/log.cc
deleted file mode 100644
index 9f276523e49..00000000000
--- a/server-tools/instance-manager/log.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "log.h"
-
-#include <my_global.h>
-#include <m_string.h>
-#include <my_sys.h>
-
-#include <stdarg.h>
-
-#include "portability.h" /* for vsnprintf() on Windows. */
-
-/*
- TODO:
- - add flexible header support
- - rewrite all fprintf with fwrite
- - think about using 'write' instead of fwrite/fprintf on POSIX systems
-*/
-
-/*
- Format log entry and write it to the given stream.
- SYNOPSIS
- log()
-*/
-
-static void log(FILE *file,const char *level_tag, const char *format,
- va_list args)
-{
- /*
- log() should be thread-safe; it implies that we either call fprintf()
- once per log(), or use flockfile()/funlockfile(). But flockfile() is
- POSIX, not ANSI C, so we try to vsnprintf the whole message to the
- stack, and if stack buffer is not enough, to malloced string. When
- message is formatted, it is fprintf()'ed to the file.
- */
-
- /* Format time like MYSQL_LOG does. */
- time_t now= time(0);
- struct tm bd_time; // broken-down time
- localtime_r(&now, &bd_time);
-
- char buff_date[128];
- sprintf(buff_date, "[%d/%lu] [%02d/%02d/%02d %02d:%02d:%02d] [%s] ",
- (int) getpid(),
- (unsigned long) pthread_self(),
- (int) bd_time.tm_year % 100,
- (int) bd_time.tm_mon + 1,
- (int) bd_time.tm_mday,
- (int) bd_time.tm_hour,
- (int) bd_time.tm_min,
- (int) bd_time.tm_sec,
- (const char *) level_tag);
- /* Format the message */
- char buff_stack[256];
-
- int n= vsnprintf(buff_stack, sizeof(buff_stack), format, args);
- /*
- return value of vsnprintf can vary, according to various standards;
- try to check all cases.
- */
- char *buff_msg= buff_stack;
- if (n < 0 || n == sizeof(buff_stack))
- {
- int size= sizeof(buff_stack) * 2;
- buff_msg= (char*) my_malloc(size, MYF(0));
- while (TRUE)
- {
- if (buff_msg == 0)
- {
- strmake(buff_stack, "log(): message is too big, my_malloc() failed",
- sizeof(buff_stack) - 1);
- buff_msg= buff_stack;
- break;
- }
- n = vsnprintf(buff_msg, size, format, args);
- if (n >= 0 && n < size)
- break;
- size*= 2;
- /* realloc() does unnecessary memcpy */
- my_free(buff_msg, 0);
- buff_msg= (char*) my_malloc(size, MYF(0));
- }
- }
- else if ((size_t) n > sizeof(buff_stack))
- {
- buff_msg= (char*) my_malloc(n + 1, MYF(0));
-#ifdef DBUG
- DBUG_ASSERT(n == vsnprintf(buff_msg, n + 1, format, args));
-#else
- vsnprintf(buff_msg, n + 1, format, args);
-#endif
- }
- fprintf(file, "%s%s\n", buff_date, buff_msg);
- if (buff_msg != buff_stack)
- my_free(buff_msg, 0);
-
- /* don't fflush() the file: buffering strategy is set in log_init() */
-}
-
-/**************************************************************************
- Logging: implementation of public interface.
-**************************************************************************/
-
-/*
- The function initializes logging sub-system.
-
- SYNOPSIS
- log_init()
-*/
-
-void log_init()
-{
- /*
- stderr is unbuffered by default; there is no good of line buffering,
- as all logging is performed linewise - so remove buffering from stdout
- also
- */
- setbuf(stdout, 0);
-}
-
-
-/*
- The function is intended to log error messages. It precedes a message
- with date, time and [ERROR] tag and print it to the stderr and stdout.
-
- We want to print it on stdout to be able to know in which context we got the
- error
-
- SYNOPSIS
- log_error()
- format [IN] format string
- ... [IN] arguments to format
-*/
-
-void log_error(const char *format, ...)
-{
- va_list args;
- va_start(args, format);
- log(stdout, "ERROR", format, args);
- fflush(stdout);
- log(stderr, "ERROR", format, args);
- fflush(stderr);
- va_end(args);
-}
-
-
-/*
- The function is intended to log information messages. It precedes
- a message with date, time and [INFO] tag and print it to the stdout.
-
- SYNOPSIS
- log_error()
- format [IN] format string
- ... [IN] arguments to format
-*/
-
-void log_info(const char *format, ...)
-{
- va_list args;
- va_start(args, format);
- log(stdout, "INFO", format, args);
- va_end(args);
-}
-
-/*
- The function prints information to the error log and eixt(1).
-
- SYNOPSIS
- die()
- format [IN] format string
- ... [IN] arguments to format
-*/
-
-void die(const char *format, ...)
-{
- va_list args;
- fprintf(stderr,"%s: ", my_progname);
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- fprintf(stderr, "\n");
- exit(1);
-}
diff --git a/server-tools/instance-manager/log.h b/server-tools/instance-manager/log.h
deleted file mode 100644
index e6c3b55c54c..00000000000
--- a/server-tools/instance-manager/log.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H
-
-/*
- Logging facilities.
-
- Two logging streams are supported: error log and info log.
- Additionally libdbug may be used for debug information output.
-
- ANSI C buffered I/O is used to perform logging.
-
- Logging is performed via stdout/stder, so one can reopen them to point to
- ordinary files. To initialize logging environment log_init() must be called.
-
- Rationale:
- - no MYSQL_LOG as it has BIN mode, and not easy to fetch from sql_class.h
- - no constructors/desctructors to make logging available all the time
-*/
-
-
-void log_init();
-
-
-void log_info(const char *format, ...)
-#ifdef __GNUC__
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
-
-
-void log_error(const char *format, ...)
-#ifdef __GNUC__
- __attribute__ ((format (printf, 1, 2)))
-#endif
- ;
-
-
-void die(const char *format, ...)
-#ifdef __GNUC__
- __attribute__ ((format (printf, 1, 2)))
-#endif
- ;
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H
diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc
deleted file mode 100644
index 792461e41a9..00000000000
--- a/server-tools/instance-manager/manager.cc
+++ /dev/null
@@ -1,526 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "manager.h"
-
-#include <my_global.h>
-#include <m_string.h>
-#include <my_sys.h>
-#include <thr_alarm.h>
-
-#include <signal.h>
-#ifndef __WIN__
-#include <sys/wait.h>
-#endif
-
-#include "exit_codes.h"
-#include "guardian.h"
-#include "instance_map.h"
-#include "listener.h"
-#include "mysql_manager_error.h"
-#include "mysqld_error.h"
-#include "log.h"
-#include "options.h"
-#include "priv.h"
-#include "thread_registry.h"
-#include "user_map.h"
-
-
-/**********************************************************************
- {{{ Platform-specific implementation.
-**********************************************************************/
-
-#ifndef __WIN__
-void set_signals(sigset_t *mask)
-{
- /* block signals */
- sigemptyset(mask);
- sigaddset(mask, SIGINT);
- sigaddset(mask, SIGTERM);
- sigaddset(mask, SIGPIPE);
- sigaddset(mask, SIGHUP);
- signal(SIGPIPE, SIG_IGN);
-
- /*
- We want this signal to be blocked in all theads but the signal
- one. It is needed for the thr_alarm subsystem to work.
- */
- sigaddset(mask,THR_SERVER_ALARM);
-
- /* all new threads will inherite this signal mask */
- pthread_sigmask(SIG_BLOCK, mask, NULL);
-
- /*
- In our case the signal thread also implements functions of alarm thread.
- Here we init alarm thread functionality. We suppose that we won't have
- more then 10 alarms at the same time.
- */
- init_thr_alarm(10);
-}
-#else
-
-bool have_signal;
-
-void onsignal(int signo)
-{
- have_signal= TRUE;
-}
-
-void set_signals(sigset_t *set)
-{
- signal(SIGINT, onsignal);
- signal(SIGTERM, onsignal);
- have_signal= FALSE;
-}
-
-int my_sigwait(const sigset_t *set, int *sig)
-{
- while (!have_signal)
- {
- Sleep(100);
- }
- return 0;
-}
-
-#endif
-
-/**********************************************************************
- }}}
-**********************************************************************/
-
-
-/**********************************************************************
- {{{ Implementation of checking the actual thread model.
-***********************************************************************/
-
-namespace { /* no-indent */
-
-class ThreadModelChecker: public Thread
-{
-public:
- ThreadModelChecker()
- :main_pid(getpid())
- { }
-
-public:
- inline bool is_linux_threads() const
- {
- return linux_threads;
- }
-
-protected:
- virtual void run()
- {
- linux_threads= main_pid != getpid();
- }
-
-private:
- pid_t main_pid;
- bool linux_threads;
-};
-
-bool check_if_linux_threads(bool *linux_threads)
-{
- ThreadModelChecker checker;
-
- if (checker.start() || checker.join())
- return TRUE;
-
- *linux_threads= checker.is_linux_threads();
-
- return FALSE;
-}
-
-}
-
-/**********************************************************************
- }}}
-***********************************************************************/
-
-
-/**********************************************************************
- Manager implementation
-***********************************************************************/
-
-Guardian *Manager::p_guardian;
-Instance_map *Manager::p_instance_map;
-Thread_registry *Manager::p_thread_registry;
-User_map *Manager::p_user_map;
-
-#ifndef __WIN__
-bool Manager::linux_threads;
-#endif // __WIN__
-
-
-/**
- Request shutdown of guardian and threads registered in Thread_registry.
-
- SYNOPSIS
- stop_all_threads()
-*/
-
-void Manager::stop_all_threads()
-{
- /*
- Let Guardian thread know that it should break it's processing cycle,
- once it wakes up.
- */
- p_guardian->request_shutdown();
-
- /* Stop all threads. */
- p_thread_registry->deliver_shutdown();
-
- /* Set error status in the thread registry. */
- p_thread_registry->set_error_status();
-}
-
-
-/**
- Initialize user map and load password file.
-
- SYNOPSIS
- init_user_map()
-
- RETURN
- FALSE on success
- TRUE on failure
-*/
-
-bool Manager::init_user_map(User_map *user_map)
-{
- int err_code;
- const char *err_msg;
-
- if (user_map->init())
- {
- log_error("Manager: can not initialize user list: out of memory.");
- return TRUE;
- }
-
- err_code= user_map->load(Options::Main::password_file_name, &err_msg);
-
- if (!err_code)
- return FALSE;
-
- if (err_code == ERR_PASSWORD_FILE_DOES_NOT_EXIST &&
- Options::Main::mysqld_safe_compatible)
- {
- /*
- The password file does not exist, but we are running in
- mysqld_safe-compatible mode. Continue, but complain in log.
- */
-
- log_info("Warning: password file does not exist, "
- "nobody will be able to connect to Instance Manager.");
-
- return FALSE;
- }
-
- log_error("Manager: %s.", (const char *) err_msg);
-
- return TRUE;
-}
-
-
-/**
- Main manager function.
-
- SYNOPSIS
- main()
-
- DESCRIPTION
- This is an entry point to the main instance manager process:
- start listener thread, write pid file and enter into signal handling.
- See also comments in mysqlmanager.cc to picture general Instance Manager
- architecture.
-
- RETURNS
- main() returns exit status (exit code).
-*/
-
-int Manager::main()
-{
- bool shutdown_complete= FALSE;
- pid_t manager_pid= getpid();
-
- log_info("Manager: initializing...");
-
-#ifndef __WIN__
- if (check_if_linux_threads(&linux_threads))
- {
- log_error("Manager: can not determine thread model.");
- return 1;
- }
-
- log_info("Manager: detected threads model: %s.",
- (const char *) (linux_threads ? "LINUX threads" : "POSIX threads"));
-#endif // __WIN__
-
- /*
- All objects created in the Manager object live as long as thread_registry
- lives, and thread_registry is alive until there are working threads.
-
- There are two main purposes of the Thread Registry:
- 1. Interrupt blocking I/O and signal condition variables in case of
- shutdown;
- 2. Wait for detached threads before shutting down the main thread.
-
- NOTE:
- 1. Handling shutdown can be done in more elegant manner by introducing
- Event (or Condition) object with support of logical operations.
- 2. Using Thread Registry to wait for detached threads is definitely not
- the best way, because when Thread Registry unregisters an thread, the
- thread is still alive. Accurate way to wait for threads to stop is
- not using detached threads and join all threads before shutdown.
- */
-
- Thread_registry thread_registry;
- User_map user_map;
- Instance_map instance_map;
- Guardian guardian(&thread_registry, &instance_map);
-
- Listener listener(&thread_registry, &user_map);
-
- p_instance_map= &instance_map;
- p_guardian= &guardian;
- p_thread_registry= &thread_registry;
- p_user_map= &user_map;
-
- /* Initialize instance map. */
-
- if (instance_map.init())
- {
- log_error("Manager: can not initialize instance list: out of memory.");
- return 1;
- }
-
- /* Initialize user db. */
-
- if (init_user_map(&user_map))
- return 1; /* logging has been already done. */
-
- /* Write Instance Manager pid file. */
-
- if (create_pid_file(Options::Main::pid_file_name, manager_pid))
- return 1; /* necessary logging has been already done. */
-
- log_info("Manager: pid file (%s) created.",
- (const char *) Options::Main::pid_file_name);
-
- /*
- Initialize signals and alarm-infrastructure.
-
- NOTE: To work nicely with LinuxThreads, the signal thread is the first
- thread in the process.
-
- NOTE: After init_thr_alarm() call it's possible to call thr_alarm()
- (from different threads), that results in sending ALARM signal to the
- alarm thread (which can be the main thread). That signal can interrupt
- blocking calls. In other words, a blocking call can be interrupted in
- the main thread after init_thr_alarm().
- */
-
- sigset_t mask;
- set_signals(&mask);
-
- /*
- Create the guardian thread. The newly started thread will block until
- we actually load instances.
-
- NOTE: Guardian should be shutdown first. Only then all other threads
- can be stopped. This should be done in this order because the guardian
- is responsible for shutting down all the guarded instances, and this
- is a long operation.
-
- NOTE: Guardian uses thr_alarm() when detects the current state of an
- instance (is_running()), but this does not interfere with
- flush_instances() call later in the code, because until
- flush_instances() completes in the main thread, Guardian thread is not
- permitted to process instances. And before flush_instances() has
- completed, there are no instances to guard.
- */
-
- if (guardian.start(Thread::DETACHED))
- {
- log_error("Manager: can not start Guardian thread.");
- goto err;
- }
-
- /* Load instances. */
-
- if (Manager::flush_instances())
- {
- log_error("Manager: can not init instances repository.");
- stop_all_threads();
- goto err;
- }
-
- /* Initialize the Listener. */
-
- if (listener.start(Thread::DETACHED))
- {
- log_error("Manager: can not start Listener thread.");
- stop_all_threads();
- goto err;
- }
-
- /*
- After the list of guarded instances have been initialized,
- Guardian should start them.
- */
-
- guardian.ping();
-
- /* Main loop. */
-
- log_info("Manager: started.");
-
- while (!shutdown_complete)
- {
- int signo;
- int status= 0;
-
- if ((status= my_sigwait(&mask, &signo)) != 0)
- {
- log_error("Manager: sigwait() failed");
- stop_all_threads();
- goto err;
- }
-
- /*
- The general idea in this loop is the following:
- - we are waiting for SIGINT, SIGTERM -- signals that mean we should
- shutdown;
- - as shutdown signal is caught, we stop Guardian thread (by calling
- Guardian::request_shutdown());
- - as Guardian is stopped, it sends SIGTERM to this thread
- (by calling Thread_registry::request_shutdown()), so that the
- my_sigwait() above returns;
- - as we catch the second SIGTERM, we send signals to all threads
- registered in Thread_registry (by calling
- Thread_registry::deliver_shutdown()) and waiting for threads to stop;
- */
-
-#ifndef __WIN__
-/*
- On some Darwin kernels SIGHUP is delivered along with most
- signals. This is why we skip it's processing on these
- platforms. For more details and test program see
- Bug #14164 IM tests fail on MacOS X (powermacg5)
-*/
-#ifdef IGNORE_SIGHUP_SIGQUIT
- if (SIGHUP == signo)
- continue;
-#endif
- if (THR_SERVER_ALARM == signo)
- process_alarm(signo);
- else
-#endif
- {
- log_info("Manager: got shutdown signal.");
-
- if (!guardian.is_stopped())
- {
- guardian.request_shutdown();
- }
- else
- {
- thread_registry.deliver_shutdown();
- shutdown_complete= TRUE;
- }
- }
- }
-
- log_info("Manager: finished.");
-
-err:
- /* delete the pid file */
- my_delete(Options::Main::pid_file_name, MYF(0));
-
-#ifndef __WIN__
- /* free alarm structures */
- end_thr_alarm(1);
-#endif
-
- return thread_registry.get_error_status() ? 1 : 0;
-}
-
-
-/**
- Re-read instance configuration file.
-
- SYNOPSIS
- flush_instances()
-
- DESCRIPTION
- This function will:
- - clear the current list of instances. This removes both
- running and stopped instances.
- - load a new instance configuration from the file.
- - pass on the new map to the guardian thread: it will start
- all instances that are marked `guarded' and not yet started.
-
- Note, as the check whether an instance is started is currently
- very simple (returns TRUE if there is a MySQL server running
- at the given port), this function has some peculiar
- side-effects:
- * if the port number of a running instance was changed, the
- old instance is forgotten, even if it was running. The new
- instance will be started at the new port.
- * if the configuration was changed in a way that two
- instances swapped their port numbers, the guardian thread
- will not notice that and simply report that both instances
- are configured successfully and running.
-
- In order to avoid such side effects one should never call
- FLUSH INSTANCES without prior stop of all running instances.
-
- RETURN
- 0 On success
- ER_OUT_OF_RESOURCES Not enough resources to complete the operation
- ER_THERE_IS_ACTIVE_INSTACE If there is an active instance
-*/
-
-int Manager::flush_instances()
-{
- p_instance_map->lock();
-
- if (p_instance_map->is_there_active_instance())
- {
- p_instance_map->unlock();
- return ER_THERE_IS_ACTIVE_INSTACE;
- }
-
- if (p_instance_map->reset())
- {
- p_instance_map->unlock();
- return ER_OUT_OF_RESOURCES;
- }
-
- if (p_instance_map->load())
- {
- p_instance_map->unlock();
-
- /* Don't init guardian if we failed to load instances. */
- return ER_OUT_OF_RESOURCES;
- }
-
- get_guardian()->init();
- get_guardian()->ping();
-
- p_instance_map->unlock();
-
- return 0;
-}
diff --git a/server-tools/instance-manager/manager.h b/server-tools/instance-manager/manager.h
deleted file mode 100644
index e6956884603..00000000000
--- a/server-tools/instance-manager/manager.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-#include <my_global.h>
-
-class Guardian;
-class Instance_map;
-class Thread_registry;
-class User_map;
-
-class Manager
-{
-public:
- static int main();
-
- static int flush_instances();
-
-public:
- /**
- These methods return a non-NULL value only for the duration
- of main().
- */
- static Instance_map *get_instance_map() { return p_instance_map; }
- static Guardian *get_guardian() { return p_guardian; }
- static Thread_registry *get_thread_registry() { return p_thread_registry; }
- static User_map *get_user_map() { return p_user_map; }
-
-public:
-#ifndef __WIN__
- static bool is_linux_threads() { return linux_threads; }
-#endif // __WIN__
-
-private:
- static void stop_all_threads();
- static bool init_user_map(User_map *user_map);
-
-private:
- static Guardian *p_guardian;
- static Instance_map *p_instance_map;
- static Thread_registry *p_thread_registry;
- static User_map *p_user_map;
-
-#ifndef __WIN__
- /*
- This flag is set if Instance Manager is running on the system using
- LinuxThreads.
- */
- static bool linux_threads;
-#endif // __WIN__
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
diff --git a/server-tools/instance-manager/messages.cc b/server-tools/instance-manager/messages.cc
deleted file mode 100644
index 201ebfd62fc..00000000000
--- a/server-tools/instance-manager/messages.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "messages.h"
-
-#include <my_global.h>
-#include <mysql_com.h>
-
-#include "mysqld_error.h"
-#include "mysql_manager_error.h"
-
-
-static const char *mysqld_error_message(unsigned sql_errno)
-{
- switch (sql_errno) {
- case ER_HANDSHAKE_ERROR:
- return "Bad handshake";
- case ER_OUT_OF_RESOURCES:
- return "Out of memory; Check if mysqld or some other process"
- " uses all available memory. If not you may have to use"
- " 'ulimit' to allow mysqld to use more memory or you can"
- " add more swap space";
- case ER_ACCESS_DENIED_ERROR:
- return "Access denied. Bad username/password pair";
- case ER_NOT_SUPPORTED_AUTH_MODE:
- return "Client does not support authentication protocol requested by"
- " server; consider upgrading MySQL client";
- case ER_UNKNOWN_COM_ERROR:
- return "Unknown command";
- case ER_SYNTAX_ERROR:
- return "You have an error in your command syntax. Check the manual that"
- " corresponds to your MySQL Instance Manager version for the right"
- " syntax to use";
- case ER_BAD_INSTANCE_NAME:
- return "Unknown instance name";
- case ER_INSTANCE_IS_NOT_STARTED:
- return "Cannot stop instance. Perhaps the instance is not started, or was"
- " started manually, so IM cannot find the pidfile.";
- case ER_INSTANCE_ALREADY_STARTED:
- return "The instance is already started";
- case ER_CANNOT_START_INSTANCE:
- return "Cannot start instance. Possible reasons are wrong instance options"
- " or resources shortage";
- case ER_OFFSET_ERROR:
- return "Cannot read negative number of bytes";
- case ER_STOP_INSTANCE:
- return "Cannot stop instance";
- case ER_READ_FILE:
- return "Cannot read requested part of the logfile";
- case ER_NO_SUCH_LOG:
- return "The instance has no such log enabled";
- case ER_OPEN_LOGFILE:
- return "Cannot open log file";
- case ER_GUESS_LOGFILE:
- return "Cannot guess the log filename. Try specifying full log name"
- " in the instance options";
- case ER_ACCESS_OPTION_FILE:
- return "Cannot open the option file to edit. Check permissions";
- case ER_DROP_ACTIVE_INSTANCE:
- return "Cannot drop an active instance. You should stop it first";
- case ER_CREATE_EXISTING_INSTANCE:
- return "Instance already exists";
- case ER_INSTANCE_MISCONFIGURED:
- return "Instance is misconfigured. Cannot start it";
- case ER_MALFORMED_INSTANCE_NAME:
- return "Malformed instance name.";
- case ER_INSTANCE_IS_ACTIVE:
- return "The instance is active. Stop the instance first";
- case ER_THERE_IS_ACTIVE_INSTACE:
- return "At least one instance is active. Stop all instances first";
- case ER_INCOMPATIBLE_OPTION:
- return "Instance Manager-specific options are prohibited from being used "
- "in the configuration of mysqld-compatible instances";
- case ER_CONF_FILE_DOES_NOT_EXIST:
- return "Configuration file does not exist";
- default:
- DBUG_ASSERT(0);
- return 0;
- }
-}
-
-
-const char *message(unsigned sql_errno)
-{
- return mysqld_error_message(sql_errno);
-}
-
-
-const char *errno_to_sqlstate(unsigned sql_errno)
-{
- return mysql_errno_to_sqlstate(sql_errno);
-}
diff --git a/server-tools/instance-manager/mysql_connection.cc b/server-tools/instance-manager/mysql_connection.cc
deleted file mode 100644
index 12ea0a3ea5a..00000000000
--- a/server-tools/instance-manager/mysql_connection.cc
+++ /dev/null
@@ -1,376 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "mysql_connection.h"
-
-#include <m_string.h>
-#include <m_string.h>
-#include <my_global.h>
-#include <mysql.h>
-#include <my_sys.h>
-#include <violite.h>
-
-#include "command.h"
-#include "log.h"
-#include "messages.h"
-#include "mysqld_error.h"
-#include "mysql_manager_error.h"
-#include "parse.h"
-#include "priv.h"
-#include "protocol.h"
-#include "thread_registry.h"
-#include "user_map.h"
-
-
-Mysql_connection::Mysql_connection(Thread_registry *thread_registry_arg,
- User_map *user_map_arg,
- struct st_vio *vio_arg, ulong
- connection_id_arg)
- :vio(vio_arg),
- connection_id(connection_id_arg),
- thread_registry(thread_registry_arg),
- user_map(user_map_arg)
-{
-}
-
-
-/*
- NET subsystem requieres its user to provide my_net_local_init extern
- C function (exactly as declared below). my_net_local_init is called by
- my_net_init and is supposed to set NET controlling variables.
- See also priv.h for variables description.
-*/
-
-C_MODE_START
-
-void my_net_local_init(NET *net)
-{
- net->max_packet= net_buffer_length;
- my_net_set_read_timeout(net, (uint)net_read_timeout);
- my_net_set_write_timeout(net, (uint)net_write_timeout);
- net->retry_count= net_retry_count;
- net->max_packet_size= max_allowed_packet;
-}
-
-C_MODE_END
-
-/*
- Unused stub hook required for linking the client API.
-*/
-
-C_MODE_START
-
-void slave_io_thread_detach_vio()
-{
-}
-
-C_MODE_END
-
-
-/*
- Every resource, which we can fail to acquire, is allocated in init().
- This function is complementary to cleanup().
-*/
-
-bool Mysql_connection::init()
-{
- /* Allocate buffers for network I/O */
- if (my_net_init(&net, vio))
- return TRUE;
-
- net.return_status= &status;
-
- /* Initialize random number generator */
- {
- ulong seed1= (ulong) &rand_st + rand();
- ulong seed2= (ulong) rand() + (ulong) time(0);
- randominit(&rand_st, seed1, seed2);
- }
-
- /* Fill scramble - server's random message used for handshake */
- create_random_string(scramble, SCRAMBLE_LENGTH, &rand_st);
-
- /* We don't support transactions, every query is atomic */
- status= SERVER_STATUS_AUTOCOMMIT;
-
- thread_registry->register_thread(&thread_info);
-
- return FALSE;
-}
-
-
-void Mysql_connection::cleanup()
-{
- net_end(&net);
- thread_registry->unregister_thread(&thread_info);
-}
-
-
-Mysql_connection::~Mysql_connection()
-{
- /* vio_delete closes the socket if necessary */
- vio_delete(vio);
-}
-
-
-void Mysql_connection::main()
-{
- log_info("Connection %lu: accepted.", (unsigned long) connection_id);
-
- if (check_connection())
- {
- log_info("Connection %lu: failed to authorize the user.",
- (unsigned long) connection_id);
-
- return;
- }
-
- log_info("Connection %lu: the user was authorized successfully.",
- (unsigned long) connection_id);
-
- vio_keepalive(vio, TRUE);
-
- while (!net.error && net.vio && !thread_registry->is_shutdown())
- {
- if (do_command())
- break;
- }
-}
-
-
-int Mysql_connection::check_connection()
-{
- ulong pkt_len=0; // to hold client reply length
-
- /* buffer for the first packet */ /* packet contains: */
- uchar buff[MAX_VERSION_LENGTH + 1 + // server version, 0-ended
- 4 + // connection id
- SCRAMBLE_LENGTH + 2 + // scramble (in 2 pieces)
- 18]; // server variables: flags,
- // charset number, status,
- uchar *pos= buff;
- ulong server_flags;
-
- memcpy(pos, mysqlmanager_version.str, mysqlmanager_version.length + 1);
- pos+= mysqlmanager_version.length + 1;
-
- int4store((uchar*) pos, connection_id);
- pos+= 4;
-
- /*
- Old clients does not understand long scrambles, but can ignore packet
- tail: that's why first part of the scramble is placed here, and second
- part at the end of packet (even though we don't support old clients,
- we must follow standard packet format.)
- */
- memcpy(pos, scramble, SCRAMBLE_LENGTH_323);
- pos+= SCRAMBLE_LENGTH_323;
- *pos++= '\0';
-
- server_flags= CLIENT_LONG_FLAG | CLIENT_PROTOCOL_41 |
- CLIENT_SECURE_CONNECTION;
-
- /*
- 18-bytes long section for various flags/variables
-
- Every flag occupies a bit in first half of ulong; int2store will
- gracefully pick up all flags.
- */
- int2store(pos, server_flags);
- pos+= 2;
- *pos++= (char) default_charset_info->number; // global mysys variable
- int2store(pos, status); // connection status
- pos+= 2;
- bzero(pos, 13); // not used now
- pos+= 13;
-
- /* second part of the scramble, null-terminated */
- memcpy(pos, scramble + SCRAMBLE_LENGTH_323,
- SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1);
- pos+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1;
-
- /* write connection message and read reply */
- enum { MIN_HANDSHAKE_SIZE= 2 };
- if (net_write_command(&net, protocol_version, (uchar*) "", 0,
- buff, pos - buff) ||
- (pkt_len= my_net_read(&net)) == packet_error ||
- pkt_len < MIN_HANDSHAKE_SIZE)
- {
- net_send_error(&net, ER_HANDSHAKE_ERROR);
- return 1;
- }
-
- client_capabilities= uint2korr(net.read_pos);
- if (!(client_capabilities & CLIENT_PROTOCOL_41))
- {
- net_send_error_323(&net, ER_NOT_SUPPORTED_AUTH_MODE);
- return 1;
- }
- client_capabilities|= ((ulong) uint2korr(net.read_pos + 2)) << 16;
-
- pos= net.read_pos + 32;
-
- /* At least one byte for username and one byte for password */
- if (pos >= net.read_pos + pkt_len + 2)
- {
- /*TODO add user and password handling in error messages*/
- net_send_error(&net, ER_HANDSHAKE_ERROR);
- return 1;
- }
-
- const char *user= (char*) pos;
- const char *password= strend(user)+1;
- ulong password_len= *password++;
- LEX_STRING user_name= { (char *) user, password - user - 2 };
-
- if (password_len != SCRAMBLE_LENGTH)
- {
- net_send_error(&net, ER_ACCESS_DENIED_ERROR);
- return 1;
- }
- if (user_map->authenticate(&user_name, password, scramble))
- {
- net_send_error(&net, ER_ACCESS_DENIED_ERROR);
- return 1;
- }
- net_send_ok(&net, connection_id, NULL);
- return 0;
-}
-
-
-int Mysql_connection::do_command()
-{
- char *packet;
- ulong packet_length;
-
- /* We start to count packets from 0 for each new command */
- net.pkt_nr= 0;
-
- if ((packet_length=my_net_read(&net)) == packet_error)
- {
- /* Check if we can continue without closing the connection */
- if (net.error != 3) // what is 3 - find out
- return 1;
- if (thread_registry->is_shutdown())
- return 1;
- net_send_error(&net, net.last_errno);
- net.error= 0;
- return 0;
- }
- else
- {
- if (thread_registry->is_shutdown())
- return 1;
- packet= (char*) net.read_pos;
- enum enum_server_command command= (enum enum_server_command)
- (uchar) *packet;
- log_info("Connection %lu: received packet (length: %lu; command: %d).",
- (unsigned long) connection_id,
- (unsigned long) packet_length,
- (int) command);
-
- return dispatch_command(command, packet + 1);
- }
-}
-
-int Mysql_connection::dispatch_command(enum enum_server_command command,
- const char *packet)
-{
- switch (command) {
- case COM_QUIT: // client exit
- log_info("Connection %lu: received QUIT command.",
- (unsigned long) connection_id);
- return 1;
-
- case COM_PING:
- log_info("Connection %lu: received PING command.",
- (unsigned long) connection_id);
- net_send_ok(&net, connection_id, NULL);
- return 0;
-
- case COM_QUERY:
- {
- log_info("Connection %lu: received QUERY command: '%s'.",
- (unsigned long) connection_id,
- (const char *) packet);
-
- if (Command *com= parse_command(packet))
- {
- int res= 0;
-
- log_info("Connection %lu: query parsed successfully.",
- (unsigned long) connection_id);
-
- res= com->execute(&net, connection_id);
- delete com;
- if (!res)
- {
- log_info("Connection %lu: query executed successfully",
- (unsigned long) connection_id);
- }
- else
- {
- log_info("Connection %lu: can not execute query (error: %d).",
- (unsigned long) connection_id,
- (int) res);
-
- net_send_error(&net, res);
- }
- }
- else
- {
- log_error("Connection %lu: can not parse query: out ot resources.",
- (unsigned long) connection_id);
-
- net_send_error(&net,ER_OUT_OF_RESOURCES);
- }
-
- return 0;
- }
-
- default:
- log_info("Connection %lu: received unsupported command (%d).",
- (unsigned long) connection_id,
- (int) command);
-
- net_send_error(&net, ER_UNKNOWN_COM_ERROR);
- return 0;
- }
-
- return 0; /* Just to make compiler happy. */
-}
-
-
-void Mysql_connection::run()
-{
- if (init())
- log_error("Connection %lu: can not init handler.",
- (unsigned long) connection_id);
- else
- {
- main();
- cleanup();
- }
-
- delete this;
-}
-
-/*
- vim: fdm=marker
-*/
diff --git a/server-tools/instance-manager/mysql_connection.h b/server-tools/instance-manager/mysql_connection.h
deleted file mode 100644
index 56bbf76e146..00000000000
--- a/server-tools/instance-manager/mysql_connection.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_CONNECTION_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_CONNECTION_H
-
-#include "thread_registry.h"
-#include <mysql_com.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-struct st_vio;
-class User_map;
-
-/*
- MySQL connection - handle one connection with mysql command line client
- See also comments in mysqlmanager.cc to picture general Instance Manager
- architecture.
- We use conventional technique to work with classes without exceptions:
- class acquires all vital resource in init(); Thus if init() succeed,
- a user must call cleanup(). All other methods are valid only between
- init() and cleanup().
-*/
-
-class Mysql_connection: public Thread
-{
-public:
- Mysql_connection(Thread_registry *thread_registry_arg,
- User_map *user_map_arg,
- struct st_vio *vio_arg,
- ulong connection_id_arg);
- virtual ~Mysql_connection();
-
-protected:
- virtual void run();
-
-private:
- struct st_vio *vio;
- ulong connection_id;
- Thread_info thread_info;
- Thread_registry *thread_registry;
- User_map *user_map;
- NET net;
- struct rand_struct rand_st;
- char scramble[SCRAMBLE_LENGTH + 1];
- uint status;
- ulong client_capabilities;
-private:
- /* The main loop implementation triad */
- bool init();
- void main();
- void cleanup();
-
- /* Names are conventionally the same as in mysqld */
- int check_connection();
- int do_command();
- int dispatch_command(enum enum_server_command command, const char *text);
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_CONNECTION_H
diff --git a/server-tools/instance-manager/mysql_manager_error.h b/server-tools/instance-manager/mysql_manager_error.h
deleted file mode 100644
index e50e5d24f6d..00000000000
--- a/server-tools/instance-manager/mysql_manager_error.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_MANAGER_ERROR_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_MANAGER_ERROR_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Definefile for instance manager error messagenumbers */
-
-#define ER_BAD_INSTANCE_NAME 3000
-#define ER_INSTANCE_IS_NOT_STARTED 3001
-#define ER_INSTANCE_ALREADY_STARTED 3002
-#define ER_CANNOT_START_INSTANCE 3003
-#define ER_STOP_INSTANCE 3004
-#define ER_NO_SUCH_LOG 3005
-#define ER_OPEN_LOGFILE 3006
-#define ER_GUESS_LOGFILE 3007
-#define ER_ACCESS_OPTION_FILE 3008
-#define ER_OFFSET_ERROR 3009
-#define ER_READ_FILE 3010
-#define ER_DROP_ACTIVE_INSTANCE 3011
-#define ER_CREATE_EXISTING_INSTANCE 3012
-#define ER_INSTANCE_MISCONFIGURED 3013
-#define ER_MALFORMED_INSTANCE_NAME 3014
-#define ER_INSTANCE_IS_ACTIVE 3015
-#define ER_THERE_IS_ACTIVE_INSTACE 3016
-#define ER_INCOMPATIBLE_OPTION 3017
-#define ER_CONF_FILE_DOES_NOT_EXIST 3018
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_MANAGER_ERROR_H */
diff --git a/server-tools/instance-manager/mysqlmanager.cc b/server-tools/instance-manager/mysqlmanager.cc
deleted file mode 100644
index 276d1ca3b49..00000000000
--- a/server-tools/instance-manager/mysqlmanager.cc
+++ /dev/null
@@ -1,232 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_dir.h>
-#include <my_sys.h>
-
-#include <string.h>
-
-#ifndef __WIN__
-#include <pwd.h>
-#include <grp.h>
-#endif
-
-#include "angel.h"
-#include "log.h"
-#include "manager.h"
-#include "options.h"
-#include "user_management_commands.h"
-
-#ifdef __WIN__
-#include "IMService.h"
-#endif
-
-
-/*
- Instance Manager consists of two processes: the angel process (IM-angel),
- and the manager process (IM-main). Responsibilities of IM-angel is to
- monitor IM-main, and restart it in case of failure/shutdown. IM-angel is
- started only if startup option '--run-as-service' is provided.
-
- IM-main consists of several subsystems (thread sets):
-
- - the signal handling thread
-
- The signal thread handles user signals and propagates them to the
- other threads. All other threads are accounted in the signal handler
- thread Thread Registry.
-
- - the listener
-
- The listener listens to all sockets. There is a listening socket for
- each subsystem (TCP/IP, UNIX socket).
-
- - mysql subsystem
-
- Instance Manager acts like an ordinary MySQL Server, but with very
- restricted command set. Each MySQL client connection is handled in a
- separate thread. All MySQL client connections threads constitute
- mysql subsystem.
-*/
-
-static int main_impl(int argc, char *argv[]);
-
-#ifndef __WIN__
-static struct passwd *check_user();
-static bool switch_user();
-#endif
-
-
-/************************************************************************/
-/**
- The entry point.
-*************************************************************************/
-
-int main(int argc, char *argv[])
-{
- int return_value;
-
- puts("\n"
- "WARNING: This program is deprecated and will be removed in 6.0.\n");
-
- /* Initialize. */
-
- MY_INIT(argv[0]);
- log_init();
- umask(0117);
- srand((uint) time(0));
-
- /* Main function. */
-
- log_info("IM: started.");
-
- return_value= main_impl(argc, argv);
-
- log_info("IM: finished.");
-
- /* Cleanup. */
-
- Options::cleanup();
- my_end(0);
-
- return return_value;
-}
-
-
-/************************************************************************/
-/**
- Instance Manager main functionality.
-*************************************************************************/
-
-int main_impl(int argc, char *argv[])
-{
- int rc;
-
- if ((rc= Options::load(argc, argv)))
- return rc;
-
- if (Options::User_management::cmd)
- return Options::User_management::cmd->execute();
-
-#ifndef __WIN__
-
- if (switch_user())
- return 1;
-
- return Options::Daemon::run_as_service ?
- Angel::main() :
- Manager::main();
-
-#else
-
- return Options::Service::stand_alone ?
- Manager::main() :
- IMService::main();
-
-#endif
-}
-
-/**************************************************************************
- OS-specific functions implementation.
-**************************************************************************/
-
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
-
-/************************************************************************/
-/**
- Change to run as another user if started with --user.
-*************************************************************************/
-
-static struct passwd *check_user()
-{
- const char *user= Options::Daemon::user;
- struct passwd *user_info;
- uid_t user_id= geteuid();
-
- /* Don't bother if we aren't superuser */
- if (user_id)
- {
- if (user)
- {
- /* Don't give a warning, if real user is same as given with --user */
- user_info= getpwnam(user);
- if ((!user_info || user_id != user_info->pw_uid))
- log_info("One can only use the --user switch if running as root\n");
- }
- return NULL;
- }
- if (!user)
- {
- log_info("You are running mysqlmanager as root! This might introduce security problems. It is safer to use --user option istead.\n");
- return NULL;
- }
- if (!strcmp(user, "root"))
- return NULL; /* Avoid problem with dynamic libraries */
- if (!(user_info= getpwnam(user)))
- {
- /* Allow a numeric uid to be used */
- const char *pos;
- for (pos= user; my_isdigit(default_charset_info, *pos); pos++)
- {}
- if (*pos) /* Not numeric id */
- goto err;
- if (!(user_info= getpwuid(atoi(user))))
- goto err;
- else
- return user_info;
- }
- else
- return user_info;
-
-err:
- log_error("Can not start under user '%s'.",
- (const char *) user);
- return NULL;
-}
-
-
-/************************************************************************/
-/**
- Switch user.
-*************************************************************************/
-
-static bool switch_user()
-{
- struct passwd *user_info= check_user();
-
- if (!user_info)
- return FALSE;
-
-#ifdef HAVE_INITGROUPS
- initgroups(Options::Daemon::user, user_info->pw_gid);
-#endif
-
- if (setgid(user_info->pw_gid) == -1)
- {
- log_error("setgid() failed");
- return TRUE;
- }
-
- if (setuid(user_info->pw_uid) == -1)
- {
- log_error("setuid() failed");
- return TRUE;
- }
-
- return FALSE;
-}
-
-#endif
diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc
deleted file mode 100644
index ebca593bb03..00000000000
--- a/server-tools/instance-manager/options.cc
+++ /dev/null
@@ -1,558 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "options.h"
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <my_getopt.h>
-#include <mysql_com.h>
-
-#include "exit_codes.h"
-#include "log.h"
-#include "portability.h"
-#include "priv.h"
-#include "user_management_commands.h"
-
-#define QUOTE2(x) #x
-#define QUOTE(x) QUOTE2(x)
-
-#ifdef __WIN__
-
-/* Define holders for default values. */
-
-static char win_dflt_config_file_name[FN_REFLEN];
-static char win_dflt_password_file_name[FN_REFLEN];
-static char win_dflt_pid_file_name[FN_REFLEN];
-
-static char win_dflt_mysqld_path[FN_REFLEN];
-
-/* Define and initialize Windows-specific options. */
-
-my_bool Options::Service::install_as_service;
-my_bool Options::Service::remove_service;
-my_bool Options::Service::stand_alone;
-
-const char *Options::Main::config_file= win_dflt_config_file_name;
-const char *Options::Main::password_file_name= win_dflt_password_file_name;
-const char *Options::Main::pid_file_name= win_dflt_pid_file_name;
-
-const char *Options::Main::default_mysqld_path= win_dflt_mysqld_path;
-
-static int setup_windows_defaults();
-
-#else /* UNIX */
-
-/* Define and initialize UNIX-specific options. */
-
-my_bool Options::Daemon::run_as_service= FALSE;
-const char *Options::Daemon::log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME);
-const char *Options::Daemon::user= NULL; /* No default value */
-const char *Options::Daemon::angel_pid_file_name= NULL;
-
-const char *Options::Main::config_file= QUOTE(DEFAULT_CONFIG_FILE);
-const char *
-Options::Main::password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME);
-const char *Options::Main::pid_file_name= QUOTE(DEFAULT_PID_FILE_NAME);
-const char *Options::Main::socket_file_name= QUOTE(DEFAULT_SOCKET_FILE_NAME);
-
-const char *Options::Main::default_mysqld_path= QUOTE(DEFAULT_MYSQLD_PATH);
-
-#endif
-
-/* Remember if the config file was forced. */
-
-bool Options::Main::is_forced_default_file= FALSE;
-
-/* Define and initialize common options. */
-
-const char *Options::Main::bind_address= NULL; /* No default value */
-uint Options::Main::monitoring_interval= DEFAULT_MONITORING_INTERVAL;
-uint Options::Main::port_number= DEFAULT_PORT;
-my_bool Options::Main::mysqld_safe_compatible= FALSE;
-const char **Options::default_directories= NULL;
-
-/* Options::User_management */
-
-char *Options::User_management::user_name= NULL;
-char *Options::User_management::password= NULL;
-
-User_management_cmd *Options::User_management::cmd= NULL;
-
-/* Private members. */
-
-char **Options::saved_argv= NULL;
-
-#ifndef DBUG_OFF
-const char *Options::Debug::config_str= "d:t:i:O,im.trace";
-#endif
-
-static const char * const ANGEL_PID_FILE_SUFFIX= ".angel.pid";
-static const int ANGEL_PID_FILE_SUFFIX_LEN= (uint) strlen(ANGEL_PID_FILE_SUFFIX);
-
-/*
- List of options, accepted by the instance manager.
- List must be closed with empty option.
-*/
-
-enum options {
- OPT_USERNAME= 'u',
- OPT_PASSWORD= 'p',
- OPT_LOG= 256,
- OPT_PID_FILE,
- OPT_SOCKET,
- OPT_PASSWORD_FILE,
- OPT_MYSQLD_PATH,
-#ifdef __WIN__
- OPT_INSTALL_SERVICE,
- OPT_REMOVE_SERVICE,
- OPT_STAND_ALONE,
-#else
- OPT_RUN_AS_SERVICE,
- OPT_USER,
- OPT_ANGEL_PID_FILE,
-#endif
- OPT_MONITORING_INTERVAL,
- OPT_PORT,
- OPT_WAIT_TIMEOUT,
- OPT_BIND_ADDRESS,
- OPT_PRINT_PASSWORD_LINE,
- OPT_ADD_USER,
- OPT_DROP_USER,
- OPT_EDIT_USER,
- OPT_CLEAN_PASSWORD_FILE,
- OPT_CHECK_PASSWORD_FILE,
- OPT_LIST_USERS,
- OPT_MYSQLD_SAFE_COMPATIBLE
-};
-
-static struct my_option my_long_options[] =
-{
- { "help", '?', "Display this help and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "add-user", OPT_ADD_USER,
- "Add a user to the password file",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
-#ifndef __WIN__
- { "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.",
- (uchar* *) &Options::Daemon::angel_pid_file_name,
- (uchar* *) &Options::Daemon::angel_pid_file_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-#endif
-
- { "bind-address", OPT_BIND_ADDRESS, "Bind address to use for connection.",
- (uchar* *) &Options::Main::bind_address,
- (uchar* *) &Options::Main::bind_address,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "check-password-file", OPT_CHECK_PASSWORD_FILE,
- "Check the password file for consistency",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "clean-password-file", OPT_CLEAN_PASSWORD_FILE,
- "Clean the password file",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
-#ifndef DBUG_OFF
- {"debug", '#', "Debug log.",
- (uchar* *) &Options::Debug::config_str,
- (uchar* *) &Options::Debug::config_str,
- 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-
- { "default-mysqld-path", OPT_MYSQLD_PATH, "Where to look for MySQL"
- " Server binary.",
- (uchar* *) &Options::Main::default_mysqld_path,
- (uchar* *) &Options::Main::default_mysqld_path,
- 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "drop-user", OPT_DROP_USER,
- "Drop existing user from the password file",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "edit-user", OPT_EDIT_USER,
- "Edit existing user in the password file",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
-#ifdef __WIN__
- { "install", OPT_INSTALL_SERVICE, "Install as system service.",
- (uchar* *) &Options::Service::install_as_service,
- (uchar* *) &Options::Service::install_as_service,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
-#endif
-
- { "list-users", OPT_LIST_USERS,
- "Print out a list of registered users",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
-#ifndef __WIN__
- { "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
- (uchar* *) &Options::Daemon::log_file_name,
- (uchar* *) &Options::Daemon::log_file_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-#endif
-
- { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor"
- " instances in seconds.",
- (uchar* *) &Options::Main::monitoring_interval,
- (uchar* *) &Options::Main::monitoring_interval,
- 0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL,
- 0, 0, 0, 0, 0 },
-
- { "mysqld-safe-compatible", OPT_MYSQLD_SAFE_COMPATIBLE,
- "Start Instance Manager in mysqld_safe compatible manner",
- (uchar* *) &Options::Main::mysqld_safe_compatible,
- (uchar* *) &Options::Main::mysqld_safe_compatible,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
-
- { "print-password-line", OPT_PRINT_PASSWORD_LINE,
- "Print out a user entry as a line for the password file and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "password", OPT_PASSWORD, "Password to update the password file",
- (uchar* *) &Options::User_management::password,
- (uchar* *) &Options::User_management::password,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "password-file", OPT_PASSWORD_FILE,
- "Look for Instance Manager users and passwords here.",
- (uchar* *) &Options::Main::password_file_name,
- (uchar* *) &Options::Main::password_file_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "pid-file", OPT_PID_FILE, "Pid file to use.",
- (uchar* *) &Options::Main::pid_file_name,
- (uchar* *) &Options::Main::pid_file_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "port", OPT_PORT, "Port number to use for connections",
- (uchar* *) &Options::Main::port_number,
- (uchar* *) &Options::Main::port_number,
- 0, GET_UINT, REQUIRED_ARG, DEFAULT_PORT, 0, 0, 0, 0, 0 },
-
-#ifdef __WIN__
- { "remove", OPT_REMOVE_SERVICE, "Remove system service.",
- (uchar* *) &Options::Service::remove_service,
- (uchar* *) &Options::Service::remove_service,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0},
-#else
- { "run-as-service", OPT_RUN_AS_SERVICE,
- "Daemonize and start angel process.",
- (uchar* *) &Options::Daemon::run_as_service,
- 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
-#endif
-
-#ifndef __WIN__
- { "socket", OPT_SOCKET, "Socket file to use for connection.",
- (uchar* *) &Options::Main::socket_file_name,
- (uchar* *) &Options::Main::socket_file_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-#endif
-
-#ifdef __WIN__
- { "standalone", OPT_STAND_ALONE, "Run the application in stand alone mode.",
- (uchar* *) &Options::Service::stand_alone,
- (uchar* *) &Options::Service::stand_alone,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0},
-#else
- { "user", OPT_USER, "Username to start mysqlmanager",
- (uchar* *) &Options::Daemon::user,
- (uchar* *) &Options::Daemon::user,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-#endif
-
- { "username", OPT_USERNAME,
- "Username to update the password file",
- (uchar* *) &Options::User_management::user_name,
- (uchar* *) &Options::User_management::user_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "version", 'V', "Output version information and exit.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
-
- { "wait-timeout", OPT_WAIT_TIMEOUT, "The number of seconds IM waits "
- "for activity on a connection before closing it.",
- (uchar* *) &net_read_timeout,
- (uchar* *) &net_read_timeout,
- 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0 },
-
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }
-};
-
-static void version()
-{
- printf("%s Ver %s for %s on %s\n", my_progname,
- (const char *) mysqlmanager_version.str,
- SYSTEM_TYPE, MACHINE_TYPE);
-}
-
-
-static const char *default_groups[]= { "manager", 0 };
-
-
-static void usage()
-{
- version();
-
- printf("Copyright (C) 2003, 2004 MySQL AB\n"
- "This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
- "and you are welcome to modify and redistribute it under the GPL license\n");
- printf("Usage: %s [OPTIONS] \n", my_progname);
-
- my_print_help(my_long_options);
- printf("\nThe following options may be given as the first argument:\n"
- "--print-defaults Print the program argument list and exit\n"
- "--defaults-file=# Only read manager configuration and instance\n"
- " setings from the given file #. The same file\n"
- " will be used to modify configuration of instances\n"
- " with SET commands.\n");
- my_print_variables(my_long_options);
-}
-
-
-C_MODE_START
-
-static my_bool
-get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- switch(optid) {
- case 'V':
- version();
- exit(0);
- case OPT_PRINT_PASSWORD_LINE:
- case OPT_ADD_USER:
- case OPT_DROP_USER:
- case OPT_EDIT_USER:
- case OPT_CLEAN_PASSWORD_FILE:
- case OPT_CHECK_PASSWORD_FILE:
- case OPT_LIST_USERS:
- if (Options::User_management::cmd)
- {
- fprintf(stderr, "Error: only one password-management command "
- "can be specified at a time.\n");
- exit(ERR_INVALID_USAGE);
- }
-
- switch (optid) {
- case OPT_PRINT_PASSWORD_LINE:
- Options::User_management::cmd= new Print_password_line_cmd();
- break;
- case OPT_ADD_USER:
- Options::User_management::cmd= new Add_user_cmd();
- break;
- case OPT_DROP_USER:
- Options::User_management::cmd= new Drop_user_cmd();
- break;
- case OPT_EDIT_USER:
- Options::User_management::cmd= new Edit_user_cmd();
- break;
- case OPT_CLEAN_PASSWORD_FILE:
- Options::User_management::cmd= new Clean_db_cmd();
- break;
- case OPT_CHECK_PASSWORD_FILE:
- Options::User_management::cmd= new Check_db_cmd();
- break;
- case OPT_LIST_USERS:
- Options::User_management::cmd= new List_users_cmd();
- break;
- }
-
- break;
- case '?':
- usage();
- exit(0);
- case '#':
-#ifndef DBUG_OFF
- DBUG_SET(argument ? argument : Options::Debug::config_str);
- DBUG_SET_INITIAL(argument ? argument : Options::Debug::config_str);
-#endif
- break;
- }
- return 0;
-}
-
-C_MODE_END
-
-
-/*
- - Process argv of original program: get tid of --defaults-extra-file
- and print a message if met there.
- - call load_defaults to load configuration file section and save the pointer
- for free_defaults.
- - call handle_options to assign defaults and command-line arguments
- to the class members.
- if either of these function fail, return the error code.
-*/
-
-int Options::load(int argc, char **argv)
-{
- if (argc >= 2)
- {
- if (is_prefix(argv[1], "--defaults-file="))
- {
- Main::config_file= strchr(argv[1], '=') + 1;
- Main::is_forced_default_file= TRUE;
- }
- if (is_prefix(argv[1], "--defaults-extra-file=") ||
- is_prefix(argv[1], "--no-defaults"))
- {
- /* the log is not enabled yet */
- fprintf(stderr, "The --defaults-extra-file and --no-defaults options"
- " are not supported by\n"
- "Instance Manager. Program aborted.\n");
- return ERR_INVALID_USAGE;
- }
- }
-
-#ifdef __WIN__
- if (setup_windows_defaults())
- {
- fprintf(stderr, "Internal error: could not setup default values.\n");
- return ERR_OUT_OF_MEMORY;
- }
-#endif
-
- /* load_defaults will reset saved_argv with a new allocated list */
- saved_argv= argv;
-
- /* config-file options are prepended to command-line ones */
-
- log_info("Loading config file '%s'...",
- (const char *) Main::config_file);
-
- my_load_defaults(Main::config_file, default_groups, &argc,
- &saved_argv, &default_directories);
-
- if ((handle_options(&argc, &saved_argv, my_long_options, get_one_option)))
- return ERR_INVALID_USAGE;
-
- if (!User_management::cmd &&
- (User_management::user_name || User_management::password))
- {
- fprintf(stderr,
- "--username and/or --password options have been specified, "
- "but no password-management command has been given.\n");
- return ERR_INVALID_USAGE;
- }
-
-#ifndef __WIN__
- if (Options::Daemon::run_as_service)
- {
- if (Options::Daemon::angel_pid_file_name == NULL)
- {
- /*
- Calculate angel pid file on the IM pid file basis: replace the
- extension (everything after the last dot) of the pid file basename to
- '.angel.pid'.
- */
-
- char *local_angel_pid_file_name;
- char *base_name_ptr;
- char *ext_ptr;
-
- local_angel_pid_file_name=
- (char *) malloc(strlen(Options::Main::pid_file_name) +
- ANGEL_PID_FILE_SUFFIX_LEN);
-
- strcpy(local_angel_pid_file_name, Options::Main::pid_file_name);
-
- base_name_ptr= strrchr(local_angel_pid_file_name, '/');
-
- if (!base_name_ptr)
- base_name_ptr= local_angel_pid_file_name + 1;
-
- ext_ptr= strrchr(base_name_ptr, '.');
- if (ext_ptr)
- *ext_ptr= 0;
-
- strcat(local_angel_pid_file_name, ANGEL_PID_FILE_SUFFIX);
-
- Options::Daemon::angel_pid_file_name= local_angel_pid_file_name;
- }
- else
- {
- Options::Daemon::angel_pid_file_name=
- strdup(Options::Daemon::angel_pid_file_name);
- }
- }
-#endif
-
- return 0;
-}
-
-void Options::cleanup()
-{
- if (saved_argv)
- free_defaults(saved_argv);
-
- delete User_management::cmd;
-
-#ifndef __WIN__
- if (Options::Daemon::run_as_service)
- free((void *) Options::Daemon::angel_pid_file_name);
-#endif
-}
-
-#ifdef __WIN__
-
-static int setup_windows_defaults()
-{
- char module_full_name[FN_REFLEN];
- char dir_name[FN_REFLEN];
- char base_name[FN_REFLEN];
- char im_name[FN_REFLEN];
- char *base_name_ptr;
- char *ptr;
-
- /* Determine dirname and basename. */
-
- if (!GetModuleFileName(NULL, module_full_name, sizeof (module_full_name)) ||
- !GetFullPathName(module_full_name, sizeof (dir_name), dir_name,
- &base_name_ptr))
- {
- return 1;
- }
-
- strmake(base_name, base_name_ptr, FN_REFLEN);
- *base_name_ptr= 0;
-
- strmake(im_name, base_name, FN_REFLEN);
- ptr= strrchr(im_name, '.');
-
- if (!ptr)
- return 1;
-
- *ptr= 0;
-
- /* Initialize the defaults. */
-
- strxmov(win_dflt_config_file_name, dir_name, DFLT_CONFIG_FILE_NAME, NullS);
- strxmov(win_dflt_mysqld_path, dir_name, DFLT_MYSQLD_PATH, NullS);
- strxmov(win_dflt_password_file_name, dir_name, im_name, DFLT_PASSWD_FILE_EXT,
- NullS);
- strxmov(win_dflt_pid_file_name, dir_name, im_name, DFLT_PID_FILE_EXT, NullS);
-
- return 0;
-}
-
-#endif
diff --git a/server-tools/instance-manager/options.h b/server-tools/instance-manager/options.h
deleted file mode 100644
index 5d4df51faae..00000000000
--- a/server-tools/instance-manager/options.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Copyright (C) 2003-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_OPTIONS_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_OPTIONS_H
-
-/*
- Options - all possible command-line options for the Instance Manager grouped
- in one struct.
-*/
-
-#include <my_global.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-class User_management_cmd;
-
-struct Options
-{
- /*
- NOTE: handle_options() expects value of my_bool type for GET_BOOL
- accessor (i.e. bool must not be used).
- */
-
- struct User_management
- {
- static User_management_cmd *cmd;
-
- static char *user_name;
- static char *password;
- };
-
- struct Main
- {
- /* this is not an option parsed by handle_options(). */
- static bool is_forced_default_file;
-
- static const char *pid_file_name;
-#ifndef __WIN__
- static const char *socket_file_name;
-#endif
- static const char *password_file_name;
- static const char *default_mysqld_path;
- static uint monitoring_interval;
- static uint port_number;
- static const char *bind_address;
- static const char *config_file;
- static my_bool mysqld_safe_compatible;
- };
-
-#ifndef DBUG_OFF
- struct Debug
- {
- static const char *config_str;
- };
-#endif
-
-#ifndef __WIN__
-
- struct Daemon
- {
- static my_bool run_as_service;
- static const char *log_file_name;
- static const char *user;
- static const char *angel_pid_file_name;
- };
-
-#else
-
- struct Service
- {
- static my_bool install_as_service;
- static my_bool remove_service;
- static my_bool stand_alone;
- };
-
-#endif
-
-public:
- /* Array of paths to be passed to my_search_option_files() later */
- static const char **default_directories;
-
- static int load(int argc, char **argv);
- static void cleanup();
-
-private:
- Options(); /* Deny instantiation of this class. */
-
-private:
- /* argv pointer returned by load_defaults() to be used by free_defaults() */
- static char **saved_argv;
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_OPTIONS_H
diff --git a/server-tools/instance-manager/parse.cc b/server-tools/instance-manager/parse.cc
deleted file mode 100644
index cd20e3bc7ab..00000000000
--- a/server-tools/instance-manager/parse.cc
+++ /dev/null
@@ -1,509 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "parse.h"
-#include "commands.h"
-
-
-enum Token
-{
- TOK_CREATE= 0,
- TOK_DROP,
- TOK_ERROR, /* Encodes the "ERROR" word, it doesn't indicate error. */
- TOK_FILES,
- TOK_FLUSH,
- TOK_GENERAL,
- TOK_INSTANCE,
- TOK_INSTANCES,
- TOK_LOG,
- TOK_OPTIONS,
- TOK_SET,
- TOK_SLOW,
- TOK_START,
- TOK_STATUS,
- TOK_STOP,
- TOK_SHOW,
- TOK_UNSET,
- TOK_NOT_FOUND, // must be after all tokens
- TOK_END
-};
-
-
-struct tokens_st
-{
- uint length;
- const char *tok_name;
-};
-
-
-static struct tokens_st tokens[]= {
- {6, "CREATE"},
- {4, "DROP"},
- {5, "ERROR"},
- {5, "FILES"},
- {5, "FLUSH"},
- {7, "GENERAL"},
- {8, "INSTANCE"},
- {9, "INSTANCES"},
- {3, "LOG"},
- {7, "OPTIONS"},
- {3, "SET"},
- {4, "SLOW"},
- {5, "START"},
- {6, "STATUS"},
- {4, "STOP"},
- {4, "SHOW"},
- {5, "UNSET"}
-};
-
-/************************************************************************/
-
-Named_value_arr::Named_value_arr() :
- initialized(FALSE)
-{
-}
-
-
-bool Named_value_arr::init()
-{
- if (my_init_dynamic_array(&arr, sizeof(Named_value), 0, 32))
- return TRUE;
-
- initialized= TRUE;
-
- return FALSE;
-}
-
-
-Named_value_arr::~Named_value_arr()
-{
- if (!initialized)
- return;
-
- for (int i= 0; i < get_size(); ++i)
- get_element(i).free();
-
- delete_dynamic(&arr);
-}
-
-/************************************************************************/
-
-/*
- Returns token no if word corresponds to some token, otherwise returns
- TOK_NOT_FOUND
-*/
-
-inline Token find_token(const char *word, size_t word_len)
-{
- int i= 0;
- do
- {
- if (my_strnncoll(default_charset_info, (const uchar *) tokens[i].tok_name,
- tokens[i].length, (const uchar *) word, word_len) == 0)
- break;
- }
- while (++i < TOK_NOT_FOUND);
- return (Token) i;
-}
-
-
-Token get_token(const char **text, size_t *word_len)
-{
- get_word(text, word_len);
- if (*word_len)
- return find_token(*text, *word_len);
- return TOK_END;
-}
-
-
-Token shift_token(const char **text, size_t *word_len)
-{
- Token save= get_token(text, word_len);
- (*text)+= *word_len;
- return save;
-}
-
-
-int get_text_id(const char **text, LEX_STRING *token)
-{
- get_word(text, &token->length);
- if (token->length == 0)
- return 1;
- token->str= (char *) *text;
- return 0;
-}
-
-
-static bool parse_long(const LEX_STRING *token, long *value)
-{
- int err_code;
- char *end_ptr= token->str + token->length;
-
- *value= (long)my_strtoll10(token->str, &end_ptr, &err_code);
-
- return err_code != 0;
-}
-
-
-bool parse_option_value(const char *text, size_t *text_len, char **value)
-{
- char beginning_quote;
- const char *text_start_ptr;
- char *v;
- bool escape_mode= FALSE;
-
- if (!*text || (*text != '\'' && *text != '"'))
- return TRUE; /* syntax error: string expected. */
-
- beginning_quote= *text;
-
- ++text; /* skip the beginning quote. */
-
- text_start_ptr= text;
-
- if (!(v= Named_value::alloc_str(text)))
- return TRUE;
-
- *value= v;
-
- while (TRUE)
- {
- if (!*text)
- {
- Named_value::free_str(value);
- return TRUE; /* syntax error: missing terminating ' character. */
- }
-
- if (*text == '\n' || *text == '\r')
- {
- Named_value::free_str(value);
- return TRUE; /* syntax error: option value should be a single line. */
- }
-
- if (!escape_mode && *text == beginning_quote)
- break;
-
- if (escape_mode)
- {
- switch (*text)
- {
- case 'b': /* \b -- backspace */
- if (v > *value)
- --v;
- break;
-
- case 't': /* \t -- tab */
- *v= '\t';
- ++v;
- break;
-
- case 'n': /* \n -- newline */
- *v= '\n';
- ++v;
- break;
-
- case 'r': /* \r -- carriage return */
- *v= '\r';
- ++v;
- break;
-
- case '\\': /* \\ -- back slash */
- *v= '\\';
- ++v;
- break;
-
- case 's': /* \s -- space */
- *v= ' ';
- ++v;
- break;
-
- default: /* Unknown escape sequence. Treat as error. */
- Named_value::free_str(value);
- return TRUE;
- }
-
- escape_mode= FALSE;
- }
- else
- {
- if (*text == '\\')
- {
- escape_mode= TRUE;
- }
- else
- {
- *v= *text;
- ++v;
- }
- }
-
- ++text;
- }
-
- *v= 0;
-
- /* "2" below stands for beginning and ending quotes. */
- *text_len= text - text_start_ptr + 2;
-
- return FALSE;
-}
-
-
-void skip_spaces(const char **text)
-{
- while (**text && my_isspace(default_charset_info, **text))
- ++(*text);
-}
-
-
-Command *parse_command(const char *text)
-{
- size_t word_len;
- LEX_STRING instance_name;
- Command *command= 0;
-
- Token tok1= shift_token(&text, &word_len);
-
- switch (tok1) {
- case TOK_START: // fallthrough
- case TOK_STOP:
- case TOK_CREATE:
- case TOK_DROP:
- if (shift_token(&text, &word_len) != TOK_INSTANCE)
- goto syntax_error;
- get_word(&text, &word_len);
- if (word_len == 0)
- goto syntax_error;
- instance_name.str= (char *) text;
- instance_name.length= word_len;
- text+= word_len;
-
- if (tok1 == TOK_CREATE)
- {
- Create_instance *cmd= new Create_instance(&instance_name);
-
- if (!cmd)
- return NULL; /* Report ER_OUT_OF_RESOURCES. */
-
- if (cmd->init(&text))
- {
- delete cmd;
- goto syntax_error;
- }
-
- command= cmd;
- }
- else
- {
- /* it should be the end of command */
- get_word(&text, &word_len, NONSPACE);
- if (word_len)
- goto syntax_error;
- }
-
- switch (tok1) {
- case TOK_START:
- command= new Start_instance(&instance_name);
- break;
- case TOK_STOP:
- command= new Stop_instance(&instance_name);
- break;
- case TOK_CREATE:
- ; /* command already initialized. */
- break;
- case TOK_DROP:
- command= new Drop_instance(&instance_name);
- break;
- default: /* this is impossible, but nevertheless... */
- DBUG_ASSERT(0);
- }
- break;
- case TOK_FLUSH:
- if (shift_token(&text, &word_len) != TOK_INSTANCES)
- goto syntax_error;
-
- get_word(&text, &word_len, NONSPACE);
- if (word_len)
- goto syntax_error;
-
- command= new Flush_instances();
- break;
- case TOK_UNSET:
- case TOK_SET:
- {
- Abstract_option_cmd *cmd;
-
- if (tok1 == TOK_SET)
- cmd= new Set_option();
- else
- cmd= new Unset_option();
-
- if (!cmd)
- return NULL; /* Report ER_OUT_OF_RESOURCES. */
-
- if (cmd->init(&text))
- {
- delete cmd;
- goto syntax_error;
- }
-
- command= cmd;
-
- break;
- }
- case TOK_SHOW:
- switch (shift_token(&text, &word_len)) {
- case TOK_INSTANCES:
- get_word(&text, &word_len, NONSPACE);
- if (word_len)
- goto syntax_error;
- command= new Show_instances();
- break;
- case TOK_INSTANCE:
- switch (Token tok2= shift_token(&text, &word_len)) {
- case TOK_OPTIONS:
- case TOK_STATUS:
- if (get_text_id(&text, &instance_name))
- goto syntax_error;
- text+= instance_name.length;
- /* check that this is the end of the command */
- get_word(&text, &word_len, NONSPACE);
- if (word_len)
- goto syntax_error;
- if (tok2 == TOK_STATUS)
- command= new Show_instance_status(&instance_name);
- else
- command= new Show_instance_options(&instance_name);
- break;
- default:
- goto syntax_error;
- }
- break;
- default:
- instance_name.str= (char *) text - word_len;
- instance_name.length= word_len;
- if (instance_name.length)
- {
- Log_type log_type;
-
- long log_size;
- LEX_STRING log_size_str;
-
- long log_offset= 0;
- LEX_STRING log_offset_str= { NULL, 0 };
-
- switch (shift_token(&text, &word_len)) {
- case TOK_LOG:
- switch (Token tok3= shift_token(&text, &word_len)) {
- case TOK_FILES:
- get_word(&text, &word_len, NONSPACE);
- /* check that this is the end of the command */
- if (word_len)
- goto syntax_error;
- command= new Show_instance_log_files(&instance_name);
- break;
- case TOK_ERROR:
- case TOK_GENERAL:
- case TOK_SLOW:
- /* define a log type */
- switch (tok3) {
- case TOK_ERROR:
- log_type= IM_LOG_ERROR;
- break;
- case TOK_GENERAL:
- log_type= IM_LOG_GENERAL;
- break;
- case TOK_SLOW:
- log_type= IM_LOG_SLOW;
- break;
- default:
- goto syntax_error;
- }
- /* get the size of the log we want to retrieve */
- if (get_text_id(&text, &log_size_str))
- goto syntax_error;
- text+= log_size_str.length;
-
- /* this parameter is required */
- if (!log_size_str.length)
- goto syntax_error;
-
- /* the next token should be comma, or nothing */
- get_word(&text, &word_len);
- switch (*text) {
- case ',':
- text++; /* swallow the comma */
- /* read the next word */
- get_word(&text, &word_len);
- if (!word_len)
- goto syntax_error;
- log_offset_str.str= (char *) text;
- log_offset_str.length= word_len;
- text+= word_len;
- get_word(&text, &word_len, NONSPACE);
- /* check that this is the end of the command */
- if (word_len)
- goto syntax_error;
- break;
- case '\0':
- break; /* this is ok */
- default:
- goto syntax_error;
- }
-
- /* Parse size parameter. */
-
- if (parse_long(&log_size_str, &log_size))
- goto syntax_error;
-
- if (log_size <= 0)
- goto syntax_error;
-
- /* Parse offset parameter (if specified). */
-
- if (log_offset_str.length)
- {
- if (parse_long(&log_offset_str, &log_offset))
- goto syntax_error;
-
- if (log_offset <= 0)
- goto syntax_error;
- }
-
- command= new Show_instance_log(&instance_name,
- log_type, log_size, log_offset);
- break;
- default:
- goto syntax_error;
- }
- break;
- default:
- goto syntax_error;
- }
- }
- else
- goto syntax_error;
- break;
- }
- break;
- default:
-syntax_error:
- command= new Syntax_error();
- }
-
- DBUG_ASSERT(command);
-
- return command;
-}
diff --git a/server-tools/instance-manager/parse.h b/server-tools/instance-manager/parse.h
deleted file mode 100644
index 9c50ace5948..00000000000
--- a/server-tools/instance-manager/parse.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
-
-class Command;
-
-enum Log_type
-{
- IM_LOG_ERROR= 0,
- IM_LOG_GENERAL,
- IM_LOG_SLOW
-};
-
-Command *parse_command(const char *text);
-
-bool parse_option_value(const char *text, size_t *text_len, char **value);
-
-void skip_spaces(const char **text);
-
-/* define kinds of the word seek method */
-enum enum_seek_method { ALPHANUM= 1, NONSPACE, OPTION_NAME };
-
-/************************************************************************/
-
-class Named_value
-{
-public:
- /*
- The purpose of these methods is just to have one method for
- allocating/deallocating memory for strings for Named_value.
- */
-
- static inline char *alloc_str(const LEX_STRING *str);
- static inline char *alloc_str(const char *str);
- static inline void free_str(char **str);
-
-public:
- inline Named_value();
- inline Named_value(char *name_arg, char *value_arg);
-
- inline char *get_name();
- inline char *get_value();
-
- inline void free();
-
-private:
- char *name;
- char *value;
-};
-
-inline char *Named_value::alloc_str(const LEX_STRING *str)
-{
- return my_strndup(str->str, str->length, MYF(0));
-}
-
-inline char *Named_value::alloc_str(const char *str)
-{
- return my_strdup(str, MYF(0));
-}
-
-inline void Named_value::free_str(char **str)
-{
- my_free(*str, MYF(MY_ALLOW_ZERO_PTR));
- *str= NULL;
-}
-
-inline Named_value::Named_value()
- :name(NULL), value(NULL)
-{ }
-
-inline Named_value::Named_value(char *name_arg, char *value_arg)
- :name(name_arg), value(value_arg)
-{ }
-
-inline char *Named_value::get_name()
-{
- return name;
-}
-
-inline char *Named_value::get_value()
-{
- return value;
-}
-
-void Named_value::free()
-{
- free_str(&name);
- free_str(&value);
-}
-
-/************************************************************************/
-
-class Named_value_arr
-{
-public:
- Named_value_arr();
- ~Named_value_arr();
-
- bool init();
-
- inline int get_size() const;
- inline Named_value get_element(int idx) const;
- inline void remove_element(int idx);
- inline bool add_element(Named_value *option);
- inline bool replace_element(int idx, Named_value *option);
-
-private:
- bool initialized;
- DYNAMIC_ARRAY arr;
-};
-
-
-inline int Named_value_arr::get_size() const
-{
- return arr.elements;
-}
-
-
-inline Named_value Named_value_arr::get_element(int idx) const
-{
- DBUG_ASSERT(0 <= idx && (uint) idx < arr.elements);
-
- Named_value option;
- get_dynamic((DYNAMIC_ARRAY *) &arr, (uchar*) &option, idx);
-
- return option;
-}
-
-
-inline void Named_value_arr::remove_element(int idx)
-{
- DBUG_ASSERT(0 <= idx && (uint) idx < arr.elements);
-
- get_element(idx).free();
-
- delete_dynamic_element(&arr, idx);
-}
-
-
-inline bool Named_value_arr::add_element(Named_value *option)
-{
- return insert_dynamic(&arr, (uchar*) option);
-}
-
-
-inline bool Named_value_arr::replace_element(int idx, Named_value *option)
-{
- DBUG_ASSERT(0 <= idx && (uint) idx < arr.elements);
-
- get_element(idx).free();
-
- return set_dynamic(&arr, (uchar*) option, idx);
-}
-
-/************************************************************************/
-
-/*
- tries to find next word in the text
- if found, returns the beginning and puts word length to word_len argument.
- if not found returns pointer to first non-space or to '\0', word_len == 0
-*/
-
-inline void get_word(const char **text, size_t *word_len,
- enum_seek_method seek_method= ALPHANUM)
-{
- const char *word_end;
-
- /* skip space */
- while (my_isspace(default_charset_info, **text))
- ++(*text);
-
- word_end= *text;
-
- switch (seek_method) {
- case ALPHANUM:
- while (my_isalnum(default_charset_info, *word_end))
- ++word_end;
- break;
- case NONSPACE:
- while (!my_isspace(default_charset_info, *word_end) &&
- (*word_end != '\0'))
- ++word_end;
- break;
- case OPTION_NAME:
- while (my_isalnum(default_charset_info, *word_end) ||
- *word_end == '-' ||
- *word_end == '_')
- ++word_end;
- break;
- }
-
- *word_len= (uint) (word_end - *text);
-}
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H */
diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc
deleted file mode 100644
index 3511589acd6..00000000000
--- a/server-tools/instance-manager/parse_output.cc
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Copyright (C) 2004 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "parse_output.h"
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
-
-#include <stdio.h>
-
-#include "parse.h"
-#include "portability.h"
-
-/**************************************************************************
- Private module implementation.
-**************************************************************************/
-
-namespace { /* no-indent */
-
-/*************************************************************************/
-
-void trim_space(const char **text, uint *word_len)
-{
- const char *start= *text;
- while (*start != 0 && *start == ' ')
- start++;
- *text= start;
-
- int len= strlen(start);
- const char *end= start + len - 1;
- while (end > start && my_isspace(&my_charset_latin1, *end))
- end--;
- *word_len= (end - start)+1;
-}
-
-/*************************************************************************/
-
-/**
- @brief A facade to the internal workings of optaining the output from an
- executed system process.
-*/
-
-class Mysqld_output_parser
-{
-public:
- Mysqld_output_parser()
- { }
-
- virtual ~Mysqld_output_parser()
- { }
-
-public:
- bool parse(const char *command,
- const char *option_name_str,
- uint option_name_length,
- char *option_value_buf,
- size_t option_value_buf_size,
- enum_option_type option_type);
-
-protected:
- /**
- @brief Run a process and attach stdout- and stdin-pipes to it.
-
- @param command The path to the process to be executed
-
- @return Error status.
- @retval TRUE An error occurred
- @retval FALSE Operation was a success
- */
-
- virtual bool run_command(const char *command)= 0;
-
-
- /**
- @brief Read a sequence of bytes from the executed process' stdout pipe.
-
- The sequence is terminated by either '\0', LF or CRLF tokens. The
- terminating token is excluded from the result.
-
- @param line_buffer A pointer to a character buffer
- @param line_buffer_size The size of the buffer in bytes
-
- @return Error status.
- @retval TRUE An error occured
- @retval FALSE Operation was a success
- */
-
- virtual bool read_line(char *line_buffer,
- uint line_buffer_size)= 0;
-
-
- /**
- @brief Release any resources needed after a execution and parsing.
- */
-
- virtual bool cleanup()= 0;
-};
-
-/*************************************************************************/
-
-bool Mysqld_output_parser::parse(const char *command,
- const char *option_name_str,
- uint option_name_length,
- char *option_value_buf,
- size_t option_value_buf_size,
- enum_option_type option_type)
-{
- /* should be enough to store the string from the output */
- const int LINE_BUFFER_SIZE= 512;
- char line_buffer[LINE_BUFFER_SIZE];
-
- if (run_command(command))
- return TRUE;
-
- while (true)
- {
- if (read_line(line_buffer, LINE_BUFFER_SIZE))
- {
- cleanup();
- return TRUE;
- }
-
- uint found_word_len= 0;
- char *linep= line_buffer;
-
- line_buffer[sizeof(line_buffer) - 1]= '\0'; /* safety */
-
- /* Find the word(s) we are looking for in the line. */
-
- linep= strstr(linep, option_name_str);
-
- if (!linep)
- continue;
-
- linep+= option_name_length;
-
- switch (option_type)
- {
- case GET_VALUE:
- trim_space((const char**) &linep, &found_word_len);
-
- if (option_value_buf_size <= found_word_len)
- {
- cleanup();
- return TRUE;
- }
-
- strmake(option_value_buf, linep, found_word_len);
-
- break;
-
- case GET_LINE:
- strmake(option_value_buf, linep, option_value_buf_size - 1);
-
- break;
- }
-
- cleanup();
-
- return FALSE;
- }
-}
-
-/**************************************************************************
- Platform-specific implementation: UNIX.
-**************************************************************************/
-
-#ifndef __WIN__
-
-class Mysqld_output_parser_unix : public Mysqld_output_parser
-{
-public:
- Mysqld_output_parser_unix() :
- m_stdout(NULL)
- { }
-
-protected:
- virtual bool run_command(const char *command);
-
- virtual bool read_line(char *line_buffer,
- uint line_buffer_size);
-
- virtual bool cleanup();
-
-private:
- FILE *m_stdout;
-};
-
-bool Mysqld_output_parser_unix::run_command(const char *command)
-{
- if (!(m_stdout= popen(command, "r")))
- return TRUE;
-
- /*
- We want fully buffered stream. We also want system to allocate
- appropriate buffer.
- */
-
- setvbuf(m_stdout, NULL, _IOFBF, 0);
-
- return FALSE;
-}
-
-bool Mysqld_output_parser_unix::read_line(char *line_buffer,
- uint line_buffer_size)
-{
- char *retbuff = fgets(line_buffer, line_buffer_size, m_stdout);
- /* Remove any tailing new line charaters */
- if (line_buffer[line_buffer_size-1] == LF)
- line_buffer[line_buffer_size-1]= '\0';
- return (retbuff == NULL);
-}
-
-bool Mysqld_output_parser_unix::cleanup()
-{
- if (m_stdout)
- pclose(m_stdout);
-
- return FALSE;
-}
-
-#else /* Windows */
-
-/**************************************************************************
- Platform-specific implementation: Windows.
-**************************************************************************/
-
-class Mysqld_output_parser_win : public Mysqld_output_parser
-{
-public:
- Mysqld_output_parser_win() :
- m_internal_buffer(NULL),
- m_internal_buffer_offset(0),
- m_internal_buffer_size(0)
- { }
-
-protected:
- virtual bool run_command(const char *command);
- virtual bool read_line(char *line_buffer,
- uint line_buffer_size);
- virtual bool cleanup();
-
-private:
- HANDLE m_h_child_stdout_wr;
- HANDLE m_h_child_stdout_rd;
- uint m_internal_buffer_offset;
- uint m_internal_buffer_size;
- char *m_internal_buffer;
-};
-
-bool Mysqld_output_parser_win::run_command(const char *command)
-{
- BOOL op_status;
-
- SECURITY_ATTRIBUTES sa_attr;
- sa_attr.nLength= sizeof(SECURITY_ATTRIBUTES);
- sa_attr.bInheritHandle= TRUE;
- sa_attr.lpSecurityDescriptor= NULL;
-
- op_status= CreatePipe(&m_h_child_stdout_rd,
- &m_h_child_stdout_wr,
- &sa_attr,
- 0 /* Use system-default buffer size. */);
-
- if (!op_status)
- return TRUE;
-
- SetHandleInformation(m_h_child_stdout_rd, HANDLE_FLAG_INHERIT, 0);
-
- STARTUPINFO si_start_info;
- ZeroMemory(&si_start_info, sizeof(STARTUPINFO));
- si_start_info.cb= sizeof(STARTUPINFO);
- si_start_info.hStdError= m_h_child_stdout_wr;
- si_start_info.hStdOutput= m_h_child_stdout_wr;
- si_start_info.dwFlags|= STARTF_USESTDHANDLES;
-
- PROCESS_INFORMATION pi_proc_info;
-
- op_status= CreateProcess(NULL, /* Application name. */
- (char*)command, /* Command line. */
- NULL, /* Process security attributes. */
- NULL, /* Primary thread security attr.*/
- TRUE, /* Handles are inherited. */
- 0, /* Creation flags. */
- NULL, /* Use parent's environment. */
- NULL, /* Use parent's curr. directory. */
- &si_start_info, /* STARTUPINFO pointer. */
- &pi_proc_info); /* Rec. PROCESS_INFORMATION. */
-
- if (!op_status)
- {
- CloseHandle(m_h_child_stdout_rd);
- CloseHandle(m_h_child_stdout_wr);
-
- return TRUE;
- }
-
- /* Close unnessary handles. */
-
- CloseHandle(pi_proc_info.hProcess);
- CloseHandle(pi_proc_info.hThread);
-
- return FALSE;
-}
-
-bool Mysqld_output_parser_win::read_line(char *line_buffer,
- uint line_buffer_size)
-{
- DWORD dw_read_count= m_internal_buffer_size;
- bzero(line_buffer,line_buffer_size);
- char *buff_ptr= line_buffer;
- char ch;
-
- while ((unsigned)(buff_ptr - line_buffer) < line_buffer_size)
- {
- do
- {
- ReadFile(m_h_child_stdout_rd, &ch,
- 1, &dw_read_count, NULL);
- } while ((ch == CR || ch == LF) && buff_ptr == line_buffer);
-
- if (dw_read_count == 0)
- return TRUE;
-
- if (ch == CR || ch == LF)
- break;
-
- *buff_ptr++ = ch;
- }
-
- return FALSE;
-}
-
-bool Mysqld_output_parser_win::cleanup()
-{
- /* Close all handles. */
-
- CloseHandle(m_h_child_stdout_wr);
- CloseHandle(m_h_child_stdout_rd);
-
- return FALSE;
-}
-#endif
-
-/*************************************************************************/
-
-} /* End of private module implementation. */
-
-/*************************************************************************/
-
-/**
- @brief Parse output of the given command
-
- @param command The command to execute.
- @param option_name_str Option name.
- @param option_name_length Length of the option name.
- @param[out] option_value_buf The buffer to store option value.
- @param option_value_buf_size Size of the option value buffer.
- @param option_type Type of the option:
- - GET_LINE if we want to get all the
- line after the option name;
- - GET_VALUE otherwise.
-
- Execute the process by running "command". Find the "option name" and
- return the next word if "option_type" is GET_VALUE. Return the rest of
- the parsed string otherwise.
-
- @note This function has a separate windows implementation.
-
- @return The error status.
- @retval FALSE Ok, the option name has been found.
- @retval TRUE Error occured or the option name is not found.
-*/
-
-bool parse_output_and_get_value(const char *command,
- const char *option_name_str,
- uint option_name_length,
- char *option_value_buf,
- size_t option_value_buf_size,
- enum_option_type option_type)
-{
-#ifndef __WIN__
- Mysqld_output_parser_unix parser;
-#else /* __WIN__ */
- Mysqld_output_parser_win parser;
-#endif
-
- return parser.parse(command,
- option_name_str,
- option_name_length,
- option_value_buf,
- option_value_buf_size,
- option_type);
-}
diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h
deleted file mode 100644
index 990e6140a9e..00000000000
--- a/server-tools/instance-manager/portability.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (C) 2005-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H
-
-#if (defined(_SCO_DS) || defined(UNIXWARE_7)) && !defined(SHUT_RDWR)
-/*
- SHUT_* functions are defined only if
- "(defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 >= 1)"
-*/
-#define SHUT_RDWR 2
-#endif
-
-#ifdef __WIN__
-
-#define vsnprintf _vsnprintf
-#define snprintf _snprintf
-
-#define SIGKILL 9
-
-/*TODO: fix this */
-#define PROTOCOL_VERSION 10
-
-#define DFLT_CONFIG_FILE_NAME "my.ini"
-#define DFLT_MYSQLD_PATH "mysqld"
-#define DFLT_PASSWD_FILE_EXT ".passwd"
-#define DFLT_PID_FILE_EXT ".pid"
-#define DFLT_SOCKET_FILE_EXT ".sock"
-
-typedef int pid_t;
-
-#undef popen
-#define popen(A,B) _popen(A,B)
-
-#define NEWLINE "\r\n"
-#define NEWLINE_LEN 2
-
-const char CR = '\r';
-const char LF = '\n';
-
-#else /* ! __WIN__ */
-
-#define NEWLINE "\n"
-#define NEWLINE_LEN 1
-
-const char LF = '\n';
-
-#endif /* __WIN__ */
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H */
-
-
diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc
deleted file mode 100644
index 74263934924..00000000000
--- a/server-tools/instance-manager/priv.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "priv.h"
-
-#include <my_global.h>
-#include <mysql_com.h>
-#include <my_sys.h>
-
-#include "log.h"
-
-/*
- The following string must be less then 80 characters, as
- mysql_connection.cc relies on it
-*/
-const LEX_STRING mysqlmanager_version= { C_STRING_WITH_LEN("1.0-beta") };
-
-const unsigned char protocol_version= PROTOCOL_VERSION;
-
-unsigned long net_buffer_length= 16384;
-
-unsigned long max_allowed_packet= 16384;
-
-unsigned long net_read_timeout= NET_WAIT_TIMEOUT; // same as in mysqld
-
-unsigned long net_write_timeout= 60; // same as in mysqld
-
-unsigned long net_retry_count= 10; // same as in mysqld
-
-/* needed by net_serv.cc */
-unsigned int test_flags= 0;
-unsigned long bytes_sent = 0L, bytes_received = 0L;
-unsigned long mysqld_net_retry_count = 10L;
-unsigned long open_files_limit;
-
-
-
-bool create_pid_file(const char *pid_file_name, int pid)
-{
- FILE *pid_file;
-
- if (!(pid_file= my_fopen(pid_file_name, O_WRONLY | O_CREAT | O_BINARY,
- MYF(0))))
- {
- log_error("Can not create pid file '%s': %s (errno: %d)",
- (const char *) pid_file_name,
- (const char *) strerror(errno),
- (int) errno);
- return TRUE;
- }
-
- if (fprintf(pid_file, "%d\n", (int) pid) <= 0)
- {
- log_error("Can not write to pid file '%s': %s (errno: %d)",
- (const char *) pid_file_name,
- (const char *) strerror(errno),
- (int) errno);
- return TRUE;
- }
-
- my_fclose(pid_file, MYF(0));
-
- return FALSE;
-}
diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h
deleted file mode 100644
index 1c2124c0e77..00000000000
--- a/server-tools/instance-manager/priv.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
-
-#include <my_global.h>
-#include <m_string.h>
-#include <my_pthread.h>
-
-#include <sys/types.h>
-
-#ifndef __WIN__
-#include <unistd.h>
-#endif
-
-#include "portability.h"
-
-/* IM-wide platform-independent defines */
-#define SERVER_DEFAULT_PORT MYSQL_PORT
-#define DEFAULT_MONITORING_INTERVAL 20
-#define DEFAULT_PORT 2273
-/* three-week timeout should be enough */
-#define LONG_TIMEOUT ((ulong) 3600L*24L*21L)
-
-const int MEM_ROOT_BLOCK_SIZE= 512;
-
-/* The maximal length of option name and option value. */
-const int MAX_OPTION_LEN= 1024;
-
-/*
- The maximal length of whole option string:
- --<option name>=<option value>
-*/
-const int MAX_OPTION_STR_LEN= 2 + MAX_OPTION_LEN + 1 + MAX_OPTION_LEN + 1;
-
-const int MAX_VERSION_LENGTH= 160;
-
-const int MAX_INSTANCE_NAME_SIZE= FN_REFLEN;
-
-extern const LEX_STRING mysqlmanager_version;
-
-/* MySQL client-server protocol version: substituted from configure */
-extern const unsigned char protocol_version;
-
-/*
- These variables are used in MySQL subsystem to work with mysql clients
- To be moved to a config file/options one day.
-*/
-
-
-/* Buffer length for TCP/IP and socket communication */
-extern unsigned long net_buffer_length;
-
-
-/* Maximum allowed incoming/ougoung packet length */
-extern unsigned long max_allowed_packet;
-
-
-/*
- Number of seconds to wait for more data from a connection before aborting
- the read
-*/
-extern unsigned long net_read_timeout;
-
-
-/*
- Number of seconds to wait for a block to be written to a connection
- before aborting the write.
-*/
-extern unsigned long net_write_timeout;
-
-
-/*
- If a read on a communication port is interrupted, retry this many times
- before giving up.
-*/
-extern unsigned long net_retry_count;
-
-extern unsigned int test_flags;
-extern unsigned long bytes_sent, bytes_received;
-extern unsigned long mysqld_net_retry_count;
-extern unsigned long open_files_limit;
-
-bool create_pid_file(const char *pid_file_name, int pid);
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
diff --git a/server-tools/instance-manager/protocol.cc b/server-tools/instance-manager/protocol.cc
deleted file mode 100644
index 8d71fcb8026..00000000000
--- a/server-tools/instance-manager/protocol.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include "protocol.h"
-
-#include "messages.h"
-
-#include <mysql_com.h>
-#include <m_string.h>
-
-
-static uchar eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
-static const char ERROR_PACKET_CODE= (char) 255;
-
-
-int net_send_ok(struct st_net *net, unsigned long connection_id,
- const char *message)
-{
- /*
- The format of a packet
- 1 packet type code
- 1-9 affected rows count
- 1-9 connection id
- 2 thread return status
- 2 warning count
- 1-9 + message length message to send (isn't stored if no message)
- */
- Buffer buff;
- uchar *pos= buff.buffer;
-
- /* check that we have space to hold mandatory fields */
- buff.reserve(0, 23);
-
- enum { OK_PACKET_CODE= 0 };
- *pos++= OK_PACKET_CODE;
- pos= net_store_length(pos, (ulonglong) 0);
- pos= net_store_length(pos, (ulonglong) connection_id);
- int2store(pos, *net->return_status);
- pos+= 2;
- /* We don't support warnings, so store 0 for total warning count */
- int2store(pos, 0);
- pos+= 2;
-
- size_t position= pos - buff.buffer; /* we might need it for message */
-
- if (message != NULL)
- {
- buff.reserve(position, 9 + strlen(message));
- store_to_protocol_packet(&buff, message, &position);
- }
-
- return my_net_write(net, buff.buffer, position) || net_flush(net);
-}
-
-
-int net_send_error(struct st_net *net, uint sql_errno)
-{
- const char *err= message(sql_errno);
- char buff[1 + // packet type code
- 2 + // sql error number
- 1 + SQLSTATE_LENGTH + // sql state
- MYSQL_ERRMSG_SIZE]; // message
- char *pos= buff;
-
- *pos++= ERROR_PACKET_CODE;
- int2store(pos, sql_errno);
- pos+= 2;
- /* The first # is to make the protocol backward compatible */
- *pos++= '#';
- memcpy(pos, errno_to_sqlstate(sql_errno), SQLSTATE_LENGTH);
- pos+= SQLSTATE_LENGTH;
- pos= strmake(pos, err, MYSQL_ERRMSG_SIZE - 1) + 1;
- return (my_net_write(net, (uchar*) buff, (size_t) (pos - buff)) ||
- net_flush(net));
-}
-
-
-int net_send_error_323(struct st_net *net, uint sql_errno)
-{
- const char *err= message(sql_errno);
- char buff[1 + // packet type code
- 2 + // sql error number
- MYSQL_ERRMSG_SIZE]; // message
- char *pos= buff;
-
- *pos++= ERROR_PACKET_CODE;
- int2store(pos, sql_errno);
- pos+= 2;
- pos= strmake(pos, err, MYSQL_ERRMSG_SIZE - 1) + 1;
- return (my_net_write(net, (uchar*) buff, (size_t) (pos - buff)) ||
- net_flush(net));
-}
-
-char *net_store_length(char *pkg, uint length)
-{
- uchar *packet=(uchar*) pkg;
- if (length < 251)
- {
- *packet=(uchar) length;
- return (char*) packet+1;
- }
- *packet++=252;
- int2store(packet,(uint) length);
- return (char*) packet+2;
-}
-
-
-int store_to_protocol_packet(Buffer *buf, const char *string, size_t *position,
- size_t string_len)
-{
- uint currpos;
-
- /* reserve max amount of bytes needed to store length */
- if (buf->reserve(*position, 9))
- goto err;
- currpos= (net_store_length(buf->buffer + *position,
- (ulonglong) string_len) - buf->buffer);
- if (buf->append(currpos, string, string_len))
- goto err;
- *position= *position + string_len + (currpos - *position);
-
- return 0;
-err:
- return 1;
-}
-
-
-int store_to_protocol_packet(Buffer *buf, const char *string,
- size_t *position)
-{
- size_t string_len;
-
- string_len= strlen(string);
- return store_to_protocol_packet(buf, string, position, string_len);
-}
-
-
-int send_eof(struct st_net *net)
-{
- uchar buff[1 + /* eof packet code */
- 2 + /* warning count */
- 2]; /* server status */
-
- buff[0]=254;
- int2store(buff+1, 0);
- int2store(buff+3, 0);
- return my_net_write(net, buff, sizeof(buff));
-}
-
-
-int send_fields(struct st_net *net, LIST *fields)
-{
- LIST *tmp= fields;
- Buffer send_buff;
- uchar small_buff[4];
- size_t position= 0;
- LEX_STRING *field;
-
- /* send the number of fileds */
- net_store_length(small_buff, (uint) list_length(fields));
- if (my_net_write(net, small_buff, (uint) 1))
- goto err;
-
- while (tmp)
- {
- position= 0;
- field= (LEX_STRING *) tmp->data;
-
- store_to_protocol_packet(&send_buff,
- (char*) "", &position); /* catalog name */
- store_to_protocol_packet(&send_buff,
- (char*) "", &position); /* db name */
- store_to_protocol_packet(&send_buff,
- (char*) "", &position); /* table name */
- store_to_protocol_packet(&send_buff,
- (char*) "", &position); /* table name alias */
- store_to_protocol_packet(&send_buff,
- field->str, &position); /* column name */
- store_to_protocol_packet(&send_buff,
- field->str, &position); /* column name alias */
- send_buff.reserve(position, 12);
- if (send_buff.is_error())
- goto err;
- send_buff.buffer[position++]= 12;
- int2store(send_buff.buffer + position, 1); /* charsetnr */
- int4store(send_buff.buffer + position + 2,
- field->length); /* field length */
- send_buff.buffer[position+6]= (char) MYSQL_TYPE_STRING; /* type */
- int2store(send_buff.buffer + position + 7, 0); /* flags */
- send_buff.buffer[position + 9]= (char) 0; /* decimals */
- send_buff.buffer[position + 10]= 0;
- send_buff.buffer[position + 11]= 0;
- position+= 12;
- if (my_net_write(net, send_buff.buffer, (uint) position+1))
- goto err;
- tmp= list_rest(tmp);
- }
-
- if (my_net_write(net, eof_buff, 1))
- goto err;
- return 0;
-
-err:
- return 1;
-}
diff --git a/server-tools/instance-manager/protocol.h b/server-tools/instance-manager/protocol.h
deleted file mode 100644
index b06ae4dfdb2..00000000000
--- a/server-tools/instance-manager/protocol.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PROTOCOL_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_PROTOCOL_H
-
-#include "buffer.h"
-
-#include <my_list.h>
-
-/* default field length to be used in various field-realted functions */
-enum { DEFAULT_FIELD_LENGTH= 20 };
-
-struct st_net;
-
-int net_send_ok(struct st_net *net, unsigned long connection_id,
- const char *message);
-
-int net_send_error(struct st_net *net, unsigned sql_errno);
-
-int net_send_error_323(struct st_net *net, unsigned sql_errno);
-
-int send_fields(struct st_net *net, LIST *fields);
-
-char *net_store_length(char *pkg, uint length);
-
-int store_to_protocol_packet(Buffer *buf, const char *string,
- size_t *position);
-
-int store_to_protocol_packet(Buffer *buf, const char *string, size_t *position,
- size_t string_len);
-
-int send_eof(struct st_net *net);
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PROTOCOL_H */
diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc
deleted file mode 100644
index 489caa0aaa8..00000000000
--- a/server-tools/instance-manager/thread_registry.cc
+++ /dev/null
@@ -1,419 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "thread_registry.h"
-#include <thr_alarm.h>
-#include <signal.h>
-#include "log.h"
-
-#ifndef __WIN__
-/* Kick-off signal handler */
-
-enum { THREAD_KICK_OFF_SIGNAL= SIGUSR2 };
-
-extern "C" void handle_signal(int);
-
-void handle_signal(int __attribute__((unused)) sig_no)
-{
-}
-#endif
-
-/* Thread_info initializer methods */
-
-void Thread_info::init(bool send_signal_on_shutdown_arg)
-{
- thread_id= pthread_self();
- send_signal_on_shutdown= send_signal_on_shutdown_arg;
-}
-
-/*
- TODO: think about moving signal information (now it's shutdown_in_progress)
- to Thread_info. It will reduce contention and allow signal deliverence to
- a particular thread, not to the whole worker crew
-*/
-
-Thread_registry::Thread_registry() :
- shutdown_in_progress(FALSE)
- ,sigwait_thread_pid(pthread_self())
- ,error_status(FALSE)
-{
- pthread_mutex_init(&LOCK_thread_registry, 0);
- pthread_cond_init(&COND_thread_registry_is_empty, 0);
-
- /* head is used by-value to simplify nodes inserting */
- head.next= head.prev= &head;
-}
-
-
-Thread_registry::~Thread_registry()
-{
- /* Check that no one uses the repository. */
- pthread_mutex_lock(&LOCK_thread_registry);
-
- for (Thread_info *ti= head.next; ti != &head; ti= ti->next)
- {
- log_error("Thread_registry: unregistered thread: %lu.",
- (unsigned long) ti->thread_id);
- }
-
- /* All threads must unregister */
- DBUG_ASSERT(head.next == &head);
-
- pthread_mutex_unlock(&LOCK_thread_registry);
- pthread_cond_destroy(&COND_thread_registry_is_empty);
- pthread_mutex_destroy(&LOCK_thread_registry);
-}
-
-
-/*
- Set signal handler for kick-off thread, and insert a thread info to the
- repository. New node is appended to the end of the list; head.prev always
- points to the last node.
-*/
-
-void Thread_registry::register_thread(Thread_info *info,
- bool send_signal_on_shutdown)
-{
- info->init(send_signal_on_shutdown);
-
- DBUG_PRINT("info", ("Thread_registry: registering thread %lu...",
- (unsigned long) info->thread_id));
-
-#ifndef __WIN__
- struct sigaction sa;
- sa.sa_handler= handle_signal;
- sa.sa_flags= 0;
- sigemptyset(&sa.sa_mask);
- sigaction(THREAD_KICK_OFF_SIGNAL, &sa, 0);
-#endif
- info->current_cond= 0;
-
- pthread_mutex_lock(&LOCK_thread_registry);
- info->next= &head;
- info->prev= head.prev;
- head.prev->next= info;
- head.prev= info;
- pthread_mutex_unlock(&LOCK_thread_registry);
-}
-
-
-/*
- Unregister a thread from the repository and free Thread_info structure.
- Every registered thread must unregister. Unregistering should be the last
- thing a thread is doing, otherwise it could have no time to finalize.
-*/
-
-void Thread_registry::unregister_thread(Thread_info *info)
-{
- DBUG_PRINT("info", ("Thread_registry: unregistering thread %lu...",
- (unsigned long) info->thread_id));
-
- pthread_mutex_lock(&LOCK_thread_registry);
- info->prev->next= info->next;
- info->next->prev= info->prev;
-
- if (head.next == &head)
- {
- DBUG_PRINT("info", ("Thread_registry: thread registry is empty!"));
- pthread_cond_signal(&COND_thread_registry_is_empty);
- }
-
- pthread_mutex_unlock(&LOCK_thread_registry);
-}
-
-
-/*
- Check whether shutdown is in progress, and if yes, return immediately.
- Else set info->current_cond and call pthread_cond_wait. When
- pthread_cond_wait returns, unregister current cond and check the shutdown
- status again.
- RETURN VALUE
- return value from pthread_cond_wait
-*/
-
-int Thread_registry::cond_wait(Thread_info *info, pthread_cond_t *cond,
- pthread_mutex_t *mutex)
-{
- pthread_mutex_lock(&LOCK_thread_registry);
- if (shutdown_in_progress)
- {
- pthread_mutex_unlock(&LOCK_thread_registry);
- return 0;
- }
- info->current_cond= cond;
- pthread_mutex_unlock(&LOCK_thread_registry);
- /* sic: race condition here, cond can be signaled in deliver_shutdown */
- int rc= pthread_cond_wait(cond, mutex);
- pthread_mutex_lock(&LOCK_thread_registry);
- info->current_cond= 0;
- pthread_mutex_unlock(&LOCK_thread_registry);
- return rc;
-}
-
-
-int Thread_registry::cond_timedwait(Thread_info *info, pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- struct timespec *wait_time)
-{
- int rc;
- pthread_mutex_lock(&LOCK_thread_registry);
- if (shutdown_in_progress)
- {
- pthread_mutex_unlock(&LOCK_thread_registry);
- return 0;
- }
- info->current_cond= cond;
- pthread_mutex_unlock(&LOCK_thread_registry);
- /* sic: race condition here, cond can be signaled in deliver_shutdown */
- if ((rc= pthread_cond_timedwait(cond, mutex, wait_time)) == ETIME)
- rc= ETIMEDOUT; // For easier usage
- pthread_mutex_lock(&LOCK_thread_registry);
- info->current_cond= 0;
- pthread_mutex_unlock(&LOCK_thread_registry);
- return rc;
-}
-
-
-/*
- Deliver shutdown message to the workers crew.
- As it's impossible to avoid all race conditions, signal latecomers
- again.
-*/
-
-void Thread_registry::deliver_shutdown()
-{
- pthread_mutex_lock(&LOCK_thread_registry);
- shutdown_in_progress= TRUE;
-
-#ifndef __WIN__
- /* to stop reading from the network we need to flush alarm queue */
- end_thr_alarm(0);
- /*
- We have to deliver final alarms this way, as the main thread has already
- stopped alarm processing.
- */
- process_alarm(THR_SERVER_ALARM);
-#endif
-
- /*
- sic: race condition here, the thread may not yet fall into
- pthread_cond_wait.
- */
-
- interrupt_threads();
-
- wait_for_threads_to_unregister();
-
- /*
- If previous signals did not reach some threads, they must be sleeping
- in pthread_cond_wait or in a blocking syscall. Wake them up:
- every thread shall check signal variables after each syscall/cond_wait,
- so this time everybody should be informed (presumably each worker can
- get CPU during shutdown_time.)
- */
-
- interrupt_threads();
-
- /* Get the last chance to threads to stop. */
-
- wait_for_threads_to_unregister();
-
-#ifndef DBUG_OFF
- /*
- Print out threads, that didn't stopped. Thread_registry destructor will
- probably abort the program if there is still any alive thread.
- */
-
- if (head.next != &head)
- {
- DBUG_PRINT("info", ("Thread_registry: non-stopped threads:"));
-
- for (Thread_info *info= head.next; info != &head; info= info->next)
- DBUG_PRINT("info", (" - %lu", (unsigned long) info->thread_id));
- }
- else
- {
- DBUG_PRINT("info", ("Thread_registry: all threads stopped."));
- }
-#endif // DBUG_OFF
-
- pthread_mutex_unlock(&LOCK_thread_registry);
-}
-
-
-void Thread_registry::request_shutdown()
-{
- pthread_kill(sigwait_thread_pid, SIGTERM);
-}
-
-
-void Thread_registry::interrupt_threads()
-{
- for (Thread_info *info= head.next; info != &head; info= info->next)
- {
- if (!info->send_signal_on_shutdown)
- continue;
-
- pthread_kill(info->thread_id, THREAD_KICK_OFF_SIGNAL);
- if (info->current_cond)
- pthread_cond_signal(info->current_cond);
- }
-}
-
-
-void Thread_registry::wait_for_threads_to_unregister()
-{
- struct timespec shutdown_time;
-
- set_timespec(shutdown_time, 1);
-
- DBUG_PRINT("info", ("Thread_registry: joining threads..."));
-
- while (true)
- {
- if (head.next == &head)
- {
- DBUG_PRINT("info", ("Thread_registry: emptied."));
- return;
- }
-
- int error= pthread_cond_timedwait(&COND_thread_registry_is_empty,
- &LOCK_thread_registry,
- &shutdown_time);
-
- if (error == ETIMEDOUT || error == ETIME)
- {
- DBUG_PRINT("info", ("Thread_registry: threads shutdown timed out."));
- return;
- }
- }
-}
-
-
-/*********************************************************************
- class Thread
-*********************************************************************/
-
-#if defined(__ia64__) || defined(__ia64)
-/*
- We can live with 32K, but reserve 64K. Just to be safe.
- On ia64 we need to reserve double of the size.
-*/
-#define IM_THREAD_STACK_SIZE (128*1024L)
-#else
-#define IM_THREAD_STACK_SIZE (64*1024)
-#endif
-
-/*
- Change the stack size and start a thread. Return an error if either
- pthread_attr_setstacksize or pthread_create fails.
- Arguments are the same as for pthread_create().
-*/
-
-static
-int set_stacksize_and_create_thread(pthread_t *thread, pthread_attr_t *attr,
- void *(*start_routine)(void *), void *arg)
-{
- int rc= 0;
-
-#ifndef __WIN__
-#ifndef PTHREAD_STACK_MIN
-#define PTHREAD_STACK_MIN 32768
-#endif
- /*
- Set stack size to be safe on the platforms with too small
- default thread stack.
- */
- rc= pthread_attr_setstacksize(attr,
- (size_t) (PTHREAD_STACK_MIN +
- IM_THREAD_STACK_SIZE));
-#endif
- if (!rc)
- rc= pthread_create(thread, attr, start_routine, arg);
- return rc;
-}
-
-
-Thread::~Thread()
-{
-}
-
-
-void *Thread::thread_func(void *arg)
-{
- Thread *thread= (Thread *) arg;
- my_thread_init();
-
- thread->run();
-
- my_thread_end();
- return NULL;
-}
-
-
-bool Thread::start(enum_thread_type thread_type)
-{
- pthread_attr_t attr;
- int rc;
-
- pthread_attr_init(&attr);
-
- if (thread_type == DETACHED)
- {
- detached = TRUE;
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- }
- else
- {
- detached = FALSE;
- }
-
- rc= set_stacksize_and_create_thread(&id, &attr, Thread::thread_func, this);
- pthread_attr_destroy(&attr);
-
- return rc != 0;
-}
-
-
-bool Thread::join()
-{
- DBUG_ASSERT(!detached);
-
- return pthread_join(id, NULL) != 0;
-}
-
-
-int Thread_registry::get_error_status()
-{
- int ret_error_status;
-
- pthread_mutex_lock(&LOCK_thread_registry);
- ret_error_status= error_status;
- pthread_mutex_unlock(&LOCK_thread_registry);
-
- return ret_error_status;
-}
-
-
-void Thread_registry::set_error_status()
-{
- pthread_mutex_lock(&LOCK_thread_registry);
- error_status= TRUE;
- pthread_mutex_unlock(&LOCK_thread_registry);
-}
diff --git a/server-tools/instance-manager/thread_registry.h b/server-tools/instance-manager/thread_registry.h
deleted file mode 100644
index d04c8442e44..00000000000
--- a/server-tools/instance-manager/thread_registry.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_H
-
-/*
- A multi-threaded application shall nicely work with signals.
-
- This means it shall, first of all, shut down nicely on ``quit'' signals:
- stop all running threads, cleanup and exit.
-
- Note, that a thread can't be shut down nicely if it doesn't want to be.
- That's why to perform clean shutdown, all threads constituting a process
- must observe certain rules. Here we use the rules, described in Butenhof
- book 'Programming with POSIX threads', namely:
- - all user signals are handled in 'signal thread' in synchronous manner
- (by means of sigwait). To guarantee that the signal thread is the only who
- can receive user signals, all threads block them, and signal thread is
- the only who calls sigwait() with an apporpriate sigmask.
- To propogate a signal to the workers the signal thread sets
- a variable, corresponding to the signal. Additionally the signal thread
- sends each worker an internal signal (by means of pthread_kill) to kick it
- out from possible blocking syscall, and possibly pthread_cond_signal if
- some thread is blocked in pthread_cond_[timed]wait.
- - a worker handles only internal 'kick' signal (the handler does nothing).
- In case when a syscall returns 'EINTR' the worker checks all
- signal-related variables and behaves accordingly.
- Also these variables shall be checked from time to time in long
- CPU-bounded operations, and before/after pthread_cond_wait. (It's supposed
- that a worker thread either waits in a syscall/conditional variable, or
- computes something.)
- - to guarantee signal deliverence, there should be some kind of feedback,
- e. g. all workers shall account in the signal thread Thread Repository and
- unregister from it on exit.
-
- Configuration reload (on SIGHUP) and thread timeouts/alarms can be handled
- in manner, similar to ``quit'' signals.
-*/
-
-#include <my_global.h>
-#include <my_pthread.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-/**
- Thread_info - repository entry for each worker thread
- All entries comprise double-linked list like:
- 0 -- entry -- entry -- entry - 0
- Double-linked list is used to unregister threads easy.
-*/
-
-class Thread_info
-{
-public:
- Thread_info() {}
- friend class Thread_registry;
-private:
- void init(bool send_signal_on_shutdown);
-private:
- pthread_cond_t *current_cond;
- Thread_info *prev, *next;
- pthread_t thread_id;
- bool send_signal_on_shutdown;
-};
-
-
-/**
- A base class for a detached thread.
-*/
-
-class Thread
-{
-public:
- enum enum_thread_type
- {
- DETACHED,
- JOINABLE
- };
-public:
- Thread()
- { }
-
-public:
- inline bool is_detached() const;
-
- bool start(enum_thread_type thread_type = JOINABLE);
- bool join();
-
-protected:
- virtual void run()= 0;
- virtual ~Thread();
-
-private:
- pthread_t id;
- bool detached;
-
-private:
- static void *thread_func(void *arg);
-
-private:
- Thread(const Thread & /* rhs */); /* not implemented */
- Thread &operator=(const Thread & /* rhs */); /* not implemented */
-};
-
-inline bool Thread::is_detached() const
-{
- return detached;
-}
-
-
-/**
- Thread_registry - contains handles for each worker thread to deliver
- signal information to workers.
-*/
-
-class Thread_registry
-{
-public:
- Thread_registry();
- ~Thread_registry();
-
- void register_thread(Thread_info *info, bool send_signal_on_shutdown= TRUE);
- void unregister_thread(Thread_info *info);
- void deliver_shutdown();
- void request_shutdown();
- inline bool is_shutdown();
- int cond_wait(Thread_info *info, pthread_cond_t *cond,
- pthread_mutex_t *mutex);
- int cond_timedwait(Thread_info *info, pthread_cond_t *cond,
- pthread_mutex_t *mutex, struct timespec *wait_time);
- int get_error_status();
- void set_error_status();
-
-private:
- void interrupt_threads();
- void wait_for_threads_to_unregister();
-
-private:
- Thread_info head;
- bool shutdown_in_progress;
- pthread_mutex_t LOCK_thread_registry;
- pthread_cond_t COND_thread_registry_is_empty;
- pthread_t sigwait_thread_pid;
- bool error_status;
-
-private:
- Thread_registry(const Thread_registry &);
- Thread_registry &operator =(const Thread_registry &);
-};
-
-
-inline bool Thread_registry::is_shutdown()
-{
- pthread_mutex_lock(&LOCK_thread_registry);
- bool res= shutdown_in_progress;
- pthread_mutex_unlock(&LOCK_thread_registry);
- return res;
-}
-
-
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_H */
diff --git a/server-tools/instance-manager/user_management_commands.cc b/server-tools/instance-manager/user_management_commands.cc
deleted file mode 100644
index 2eb0ae30aa5..00000000000
--- a/server-tools/instance-manager/user_management_commands.cc
+++ /dev/null
@@ -1,421 +0,0 @@
-/* Copyright (C) 2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "user_management_commands.h"
-
-#include "exit_codes.h"
-#include "options.h"
-#include "user_map.h"
-
-/*************************************************************************
- Module-specific (internal) functions.
-*************************************************************************/
-
-/*
- The function returns user name. The user name is retrieved from command-line
- options (if specified) or from console.
-
- NOTE
- This function must not be used in user-management command implementations.
- Use get_user_name() instead.
-
- SYNOPSIS
- get_user_name_impl()
-
- RETURN
- NULL on error
- valid pointer on success
-*/
-
-static char *get_user_name_impl()
-{
- static char user_name_buf[1024];
- char *ptr;
-
- if (Options::User_management::user_name)
- return Options::User_management::user_name;
-
- printf("Enter user name: ");
- fflush(stdout);
-
- if (!fgets(user_name_buf, sizeof (user_name_buf), stdin))
- return NULL;
-
- if ((ptr= strchr(user_name_buf, '\n')))
- *ptr= 0;
-
- if ((ptr= strchr(user_name_buf, '\r')))
- *ptr= 0;
-
- return user_name_buf;
-}
-
-
-/*
- The function is intended to provide user name for user-management
- operations. It also checks that length of the specified user name is correct
- (not empty, not exceeds USERNAME_LENGTH). Report to stderr if something is
- wrong.
-
- SYNOPSIS
- get_user_name()
- user_name [OUT] on success contains user name
-
- RETURN
- TRUE on error
- FALSE on success
-*/
-
-static bool get_user_name(LEX_STRING *user_name)
-{
- char *user_name_str= get_user_name_impl();
-
- if (!user_name_str)
- {
- fprintf(stderr, "Error: unable to read user name from stdin.\n");
- return TRUE;
- }
-
- user_name->str= user_name_str;
- user_name->length= strlen(user_name->str);
-
- if (user_name->length == 0)
- {
- fprintf(stderr, "Error: user name can not be empty.\n");
- return TRUE;
- }
-
- if (user_name->length > USERNAME_LENGTH)
- {
- fprintf(stderr, "Error: user name must not exceed %d characters.\n",
- (int) USERNAME_LENGTH);
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/*
- The function is intended to provide password for user-management operations.
- The password is retrieved from command-line options (if specified) or from
- console.
-
- SYNOPSIS
- get_password()
-
- RETURN
- NULL on error
- valid pointer on success
-*/
-
-static const char *get_password()
-{
- if (Options::User_management::password)
- return Options::User_management::password;
-
- const char *passwd1= get_tty_password("Enter password: ");
- const char *passwd2= get_tty_password("Re-type password: ");
-
- if (strcmp(passwd1, passwd2))
- {
- fprintf(stderr, "Error: passwords do not match.\n");
- return 0;
- }
-
- return passwd1;
-}
-
-
-/*
- Load password file into user map.
-
- SYNOPSIS
- load_password_file()
- user_map target user map
-
- RETURN
- See exit_codes.h for possible values.
-*/
-
-static int load_password_file(User_map *user_map)
-{
- int err_code;
- const char *err_msg;
-
- if (user_map->init())
- {
- fprintf(stderr, "Error: can not initialize user map.\n");
- return ERR_OUT_OF_MEMORY;
- }
-
- if ((err_code= user_map->load(Options::Main::password_file_name, &err_msg)))
- fprintf(stderr, "Error: %s.\n", (const char *) err_msg);
-
- return err_code;
-}
-
-
-/*
- Save user map into password file.
-
- SYNOPSIS
- save_password_file()
- user_map user map
-
- RETURN
- See exit_codes.h for possible values.
-*/
-
-static int save_password_file(User_map *user_map)
-{
- int err_code;
- const char *err_msg;
-
- if ((err_code= user_map->save(Options::Main::password_file_name, &err_msg)))
- fprintf(stderr, "Error: %s.\n", (const char *) err_msg);
-
- return err_code;
-}
-
-/*************************************************************************
- Print_password_line_cmd
-*************************************************************************/
-
-int Print_password_line_cmd::execute()
-{
- LEX_STRING user_name;
- const char *password;
-
- printf("Creating record for new user.\n");
-
- if (get_user_name(&user_name))
- return ERR_CAN_NOT_READ_USER_NAME;
-
- if (!(password= get_password()))
- return ERR_CAN_NOT_READ_PASSWORD;
-
- {
- User user(&user_name, password);
-
- printf("%s:%s\n",
- (const char *) user.user,
- (const char *) user.scrambled_password);
- }
-
- return ERR_OK;
-}
-
-
-/*************************************************************************
- Add_user_cmd
-*************************************************************************/
-
-int Add_user_cmd::execute()
-{
- LEX_STRING user_name;
- const char *password;
-
- User_map user_map;
- User *new_user;
-
- int err_code;
-
- if (get_user_name(&user_name))
- return ERR_CAN_NOT_READ_USER_NAME;
-
- /* Load the password file. */
-
- if ((err_code= load_password_file(&user_map)) != ERR_OK)
- return err_code;
-
- /* Check that the user does not exist. */
-
- if (user_map.find_user(&user_name))
- {
- fprintf(stderr, "Error: user '%s' already exists.\n",
- (const char *) user_name.str);
- return ERR_USER_ALREADY_EXISTS;
- }
-
- /* Add the user. */
-
- if (!(password= get_password()))
- return ERR_CAN_NOT_READ_PASSWORD;
-
- if (!(new_user= new User(&user_name, password)))
- return ERR_OUT_OF_MEMORY;
-
- if (user_map.add_user(new_user))
- {
- delete new_user;
- return ERR_OUT_OF_MEMORY;
- }
-
- /* Save the password file. */
-
- return save_password_file(&user_map);
-}
-
-
-/*************************************************************************
- Drop_user_cmd
-*************************************************************************/
-
-int Drop_user_cmd::execute()
-{
- LEX_STRING user_name;
-
- User_map user_map;
- User *user;
-
- int err_code;
-
- if (get_user_name(&user_name))
- return ERR_CAN_NOT_READ_USER_NAME;
-
- /* Load the password file. */
-
- if ((err_code= load_password_file(&user_map)) != ERR_OK)
- return err_code;
-
- /* Find the user. */
-
- user= user_map.find_user(&user_name);
-
- if (!user)
- {
- fprintf(stderr, "Error: user '%s' does not exist.\n",
- (const char *) user_name.str);
- return ERR_USER_NOT_FOUND;
- }
-
- /* Remove the user (ignore possible errors). */
-
- user_map.remove_user(user);
-
- /* Save the password file. */
-
- return save_password_file(&user_map);
-}
-
-
-/*************************************************************************
- Edit_user_cmd
-*************************************************************************/
-
-int Edit_user_cmd::execute()
-{
- LEX_STRING user_name;
- const char *password;
-
- User_map user_map;
- User *user;
-
- int err_code;
-
- if (get_user_name(&user_name))
- return ERR_CAN_NOT_READ_USER_NAME;
-
- /* Load the password file. */
-
- if ((err_code= load_password_file(&user_map)) != ERR_OK)
- return err_code;
-
- /* Find the user. */
-
- user= user_map.find_user(&user_name);
-
- if (!user)
- {
- fprintf(stderr, "Error: user '%s' does not exist.\n",
- (const char *) user_name.str);
- return ERR_USER_NOT_FOUND;
- }
-
- /* Modify user's password. */
-
- if (!(password= get_password()))
- return ERR_CAN_NOT_READ_PASSWORD;
-
- user->set_password(password);
-
- /* Save the password file. */
-
- return save_password_file(&user_map);
-}
-
-
-/*************************************************************************
- Clean_db_cmd
-*************************************************************************/
-
-int Clean_db_cmd::execute()
-{
- User_map user_map;
-
- if (user_map.init())
- {
- fprintf(stderr, "Error: can not initialize user map.\n");
- return ERR_OUT_OF_MEMORY;
- }
-
- return save_password_file(&user_map);
-}
-
-
-/*************************************************************************
- Check_db_cmd
-*************************************************************************/
-
-int Check_db_cmd::execute()
-{
- User_map user_map;
-
- return load_password_file(&user_map);
-}
-
-
-/*************************************************************************
- List_users_cmd
-*************************************************************************/
-
-int List_users_cmd::execute()
-{
- User_map user_map;
-
- int err_code;
-
- /* Load the password file. */
-
- if ((err_code= load_password_file(&user_map)))
- return err_code;
-
- /* Print out registered users. */
-
- {
- User_map::Iterator it(&user_map);
- User *user;
-
- while ((user= it.next()))
- fprintf(stderr, "%s\n", (const char *) user->user);
- }
-
- return ERR_OK;
-}
diff --git a/server-tools/instance-manager/user_management_commands.h b/server-tools/instance-manager/user_management_commands.h
deleted file mode 100644
index c925e6ae363..00000000000
--- a/server-tools/instance-manager/user_management_commands.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H
-
-/*
- Copyright (C) 2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- This header contains declarations of classes inteded to support
- user-management commands (such as add user, get list of users, etc).
-
- The general idea is to have one interface (pure abstract class) for such a
- command. Each concrete user-management command is implemented in concrete
- class, derived from the common interface.
-*/
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-/*************************************************************************
- User_management_cmd -- base class for User-management commands.
-*************************************************************************/
-
-class User_management_cmd
-{
-public:
- User_management_cmd()
- { }
-
- virtual ~User_management_cmd()
- { }
-
-public:
- /*
- Executes user-management command.
-
- SYNOPSIS
- execute()
-
- RETURN
- See exit_codes.h for possible values.
- */
-
- virtual int execute() = 0;
-};
-
-
-/*************************************************************************
- Print_password_line_cmd: support for --print-password-line command-line
- option.
-*************************************************************************/
-
-class Print_password_line_cmd: public User_management_cmd
-{
-public:
- Print_password_line_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- Add_user_cmd: support for --add-user command-line option.
-*************************************************************************/
-
-class Add_user_cmd: public User_management_cmd
-{
-public:
- Add_user_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- Drop_user_cmd: support for --drop-user command-line option.
-*************************************************************************/
-
-class Drop_user_cmd: public User_management_cmd
-{
-public:
- Drop_user_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- Edit_user_cmd: support for --edit-user command-line option.
-*************************************************************************/
-
-class Edit_user_cmd: public User_management_cmd
-{
-public:
- Edit_user_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- Clean_db_cmd: support for --clean-db command-line option.
-*************************************************************************/
-
-class Clean_db_cmd: public User_management_cmd
-{
-public:
- Clean_db_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- Check_db_cmd: support for --check-db command-line option.
-*************************************************************************/
-
-class Check_db_cmd: public User_management_cmd
-{
-public:
- Check_db_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-
-/*************************************************************************
- List_users_cmd: support for --list-users command-line option.
-*************************************************************************/
-
-class List_users_cmd: public User_management_cmd
-{
-public:
- List_users_cmd()
- { }
-
-public:
- virtual int execute();
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H
diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc
deleted file mode 100644
index 49c35c16ca9..00000000000
--- a/server-tools/instance-manager/user_map.cc
+++ /dev/null
@@ -1,395 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
-#pragma implementation
-#endif
-
-#include "user_map.h"
-#include "exit_codes.h"
-#include "log.h"
-#include "portability.h"
-
-User::User(const LEX_STRING *user_name_arg, const char *password)
-{
- user_length= (uint8) (strmake(user, user_name_arg->str,
- USERNAME_LENGTH + 1) - user);
- set_password(password);
-}
-
-int User::init(const char *line)
-{
- const char *name_begin, *name_end, *password;
- int password_length;
-
- if (line[0] == '\'' || line[0] == '"')
- {
- name_begin= line + 1;
- name_end= strchr(name_begin, line[0]);
- if (name_end == 0 || name_end[1] != ':')
- {
- log_error("Invalid format (unmatched quote) of user line (%s).",
- (const char *) line);
- return 1;
- }
- password= name_end + 2;
- }
- else
- {
- name_begin= line;
- name_end= strchr(name_begin, ':');
- if (name_end == 0)
- {
- log_error("Invalid format (no delimiter) of user line (%s).",
- (const char *) line);
- return 1;
- }
- password= name_end + 1;
- }
-
- user_length= (uint8) (name_end - name_begin);
- if (user_length > USERNAME_LENGTH)
- {
- log_error("User name is too long (%d). Max length: %d. "
- "User line: '%s'.",
- (int) user_length,
- (int) USERNAME_LENGTH,
- (const char *) line);
- return 1;
- }
-
- password_length= (int) strlen(password);
- if (password_length > SCRAMBLED_PASSWORD_CHAR_LENGTH)
- {
- log_error("Password is too long (%d). Max length: %d."
- "User line: '%s'.",
- (int) password_length,
- (int) SCRAMBLED_PASSWORD_CHAR_LENGTH,
- (const char *) line);
- return 1;
- }
-
- memcpy(user, name_begin, user_length);
- user[user_length]= 0;
-
- memcpy(scrambled_password, password, password_length);
- scrambled_password[password_length]= 0;
-
- get_salt_from_password(salt, password);
-
- log_info("Loaded user '%s'.", (const char *) user);
-
- return 0;
-}
-
-
-C_MODE_START
-
-static uchar* get_user_key(const uchar* u, size_t* len,
- my_bool __attribute__((unused)) t)
-{
- const User *user= (const User *) u;
- *len= user->user_length;
- return (uchar *) user->user;
-}
-
-static void delete_user(void *u)
-{
- User *user= (User *) u;
- delete user;
-}
-
-C_MODE_END
-
-
-void User_map::Iterator::reset()
-{
- cur_idx= 0;
-}
-
-
-User *User_map::Iterator::next()
-{
- if (cur_idx < user_map->hash.records)
- return (User *) hash_element(&user_map->hash, cur_idx++);
-
- return NULL;
-}
-
-
-int User_map::init()
-{
- enum { START_HASH_SIZE= 16 };
- if (hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
- get_user_key, delete_user, 0))
- return 1;
-
- initialized= TRUE;
-
- return 0;
-}
-
-
-User_map::User_map()
- :initialized(FALSE)
-{
-}
-
-
-User_map::~User_map()
-{
- if (initialized)
- hash_free(&hash);
-}
-
-
-/*
- Load password database.
-
- SYNOPSIS
- load()
- password_file_name [IN] password file path
- err_msg [OUT] error message
-
- DESCRIPTION
- Load all users from the password file. Must be called once right after
- construction. In case of failure, puts error message to the log file and
- returns specific error code.
-
- RETURN
- 0 on success
- !0 on error
-*/
-
-int User_map::load(const char *password_file_name, const char **err_msg)
-{
- static const int ERR_MSG_BUF_SIZE = 255;
- static char err_msg_buf[ERR_MSG_BUF_SIZE];
-
- FILE *file;
- char line[USERNAME_LENGTH + SCRAMBLED_PASSWORD_CHAR_LENGTH +
- 2 + /* for possible quotes */
- 1 + /* for ':' */
- 2 + /* for newline */
- 1]; /* for trailing zero */
- User *user;
-
- if (my_access(password_file_name, F_OK) != 0)
- {
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "password file (%s) does not exist",
- (const char *) password_file_name);
- *err_msg= err_msg_buf;
- }
-
- return ERR_PASSWORD_FILE_DOES_NOT_EXIST;
- }
-
- if ((file= my_fopen(password_file_name, O_RDONLY | O_BINARY, MYF(0))) == 0)
- {
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "can not open password file (%s): %s",
- (const char *) password_file_name,
- (const char *) strerror(errno));
- *err_msg= err_msg_buf;
- }
-
- return ERR_IO_ERROR;
- }
-
- log_info("Loading the password database...");
-
- while (fgets(line, sizeof(line), file))
- {
- char *user_line= line;
-
- /*
- We need to skip EOL-symbols also from the beginning of the line, because
- if the previous line was ended by \n\r sequence, we get \r in our line.
- */
-
- while (user_line[0] == '\r' || user_line[0] == '\n')
- ++user_line;
-
- /* Skip EOL-symbols in the end of the line. */
-
- {
- char *ptr;
-
- if ((ptr= strchr(user_line, '\n')))
- *ptr= 0;
-
- if ((ptr= strchr(user_line, '\r')))
- *ptr= 0;
- }
-
- /* skip comments and empty lines */
- if (!user_line[0] || user_line[0] == '#')
- continue;
-
- if ((user= new User) == 0)
- {
- my_fclose(file, MYF(0));
-
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "out of memory while parsing password file (%s)",
- (const char *) password_file_name);
- *err_msg= err_msg_buf;
- }
-
- return ERR_OUT_OF_MEMORY;
- }
-
- if (user->init(user_line))
- {
- delete user;
- my_fclose(file, MYF(0));
-
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "password file (%s) corrupted",
- (const char *) password_file_name);
- *err_msg= err_msg_buf;
- }
-
- return ERR_PASSWORD_FILE_CORRUPTED;
- }
-
- if (my_hash_insert(&hash, (uchar *) user))
- {
- delete user;
- my_fclose(file, MYF(0));
-
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "out of memory while parsing password file (%s)",
- (const char *) password_file_name);
- *err_msg= err_msg_buf;
- }
-
- return ERR_OUT_OF_MEMORY;
- }
- }
-
- log_info("The password database loaded successfully.");
-
- my_fclose(file, MYF(0));
-
- if (err_msg)
- *err_msg= NULL;
-
- return ERR_OK;
-}
-
-
-int User_map::save(const char *password_file_name, const char **err_msg)
-{
- static const int ERR_MSG_BUF_SIZE = 255;
- static char err_msg_buf[ERR_MSG_BUF_SIZE];
-
- FILE *file;
-
- if ((file= my_fopen(password_file_name, O_WRONLY | O_TRUNC | O_BINARY,
- MYF(0))) == 0)
- {
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "can not open password file (%s) for writing: %s",
- (const char *) password_file_name,
- (const char *) strerror(errno));
- *err_msg= err_msg_buf;
- }
-
- return ERR_IO_ERROR;
- }
-
- {
- User_map::Iterator it(this);
- User *user;
-
- while ((user= it.next()))
- {
- if (fprintf(file, "%s:%s\n", (const char *) user->user,
- (const char *) user->scrambled_password) < 0)
- {
- if (err_msg)
- {
- snprintf(err_msg_buf, ERR_MSG_BUF_SIZE,
- "can not write to password file (%s): %s",
- (const char *) password_file_name,
- (const char *) strerror(errno));
- *err_msg= err_msg_buf;
- }
-
- my_fclose(file, MYF(0));
-
- return ERR_IO_ERROR;
- }
- }
- }
-
- my_fclose(file, MYF(0));
-
- return ERR_OK;
-}
-
-
-/*
- Check if user exists and password is correct
- RETURN VALUE
- 0 - user found and password OK
- 1 - password mismatch
- 2 - user not found
-*/
-
-int User_map::authenticate(const LEX_STRING *user_name,
- const char *scrambled_password,
- const char *scramble) const
-{
- const User *user= find_user(user_name);
- return user ? check_scramble(scrambled_password, scramble, user->salt) : 2;
-}
-
-
-User *User_map::find_user(const LEX_STRING *user_name)
-{
- return (User*) hash_search(&hash, (uchar*) user_name->str, user_name->length);
-}
-
-const User *User_map::find_user(const LEX_STRING *user_name) const
-{
- return const_cast<User_map *> (this)->find_user(user_name);
-}
-
-
-bool User_map::add_user(User *user)
-{
- return my_hash_insert(&hash, (uchar*) user) == 0 ? FALSE : TRUE;
-}
-
-
-bool User_map::remove_user(User *user)
-{
- return hash_delete(&hash, (uchar*) user) == 0 ? FALSE : TRUE;
-}
diff --git a/server-tools/instance-manager/user_map.h b/server-tools/instance-manager/user_map.h
deleted file mode 100644
index 6168f2b04fa..00000000000
--- a/server-tools/instance-manager/user_map.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright (C) 2004-2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MAP_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MAP_H
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <mysql_com.h>
-#include <m_string.h>
-#include <hash.h>
-
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
-struct User
-{
- User()
- {}
-
- User(const LEX_STRING *user_name_arg, const char *password);
-
- int init(const char *line);
-
- inline void set_password(const char *password)
- {
- make_scrambled_password(scrambled_password, password);
- }
-
- char user[USERNAME_LENGTH + 1];
- char scrambled_password[SCRAMBLED_PASSWORD_CHAR_LENGTH + 1];
- uint8 user_length;
- uint8 salt[SCRAMBLE_LENGTH];
-};
-
-/*
- User_map -- all users and passwords
-*/
-
-class User_map
-{
-public:
- /* User_map iterator */
-
- class Iterator
- {
- public:
- Iterator(User_map *user_map_arg) :
- user_map(user_map_arg), cur_idx(0)
- { }
-
- public:
- void reset();
-
- User *next();
-
- private:
- User_map *user_map;
- uint cur_idx;
- };
-
-public:
- User_map();
- ~User_map();
-
- int init();
- int load(const char *password_file_name, const char **err_msg);
- int save(const char *password_file_name, const char **err_msg);
- int authenticate(const LEX_STRING *user_name,
- const char *scrambled_password,
- const char *scramble) const;
-
- const User *find_user(const LEX_STRING *user_name) const;
- User *find_user(const LEX_STRING *user_name);
-
- bool add_user(User *user);
- bool remove_user(User *user);
-
-private:
- User_map(const User_map &);
- User_map &operator =(const User_map &);
-
-private:
- HASH hash;
- bool initialized;
-
- friend class Iterator;
-};
-
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MAP_H
diff --git a/sql-common/client.c b/sql-common/client.c
index 51bbda3bade..5114b645818 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -145,9 +145,12 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen,
uint timeout)
{
#if defined(__WIN__) || defined(__NETWARE__)
- return connect(fd, (struct sockaddr*) name, namelen);
+ DBUG_ENTER("my_connect");
+ DBUG_RETURN(connect(fd, (struct sockaddr*) name, namelen));
#else
int flags, res, s_err;
+ DBUG_ENTER("my_connect");
+ DBUG_PRINT("enter", ("fd: %d timeout: %u", fd, timeout));
/*
If they passed us a timeout of zero, we should behave
@@ -155,24 +158,26 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen,
*/
if (timeout == 0)
- return connect(fd, (struct sockaddr*) name, namelen);
+ DBUG_RETURN(connect(fd, (struct sockaddr*) name, namelen));
flags = fcntl(fd, F_GETFL, 0); /* Set socket to not block */
#ifdef O_NONBLOCK
fcntl(fd, F_SETFL, flags | O_NONBLOCK); /* and save the flags.. */
#endif
+ DBUG_PRINT("info", ("connecting non-blocking"));
res= connect(fd, (struct sockaddr*) name, namelen);
+ DBUG_PRINT("info", ("connect result: %d errno: %d", res, errno));
s_err= errno; /* Save the error... */
fcntl(fd, F_SETFL, flags);
if ((res != 0) && (s_err != EINPROGRESS))
{
errno= s_err; /* Restore it */
- return(-1);
+ DBUG_RETURN(-1);
}
if (res == 0) /* Connected quickly! */
- return(0);
- return wait_for_data(fd, timeout);
+ DBUG_RETURN(0);
+ DBUG_RETURN(wait_for_data(fd, timeout));
#endif
}
@@ -191,26 +196,58 @@ static int wait_for_data(my_socket fd, uint timeout)
#ifdef HAVE_POLL
struct pollfd ufds;
int res;
+ DBUG_ENTER("wait_for_data");
+ DBUG_PRINT("info", ("polling"));
ufds.fd= fd;
ufds.events= POLLIN | POLLPRI;
if (!(res= poll(&ufds, 1, (int) timeout*1000)))
{
+ DBUG_PRINT("info", ("poll timed out"));
errno= EINTR;
- return -1;
+ DBUG_RETURN(-1);
}
+ DBUG_PRINT("info",
+ ("poll result: %d errno: %d revents: 0x%02d events: 0x%02d",
+ res, errno, ufds.revents, ufds.events));
if (res < 0 || !(ufds.revents & (POLLIN | POLLPRI)))
- return -1;
- return 0;
+ DBUG_RETURN(-1);
+ /*
+ At this point, we know that something happened on the socket.
+ But this does not means that everything is alright.
+ The connect might have failed. We need to retrieve the error code
+ from the socket layer. We must return success only if we are sure
+ that it was really a success. Otherwise we might prevent the caller
+ from trying another address to connect to.
+ */
+ {
+ int s_err;
+ socklen_t s_len= sizeof(s_err);
+
+ DBUG_PRINT("info", ("Get SO_ERROR from non-blocked connected socket."));
+ res= getsockopt(fd, SOL_SOCKET, SO_ERROR, &s_err, &s_len);
+ DBUG_PRINT("info", ("getsockopt res: %d s_err: %d", res, s_err));
+ if (res)
+ DBUG_RETURN(res);
+ /* getsockopt() was successful, check the retrieved status value. */
+ if (s_err)
+ {
+ errno= s_err;
+ DBUG_RETURN(-1);
+ }
+ /* Status from connect() is zero. Socket is successfully connected. */
+ }
+ DBUG_RETURN(0);
#else
SOCKOPT_OPTLEN_TYPE s_err_size = sizeof(uint);
fd_set sfds;
struct timeval tv;
time_t start_time, now_time;
int res, s_err;
+ DBUG_ENTER("wait_for_data");
if (fd >= FD_SETSIZE) /* Check if wrong error */
- return 0; /* Can't use timeout */
+ DBUG_RETURN(0); /* Can't use timeout */
/*
Our connection is "in progress." We can use the select() call to wait
@@ -250,11 +287,11 @@ static int wait_for_data(my_socket fd, uint timeout)
break;
#endif
if (res == 0) /* timeout */
- return -1;
+ DBUG_RETURN(-1);
now_time= my_time(0);
timeout-= (uint) (now_time - start_time);
if (errno != EINTR || (int) timeout <= 0)
- return -1;
+ DBUG_RETURN(-1);
}
/*
@@ -265,14 +302,14 @@ static int wait_for_data(my_socket fd, uint timeout)
s_err=0;
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0)
- return(-1);
+ DBUG_RETURN(-1);
if (s_err)
{ /* getsockopt could succeed */
errno = s_err;
- return(-1); /* but return an error... */
+ DBUG_RETURN(-1); /* but return an error... */
}
- return (0); /* ok */
+ DBUG_RETURN(0); /* ok */
#endif /* HAVE_POLL */
}
#endif /* defined(__WIN__) || defined(__NETWARE__) */
@@ -673,10 +710,14 @@ err:
}
#endif
-/*****************************************************************************
+/**
Read a packet from server. Give error message if socket was down
or packet is an error message
-*****************************************************************************/
+
+ @retval packet_error An error occurred during reading.
+ Error message is set.
+ @retval
+*/
ulong
cli_safe_read(MYSQL *mysql)
@@ -842,31 +883,132 @@ void free_old_query(MYSQL *mysql)
DBUG_VOID_RETURN;
}
+
+/**
+ Finish reading of a partial result set from the server.
+ Get the EOF packet, and update mysql->status
+ and mysql->warning_count.
+
+ @return TRUE if a communication or protocol error, an error
+ is set in this case, FALSE otherwise.
+*/
+
+my_bool flush_one_result(MYSQL *mysql)
+{
+ ulong packet_length;
+
+ DBUG_ASSERT(mysql->status != MYSQL_STATUS_READY);
+
+ do
+ {
+ packet_length= cli_safe_read(mysql);
+ /*
+ There is an error reading from the connection,
+ or (sic!) there were no error and no
+ data in the stream, i.e. no more data from the server.
+ Since we know our position in the stream (somewhere in
+ the middle of a result set), this latter case is an error too
+ -- each result set must end with a EOF packet.
+ cli_safe_read() has set an error for us, just return.
+ */
+ if (packet_length == packet_error)
+ return TRUE;
+ }
+ while (packet_length > 8 || mysql->net.read_pos[0] != 254);
+
+ /* Analyze EOF packet of the result set. */
+
+ if (protocol_41(mysql))
+ {
+ char *pos= (char*) mysql->net.read_pos + 1;
+ mysql->warning_count=uint2korr(pos);
+ pos+=2;
+ mysql->server_status=uint2korr(pos);
+ pos+=2;
+ }
+ return FALSE;
+}
+
+
+/**
+ Read a packet from network. If it's an OK packet, flush it.
+
+ @return TRUE if error, FALSE otherwise. In case of
+ success, is_ok_packet is set to TRUE or FALSE,
+ based on what we got from network.
+*/
+
+my_bool opt_flush_ok_packet(MYSQL *mysql, my_bool *is_ok_packet)
+{
+ ulong packet_length= cli_safe_read(mysql);
+
+ if (packet_length == packet_error)
+ return TRUE;
+
+ /* cli_safe_read always reads a non-empty packet. */
+ DBUG_ASSERT(packet_length);
+
+ *is_ok_packet= mysql->net.read_pos[0] == 0;
+ if (*is_ok_packet)
+ {
+ uchar *pos= mysql->net.read_pos + 1;
+
+ net_field_length_ll(&pos); /* affected rows */
+ net_field_length_ll(&pos); /* insert id */
+
+ mysql->server_status=uint2korr(pos);
+ pos+=2;
+
+ if (protocol_41(mysql))
+ {
+ mysql->warning_count=uint2korr(pos);
+ pos+=2;
+ }
+ }
+ return FALSE;
+}
+
+
/*
Flush result set sent from server
*/
-static void cli_flush_use_result(MYSQL *mysql)
+static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results)
{
/* Clear the current execution status */
DBUG_ENTER("cli_flush_use_result");
DBUG_PRINT("warning",("Not all packets read, clearing them"));
- for (;;)
+
+ if (flush_one_result(mysql))
+ DBUG_VOID_RETURN; /* An error occurred */
+
+ if (! flush_all_results)
+ DBUG_VOID_RETURN;
+
+ while (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
{
- ulong pkt_len;
- if ((pkt_len=cli_safe_read(mysql)) == packet_error)
- break;
- if (pkt_len <= 8 && mysql->net.read_pos[0] == 254)
+ my_bool is_ok_packet;
+ if (opt_flush_ok_packet(mysql, &is_ok_packet))
+ DBUG_VOID_RETURN; /* An error occurred. */
+ if (is_ok_packet)
{
- if (protocol_41(mysql))
- {
- char *pos= (char*) mysql->net.read_pos + 1;
- mysql->warning_count=uint2korr(pos); pos+=2;
- mysql->server_status=uint2korr(pos); pos+=2;
- }
- break; /* End of data */
+ /*
+ Indeed what we got from network was an OK packet, and we
+ know that OK is the last one in a multi-result-set, so
+ just return.
+ */
+ DBUG_VOID_RETURN;
}
+ /*
+ It's a result set, not an OK packet. A result set contains
+ of two result set subsequences: field metadata, terminated
+ with EOF packet, and result set data, again terminated with
+ EOF packet. Read and flush them.
+ */
+ if (flush_one_result(mysql) || flush_one_result(mysql))
+ DBUG_VOID_RETURN; /* An error occurred. */
}
+
DBUG_VOID_RETURN;
}
@@ -972,7 +1114,7 @@ mysql_free_result(MYSQL_RES *result)
mysql->unbuffered_fetch_owner= 0;
if (mysql->status == MYSQL_STATUS_USE_RESULT)
{
- (*mysql->methods->flush_use_result)(mysql);
+ (*mysql->methods->flush_use_result)(mysql, FALSE);
mysql->status=MYSQL_STATUS_READY;
if (mysql->unbuffered_fetch_owner)
*mysql->unbuffered_fetch_owner= TRUE;
@@ -999,7 +1141,6 @@ static const char *default_options[]=
"ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath",
"character-sets-dir", "default-character-set", "interactive-timeout",
"connect-timeout", "local-infile", "disable-local-infile",
- "replication-probe", "enable-reads-from-master", "repl-parse-query",
"ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name",
"multi-results", "multi-statements", "multi-queries", "secure-auth",
"report-data-truncation",
@@ -1053,6 +1194,8 @@ void mysql_read_default_options(struct st_mysql_options *options,
char **option=argv;
while (*++option)
{
+ if (option[0] == args_separator) /* skip arguments separator */
+ continue;
/* DBUG_PRINT("info",("option: %s",option[0])); */
if (option[0][0] == '-' && option[0][1] == '-')
{
@@ -1145,7 +1288,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
my_free(options->ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME));
break;
- case 26: /* ssl_cipher */
+ case 23: /* ssl_cipher */
my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME));
break;
@@ -1154,7 +1297,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
case 14:
case 15:
case 16:
- case 26:
+ case 23:
break;
#endif /* HAVE_OPENSSL */
case 17: /* charset-lib */
@@ -1177,24 +1320,11 @@ void mysql_read_default_options(struct st_mysql_options *options,
case 22:
options->client_flag&= ~CLIENT_LOCAL_FILES;
break;
- case 23: /* replication probe */
-#ifndef TO_BE_DELETED
- options->rpl_probe= 1;
-#endif
- break;
- case 24: /* enable-reads-from-master */
- options->no_master_reads= 0;
- break;
- case 25: /* repl-parse-query */
-#ifndef TO_BE_DELETED
- options->rpl_parse= 1;
-#endif
- break;
- case 27:
+ case 24: /* max-allowed-packet */
if (opt_arg)
options->max_allowed_packet= atoi(opt_arg);
break;
- case 28: /* protocol */
+ case 25: /* protocol */
if ((options->protocol= find_type(opt_arg,
&sql_protocol_typelib,0)) <= 0)
{
@@ -1202,24 +1332,24 @@ void mysql_read_default_options(struct st_mysql_options *options,
exit(1);
}
break;
- case 29: /* shared_memory_base_name */
+ case 26: /* shared_memory_base_name */
#ifdef HAVE_SMEM
if (options->shared_memory_base_name != def_shared_memory_base_name)
my_free(options->shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
options->shared_memory_base_name=my_strdup(opt_arg,MYF(MY_WME));
#endif
break;
- case 30:
+ case 27: /* multi-results */
options->client_flag|= CLIENT_MULTI_RESULTS;
break;
- case 31:
- case 32:
+ case 28: /* multi-statements */
+ case 29: /* multi-queries */
options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS;
break;
- case 33: /* secure-auth */
+ case 30: /* secure-auth */
options->secure_auth= TRUE;
break;
- case 34: /* report-data-truncation */
+ case 31: /* report-data-truncation */
options->report_data_truncation= opt_arg ? test(atoi(opt_arg)) : 1;
break;
default:
@@ -1313,7 +1443,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags= uint2korr(pos+7);
field->decimals= (uint) pos[9];
- if (INTERNAL_NUM_FIELD(field))
+ if (IS_NUM(field->type))
field->flags|= NUM_FLAG;
if (default_value && row->data[7])
{
@@ -1354,7 +1484,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags= (uint) (uchar) row->data[4][0];
field->decimals=(uint) (uchar) row->data[4][1];
}
- if (INTERNAL_NUM_FIELD(field))
+ if (IS_NUM(field->type))
field->flags|= NUM_FLAG;
if (default_value && row->data[5])
{
@@ -1546,16 +1676,8 @@ mysql_init(MYSQL *mysql)
else
bzero((char*) (mysql), sizeof(*(mysql)));
mysql->options.connect_timeout= CONNECT_TIMEOUT;
- mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
mysql->charset=default_client_charset_info;
strmov(mysql->net.sqlstate, not_error_sqlstate);
- /*
- By default, we are a replication pivot. The caller must reset it
- after we return if this is not the case.
- */
-#ifndef TO_BE_DELETED
- mysql->rpl_pivot = 1;
-#endif
/*
Only enable LOAD DATA INFILE by default if configured with
@@ -1782,52 +1904,298 @@ static MYSQL_METHODS client_methods=
#endif
};
+
+
+typedef enum my_cs_match_type_enum
+{
+ /* MySQL and OS charsets are fully compatible */
+ my_cs_exact,
+ /* MySQL charset is very close to OS charset */
+ my_cs_approx,
+ /*
+ MySQL knows this charset, but it is not supported as client character set.
+ */
+ my_cs_unsupp
+} my_cs_match_type;
+
+
+typedef struct str2str_st
+{
+ const char *os_name;
+ const char *my_name;
+ my_cs_match_type param;
+} MY_CSET_OS_NAME;
+
+const MY_CSET_OS_NAME charsets[]=
+{
+#ifdef __WIN__
+ {"cp437", "cp850", my_cs_approx},
+ {"cp850", "cp850", my_cs_exact},
+ {"cp852", "cp852", my_cs_exact},
+ {"cp858", "cp850", my_cs_approx},
+ {"cp866", "cp866", my_cs_exact},
+ {"cp874", "tis620", my_cs_approx},
+ {"cp932", "cp932", my_cs_exact},
+ {"cp936", "gbk", my_cs_approx},
+ {"cp949", "euckr", my_cs_approx},
+ {"cp950", "big5", my_cs_exact},
+ {"cp1200", "utf16le", my_cs_unsupp},
+ {"cp1201", "utf16", my_cs_unsupp},
+ {"cp1250", "cp1250", my_cs_exact},
+ {"cp1251", "cp1251", my_cs_exact},
+ {"cp1252", "latin1", my_cs_exact},
+ {"cp1253", "greek", my_cs_exact},
+ {"cp1254", "latin5", my_cs_exact},
+ {"cp1255", "hebrew", my_cs_approx},
+ {"cp1256", "cp1256", my_cs_exact},
+ {"cp1257", "cp1257", my_cs_exact},
+ {"cp10000", "macroman", my_cs_exact},
+ {"cp10001", "sjis", my_cs_approx},
+ {"cp10002", "big5", my_cs_approx},
+ {"cp10008", "gb2312", my_cs_approx},
+ {"cp10021", "tis620", my_cs_approx},
+ {"cp10029", "macce", my_cs_exact},
+ {"cp12001", "utf32", my_cs_unsupp},
+ {"cp20107", "swe7", my_cs_exact},
+ {"cp20127", "ascii", my_cs_exact},
+ {"cp20866", "koi8r", my_cs_exact},
+ {"cp20932", "ujis", my_cs_exact},
+ {"cp20936", "gb2312", my_cs_approx},
+ {"cp20949", "euckr", my_cs_approx},
+ {"cp21866", "koi8u", my_cs_exact},
+ {"cp28591", "latin1", my_cs_approx},
+ {"cp28592", "latin2", my_cs_exact},
+ {"cp28597", "greek", my_cs_exact},
+ {"cp28598", "hebrew", my_cs_exact},
+ {"cp28599", "latin5", my_cs_exact},
+ {"cp28603", "latin7", my_cs_exact},
+#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE
+ {"cp28605", "latin9", my_cs_exact},
+#endif
+ {"cp38598", "hebrew", my_cs_exact},
+ {"cp51932", "ujis", my_cs_exact},
+ {"cp51936", "gb2312", my_cs_exact},
+ {"cp51949", "euckr", my_cs_exact},
+ {"cp51950", "big5", my_cs_exact},
+#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE
+ {"cp54936", "gb18030", my_cs_exact},
+#endif
+ {"cp65001", "utf8", my_cs_exact},
+
+#else /* not Windows */
+
+ {"646", "latin1", my_cs_approx}, /* Default on Solaris */
+ {"ANSI_X3.4-1968", "ascii", my_cs_exact},
+ {"ansi1251", "cp1251", my_cs_exact},
+ {"armscii8", "armscii8", my_cs_exact},
+ {"armscii-8", "armscii8", my_cs_exact},
+ {"ASCII", "ascii", my_cs_exact},
+ {"Big5", "big5", my_cs_exact},
+ {"cp1251", "cp1251", my_cs_exact},
+ {"cp1255", "hebrew", my_cs_approx},
+ {"CP866", "cp866", my_cs_exact},
+ {"eucCN", "gb2312", my_cs_exact},
+ {"euc-CN", "gb2312", my_cs_exact},
+ {"eucJP", "ujis", my_cs_exact},
+ {"euc-JP", "ujis", my_cs_exact},
+ {"eucKR", "euckr", my_cs_exact},
+ {"euc-KR", "euckr", my_cs_exact},
+#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE
+ {"gb18030", "gb18030", my_cs_exact},
+#endif
+ {"gb2312", "gb2312", my_cs_exact},
+ {"gbk", "gbk", my_cs_exact},
+ {"georgianps", "geostd8", my_cs_exact},
+ {"georgian-ps", "geostd8", my_cs_exact},
+ {"IBM-1252", "cp1252", my_cs_exact},
+
+ {"iso88591", "latin1", my_cs_approx},
+ {"ISO_8859-1", "latin1", my_cs_approx},
+ {"ISO8859-1", "latin1", my_cs_approx},
+ {"ISO-8859-1", "latin1", my_cs_approx},
+
+ {"iso885913", "latin7", my_cs_exact},
+ {"ISO_8859-13", "latin7", my_cs_exact},
+ {"ISO8859-13", "latin7", my_cs_exact},
+ {"ISO-8859-13", "latin7", my_cs_exact},
+
+#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE
+ {"iso885915", "latin9", my_cs_exact},
+ {"ISO_8859-15", "latin9", my_cs_exact},
+ {"ISO8859-15", "latin9", my_cs_exact},
+ {"ISO-8859-15", "latin9", my_cs_exact},
+#endif
+
+ {"iso88592", "latin2", my_cs_exact},
+ {"ISO_8859-2", "latin2", my_cs_exact},
+ {"ISO8859-2", "latin2", my_cs_exact},
+ {"ISO-8859-2", "latin2", my_cs_exact},
+
+ {"iso88597", "greek", my_cs_exact},
+ {"ISO_8859-7", "greek", my_cs_exact},
+ {"ISO8859-7", "greek", my_cs_exact},
+ {"ISO-8859-7", "greek", my_cs_exact},
+
+ {"iso88598", "hebrew", my_cs_exact},
+ {"ISO_8859-8", "hebrew", my_cs_exact},
+ {"ISO8859-8", "hebrew", my_cs_exact},
+ {"ISO-8859-8", "hebrew", my_cs_exact},
+
+ {"iso88599", "latin5", my_cs_exact},
+ {"ISO_8859-9", "latin5", my_cs_exact},
+ {"ISO8859-9", "latin5", my_cs_exact},
+ {"ISO-8859-9", "latin5", my_cs_exact},
+
+ {"koi8r", "koi8r", my_cs_exact},
+ {"KOI8-R", "koi8r", my_cs_exact},
+ {"koi8u", "koi8u", my_cs_exact},
+ {"KOI8-U", "koi8u", my_cs_exact},
+
+ {"roman8", "hp8", my_cs_exact}, /* Default on HP UX */
+
+ {"Shift_JIS", "sjis", my_cs_exact},
+ {"SJIS", "sjis", my_cs_exact},
+ {"shiftjisx0213", "sjis", my_cs_exact},
+
+ {"tis620", "tis620", my_cs_exact},
+ {"tis-620", "tis620", my_cs_exact},
+
+ {"ujis", "ujis", my_cs_exact},
+
+ {"US-ASCII", "ascii", my_cs_exact},
+
+ {"utf8", "utf8", my_cs_exact},
+ {"utf-8", "utf8", my_cs_exact},
+#endif
+ {NULL, NULL, 0}
+};
+
+
+static const char *
+my_os_charset_to_mysql_charset(const char *csname)
+{
+ const MY_CSET_OS_NAME *csp;
+ for (csp= charsets; csp->os_name; csp++)
+ {
+ if (!my_strcasecmp(&my_charset_latin1, csp->os_name, csname))
+ {
+ switch (csp->param)
+ {
+ case my_cs_exact:
+ return csp->my_name;
+
+ case my_cs_approx:
+ /*
+ Maybe we should print a warning eventually:
+ character set correspondence is not exact.
+ */
+ return csp->my_name;
+
+ default:
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "OS character set '%s'"
+ " is not supported by MySQL client",
+ MYF(0), csp->my_name);
+ goto def;
+ }
+ }
+ }
+
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "Unknown OS character set '%s'.",
+ MYF(0), csname);
+
+def:
+ csname= MYSQL_DEFAULT_CHARSET_NAME;
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "Switching to the default character set '%s'.",
+ MYF(0), csname);
+ return csname;
+}
+
+
+#ifndef __WIN__
+#include <stdlib.h> /* for getenv() */
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#endif /* __WIN__ */
+
+
+static int
+mysql_autodetect_character_set(MYSQL *mysql)
+{
+ const char *csname= MYSQL_DEFAULT_CHARSET_NAME;
+
+#ifdef __WIN__
+ char cpbuf[64];
+ {
+ my_snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int) GetConsoleCP());
+ csname= my_os_charset_to_mysql_charset(cpbuf);
+ }
+#elif defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO)
+ {
+ if (setlocale(LC_CTYPE, "") && (csname= nl_langinfo(CODESET)))
+ csname= my_os_charset_to_mysql_charset(csname);
+ }
+#endif
+
+ if (!(mysql->options.charset_name= my_strdup(csname, MYF(MY_WME))))
+ return 1;
+ return 0;
+}
+
+
+static void
+mysql_set_character_set_with_default_collation(MYSQL *mysql)
+{
+ const char *save= charsets_dir;
+ if (mysql->options.charset_dir)
+ charsets_dir=mysql->options.charset_dir;
+
+ if ((mysql->charset= get_charset_by_csname(mysql->options.charset_name,
+ MY_CS_PRIMARY, MYF(MY_WME))))
+ {
+ /* Try to set compiled default collation when it's possible. */
+ CHARSET_INFO *collation;
+ if ((collation=
+ get_charset_by_name(MYSQL_DEFAULT_COLLATION_NAME, MYF(MY_WME))) &&
+ my_charset_same(mysql->charset, collation))
+ {
+ mysql->charset= collation;
+ }
+ else
+ {
+ /*
+ Default compiled collation not found, or is not applicable
+ to the requested character set.
+ Continue with the default collation of the character set.
+ */
+ }
+ }
+ charsets_dir= save;
+}
+
+
C_MODE_START
int mysql_init_character_set(MYSQL *mysql)
{
- const char *default_collation_name;
-
/* Set character set */
if (!mysql->options.charset_name)
{
- default_collation_name= MYSQL_DEFAULT_COLLATION_NAME;
if (!(mysql->options.charset_name=
my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME))))
- return 1;
- }
- else
- default_collation_name= NULL;
-
- {
- const char *save= charsets_dir;
- if (mysql->options.charset_dir)
- charsets_dir=mysql->options.charset_dir;
- mysql->charset=get_charset_by_csname(mysql->options.charset_name,
- MY_CS_PRIMARY, MYF(MY_WME));
- if (mysql->charset && default_collation_name)
- {
- CHARSET_INFO *collation;
- if ((collation=
- get_charset_by_name(default_collation_name, MYF(MY_WME))))
- {
- if (!my_charset_same(mysql->charset, collation))
- {
- my_printf_error(ER_UNKNOWN_ERROR,
- "COLLATION %s is not valid for CHARACTER SET %s",
- MYF(0),
- default_collation_name, mysql->options.charset_name);
- mysql->charset= NULL;
- }
- else
- {
- mysql->charset= collation;
- }
- }
- else
- mysql->charset= NULL;
- }
- charsets_dir= save;
+ return 1;
}
+ else if (!strcmp(mysql->options.charset_name,
+ MYSQL_AUTODETECT_CHARSET_NAME) &&
+ mysql_autodetect_character_set(mysql))
+ return 1;
+
+ mysql_set_character_set_with_default_collation(mysql);
if (!mysql->charset)
{
@@ -1877,11 +2245,18 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
init_sigpipe_variables
DBUG_ENTER("mysql_real_connect");
- DBUG_PRINT("enter",("host: %s db: %s user: %s",
+ DBUG_PRINT("enter",("host: %s db: %s user: %s (client)",
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
+ /* Test whether we're already connected */
+ if (net->vio)
+ {
+ set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
+ DBUG_RETURN(0);
+ }
+
/* Don't give sigpipe errors if the client doesn't want them */
set_sigpipe(mysql);
mysql->methods= &client_methods;
@@ -1927,6 +2302,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
unix_socket=mysql->options.unix_socket;
mysql->server_status=SERVER_STATUS_AUTOCOMMIT;
+ DBUG_PRINT("info", ("Connecting"));
/*
Part 0: Grab a socket and connect it to the server
@@ -1936,6 +2312,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql->options.protocol == MYSQL_PROTOCOL_MEMORY) &&
(!host || !strcmp(host,LOCAL_HOST)))
{
+ DBUG_PRINT("info", ("Using shared memory"));
if ((create_shared_memory(mysql,net, mysql->options.connect_timeout)) ==
INVALID_HANDLE_VALUE)
{
@@ -2034,6 +2411,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
}
}
#endif
+ DBUG_PRINT("info", ("net->vio: %p protocol: %d",
+ net->vio, mysql->options.protocol));
if (!net->vio &&
(!mysql->options.protocol ||
mysql->options.protocol == MYSQL_PROTOCOL_TCP))
@@ -2100,11 +2479,16 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
for (i= 0; status && hp->h_addr_list[i]; i++)
{
- IF_DBUG(char ipaddr[18];)
+ char ipaddr[18] __attribute__((unused));
memcpy(&sock_addr.sin_addr, hp->h_addr_list[i],
min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length));
DBUG_PRINT("info",("Trying %s...",
(my_inet_ntoa(sock_addr.sin_addr, ipaddr), ipaddr)));
+ /*
+ Here we rely on my_connect() to return success only if the
+ connect attempt was really successful. Otherwise we would stop
+ trying another address, believing we were successful.
+ */
status= my_connect(sock, (struct sockaddr *) &sock_addr,
sizeof(sock_addr), mysql->options.connect_timeout);
}
@@ -2163,6 +2547,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/*
Part 1: Connection established, read and parse first packet
*/
+ DBUG_PRINT("info", ("Read first packet."));
if ((pkt_length=cli_safe_read(mysql)) == packet_error)
{
@@ -2479,11 +2864,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql->reconnect=reconnect;
}
-#ifndef TO_BE_DELETED
- if (mysql->options.rpl_probe && mysql_rpl_probe(mysql))
- goto error;
-#endif
-
DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
reset_sigpipe(mysql);
DBUG_RETURN(mysql);
@@ -2505,28 +2885,6 @@ error:
}
-/* needed when we move MYSQL structure to a different address */
-
-#ifndef TO_BE_DELETED
-static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql)
-{
- MYSQL *tmp, *tmp_prev;
- if (mysql->master == old_mysql)
- mysql->master= mysql;
- if (mysql->last_used_con == old_mysql)
- mysql->last_used_con= mysql;
- if (mysql->last_used_slave == old_mysql)
- mysql->last_used_slave= mysql;
- for (tmp_prev = mysql, tmp = mysql->next_slave;
- tmp != old_mysql;tmp = tmp->next_slave)
- {
- tmp_prev= tmp;
- }
- tmp_prev->next_slave= mysql;
-}
-#endif
-
-
my_bool mysql_reconnect(MYSQL *mysql)
{
MYSQL tmp_mysql;
@@ -2545,8 +2903,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
mysql_init(&tmp_mysql);
tmp_mysql.options= mysql->options;
tmp_mysql.options.my_cnf_file= tmp_mysql.options.my_cnf_group= 0;
- tmp_mysql.rpl_pivot= mysql->rpl_pivot;
-
+
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag | CLIENT_REMEMBER_OPTIONS))
@@ -2580,7 +2937,6 @@ my_bool mysql_reconnect(MYSQL *mysql)
mysql->free_me=0;
mysql_close(mysql);
*mysql=tmp_mysql;
- mysql_fix_pointers(mysql, &tmp_mysql); /* adjust connection pointers */
net_clear(&mysql->net, 1);
mysql->affected_rows= ~(my_ulonglong) 0;
DBUG_RETURN(0);
@@ -2758,23 +3114,6 @@ void STDCALL mysql_close(MYSQL *mysql)
mysql_close_free_options(mysql);
mysql_close_free(mysql);
mysql_detach_stmt_list(&mysql->stmts, "mysql_close");
-#ifndef TO_BE_DELETED
- /* free/close slave list */
- if (mysql->rpl_pivot)
- {
- MYSQL* tmp;
- for (tmp = mysql->next_slave; tmp != mysql; )
- {
- /* trick to avoid following freed pointer */
- MYSQL* tmp1 = tmp->next_slave;
- mysql_close(tmp);
- tmp = tmp1;
- }
- mysql->rpl_pivot=0;
- }
-#endif
- if (mysql != mysql->master)
- mysql_close(mysql->master);
#ifndef MYSQL_SERVER
if (mysql->thd)
(*mysql->methods->free_embedded_thd)(mysql);
@@ -2794,12 +3133,6 @@ static my_bool cli_read_query_result(MYSQL *mysql)
ulong length;
DBUG_ENTER("cli_read_query_result");
- /*
- Read from the connection which we actually used, which
- could differ from the original connection if we have slaves
- */
- mysql = mysql->last_used_con;
-
if ((length = cli_safe_read(mysql)) == packet_error)
DBUG_RETURN(1);
free_old_query(mysql); /* Free old result */
@@ -2874,23 +3207,6 @@ int STDCALL
mysql_send_query(MYSQL* mysql, const char* query, ulong length)
{
DBUG_ENTER("mysql_send_query");
- DBUG_PRINT("enter",("rpl_parse: %d rpl_pivot: %d",
- mysql->options.rpl_parse, mysql->rpl_pivot));
-#ifndef TO_BE_DELETED
- if (mysql->options.rpl_parse && mysql->rpl_pivot)
- {
- switch (mysql_rpl_query_type(query, length)) {
- case MYSQL_RPL_MASTER:
- DBUG_RETURN(mysql_master_send_query(mysql, query, length));
- case MYSQL_RPL_SLAVE:
- DBUG_RETURN(mysql_slave_send_query(mysql, query, length));
- case MYSQL_RPL_ADMIN:
- break; /* fall through */
- }
- }
- mysql->last_used_con = mysql;
-#endif
-
DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
}
@@ -2917,8 +3233,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
{
MYSQL_RES *result;
DBUG_ENTER("mysql_store_result");
- /* read from the actually used connection */
- mysql = mysql->last_used_con;
+
if (!mysql->fields)
DBUG_RETURN(0);
if (mysql->status != MYSQL_STATUS_GET_RESULT)
@@ -2973,8 +3288,6 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql)
MYSQL_RES *result;
DBUG_ENTER("cli_use_result");
- mysql = mysql->last_used_con;
-
if (!mysql->fields)
DBUG_RETURN(0);
if (mysql->status != MYSQL_STATUS_GET_RESULT)
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 7f6074c903c..15c2d950ff9 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -15,9 +15,9 @@
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
+ "${CMAKE_CXX_FLAGS_DEBUG} -DUSE_SYMDIR /Zi")
SET(CMAKE_C_FLAGS_DEBUG
- "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
+ "${CMAKE_C_FLAGS_DEBUG} -DUSE_SYMDIR /Zi")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
@@ -45,7 +45,7 @@ SET (SQL_SOURCE
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_partition.cc
- handler.cc hash_filo.cc hash_filo.h
+ handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc
item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
@@ -76,6 +76,7 @@ SET (SQL_SOURCE
rpl_rli.cc rpl_mi.cc sql_servers.cc
sql_connect.cc scheduler.cc
sql_profile.cc event_parse_data.cc
+ sql_signal.cc rpl_handler.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
@@ -96,7 +97,6 @@ SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
SET (MYSQLD_CORE_LIBS mysys zlib dbug strings yassl taocrypt vio regex sql)
TARGET_LINK_LIBRARIES(mysqld ${MYSQLD_CORE_LIBS} ${MYSQLD_STATIC_ENGINE_LIBS})
-TARGET_LINK_LIBRARIES(mysqld ws2_32.lib)
IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
@@ -129,7 +129,7 @@ ADD_CUSTOM_COMMAND(
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
-TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient wsock32)
+TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
@@ -152,4 +152,4 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings GenError)
-TARGET_LINK_LIBRARIES(udf_example strings wsock32)
+TARGET_LINK_LIBRARIES(udf_example strings)
diff --git a/sql/Makefile.am b/sql/Makefile.am
index a6d883a27dc..15ee0d588c4 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -82,7 +82,7 @@ mysqld_LDADD = libndb.la \
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h \
- item_xmlfunc.h \
+ item_xmlfunc.h sql_plugin_services.h \
item_create.h item_subselect.h item_row.h \
mysql_priv.h item_geofunc.h sql_bitmap.h \
procedure.h sql_class.h sql_lex.h sql_list.h \
@@ -111,7 +111,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_plugin.h authors.h event_parse_data.h \
event_data_objects.h event_scheduler.h \
sql_partition.h partition_info.h partition_element.h \
- contributors.h sql_servers.h
+ contributors.h sql_servers.h sql_signal.h records.h \
+ sql_prepare.h rpl_handler.h replication.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
@@ -156,7 +157,8 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
event_queue.cc event_db_repository.cc events.cc \
sql_plugin.cc sql_binlog.cc \
sql_builtin.cc sql_tablespace.cc partition_info.cc \
- sql_servers.cc event_parse_data.cc
+ sql_servers.cc event_parse_data.cc sql_signal.cc \
+ rpl_handler.cc
nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c
diff --git a/sql/add_errmsg b/sql/add_errmsg
index cf54ede5dce..86226926d38 100755
--- a/sql/add_errmsg
+++ b/sql/add_errmsg
@@ -8,8 +8,8 @@ then
fi
FILE=/tmp/add.$$
-tail -$1 share/english/errmsg.txt > $FILE
-for i in `ls share/*/errmsg.txt | grep -v english`
+tail -$1 share/english/errmsg-utf8.txt > $FILE
+for i in `ls share/*/errmsg-utf8.txt | grep -v english`
do
cat $FILE >> $i
done
diff --git a/sql/authors.h b/sql/authors.h
index dfe3b143e2f..ec46e368f5f 100644
--- a/sql/authors.h
+++ b/sql/authors.h
@@ -1,3 +1,6 @@
+#ifndef AUTHORS_INCLUDED
+#define AUTHORS_INCLUDED
+
/* Copyright (C) 2005-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -36,6 +39,7 @@ struct show_table_authors_st {
struct show_table_authors_st show_table_authors[]= {
{ "Brian (Krow) Aker", "Seattle, WA, USA",
"Architecture, archive, federated, bunch of little stuff :)" },
+ { "Marc Alff", "Denver, CO, USA", "Signal, Resignal" },
{ "Venu Anuganti", "", "Client/server protocol (4.1)" },
{ "David Axmark", "Uppsala, Sweden",
"Small stuff long time ago, Monty ripped it out!" },
@@ -150,3 +154,5 @@ struct show_table_authors_st show_table_authors[]= {
"SHA1(), AES_ENCRYPT(), AES_DECRYPT(), bug fixing" },
{NULL, NULL, NULL}
};
+
+#endif /* AUTHORS_INCLUDED */
diff --git a/sql/client_settings.h b/sql/client_settings.h
index 4f06c15a29e..fd50bfdbb88 100644
--- a/sql/client_settings.h
+++ b/sql/client_settings.h
@@ -14,6 +14,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifndef CLIENT_SETTINGS_INCLUDED
+#define CLIENT_SETTINGS_INCLUDED
+#else
+#error You have already included an client_settings.h and it should not be included twice
+#endif /* CLIENT_SETTINGS_INCLUDED */
+
#include <thr_alarm.h>
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
diff --git a/sql/contributors.h b/sql/contributors.h
index 87001e29d88..6cf8bb88e3b 100644
--- a/sql/contributors.h
+++ b/sql/contributors.h
@@ -1,3 +1,6 @@
+#ifndef CONTRIBUTORS_INCLUDED
+#define CONTRIBUTORS_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -37,3 +40,5 @@ struct show_table_contributors_st show_table_contributors[]= {
{"Mark Shuttleworth", "London, UK.", "EFF contribution for UC2006 Auction"},
{NULL, NULL, NULL}
};
+
+#endif /* CONTRIBUTORS_INCLUDED */
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 2580d526b52..81870e6b7a3 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1701,9 +1701,11 @@ uchar *sys_var_debug_sync::value_ptr(THD *thd,
static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
{
- IF_DBUG(const char *dsp_name= action->sync_point.c_ptr());
- IF_DBUG(const char *sig_emit= action->signal.c_ptr());
- IF_DBUG(const char *sig_wait= action->wait_for.c_ptr());
+#ifndef DBUG_OFF
+ const char *dsp_name= action->sync_point.c_ptr();
+ const char *sig_emit= action->signal.c_ptr();
+ const char *sig_wait= action->wait_for.c_ptr();
+#endif
DBUG_ENTER("debug_sync_execute");
DBUG_ASSERT(thd);
DBUG_ASSERT(action);
diff --git a/sql/derror.cc b/sql/derror.cc
index a8cfa00ad1d..3073f37eba3 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -24,10 +24,15 @@
#include "mysql_priv.h"
#include "mysys_err.h"
-static bool read_texts(const char *file_name,const char ***point,
- uint error_messages);
static void init_myfunc_errs(void);
+
+const char **get_server_errmsgs()
+{
+ return CURRENT_THD_ERRMSGS;
+}
+
+
/**
Read messages from errorfile.
@@ -54,7 +59,8 @@ bool init_errmessage(void)
errmsgs= my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST);
/* Read messages from file. */
- if (read_texts(ERRMSG_FILE, &errmsgs, ER_ERROR_LAST - ER_ERROR_FIRST + 1) &&
+ if (read_texts(ERRMSG_FILE, my_default_lc_messages->errmsgs->language,
+ &errmsgs, ER_ERROR_LAST - ER_ERROR_FIRST + 1) &&
!errmsgs)
{
if (!(errmsgs= (const char**) my_malloc((ER_ERROR_LAST-ER_ERROR_FIRST+1)*
@@ -65,13 +71,13 @@ bool init_errmessage(void)
}
/* Register messages for use with my_error(). */
- if (my_error_register(errmsgs, ER_ERROR_FIRST, ER_ERROR_LAST))
+ if (my_error_register(get_server_errmsgs, ER_ERROR_FIRST, ER_ERROR_LAST))
{
x_free((uchar*) errmsgs);
DBUG_RETURN(TRUE);
}
- errmesg= errmsgs; /* Init global variabel */
+ DEFAULT_ERRMSGS= errmsgs; /* Init global variable */
init_myfunc_errs(); /* Init myfunc messages */
DBUG_RETURN(FALSE);
}
@@ -81,19 +87,17 @@ bool init_errmessage(void)
Read text from packed textfile in language-directory.
If we can't read messagefile then it's panic- we can't continue.
-
- @todo
- Convert the character set to server system character set
*/
-static bool read_texts(const char *file_name,const char ***point,
- uint error_messages)
+bool read_texts(const char *file_name, const char *language,
+ const char ***point, uint error_messages)
{
register uint i;
uint count,funktpos,textcount;
size_t length;
File file;
char name[FN_REFLEN];
+ char lang_path[FN_REFLEN];
uchar *buff;
uchar head[32],*pos;
const char *errmsg;
@@ -101,10 +105,26 @@ static bool read_texts(const char *file_name,const char ***point,
LINT_INIT(buff);
funktpos=0;
- if ((file=my_open(fn_format(name,file_name,language,"",4),
+ convert_dirname(lang_path, language, NullS);
+ (void) my_load_path(lang_path, lang_path, lc_messages_dir);
+ if ((file=my_open(fn_format(name,file_name,
+ lang_path, "", 4),
O_RDONLY | O_SHARE | O_BINARY,
MYF(0))) < 0)
- goto err; /* purecov: inspected */
+ {
+ /*
+ Trying pre-5.4 sematics of the --language parameter.
+ It included the language-specific part, e.g.:
+
+ --language=/path/to/english/
+ */
+ if ((file= my_open(fn_format(name, file_name, lc_messages_dir, "", 4),
+ O_RDONLY | O_SHARE | O_BINARY,
+ MYF(0))) < 0)
+ goto err;
+ sql_print_error("An old style --language value with language specific part detected: %s", lc_messages_dir);
+ sql_print_error("Use --lc-messages-dir without language specific part instead.");
+ }
funktpos=1;
if (my_read(file,(uchar*) head,32,MYF(MY_NABP))) goto err;
@@ -113,21 +133,7 @@ static bool read_texts(const char *file_name,const char ***point,
goto err; /* purecov: inspected */
textcount=head[4];
- if (!head[30])
- {
- sql_print_error("Character set information not found in '%s'. \
-Please install the latest version of this file.",name);
- goto err1;
- }
-
- /* TODO: Convert the character set to server system character set */
- if (!get_charset(head[30],MYF(MY_WME)))
- {
- sql_print_error("Character set #%d is not supported for messagefile '%s'",
- (int)head[30],name);
- goto err1;
- }
-
+ error_message_charset_info= system_charset_info;
length=uint2korr(head+6); count=uint2korr(head+8);
if (count < error_messages)
@@ -180,7 +186,6 @@ err:
break;
}
sql_print_error(errmsg, name);
-err1:
if (file != FERR)
VOID(my_close(file,MYF(MY_WME)));
DBUG_RETURN(1);
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index f2ec0e8cf64..23eec749a30 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1225,7 +1225,9 @@ Event_timed::get_create_event(THD *thd, String *buf)
expression))
DBUG_RETURN(EVEX_MICROSECOND_UNSUP);
- buf->append(STRING_WITH_LEN("CREATE EVENT "));
+ buf->append(STRING_WITH_LEN("CREATE "));
+ append_definer(thd, buf, &definer_user, &definer_host);
+ buf->append(STRING_WITH_LEN("EVENT "));
append_identifier(thd, buf, name.str, name.length);
if (expression)
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 8c0025f9ed4..ea20270b457 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -74,7 +74,7 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et)
{
MYSQL_ERROR *err;
DBUG_ENTER("evex_print_warnings");
- if (!thd->warn_list.elements)
+ if (thd->warning_info->is_empty())
DBUG_VOID_RETURN;
char msg_buf[10 * STRING_BUFFER_USUAL_SIZE];
@@ -90,17 +90,18 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et)
prefix.append(et->name.str, et->name.length, system_charset_info);
prefix.append("] ", 2);
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
while ((err= it++))
{
String err_msg(msg_buf, sizeof(msg_buf), system_charset_info);
/* set it to 0 or we start adding at the end. That's the trick ;) */
err_msg.length(0);
err_msg.append(prefix);
- err_msg.append(err->msg, strlen(err->msg), system_charset_info);
- DBUG_ASSERT(err->level < 3);
- (sql_print_message_handlers[err->level])("%*s", err_msg.length(),
- err_msg.c_ptr());
+ err_msg.append(err->get_message_text(),
+ err->get_message_octet_length(), system_charset_info);
+ DBUG_ASSERT(err->get_level() < 3);
+ (sql_print_message_handlers[err->get_level()])("%*s", err_msg.length(),
+ err_msg.c_ptr());
}
DBUG_VOID_RETURN;
}
@@ -606,7 +607,12 @@ Event_scheduler::stop()
LOCK_DATA();
DBUG_PRINT("info", ("state before action %s", scheduler_states_names[state].str));
if (state != RUNNING)
+ {
+ /* Synchronously wait until the scheduler stops. */
+ while (state != INITIALIZED)
+ COND_STATE_WAIT(thd, NULL, "Waiting for the scheduler to stop");
goto end;
+ }
/* Guarantee we don't catch spurious signals */
do {
diff --git a/sql/events.cc b/sql/events.cc
index 458ad61718d..f7ff2b0ccf1 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -757,7 +757,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
field_list.push_back(
new Item_empty_string("Database Collation", MY_CS_NAME_SIZE));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
diff --git a/sql/field.cc b/sql/field.cc
index 01ccc338782..1a480b7135e 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1016,6 +1016,36 @@ Item_result Field::result_merge_type(enum_field_types field_type)
Static help functions
*****************************************************************************/
+/**
+ Output a warning for erroneous conversion of strings to numerical
+ values. For use with ER_TRUNCATED_WRONG_VALUE[_FOR_FIELD]
+
+ @param thd THD object
+ @param str pointer to string that failed to be converted
+ @param length length of string
+ @param cs charset for string
+ @param typestr string describing type converted to
+ @param error error value to output
+ @param field_name (for *_FOR_FIELD) name of field
+ @param row_num (for *_FOR_FIELD) row number
+ */
+static void push_numerical_conversion_warning(THD* thd, const char* str,
+ uint length, CHARSET_INFO* cs,
+ const char* typestr, int error,
+ const char* field_name="UNKNOWN",
+ ulong row_num=0)
+{
+ char buf[max(max(DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE,
+ LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE),
+ DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE)];
+
+ String tmp(buf, sizeof(buf), cs);
+ tmp.copy(str, length, cs);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ error, ER(error), typestr, tmp.c_ptr(),
+ field_name, row_num);
+}
+
/**
Check whether a field type can be partially indexed by a key.
@@ -1109,14 +1139,12 @@ int Field_num::check_int(CHARSET_INFO *cs, const char *str, int length,
/* Test if we get an empty string or wrong integer */
if (str == int_end || error == MY_ERRNO_EDOM)
{
- char buff[128];
- String tmp(buff, (uint32) sizeof(buff), system_charset_info);
- tmp.copy(str, length, system_charset_info);
+ ErrConvString err(str, length, cs);
push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
- "integer", tmp.c_ptr(), field_name,
- (ulong) table->in_use->row_count);
+ "integer", err.ptr(), field_name,
+ (ulong) table->in_use->warning_info->current_row_for_warning());
return 1;
}
/* Test if we have garbage at the end of the given string. */
@@ -1529,7 +1557,12 @@ void Field::make_field(Send_field *field)
if (orig_table && orig_table->s->db.str && *orig_table->s->db.str)
{
field->db_name= orig_table->s->db.str;
- field->org_table_name= orig_table->s->table_name.str;
+ if (orig_table->pos_in_table_list &&
+ orig_table->pos_in_table_list->schema_table)
+ field->org_table_name= (orig_table->pos_in_table_list->
+ schema_table->table_name);
+ else
+ field->org_table_name= orig_table->s->table_name.str;
}
else
field->org_table_name= field->db_name= "";
@@ -1772,7 +1805,7 @@ bool Field::optimize_range(uint idx, uint part)
}
-Field *Field::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field::new_field(MEM_ROOT *root, TABLE *new_table,
bool keep_type __attribute__((unused)))
{
Field *tmp;
@@ -1793,7 +1826,7 @@ Field *Field::new_field(MEM_ROOT *root, struct st_table *new_table,
}
-Field *Field::new_key_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field::new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
@@ -1810,7 +1843,7 @@ Field *Field::new_key_field(MEM_ROOT *root, struct st_table *new_table,
/* This is used to generate a field in TABLE from TABLE_SHARE */
-Field *Field::clone(MEM_ROOT *root, struct st_table *new_table)
+Field *Field::clone(MEM_ROOT *root, TABLE *new_table)
{
Field *tmp;
if ((tmp= (Field*) memdup_root(root,(char*) this,size_of())))
@@ -2633,15 +2666,12 @@ int Field_new_decimal::store(const char *from, uint length,
&decimal_value)) &&
table->in_use->abort_on_warning)
{
- /* Because "from" is not NUL-terminated and we use %s in the ER() */
- String from_as_str;
- from_as_str.copy(from, length, &my_charset_bin);
-
- push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ErrConvString errmsg(from, length, &my_charset_bin);
+ push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
- "decimal", from_as_str.c_ptr(), field_name,
- (ulong) table->in_use->row_count);
+ "decimal", errmsg.ptr(), field_name,
+ (ulong) table->in_use->warning_info->current_row_for_warning());
DBUG_RETURN(err);
}
@@ -2656,18 +2686,15 @@ int Field_new_decimal::store(const char *from, uint length,
break;
case E_DEC_BAD_NUM:
{
- /* Because "from" is not NUL-terminated and we use %s in the ER() */
- String from_as_str;
- from_as_str.copy(from, length, &my_charset_bin);
-
- push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
- ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
- "decimal", from_as_str.c_ptr(), field_name,
- (ulong) table->in_use->row_count);
- my_decimal_set_zero(&decimal_value);
-
- break;
+ ErrConvString errmsg(from, length, &my_charset_bin);
+ push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
+ ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
+ "decimal", errmsg.ptr(), field_name,
+ (ulong) table->in_use->warning_info->
+ current_row_for_warning());
+ my_decimal_set_zero(&decimal_value);
+ break;
}
}
@@ -4528,10 +4555,11 @@ warn:
char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
String tmp(buf, sizeof(buf), &my_charset_latin1), *str;
str= val_str(&tmp, 0);
+ ErrConvString err(str);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
- str->c_ptr());
+ err.ptr());
}
return res;
}
@@ -5317,7 +5345,7 @@ bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE), field_name,
- thd->row_count);
+ thd->warning_info->current_row_for_warning());
return 1;
}
tmp=(long) sint3korr(ptr);
@@ -6311,21 +6339,20 @@ check_string_copy_error(Field_str *field,
{
const char *pos;
char tmp[32];
-
+ THD *thd= field->table->in_use;
+
if (!(pos= well_formed_error_pos) &&
!(pos= cannot_convert_error_pos))
return FALSE;
convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6);
- push_warning_printf(field->table->in_use,
- field->table->in_use->abort_on_warning ?
- MYSQL_ERROR::WARN_LEVEL_ERROR :
+ push_warning_printf(thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
+ ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"string", tmp, field->field_name,
- (ulong) field->table->in_use->row_count);
+ thd->warning_info->current_row_for_warning());
return TRUE;
}
@@ -6359,7 +6386,7 @@ Field_longstr::report_if_important_data(const char *ptr, const char *end,
if (test_if_important_data(field_charset, ptr, end))
{
if (table->in_use->abort_on_warning)
- set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 2;
@@ -6559,13 +6586,11 @@ double Field_string::val_real(void)
!check_if_only_end_space(cs, end,
(char*) ptr + field_length))))
{
- char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
+ ErrConvString err((char*) ptr, field_length, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_TRUNCATED_WRONG_VALUE,
- ER(ER_TRUNCATED_WRONG_VALUE),
- "DOUBLE", tmp.c_ptr());
+ ER_TRUNCATED_WRONG_VALUE,
+ ER(ER_TRUNCATED_WRONG_VALUE), "DOUBLE",
+ err.ptr());
}
return result;
}
@@ -6585,13 +6610,11 @@ longlong Field_string::val_int(void)
!check_if_only_end_space(cs, end,
(char*) ptr + field_length))))
{
- char buf[LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE];
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
+ ErrConvString err((char*) ptr, field_length, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
- "INTEGER", tmp.c_ptr());
+ "INTEGER", err.ptr());
}
return result;
}
@@ -6623,14 +6646,11 @@ my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
charset(), decimal_value);
if (!table->in_use->no_errors && err)
{
- char buf[DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE];
- CHARSET_INFO *cs= charset();
- String tmp(buf, sizeof(buf), cs);
- tmp.copy((char*) ptr, field_length, cs);
+ ErrConvString errmsg((char*) ptr, field_length, charset());
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
- "DECIMAL", tmp.c_ptr());
+ "DECIMAL", errmsg.ptr());
}
return decimal_value;
@@ -6693,9 +6713,8 @@ int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr)
void Field_string::sort_string(uchar *to,uint length)
{
- IF_DBUG(uint tmp=) my_strnxfrm(field_charset,
- to, length,
- ptr, field_length);
+ uint tmp __attribute__((unused))=
+ my_strnxfrm(field_charset, to, length, ptr, field_length);
DBUG_ASSERT(tmp == length);
}
@@ -6951,7 +6970,7 @@ uint Field_string::get_key_image(uchar *buff, uint length, imagetype type_arg)
}
-Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_string::new_field(MEM_ROOT *root, TABLE *new_table,
bool keep_type)
{
Field *field;
@@ -7062,22 +7081,46 @@ int Field_varstring::store(longlong nr, bool unsigned_val)
double Field_varstring::val_real(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int not_used;
- char *end_not_used;
+ int error;
+ char *end;
+ double result;
+ CHARSET_INFO* cs= charset();
+
uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
- return my_strntod(field_charset, (char*) ptr+length_bytes, length,
- &end_not_used, &not_used);
+ result= my_strntod(cs, (char*)ptr+length_bytes, length, &end, &error);
+
+ if (!table->in_use->no_errors &&
+ (error || (length != (uint)(end - (char*)ptr+length_bytes) &&
+ !check_if_only_end_space(cs, end, (char*)ptr+length_bytes+length))))
+ {
+ push_numerical_conversion_warning(current_thd, (char*)ptr+length_bytes,
+ length, cs,"DOUBLE",
+ ER_TRUNCATED_WRONG_VALUE);
+ }
+ return result;
}
longlong Field_varstring::val_int(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int not_used;
- char *end_not_used;
+ int error;
+ char *end;
+ CHARSET_INFO *cs= charset();
+
uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
- return my_strntoll(field_charset, (char*) ptr+length_bytes, length, 10,
- &end_not_used, &not_used);
+ longlong result= my_strntoll(cs, (char*) ptr+length_bytes, length, 10,
+ &end, &error);
+
+ if (!table->in_use->no_errors &&
+ (error || (length != (uint)(end - (char*)ptr+length_bytes) &&
+ !check_if_only_end_space(cs, end, (char*)ptr+length_bytes+length))))
+ {
+ push_numerical_conversion_warning(current_thd, (char*)ptr+length_bytes,
+ length, cs, "INTEGER",
+ ER_TRUNCATED_WRONG_VALUE);
+ }
+ return result;
}
String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
@@ -7093,9 +7136,17 @@ String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
{
ASSERT_COLUMN_MARKED_FOR_READ;
+ CHARSET_INFO *cs= charset();
uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
- str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
- charset(), decimal_value);
+ int error= str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
+ cs, decimal_value);
+
+ if (!table->in_use->no_errors && error)
+ {
+ push_numerical_conversion_warning(current_thd, (char*)ptr+length_bytes,
+ length, cs, "DECIMAL",
+ ER_TRUNCATED_WRONG_VALUE);
+ }
return decimal_value;
}
@@ -7497,7 +7548,7 @@ int Field_varstring::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
}
-Field *Field_varstring::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_varstring::new_field(MEM_ROOT *root, TABLE *new_table,
bool keep_type)
{
Field_varstring *res= (Field_varstring*) Field::new_field(root, new_table,
@@ -7509,7 +7560,7 @@ Field *Field_varstring::new_field(MEM_ROOT *root, struct st_table *new_table,
Field *Field_varstring::new_key_field(MEM_ROOT *root,
- struct st_table *new_table,
+ TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
@@ -8639,7 +8690,7 @@ void Field_enum::sql_type(String &res) const
}
-Field *Field_enum::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_enum::new_field(MEM_ROOT *root, TABLE *new_table,
bool keep_type)
{
Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type);
@@ -8980,7 +9031,7 @@ Field_bit::do_last_null_byte() const
Field *Field_bit::new_key_field(MEM_ROOT *root,
- struct st_table *new_table,
+ TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
@@ -9021,7 +9072,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
set_rec_bits((1 << bit_len) - 1, bit_ptr, bit_ofs, bit_len);
memset(ptr, 0xff, bytes_in_rec);
if (table->in_use->really_abort_on_warning())
- set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
@@ -9432,7 +9483,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
if (bits)
*ptr&= ((1 << bits) - 1); /* set first uchar */
if (table->in_use->really_abort_on_warning())
- set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
@@ -9819,8 +9870,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
break;
case MYSQL_TYPE_DATE:
/* Old date type. */
- if (protocol_version != PROTOCOL_VERSION-1)
- sql_type= MYSQL_TYPE_NEWDATE;
+ sql_type= MYSQL_TYPE_NEWDATE;
/* fall trough */
case MYSQL_TYPE_NEWDATE:
length= MAX_DATE_WIDTH;
@@ -10315,7 +10365,7 @@ Field::set_warning(MYSQL_ERROR::enum_warning_level level, uint code,
{
thd->cuted_fields+= cuted_increment;
push_warning_printf(thd, level, code, ER(code), field_name,
- thd->row_count);
+ thd->warning_info->current_row_for_warning());
return 0;
}
return level >= MYSQL_ERROR::WARN_LEVEL_WARN;
diff --git a/sql/field.h b/sql/field.h
index ae074cc1a30..159e4bf707c 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,3 +1,6 @@
+#ifndef FIELD_INCLUDED
+#define FIELD_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -60,8 +63,8 @@ public:
Note that you can use table->in_use as replacement for current_thd member
only inside of val_*() and store() members (e.g. you can't use it in cons)
*/
- struct st_table *table; // Pointer for table
- struct st_table *orig_table; // Pointer to original table
+ TABLE *table; // Pointer for table
+ TABLE *orig_table; // Pointer to original table
const char **table_name, *field_name;
LEX_STRING comment;
/* Field is part of the following keys */
@@ -301,12 +304,12 @@ public:
*/
virtual bool can_be_compared_as_longlong() const { return FALSE; }
virtual void free() {}
- virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table,
+ virtual Field *new_field(MEM_ROOT *root, TABLE *new_table,
bool keep_type);
- virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+ virtual Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
- Field *clone(MEM_ROOT *mem_root, struct st_table *new_table);
+ Field *clone(MEM_ROOT *mem_root, TABLE *new_table);
inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
{
ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
@@ -1510,7 +1513,7 @@ public:
enum_field_types real_type() const { return MYSQL_TYPE_STRING; }
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
- Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
+ Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
virtual uint get_key_image(uchar *buff,uint length, imagetype type);
private:
int do_save_field_metadata(uchar *first_byte);
@@ -1597,8 +1600,8 @@ public:
enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
- Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
- Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+ Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
+ Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
uint is_equal(Create_field *new_field);
@@ -1837,7 +1840,7 @@ public:
{
flags|=ENUM_FLAG;
}
- Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
+ Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
enum_field_types type() const { return MYSQL_TYPE_STRING; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Item_result cast_to_int_type () const { return INT_RESULT; }
@@ -1937,9 +1940,12 @@ public:
virtual bool str_needs_quotes() { return TRUE; }
my_decimal *val_decimal(my_decimal *);
int cmp(const uchar *a, const uchar *b)
- {
- DBUG_ASSERT(ptr == a);
- return Field_bit::key_cmp(b, bytes_in_rec+test(bit_len));
+ {
+ DBUG_ASSERT(ptr == a || ptr == b);
+ if (ptr == a)
+ return Field_bit::key_cmp(b, bytes_in_rec+test(bit_len));
+ else
+ return Field_bit::key_cmp(a, bytes_in_rec+test(bit_len)) * -1;
}
int cmp_binary_offset(uint row_offset)
{ return cmp_offset(row_offset); }
@@ -1971,7 +1977,7 @@ public:
uint param_data, bool low_byte_first);
virtual void set_default();
- Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+ Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
@@ -2085,7 +2091,7 @@ public:
A class for sending info to the client
*/
-class Send_field {
+class Send_field :public Sql_alloc {
public:
const char *db_name;
const char *table_name,*org_table_name;
@@ -2188,3 +2194,5 @@ int set_field_to_null_with_conversions(Field *field, bool no_conversions);
#define f_no_default(x) (x & FIELDFLAG_NO_DEFAULT)
#define f_bit_as_char(x) ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR)
#define f_is_hex_escape(x) ((x) & FIELDFLAG_HEX_ESCAPE)
+
+#endif /* FIELD_INCLUDED */
diff --git a/sql/gstream.h b/sql/gstream.h
index 1ef90ad5bf0..ea7158ee1a3 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -1,3 +1,6 @@
+#ifndef GSTREAM_INCLUDED
+#define GSTREAM_INCLUDED
+
/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -73,3 +76,5 @@ protected:
char *m_err_msg;
CHARSET_INFO *m_charset;
};
+
+#endif /* GSTREAM_INCLUDED */
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index d047e8ef189..83cceb0da76 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -265,11 +265,11 @@ static int ndb_to_mysql_error(const NdbError *ndberr)
- Used by replication to see if the error was temporary
*/
if (ndberr->status == NdbError::TemporaryError)
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
ndberr->code, ndberr->message, "NDB");
else
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndberr->code, ndberr->message, "NDB");
return error;
@@ -355,8 +355,8 @@ Thd_ndb::Thd_ndb()
m_error_code= 0;
query_state&= NDB_QUERY_NORMAL;
options= 0;
- (void) hash_init(&open_tables, &my_charset_bin, 5, 0, 0,
- (hash_get_key)thd_ndb_share_get_key, 0, 0);
+ (void) my_hash_init(&open_tables, &my_charset_bin, 5, 0, 0,
+ (my_hash_get_key)thd_ndb_share_get_key, 0, 0);
}
Thd_ndb::~Thd_ndb()
@@ -380,7 +380,7 @@ Thd_ndb::~Thd_ndb()
ndb= NULL;
}
changed_tables.empty();
- hash_free(&open_tables);
+ my_hash_free(&open_tables);
}
void
@@ -536,7 +536,7 @@ static void set_ndb_err(THD *thd, const NdbError &err)
{
char buf[FN_REFLEN];
ndb_error_string(thd_ndb->m_error_code, buf, sizeof(buf));
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
thd_ndb->m_error_code, buf, "NDB");
}
@@ -4316,7 +4316,7 @@ int ha_ndbcluster::end_bulk_insert()
}
else
{
- IF_DBUG(int res=) trans->restart();
+ int res __attribute__((unused))= trans->restart();
DBUG_ASSERT(res == 0);
}
}
@@ -4587,9 +4587,9 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb)
const void *key= m_table;
HASH_SEARCH_STATE state;
THD_NDB_SHARE *thd_ndb_share=
- (THD_NDB_SHARE*)hash_first(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
+ (THD_NDB_SHARE*)my_hash_first(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
while (thd_ndb_share && thd_ndb_share->key != key)
- thd_ndb_share= (THD_NDB_SHARE*)hash_next(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
+ thd_ndb_share= (THD_NDB_SHARE*)my_hash_next(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
if (thd_ndb_share == 0)
{
thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root,
@@ -5308,7 +5308,7 @@ int ha_ndbcluster::create(const char *name,
{
if (create_info->storage_media == HA_SM_MEMORY)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@@ -5363,7 +5363,7 @@ int ha_ndbcluster::create(const char *name,
case ROW_TYPE_FIXED:
if (field_type_forces_var_part(field->type()))
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@@ -5523,8 +5523,8 @@ int ha_ndbcluster::create(const char *name,
*/
{
uint length= (uint) strlen(name);
- if ((share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (uchar*) name, length)))
+ if ((share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
+ (uchar*) name, length)))
handle_trailing_share(share);
}
/*
@@ -5703,7 +5703,7 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info,
case ORDERED_INDEX:
if (key_info->algorithm == HA_KEY_ALG_HASH)
{
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@@ -5928,7 +5928,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
{
DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u",
share->key, share->use_count));
- IF_DBUG(int r=) rename_share(share, to);
+ int r __attribute__((unused))= rename_share(share, to);
DBUG_ASSERT(r == 0);
}
#endif
@@ -5952,7 +5952,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
#ifdef HAVE_NDB_BINLOG
if (share)
{
- IF_DBUG(int ret=) rename_share(share, from);
+ int ret __attribute__((unused))= rename_share(share, from);
DBUG_ASSERT(ret == 0);
/* ndb_share reference temporary free */
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
@@ -7119,18 +7119,18 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
NdbDictionary::Object::UserTable) != 0)
ERR_RETURN(dict->getNdbError());
- if (hash_init(&ndb_tables, system_charset_info,list.count,0,0,
- (hash_get_key)tables_get_key,0,0))
+ if (my_hash_init(&ndb_tables, system_charset_info,list.count,0,0,
+ (my_hash_get_key)tables_get_key,0,0))
{
DBUG_PRINT("error", ("Failed to init HASH ndb_tables"));
DBUG_RETURN(-1);
}
- if (hash_init(&ok_tables, system_charset_info,32,0,0,
- (hash_get_key)tables_get_key,0,0))
+ if (my_hash_init(&ok_tables, system_charset_info,32,0,0,
+ (my_hash_get_key)tables_get_key,0,0))
{
DBUG_PRINT("error", ("Failed to init HASH ok_tables"));
- hash_free(&ndb_tables);
+ my_hash_free(&ndb_tables);
DBUG_RETURN(-1);
}
@@ -7171,7 +7171,8 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
{
bool file_on_disk= FALSE;
DBUG_PRINT("info", ("%s", file_name->str));
- if (hash_search(&ndb_tables, (uchar*) file_name->str, file_name->length))
+ if (my_hash_search(&ndb_tables, (uchar*) file_name->str,
+ file_name->length))
{
build_table_filename(name, sizeof(name) - 1, db,
file_name->str, reg_ext, 0);
@@ -7206,10 +7207,10 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
if (file_on_disk)
{
// Ignore this ndb table
- uchar *record= hash_search(&ndb_tables, (uchar*) file_name->str,
- file_name->length);
+ uchar *record= my_hash_search(&ndb_tables, (uchar*) file_name->str,
+ file_name->length);
DBUG_ASSERT(record);
- hash_delete(&ndb_tables, record);
+ my_hash_delete(&ndb_tables, record);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TABLE_EXISTS_ERROR,
"Local table %s.%s shadows ndb table",
@@ -7243,7 +7244,7 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
build_table_filename(name, sizeof(name) - 1, db, "", "", 0);
for (i= 0; i < ok_tables.records; i++)
{
- file_name_str= (char*)hash_element(&ok_tables, i);
+ file_name_str= (char*)my_hash_element(&ok_tables, i);
end= end1 +
tablename_to_filename(file_name_str, end1, sizeof(name) - (end1 - name));
pthread_mutex_lock(&LOCK_open);
@@ -7259,8 +7260,9 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
List<char> create_list;
for (i= 0 ; i < ndb_tables.records ; i++)
{
- file_name_str= (char*) hash_element(&ndb_tables, i);
- if (!hash_search(&ok_tables, (uchar*) file_name_str, strlen(file_name_str)))
+ file_name_str= (char*) my_hash_element(&ndb_tables, i);
+ if (!my_hash_search(&ok_tables, (uchar*) file_name_str,
+ strlen(file_name_str)))
{
build_table_filename(name, sizeof(name) - 1,
db, file_name_str, reg_ext, 0);
@@ -7314,8 +7316,8 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
pthread_mutex_unlock(&LOCK_open);
- hash_free(&ok_tables);
- hash_free(&ndb_tables);
+ my_hash_free(&ok_tables);
+ my_hash_free(&ndb_tables);
// Delete schema file from files
if (!strcmp(db, NDB_REP_DB))
@@ -7479,8 +7481,8 @@ static int ndbcluster_init(void *p)
goto ndbcluster_init_error;
}
- (void) hash_init(&ndbcluster_open_tables,system_charset_info,32,0,0,
- (hash_get_key) ndbcluster_get_key,0,0);
+ (void) my_hash_init(&ndbcluster_open_tables,system_charset_info,32,0,0,
+ (my_hash_get_key) ndbcluster_get_key,0,0);
#ifdef HAVE_NDB_BINLOG
/* start the ndb injector thread */
if (ndbcluster_binlog_start())
@@ -7493,7 +7495,7 @@ static int ndbcluster_init(void *p)
if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0))
{
DBUG_PRINT("error", ("Could not create ndb utility thread"));
- hash_free(&ndbcluster_open_tables);
+ my_hash_free(&ndbcluster_open_tables);
pthread_mutex_destroy(&ndbcluster_mutex);
pthread_mutex_destroy(&LOCK_ndb_util_thread);
pthread_cond_destroy(&COND_ndb_util_thread);
@@ -7510,7 +7512,7 @@ static int ndbcluster_init(void *p)
if (!ndb_util_thread_running)
{
DBUG_PRINT("error", ("ndb utility thread exited prematurely"));
- hash_free(&ndbcluster_open_tables);
+ my_hash_free(&ndbcluster_open_tables);
pthread_mutex_destroy(&ndbcluster_mutex);
pthread_mutex_destroy(&LOCK_ndb_util_thread);
pthread_cond_destroy(&COND_ndb_util_thread);
@@ -7561,7 +7563,7 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
while (ndbcluster_open_tables.records)
{
NDB_SHARE *share=
- (NDB_SHARE*) hash_element(&ndbcluster_open_tables, 0);
+ (NDB_SHARE*) my_hash_element(&ndbcluster_open_tables, 0);
#ifndef DBUG_OFF
fprintf(stderr, "NDB: table share %s with use_count %d not freed\n",
share->key, share->use_count);
@@ -7571,7 +7573,7 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
pthread_mutex_unlock(&ndbcluster_mutex);
}
#endif
- hash_free(&ndbcluster_open_tables);
+ my_hash_free(&ndbcluster_open_tables);
if (g_ndb)
{
@@ -7904,9 +7906,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
dbname, tabname, "", 0);
DBUG_PRINT("enter", ("name: %s", name));
pthread_mutex_lock(&ndbcluster_mutex);
- if (!(share=(NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (uchar*) name,
- strlen(name))))
+ if (!(share=(NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
+ (uchar*) name,
+ strlen(name))))
{
pthread_mutex_unlock(&ndbcluster_mutex);
DBUG_PRINT("info", ("Table %s not found in ndbcluster_open_tables", name));
@@ -8166,7 +8168,7 @@ static void print_ndbcluster_open_tables()
fprintf(DBUG_FILE, ">ndbcluster_open_tables\n");
for (uint i= 0; i < ndbcluster_open_tables.records; i++)
print_share("",
- (NDB_SHARE*)hash_element(&ndbcluster_open_tables, i));
+ (NDB_SHARE*)my_hash_element(&ndbcluster_open_tables, i));
fprintf(DBUG_FILE, "<ndbcluster_open_tables\n");
DBUG_UNLOCK_FILE;
}
@@ -8277,7 +8279,7 @@ int handle_trailing_share(NDB_SHARE *share)
at the cost of a possible mem leak, by "renaming" the share
- First remove from hash
*/
- hash_delete(&ndbcluster_open_tables, (uchar*) share);
+ my_hash_delete(&ndbcluster_open_tables, (uchar*) share);
/*
now give it a new name, just a running number
@@ -8310,12 +8312,12 @@ static int rename_share(NDB_SHARE *share, const char *new_key)
uint new_length= (uint) strlen(new_key);
DBUG_PRINT("rename_share", ("old_key: %s old__length: %d",
share->key, share->key_length));
- if ((tmp= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (uchar*) new_key, new_length)))
+ if ((tmp= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
+ (uchar*) new_key, new_length)))
handle_trailing_share(tmp);
/* remove the share from hash */
- hash_delete(&ndbcluster_open_tables, (uchar*) share);
+ my_hash_delete(&ndbcluster_open_tables, (uchar*) share);
dbug_print_open_tables();
/* save old stuff if insert should fail */
@@ -8416,9 +8418,9 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
if (!have_lock)
pthread_mutex_lock(&ndbcluster_mutex);
- if (!(share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (uchar*) key,
- length)))
+ if (!(share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
+ (uchar*) key,
+ length)))
{
if (!create_if_not_exists)
{
@@ -8494,7 +8496,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
DBUG_ENTER("ndbcluster_real_free_share");
dbug_print_share("ndbcluster_real_free_share:", *share);
- hash_delete(&ndbcluster_open_tables, (uchar*) *share);
+ my_hash_delete(&ndbcluster_open_tables, (uchar*) *share);
thr_lock_delete(&(*share)->lock);
pthread_mutex_destroy(&(*share)->mutex);
@@ -9398,7 +9400,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
}
for (i= 0, open_count= 0; i < record_count; i++)
{
- share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i);
+ share= (NDB_SHARE *)my_hash_element(&ndbcluster_open_tables, i);
#ifdef HAVE_NDB_BINLOG
if ((share->use_count - (int) (share->op != 0) - (int) (share->op != 0))
<= 0)
@@ -9609,11 +9611,11 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name, uint name_len)
}
err:
if (ndberr.status == NdbError::TemporaryError)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
ndberr.code, ndberr.message, "NDB");
else
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndberr.code, ndberr.message, "NDB");
return 0;
@@ -9784,7 +9786,7 @@ void ha_ndbcluster::set_auto_partitions(partition_info *part_info)
int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
{
NDBTAB *tab= (NDBTAB*)tab_ref;
- int32 *range_data= (int32*)my_malloc(part_info->no_parts*sizeof(int32),
+ int32 *range_data= (int32*)my_malloc(part_info->num_parts*sizeof(int32),
MYF(0));
uint i;
int error= 0;
@@ -9793,17 +9795,17 @@ int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
if (!range_data)
{
- mem_alloc_error(part_info->no_parts*sizeof(int32));
+ mem_alloc_error(part_info->num_parts*sizeof(int32));
DBUG_RETURN(1);
}
- for (i= 0; i < part_info->no_parts; i++)
+ for (i= 0; i < part_info->num_parts; i++)
{
longlong range_val= part_info->range_int_array[i];
if (unsigned_flag)
range_val-= 0x8000000000000000ULL;
if (range_val < INT_MIN32 || range_val >= INT_MAX32)
{
- if ((i != part_info->no_parts - 1) ||
+ if ((i != part_info->num_parts - 1) ||
(range_val != LONGLONG_MAX))
{
my_error(ER_LIMITED_PART_RANGE, MYF(0), "NDB");
@@ -9814,7 +9816,7 @@ int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
}
range_data[i]= (int32)range_val;
}
- tab->setRangeListData(range_data, sizeof(int32)*part_info->no_parts);
+ tab->setRangeListData(range_data, sizeof(int32)*part_info->num_parts);
error:
my_free((char*)range_data, MYF(0));
DBUG_RETURN(error);
@@ -9823,7 +9825,7 @@ error:
int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
{
NDBTAB *tab= (NDBTAB*)tab_ref;
- int32 *list_data= (int32*)my_malloc(part_info->no_list_values * 2
+ int32 *list_data= (int32*)my_malloc(part_info->num_list_values * 2
* sizeof(int32), MYF(0));
uint32 *part_id, i;
int error= 0;
@@ -9832,10 +9834,10 @@ int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
if (!list_data)
{
- mem_alloc_error(part_info->no_list_values*2*sizeof(int32));
+ mem_alloc_error(part_info->num_list_values*2*sizeof(int32));
DBUG_RETURN(1);
}
- for (i= 0; i < part_info->no_list_values; i++)
+ for (i= 0; i < part_info->num_list_values; i++)
{
LIST_PART_ENTRY *list_entry= &part_info->list_array[i];
longlong list_val= list_entry->list_value;
@@ -9851,7 +9853,7 @@ int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
part_id= (uint32*)&list_data[2*i+1];
*part_id= list_entry->partition_id;
}
- tab->setRangeListData(list_data, 2*sizeof(int32)*part_info->no_list_values);
+ tab->setRangeListData(list_data, 2*sizeof(int32)*part_info->num_list_values);
error:
my_free((char*)list_data, MYF(0));
DBUG_RETURN(error);
@@ -9907,7 +9909,7 @@ uint ha_ndbcluster::set_up_partition_info(partition_info *part_info,
{
if (!current_thd->variables.new_mode)
{
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@@ -9973,11 +9975,11 @@ uint ha_ndbcluster::set_up_partition_info(partition_info *part_info,
ng= 0;
ts_names[fd_index]= part_elem->tablespace_name;
frag_data[fd_index++]= ng;
- } while (++j < part_info->no_subparts);
+ } while (++j < part_info->num_subparts);
}
first= FALSE;
- } while (++i < part_info->no_parts);
- tab->setDefaultNoPartitionsFlag(part_info->use_default_no_partitions);
+ } while (++i < part_info->num_parts);
+ tab->setDefaultNoPartitionsFlag(part_info->use_default_num_partitions);
tab->setLinearFlag(part_info->linear_hash_ind);
{
ha_rows max_rows= table_share->max_rows;
@@ -10371,7 +10373,7 @@ ndberror2:
}
-bool ha_ndbcluster::get_no_parts(const char *name, uint *no_parts)
+bool ha_ndbcluster::get_no_parts(const char *name, uint *num_parts)
{
Ndb *ndb;
NDBDICT *dict;
@@ -10393,7 +10395,7 @@ bool ha_ndbcluster::get_no_parts(const char *name, uint *no_parts)
Ndb_table_guard ndbtab_g(dict= ndb->getDictionary(), m_tabname);
if (!ndbtab_g.get_table())
ERR_BREAK(dict->getNdbError(), err);
- *no_parts= ndbtab_g.get_table()->getFragmentCount();
+ *num_parts= ndbtab_g.get_table()->getFragmentCount();
DBUG_RETURN(FALSE);
}
@@ -10450,7 +10452,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
continue;
ERR_RETURN(ndberr);
}
-
+ table->field[IS_FILES_TABLE_CATALOG]->store(STRING_WITH_LEN("def"),
+ system_charset_info);
table->field[IS_FILES_FILE_NAME]->set_notnull();
table->field[IS_FILES_FILE_NAME]->store(elt.name, strlen(elt.name),
system_charset_info);
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 9106fd60731..ac3e7329136 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -1,3 +1,6 @@
+#ifndef HA_NDBCLUSTER_INCLUDED
+#define HA_NDBCLUSTER_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -582,3 +585,5 @@ static const int ndbcluster_hton_name_length=sizeof(ndbcluster_hton_name)-1;
extern int ndbcluster_terminating;
extern int ndb_util_thread_running;
extern pthread_cond_t COND_ndb_util_ready;
+
+#endif /* HA_NDBCLUSTER_INCLUDED */
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 27af3f2cf2f..e34a22cf9f4 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -272,13 +272,13 @@ static void run_query(THD *thd, char *buf, char *end,
Thd_ndb *thd_ndb= get_thd_ndb(thd);
for (i= 0; no_print_error[i]; i++)
if ((thd_ndb->m_error_code == no_print_error[i]) ||
- (thd->main_da.sql_errno() == (unsigned) no_print_error[i]))
+ (thd->stmt_da->sql_errno() == (unsigned) no_print_error[i]))
break;
if (!no_print_error[i])
sql_print_error("NDB: %s: error %s %d(ndb: %d) %d %d",
buf,
- thd->main_da.message(),
- thd->main_da.sql_errno(),
+ thd->stmt_da->message(),
+ thd->stmt_da->sql_errno(),
thd_ndb->m_error_code,
(int) thd->is_error(), thd->is_slave_error);
}
@@ -293,7 +293,7 @@ static void run_query(THD *thd, char *buf, char *end,
is called from ndbcluster_reset_logs(), which is called from
mysql_flush().
*/
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
thd->options= save_thd_options;
thd->set_query(save_thd_query, save_thd_query_length);
@@ -740,9 +740,9 @@ static NDB_SHARE *ndbcluster_check_ndb_apply_status_share()
{
pthread_mutex_lock(&ndbcluster_mutex);
- void *share= hash_search(&ndbcluster_open_tables,
- (uchar*) NDB_APPLY_TABLE_FILE,
- sizeof(NDB_APPLY_TABLE_FILE) - 1);
+ void *share= my_hash_search(&ndbcluster_open_tables,
+ (uchar*) NDB_APPLY_TABLE_FILE,
+ sizeof(NDB_APPLY_TABLE_FILE) - 1);
DBUG_PRINT("info",("ndbcluster_check_ndb_apply_status_share %s 0x%lx",
NDB_APPLY_TABLE_FILE, (long) share));
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -758,9 +758,9 @@ static NDB_SHARE *ndbcluster_check_ndb_schema_share()
{
pthread_mutex_lock(&ndbcluster_mutex);
- void *share= hash_search(&ndbcluster_open_tables,
- (uchar*) NDB_SCHEMA_TABLE_FILE,
- sizeof(NDB_SCHEMA_TABLE_FILE) - 1);
+ void *share= my_hash_search(&ndbcluster_open_tables,
+ (uchar*) NDB_SCHEMA_TABLE_FILE,
+ sizeof(NDB_SCHEMA_TABLE_FILE) - 1);
DBUG_PRINT("info",("ndbcluster_check_ndb_schema_share %s 0x%lx",
NDB_SCHEMA_TABLE_FILE, (long) share));
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -963,6 +963,21 @@ struct Cluster_schema
uint32 any_value;
};
+static void print_could_not_discover_error(THD *thd,
+ const Cluster_schema *schema)
+{
+ sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
+ "binlog schema event '%s' from node %d. "
+ "my_errno: %d",
+ schema->db, schema->name, schema->query,
+ schema->node_id, my_errno);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
+ MYSQL_ERROR *err;
+ while ((err= it++))
+ sql_print_warning("NDB Binlog: (%d)%s", err->get_sql_errno(),
+ err->get_message_text());
+}
+
/*
Transfer schema table data into corresponding struct
*/
@@ -1198,7 +1213,7 @@ ndbcluster_update_slock(THD *thd,
}
if (ndb_error)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb_error->code,
ndb_error->message,
@@ -1521,7 +1536,7 @@ err:
}
end:
if (ndb_error)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb_error->code,
ndb_error->message,
@@ -1971,15 +1986,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
- sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
- "binlog schema event '%s' from node %d. "
- "my_errno: %d",
- schema->db, schema->name, schema->query,
- schema->node_id, my_errno);
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
- MYSQL_ERROR *err;
- while ((err= it++))
- sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
+ print_could_not_discover_error(thd, schema);
}
pthread_mutex_unlock(&LOCK_open);
log_query= 1;
@@ -2177,8 +2184,8 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
{
pthread_mutex_lock(&ndbcluster_mutex);
NDB_SCHEMA_OBJECT *ndb_schema_object=
- (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
- (uchar*) key, strlen(key));
+ (NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects,
+ (uchar*) key, strlen(key));
if (ndb_schema_object)
{
pthread_mutex_lock(&ndb_schema_object->mutex);
@@ -2262,14 +2269,7 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
- sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
- "binlog schema event '%s' from node %d. my_errno: %d",
- schema->db, schema->name, schema->query,
- schema->node_id, my_errno);
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
- MYSQL_ERROR *err;
- while ((err= it++))
- sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
+ print_could_not_discover_error(thd, schema);
}
pthread_mutex_unlock(&LOCK_open);
}
@@ -2344,8 +2344,8 @@ static int open_ndb_binlog_index(THD *thd, TABLE_LIST *tables,
sql_print_error("NDB Binlog: Opening ndb_binlog_index: killed");
else
sql_print_error("NDB Binlog: Opening ndb_binlog_index: %d, '%s'",
- thd->main_da.sql_errno(),
- thd->main_da.message());
+ thd->stmt_da->sql_errno(),
+ thd->stmt_da->message());
thd->proc_info= save_proc_info;
return -1;
}
@@ -2571,8 +2571,8 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
pthread_mutex_lock(&ndbcluster_mutex);
/* Handle any trailing share */
- NDB_SHARE *share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (uchar*) key, key_len);
+ NDB_SHARE *share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables,
+ (uchar*) key, key_len);
if (share && share_may_exist)
{
@@ -2741,7 +2741,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
"with BLOB attribute and no PK is not supported",
share->key);
if (push_warning)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@@ -2785,7 +2785,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
failed, print a warning
*/
if (push_warning > 1)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@@ -2813,7 +2813,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
dict->dropEvent(my_event.getName()))
{
if (push_warning > 1)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@@ -2832,7 +2832,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
if (dict->createEvent(my_event))
{
if (push_warning > 1)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@@ -2845,7 +2845,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
DBUG_RETURN(-1);
}
#ifdef NDB_BINLOG_EXTRA_WARNINGS
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
0, "NDB Binlog: Removed trailing event",
"NDB");
@@ -2956,7 +2956,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
{
sql_print_error("NDB Binlog: Creating NdbEventOperation failed for"
" %s",event_name);
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb->getNdbError().code,
ndb->getNdbError().message,
@@ -3005,7 +3005,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
sql_print_error("NDB Binlog: Creating NdbEventOperation"
" blob field %u handles failed (code=%d) for %s",
j, op->getNdbError().code, event_name);
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
op->getNdbError().code,
op->getNdbError().message,
@@ -3044,7 +3044,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
retries= 0;
if (retries == 0)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
op->getNdbError().code, op->getNdbError().message,
"NDB");
@@ -3112,7 +3112,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
if (dict->getNdbError().code != 4710)
{
/* drop event failed for some reason, issue a warning */
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@@ -3390,14 +3390,14 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
if (share->flags & NSF_BLOB_FLAG)
{
my_ptrdiff_t ptrdiff= 0;
- IF_DBUG(int ret =) get_ndb_blobs_value(table, share->ndb_value[0],
+ int ret __attribute__((unused))= get_ndb_blobs_value(table, share->ndb_value[0],
blobs_buffer[0],
blobs_buffer_size[0],
ptrdiff);
DBUG_ASSERT(ret == 0);
}
ndb_unpack_record(table, share->ndb_value[0], &b, table->record[0]);
- IF_DBUG(int ret=) trans.write_row(originating_server_id,
+ int ret __attribute__((unused))= trans.write_row(originating_server_id,
injector::transaction::table(table,
TRUE),
&b, n_fields, table->record[0]);
@@ -3429,7 +3429,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
if (share->flags & NSF_BLOB_FLAG)
{
my_ptrdiff_t ptrdiff= table->record[n] - table->record[0];
- IF_DBUG(int ret =) get_ndb_blobs_value(table, share->ndb_value[n],
+ int ret __attribute__((unused))= get_ndb_blobs_value(table, share->ndb_value[n],
blobs_buffer[n],
blobs_buffer_size[n],
ptrdiff);
@@ -3437,7 +3437,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
}
ndb_unpack_record(table, share->ndb_value[n], &b, table->record[n]);
DBUG_EXECUTE("info", print_records(table, table->record[n]););
- IF_DBUG(int ret =) trans.delete_row(originating_server_id,
+ int ret __attribute__((unused))= trans.delete_row(originating_server_id,
injector::transaction::table(table,
TRUE),
&b, n_fields, table->record[n]);
@@ -3452,7 +3452,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
if (share->flags & NSF_BLOB_FLAG)
{
my_ptrdiff_t ptrdiff= 0;
- IF_DBUG(int ret =) get_ndb_blobs_value(table, share->ndb_value[0],
+ int ret __attribute__((unused))= get_ndb_blobs_value(table, share->ndb_value[0],
blobs_buffer[0],
blobs_buffer_size[0],
ptrdiff);
@@ -3480,7 +3480,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
if (share->flags & NSF_BLOB_FLAG)
{
my_ptrdiff_t ptrdiff= table->record[1] - table->record[0];
- IF_DBUG(int ret =) get_ndb_blobs_value(table, share->ndb_value[1],
+ int ret __attribute__((unused))= get_ndb_blobs_value(table, share->ndb_value[1],
blobs_buffer[1],
blobs_buffer_size[1],
ptrdiff);
@@ -3488,7 +3488,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
}
ndb_unpack_record(table, share->ndb_value[1], &b, table->record[1]);
DBUG_EXECUTE("info", print_records(table, table->record[1]););
- IF_DBUG(int ret =) trans.update_row(originating_server_id,
+ int ret __attribute__((unused))= trans.update_row(originating_server_id,
injector::transaction::table(table,
TRUE),
&b, n_fields,
@@ -3558,9 +3558,9 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
if (!have_lock)
pthread_mutex_lock(&ndbcluster_mutex);
while (!(ndb_schema_object=
- (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
- (uchar*) key,
- length)))
+ (NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects,
+ (uchar*) key,
+ length)))
{
if (!create_if_not_exists)
{
@@ -3609,7 +3609,7 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
if (!--(*ndb_schema_object)->use_count)
{
DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count));
- hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object);
+ my_hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object);
pthread_mutex_destroy(&(*ndb_schema_object)->mutex);
my_free((uchar*) *ndb_schema_object, MYF(0));
*ndb_schema_object= 0;
@@ -3715,8 +3715,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
}
/* init hash for schema object distribution */
- (void) hash_init(&ndb_schema_objects, system_charset_info, 32, 0, 0,
- (hash_get_key)ndb_schema_objects_get_key, 0, 0);
+ (void) my_hash_init(&ndb_schema_objects, system_charset_info, 32, 0, 0,
+ (my_hash_get_key)ndb_schema_objects_get_key, 0, 0);
/*
Expose global reference to our ndb object.
@@ -3792,7 +3792,7 @@ restart:
{ C_STRING_WITH_LEN("mysqld startup") },
{ C_STRING_WITH_LEN("cluster disconnect")}
};
- IF_DBUG(int error=)
+ int error __attribute__((unused))=
inj->record_incident(thd, INCIDENT_LOST_EVENTS, msg[incident_id]);
DBUG_ASSERT(!error);
break;
@@ -4107,7 +4107,7 @@ restart:
DBUG_PRINT("info", ("use_table: %.*s",
(int) name.length, name.str));
injector::transaction::table tbl(table, TRUE);
- IF_DBUG(int ret=) trans.use_table(::server_id, tbl);
+ int ret __attribute__((unused))= trans.use_table(::server_id, tbl);
DBUG_ASSERT(ret == 0);
}
}
@@ -4123,7 +4123,7 @@ restart:
(int) name.length, name.str));
#endif
injector::transaction::table tbl(table, TRUE);
- IF_DBUG(int ret=) trans.use_table(::server_id, tbl);
+ int ret __attribute__((unused))= trans.use_table(::server_id, tbl);
DBUG_ASSERT(ret == 0);
/*
@@ -4193,7 +4193,7 @@ restart:
else
{
// set injector_ndb database/schema from table internal name
- IF_DBUG(int ret=)
+ int ret __attribute__((unused))=
i_ndb->setDatabaseAndSchemaName(pOp->getEvent()->getTable());
DBUG_ASSERT(ret == 0);
ndb_binlog_thread_handle_non_data_event(thd, i_ndb, pOp, row);
@@ -4367,7 +4367,7 @@ err:
i_ndb= 0;
}
- hash_free(&ndb_schema_objects);
+ my_hash_free(&ndb_schema_objects);
net_end(&thd->net);
thd->cleanup();
diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
index 1cad643e5ec..d80dfe9ee74 100644
--- a/sql/ha_ndbcluster_binlog.h
+++ b/sql/ha_ndbcluster_binlog.h
@@ -1,3 +1,6 @@
+#ifndef HA_NDBCLUSTER_BINLOG_INCLUDED
+#define HA_NDBCLUSTER_BINLOG_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -225,3 +228,5 @@ set_thd_ndb(THD *thd, Thd_ndb *thd_ndb)
{ thd_set_ha_data(thd, ndbcluster_hton, thd_ndb); }
Ndb* check_ndb_in_thd(THD* thd);
+
+#endif /* HA_NDBCLUSTER_BINLOG_INCLUDED */
diff --git a/sql/ha_ndbcluster_cond.h b/sql/ha_ndbcluster_cond.h
index 4401a93c9e1..4ccc7e062ec 100644
--- a/sql/ha_ndbcluster_cond.h
+++ b/sql/ha_ndbcluster_cond.h
@@ -1,3 +1,6 @@
+#ifndef HA_NDBCLUSTER_COND_INCLUDED
+#define HA_NDBCLUSTER_COND_INCLUDED
+
/* Copyright (C) 2000-2007 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -486,3 +489,5 @@ private:
Ndb_cond_stack *m_cond_stack;
};
+
+#endif /* HA_NDBCLUSTER_COND_INCLUDED */
diff --git a/sql/ha_ndbcluster_tables.h b/sql/ha_ndbcluster_tables.h
index c6bc8f577f8..ba2e8ec251b 100644
--- a/sql/ha_ndbcluster_tables.h
+++ b/sql/ha_ndbcluster_tables.h
@@ -1,3 +1,6 @@
+#ifndef HA_NDBCLUSTER_TABLES_INCLUDED
+#define HA_NDBCLUSTER_TABLES_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -21,3 +24,5 @@
#define OLD_NDB_APPLY_TABLE "apply_status"
#define NDB_SCHEMA_TABLE "ndb_schema"
#define OLD_NDB_SCHEMA_TABLE "schema"
+
+#endif /* HA_NDBCLUSTER_TABLES_INCLUDED */
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 451631ff373..7e5eccb2374 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -245,7 +245,7 @@ void ha_partition::init_handler_variables()
/*
this allows blackhole to work properly
*/
- m_no_locks= 0;
+ m_num_locks= 0;
#ifdef DONT_HAVE_TO_BE_INITALIZED
m_start_key.flag= 0;
@@ -580,8 +580,8 @@ int ha_partition::drop_partitions(const char *path)
{
List_iterator<partition_element> part_it(m_part_info->partitions);
char part_name_buff[FN_REFLEN];
- uint no_parts= m_part_info->partitions.elements;
- uint no_subparts= m_part_info->no_subparts;
+ uint num_parts= m_part_info->partitions.elements;
+ uint num_subparts= m_part_info->num_subparts;
uint i= 0;
uint name_variant;
int ret_error;
@@ -611,7 +611,7 @@ int ha_partition::drop_partitions(const char *path)
do
{
partition_element *sub_elem= sub_it++;
- part= i * no_subparts + j;
+ part= i * num_subparts + j;
create_subpartition_name(part_name_buff, path,
part_elem->partition_name,
sub_elem->partition_name, name_variant);
@@ -621,7 +621,7 @@ int ha_partition::drop_partitions(const char *path)
error= ret_error;
if (deactivate_ddl_log_entry(sub_elem->log_entry->entry_pos))
error= 1;
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -640,7 +640,7 @@ int ha_partition::drop_partitions(const char *path)
else
part_elem->part_state= PART_IS_DROPPED;
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
VOID(sync_ddl_log());
DBUG_RETURN(error);
}
@@ -671,9 +671,9 @@ int ha_partition::rename_partitions(const char *path)
List_iterator<partition_element> temp_it(m_part_info->temp_partitions);
char part_name_buff[FN_REFLEN];
char norm_name_buff[FN_REFLEN];
- uint no_parts= m_part_info->partitions.elements;
+ uint num_parts= m_part_info->partitions.elements;
uint part_count= 0;
- uint no_subparts= m_part_info->no_subparts;
+ uint num_subparts= m_part_info->num_subparts;
uint i= 0;
uint j= 0;
int error= 0;
@@ -722,7 +722,7 @@ int ha_partition::rename_partitions(const char *path)
error= 1;
else
sub_elem->log_entry= NULL; /* Indicate success */
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -778,7 +778,7 @@ int ha_partition::rename_partitions(const char *path)
do
{
sub_elem= sub_it++;
- part= i * no_subparts + j;
+ part= i * num_subparts + j;
create_subpartition_name(norm_name_buff, path,
part_elem->partition_name,
sub_elem->partition_name,
@@ -807,7 +807,7 @@ int ha_partition::rename_partitions(const char *path)
error= 1;
else
sub_elem->log_entry= NULL;
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -839,7 +839,7 @@ int ha_partition::rename_partitions(const char *path)
part_elem->log_entry= NULL;
}
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
VOID(sync_ddl_log());
DBUG_RETURN(error);
}
@@ -849,9 +849,12 @@ int ha_partition::rename_partitions(const char *path)
#define ANALYZE_PARTS 2
#define CHECK_PARTS 3
#define REPAIR_PARTS 4
+#define ASSIGN_KEYCACHE_PARTS 5
+#define PRELOAD_KEYS_PARTS 6
static const char *opt_op_name[]= {NULL,
- "optimize", "analyze", "check", "repair" };
+ "optimize", "analyze", "check", "repair",
+ "assign_to_keycache", "preload_keys"};
/*
Optimize table
@@ -936,7 +939,44 @@ int ha_partition::repair(THD *thd, HA_CHECK_OPT *check_opt)
DBUG_RETURN(handle_opt_partitions(thd, check_opt, REPAIR_PARTS));
}
+/**
+ Assign to keycache
+
+ @param thd Thread object
+ @param check_opt Check/analyze/repair/optimize options
+
+ @return
+ @retval >0 Error
+ @retval 0 Success
+*/
+
+int ha_partition::assign_to_keycache(THD *thd, HA_CHECK_OPT *check_opt)
+{
+ DBUG_ENTER("ha_partition::assign_to_keycache");
+
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, ASSIGN_KEYCACHE_PARTS));
+}
+
+
+/**
+ Preload to keycache
+
+ @param thd Thread object
+ @param check_opt Check/analyze/repair/optimize options
+
+ @return
+ @retval >0 Error
+ @retval 0 Success
+*/
+
+int ha_partition::preload_keys(THD *thd, HA_CHECK_OPT *check_opt)
+{
+ DBUG_ENTER("ha_partition::preload_keys");
+ DBUG_RETURN(handle_opt_partitions(thd, check_opt, PRELOAD_KEYS_PARTS));
+}
+
+
/*
Handle optimize/analyze/check/repair of one partition
@@ -967,6 +1007,10 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
error= file->ha_check(thd, check_opt);
else if (flag == REPAIR_PARTS)
error= file->ha_repair(thd, check_opt);
+ else if (flag == ASSIGN_KEYCACHE_PARTS)
+ error= file->assign_to_keycache(thd, check_opt);
+ else if (flag == PRELOAD_KEYS_PARTS)
+ error= file->preload_keys(thd, check_opt);
else
{
DBUG_ASSERT(FALSE);
@@ -1049,8 +1093,8 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
uint flag)
{
List_iterator<partition_element> part_it(m_part_info->partitions);
- uint no_parts= m_part_info->no_parts;
- uint no_subparts= m_part_info->no_subparts;
+ uint num_parts= m_part_info->num_parts;
+ uint num_subparts= m_part_info->num_subparts;
uint i= 0;
int error;
DBUG_ENTER("ha_partition::handle_opt_partitions");
@@ -1064,7 +1108,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
it should only do named partitions, otherwise all partitions
*/
if (!(thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION) ||
- part_elem->part_state == PART_CHANGED)
+ part_elem->part_state == PART_ADMIN)
{
if (m_is_sub_partitioned)
{
@@ -1074,7 +1118,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
do
{
sub_elem= subpart_it++;
- part= i * no_subparts + j;
+ part= i * num_subparts + j;
DBUG_PRINT("info", ("Optimize subpartition %u (%s)",
part, sub_elem->partition_name));
#ifdef NOT_USED
@@ -1096,9 +1140,15 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
"Subpartition %s returned error",
sub_elem->partition_name);
}
+ /* reset part_state for the remaining partitions */
+ do
+ {
+ if (part_elem->part_state == PART_ADMIN)
+ part_elem->part_state= PART_NORMAL;
+ } while (part_elem= part_it++);
DBUG_RETURN(error);
}
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -1122,11 +1172,18 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
opt_op_name[flag], "Partition %s returned error",
part_elem->partition_name);
}
+ /* reset part_state for the remaining partitions */
+ do
+ {
+ if (part_elem->part_state == PART_ADMIN)
+ part_elem->part_state= PART_NORMAL;
+ } while (part_elem= part_it++);
DBUG_RETURN(error);
}
}
+ part_elem->part_state= PART_NORMAL;
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
DBUG_RETURN(FALSE);
}
@@ -1330,10 +1387,10 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
List_iterator<partition_element> part_it(m_part_info->partitions);
List_iterator <partition_element> t_it(m_part_info->temp_partitions);
char part_name_buff[FN_REFLEN];
- uint no_parts= m_part_info->partitions.elements;
- uint no_subparts= m_part_info->no_subparts;
+ uint num_parts= m_part_info->partitions.elements;
+ uint num_subparts= m_part_info->num_subparts;
uint i= 0;
- uint no_remain_partitions, part_count, orig_count;
+ uint num_remain_partitions, part_count, orig_count;
handler **new_file_array;
int error= 1;
bool first;
@@ -1349,7 +1406,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
part_name_buff)));
m_reorged_parts= 0;
if (!m_part_info->is_sub_partitioned())
- no_subparts= 1;
+ num_subparts= 1;
/*
Step 1:
@@ -1358,7 +1415,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
*/
if (temp_partitions)
{
- m_reorged_parts= temp_partitions * no_subparts;
+ m_reorged_parts= temp_partitions * num_subparts;
}
else
{
@@ -1368,9 +1425,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
if (part_elem->part_state == PART_CHANGED ||
part_elem->part_state == PART_REORGED_DROPPED)
{
- m_reorged_parts+= no_subparts;
+ m_reorged_parts+= num_subparts;
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
}
if (m_reorged_parts &&
!(m_reorged_file= (handler**)sql_calloc(sizeof(handler*)*
@@ -1385,10 +1442,10 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
Calculate number of partitions after change and allocate space for
their handler references.
*/
- no_remain_partitions= 0;
+ num_remain_partitions= 0;
if (temp_partitions)
{
- no_remain_partitions= no_parts * no_subparts;
+ num_remain_partitions= num_parts * num_subparts;
}
else
{
@@ -1401,17 +1458,17 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
part_elem->part_state == PART_TO_BE_ADDED ||
part_elem->part_state == PART_CHANGED)
{
- no_remain_partitions+= no_subparts;
+ num_remain_partitions+= num_subparts;
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
}
if (!(new_file_array= (handler**)sql_calloc(sizeof(handler*)*
- (2*(no_remain_partitions + 1)))))
+ (2*(num_remain_partitions + 1)))))
{
- mem_alloc_error(sizeof(handler*)*2*(no_remain_partitions+1));
+ mem_alloc_error(sizeof(handler*)*2*(num_remain_partitions+1));
DBUG_RETURN(ER_OUTOFMEMORY);
}
- m_added_file= &new_file_array[no_remain_partitions + 1];
+ m_added_file= &new_file_array[num_remain_partitions + 1];
/*
Step 3:
@@ -1430,9 +1487,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
part_elem->part_state == PART_REORGED_DROPPED)
{
memcpy((void*)&m_reorged_file[part_count],
- (void*)&m_file[i*no_subparts],
- sizeof(handler*)*no_subparts);
- part_count+= no_subparts;
+ (void*)&m_file[i*num_subparts],
+ sizeof(handler*)*num_subparts);
+ part_count+= num_subparts;
}
else if (first && temp_partitions &&
part_elem->part_state == PART_TO_BE_ADDED)
@@ -1447,11 +1504,11 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
ones used to be.
*/
first= FALSE;
- DBUG_ASSERT(((i*no_subparts) + m_reorged_parts) <= m_file_tot_parts);
- memcpy((void*)m_reorged_file, &m_file[i*no_subparts],
+ DBUG_ASSERT(((i*num_subparts) + m_reorged_parts) <= m_file_tot_parts);
+ memcpy((void*)m_reorged_file, &m_file[i*num_subparts],
sizeof(handler*)*m_reorged_parts);
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
}
/*
@@ -1469,11 +1526,11 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
partition_element *part_elem= part_it++;
if (part_elem->part_state == PART_NORMAL)
{
- DBUG_ASSERT(orig_count + no_subparts <= m_file_tot_parts);
+ DBUG_ASSERT(orig_count + num_subparts <= m_file_tot_parts);
memcpy((void*)&new_file_array[part_count], (void*)&m_file[orig_count],
- sizeof(handler*)*no_subparts);
- part_count+= no_subparts;
- orig_count+= no_subparts;
+ sizeof(handler*)*num_subparts);
+ part_count+= num_subparts;
+ orig_count+= num_subparts;
}
else if (part_elem->part_state == PART_CHANGED ||
part_elem->part_state == PART_TO_BE_ADDED)
@@ -1489,16 +1546,16 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
mem_alloc_error(sizeof(handler));
DBUG_RETURN(ER_OUTOFMEMORY);
}
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
if (part_elem->part_state == PART_CHANGED)
- orig_count+= no_subparts;
+ orig_count+= num_subparts;
else if (temp_partitions && first)
{
- orig_count+= (no_subparts * temp_partitions);
+ orig_count+= (num_subparts * temp_partitions);
first= FALSE;
}
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
first= FALSE;
/*
Step 5:
@@ -1535,7 +1592,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
part_elem->partition_name,
sub_elem->partition_name,
name_variant);
- part= i * no_subparts + j;
+ part= i * num_subparts + j;
DBUG_PRINT("info", ("Add subpartition %s", part_name_buff));
if ((error= prepare_new_partition(table, create_info,
new_file_array[part],
@@ -1546,7 +1603,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
DBUG_RETURN(error);
}
m_added_file[part_count++]= new_file_array[part];
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -1565,7 +1622,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
m_added_file[part_count++]= new_file_array[i];
}
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
/*
Step 6:
@@ -1582,7 +1639,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
part_elem->part_state= PART_IS_CHANGED;
else if (part_elem->part_state == PART_REORGED_DROPPED)
part_elem->part_state= PART_TO_BE_DROPPED;
- } while (++i < no_parts);
+ } while (++i < num_parts);
for (i= 0; i < temp_partitions; i++)
{
partition_element *part_elem= t_it++;
@@ -1623,9 +1680,9 @@ int ha_partition::copy_partitions(ulonglong * const copied,
if (m_part_info->linear_hash_ind)
{
if (m_part_info->part_type == HASH_PARTITION)
- set_linear_hash_mask(m_part_info, m_part_info->no_parts);
+ set_linear_hash_mask(m_part_info, m_part_info->num_parts);
else
- set_linear_hash_mask(m_part_info, m_part_info->no_subparts);
+ set_linear_hash_mask(m_part_info, m_part_info->num_subparts);
}
while (reorg_part < m_reorged_parts)
@@ -1904,7 +1961,7 @@ partition_element *ha_partition::find_partition_element(uint part_id)
uint curr_part_id= 0;
List_iterator_fast <partition_element> part_it(m_part_info->partitions);
- for (i= 0; i < m_part_info->no_parts; i++)
+ for (i= 0; i < m_part_info->num_parts; i++)
{
partition_element *part_elem;
part_elem= part_it++;
@@ -1912,7 +1969,7 @@ partition_element *ha_partition::find_partition_element(uint part_id)
{
uint j;
List_iterator_fast <partition_element> sub_it(part_elem->subpartitions);
- for (j= 0; j < m_part_info->no_subparts; j++)
+ for (j= 0; j < m_part_info->num_subparts; j++)
{
part_elem= sub_it++;
if (part_id == curr_part_id++)
@@ -2033,7 +2090,7 @@ bool ha_partition::create_handler_file(const char *name)
{
partition_element *part_elem, *subpart_elem;
uint i, j, part_name_len, subpart_name_len;
- uint tot_partition_words, tot_name_len, no_parts;
+ uint tot_partition_words, tot_name_len, num_parts;
uint tot_parts= 0;
uint tot_len_words, tot_len_byte, chksum, tot_name_words;
char *name_buffer_ptr;
@@ -2046,11 +2103,11 @@ bool ha_partition::create_handler_file(const char *name)
List_iterator_fast <partition_element> part_it(m_part_info->partitions);
DBUG_ENTER("create_handler_file");
- no_parts= m_part_info->partitions.elements;
- DBUG_PRINT("info", ("table name = %s, no_parts = %u", name,
- no_parts));
+ num_parts= m_part_info->partitions.elements;
+ DBUG_PRINT("info", ("table name = %s, num_parts = %u", name,
+ num_parts));
tot_name_len= 0;
- for (i= 0; i < no_parts; i++)
+ for (i= 0; i < num_parts; i++)
{
part_elem= part_it++;
if (part_elem->part_state != PART_NORMAL &&
@@ -2068,7 +2125,7 @@ bool ha_partition::create_handler_file(const char *name)
else
{
List_iterator_fast <partition_element> sub_it(part_elem->subpartitions);
- for (j= 0; j < m_part_info->no_subparts; j++)
+ for (j= 0; j < m_part_info->num_subparts; j++)
{
subpart_elem= sub_it++;
tablename_to_filename(subpart_elem->partition_name,
@@ -2102,7 +2159,7 @@ bool ha_partition::create_handler_file(const char *name)
engine_array= (file_buffer + 12);
name_buffer_ptr= (char*) (file_buffer + ((4 + tot_partition_words) * 4));
part_it.rewind();
- for (i= 0; i < no_parts; i++)
+ for (i= 0; i < num_parts; i++)
{
part_elem= part_it++;
if (part_elem->part_state != PART_NORMAL &&
@@ -2120,7 +2177,7 @@ bool ha_partition::create_handler_file(const char *name)
else
{
List_iterator_fast <partition_element> sub_it(part_elem->subpartitions);
- for (j= 0; j < m_part_info->no_subparts; j++)
+ for (j= 0; j < m_part_info->num_subparts; j++)
{
subpart_elem= sub_it++;
tablename_to_filename(part_elem->partition_name, part_name,
@@ -2256,7 +2313,7 @@ bool ha_partition::new_handlers_from_part_info(MEM_ROOT *mem_root)
}
m_file_tot_parts= m_tot_parts;
bzero((char*) m_file, alloc_len);
- DBUG_ASSERT(m_part_info->no_parts > 0);
+ DBUG_ASSERT(m_part_info->num_parts > 0);
i= 0;
part_count= 0;
@@ -2269,7 +2326,7 @@ bool ha_partition::new_handlers_from_part_info(MEM_ROOT *mem_root)
part_elem= part_it++;
if (m_is_sub_partitioned)
{
- for (j= 0; j < m_part_info->no_subparts; j++)
+ for (j= 0; j < m_part_info->num_subparts; j++)
{
if (!(m_file[part_count++]= get_new_handler(table_share, mem_root,
part_elem->engine_type)))
@@ -2286,7 +2343,7 @@ bool ha_partition::new_handlers_from_part_info(MEM_ROOT *mem_root)
DBUG_PRINT("info", ("engine_type: %u",
(uint) ha_legacy_type(part_elem->engine_type)));
}
- } while (++i < m_part_info->no_parts);
+ } while (++i < m_part_info->num_parts);
if (part_elem->engine_type == myisam_hton)
{
DBUG_PRINT("info", ("MyISAM"));
@@ -2395,6 +2452,21 @@ err1:
/****************************************************************************
MODULE open/close object
****************************************************************************/
+
+
+/**
+ A destructor for partition-specific TABLE_SHARE data.
+*/
+
+void ha_data_partition_destroy(void *ha_data)
+{
+ if (ha_data)
+ {
+ HA_DATA_PARTITION *ha_data_partition= (HA_DATA_PARTITION*) ha_data;
+ pthread_mutex_destroy(&ha_data_partition->mutex);
+ }
+}
+
/*
Open handler object
@@ -2489,7 +2561,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
if ((error= (*file)->ha_open(table, (const char*) name_buff, mode,
test_if_locked)))
goto err_handler;
- m_no_locks+= (*file)->lock_count();
+ m_num_locks+= (*file)->lock_count();
name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
set_if_bigger(ref_length, ((*file)->ref_length));
/*
@@ -2551,6 +2623,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data));
bzero(ha_data, sizeof(HA_DATA_PARTITION));
+ table_share->ha_data_destroy= ha_data_partition_destroy;
+ pthread_mutex_init(&ha_data->mutex, MY_MUTEX_INIT_FAST);
}
if (is_not_tmp_table)
pthread_mutex_unlock(&table_share->mutex);
@@ -2836,8 +2910,8 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
uint ha_partition::lock_count() const
{
DBUG_ENTER("ha_partition::lock_count");
- DBUG_PRINT("info", ("m_no_locks %d", m_no_locks));
- DBUG_RETURN(m_no_locks);
+ DBUG_PRINT("info", ("m_num_locks %d", m_num_locks));
+ DBUG_RETURN(m_num_locks);
}
@@ -3221,6 +3295,9 @@ int ha_partition::delete_row(const uchar *buf)
Called from sql_delete.cc by mysql_delete().
Called from sql_select.cc by JOIN::reinit().
Called from sql_union.cc by st_select_lex_unit::exec().
+
+ Also used for handle ALTER TABLE t TRUNCATE PARTITION ...
+ NOTE: auto increment value will be truncated in that partition as well!
*/
int ha_partition::delete_all_rows()
@@ -3233,11 +3310,84 @@ int ha_partition::delete_all_rows()
if (thd->lex->sql_command == SQLCOM_TRUNCATE)
{
+ Alter_info *alter_info= &thd->lex->alter_info;
HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ /* TRUNCATE also means resetting auto_increment */
lock_auto_increment();
ha_data->next_auto_inc_val= 0;
ha_data->auto_inc_initialized= FALSE;
unlock_auto_increment();
+ if (alter_info->flags & ALTER_ADMIN_PARTITION)
+ {
+ /* ALTER TABLE t TRUNCATE PARTITION ... */
+ List_iterator<partition_element> part_it(m_part_info->partitions);
+ int saved_error= 0;
+ uint num_parts= m_part_info->num_parts;
+ uint num_subparts= m_part_info->num_subparts;
+ uint i= 0;
+ uint num_parts_set= alter_info->partition_names.elements;
+ uint num_parts_found= set_part_state(alter_info, m_part_info,
+ PART_ADMIN);
+ if (num_parts_set != num_parts_found &&
+ (!(alter_info->flags & ALTER_ALL_PARTITION)))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
+ /*
+ Cannot return HA_ERR_WRONG_COMMAND here without correct pruning
+ since that whould delete the whole table row by row in sql_delete.cc
+ */
+ bitmap_clear_all(&m_part_info->used_partitions);
+ do
+ {
+ partition_element *part_elem= part_it++;
+ if (part_elem->part_state == PART_ADMIN)
+ {
+ if (m_is_sub_partitioned)
+ {
+ List_iterator<partition_element>
+ subpart_it(part_elem->subpartitions);
+ partition_element *sub_elem;
+ uint j= 0, part;
+ do
+ {
+ sub_elem= subpart_it++;
+ part= i * num_subparts + j;
+ bitmap_set_bit(&m_part_info->used_partitions, part);
+ if (!saved_error)
+ {
+ DBUG_PRINT("info", ("truncate subpartition %u (%s)",
+ part, sub_elem->partition_name));
+ if ((error= m_file[part]->ha_delete_all_rows()))
+ saved_error= error;
+ /* If not reset_auto_increment is supported, just accept it */
+ if (!saved_error &&
+ (error= m_file[part]->ha_reset_auto_increment(0)) &&
+ error != HA_ERR_WRONG_COMMAND)
+ saved_error= error;
+ }
+ } while (++j < num_subparts);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("truncate partition %u (%s)", i,
+ part_elem->partition_name));
+ bitmap_set_bit(&m_part_info->used_partitions, i);
+ if (!saved_error)
+ {
+ if ((error= m_file[i]->ha_delete_all_rows()) && !saved_error)
+ saved_error= error;
+ /* If not reset_auto_increment is supported, just accept it */
+ if (!saved_error &&
+ (error= m_file[i]->ha_reset_auto_increment(0)) &&
+ error != HA_ERR_WRONG_COMMAND)
+ saved_error= error;
+ }
+ }
+ part_elem->part_state= PART_NORMAL;
+ }
+ } while (++i < num_parts);
+ DBUG_RETURN(saved_error);
+ }
truncate= TRUE;
}
file= m_file;
@@ -5978,12 +6128,14 @@ enum row_type ha_partition::get_row_type() const
void ha_partition::print_error(int error, myf errflag)
{
+ THD *thd= ha_thd();
DBUG_ENTER("ha_partition::print_error");
/* Should probably look for my own errors first */
DBUG_PRINT("enter", ("error: %d", error));
- if (error == HA_ERR_NO_PARTITION_FOUND)
+ if (error == HA_ERR_NO_PARTITION_FOUND &&
+ thd->lex->sql_command != SQLCOM_TRUNCATE)
m_part_info->print_no_partition_found(table);
else
m_file[m_last_part]->print_error(error, errflag);
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index c08b1f77eca..d4579d013fd 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -1,4 +1,7 @@
-/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+#ifndef HA_PARTITION_INCLUDED
+#define HA_PARTITION_INCLUDED
+
+/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +22,8 @@
enum partition_keywords
{
- PKW_HASH= 0, PKW_RANGE, PKW_LIST, PKW_KEY, PKW_MAXVALUE, PKW_LINEAR
+ PKW_HASH= 0, PKW_RANGE, PKW_LIST, PKW_KEY, PKW_MAXVALUE, PKW_LINEAR,
+ PKW_COLUMNS
};
/*
@@ -45,6 +49,7 @@ typedef struct st_ha_data_partition
{
ulonglong next_auto_inc_val; /**< first non reserved value */
bool auto_inc_initialized;
+ pthread_mutex_t mutex;
} HA_DATA_PARTITION;
#define PARTITION_BYTES_IN_POS 2
@@ -111,7 +116,7 @@ private:
uint m_reorged_parts; // Number of reorganised parts
uint m_tot_parts; // Total number of partitions;
- uint m_no_locks; // For engines like ha_blackhole, which needs no locks
+ uint m_num_locks; // For engines like ha_blackhole, which needs no locks
uint m_last_part; // Last file that we update,write,read
int m_lock_type; // Remembers type of last
// external_lock
@@ -243,10 +248,10 @@ public:
size_t pack_frm_len);
virtual int drop_partitions(const char *path);
virtual int rename_partitions(const char *path);
- bool get_no_parts(const char *name, uint *no_parts)
+ bool get_no_parts(const char *name, uint *num_parts)
{
DBUG_ENTER("ha_partition::get_no_parts");
- *no_parts= m_tot_parts;
+ *num_parts= m_tot_parts;
DBUG_RETURN(0);
}
virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
@@ -1072,12 +1077,13 @@ public:
virtual int backup(TD* thd, HA_CHECK_OPT *check_opt);
virtual int restore(THD* thd, HA_CHECK_OPT *check_opt);
- virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt);
- virtual int preload_keys(THD *thd, HA_CHECK_OPT *check_opt);
virtual int dump(THD* thd, int fd = -1);
virtual int net_read_dump(NET* net);
virtual uint checksum() const;
*/
+ /* Enabled keycache for performance reasons, WL#4571 */
+ virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt);
+ virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);
/*
-------------------------------------------------------------------------
@@ -1101,3 +1107,5 @@ public:
virtual void append_create_info(String *packet)
*/
};
+
+#endif /* HA_PARTITION_INCLUDED */
diff --git a/sql/handler.cc b/sql/handler.cc
index 397c4ce7335..ad7e1ecfa80 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -24,6 +24,7 @@
#endif
#include "mysql_priv.h"
+#include "rpl_handler.h"
#include "rpl_filter.h"
#include <myisampack.h>
#include <errno.h>
@@ -222,6 +223,8 @@ handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
return NULL;
}
+ RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+
switch (database_type) {
#ifndef NO_HASH
case DB_TYPE_HASH:
@@ -283,6 +286,15 @@ handler *get_ha_partition(partition_info *part_info)
#endif
+const char **handler_errmsgs;
+
+
+const char **get_handler_errmsgs()
+{
+ return handler_errmsgs;
+}
+
+
/**
Register handler error messages for use with my_error().
@@ -294,61 +306,61 @@ handler *get_ha_partition(partition_info *part_info)
int ha_init_errors(void)
{
-#define SETMSG(nr, msg) errmsgs[(nr) - HA_ERR_FIRST]= (msg)
+#define SETMSG(nr, msg) handler_errmsgs[(nr) - HA_ERR_FIRST]= (msg)
const char **errmsgs;
/* Allocate a pointer array for the error message strings. */
/* Zerofill it to avoid uninitialized gaps. */
- if (! (errmsgs= (const char**) my_malloc(HA_ERR_ERRORS * sizeof(char*),
- MYF(MY_WME | MY_ZEROFILL))))
+ if (! (handler_errmsgs= (const char**) my_malloc(HA_ERR_ERRORS * sizeof(char*),
+ MYF(MY_WME | MY_ZEROFILL))))
return 1;
/* Set the dedicated error messages. */
- SETMSG(HA_ERR_KEY_NOT_FOUND, ER(ER_KEY_NOT_FOUND));
- SETMSG(HA_ERR_FOUND_DUPP_KEY, ER(ER_DUP_KEY));
+ SETMSG(HA_ERR_KEY_NOT_FOUND, ER_DEFAULT(ER_KEY_NOT_FOUND));
+ SETMSG(HA_ERR_FOUND_DUPP_KEY, ER_DEFAULT(ER_DUP_KEY));
SETMSG(HA_ERR_RECORD_CHANGED, "Update wich is recoverable");
SETMSG(HA_ERR_WRONG_INDEX, "Wrong index given to function");
- SETMSG(HA_ERR_CRASHED, ER(ER_NOT_KEYFILE));
- SETMSG(HA_ERR_WRONG_IN_RECORD, ER(ER_CRASHED_ON_USAGE));
+ SETMSG(HA_ERR_CRASHED, ER_DEFAULT(ER_NOT_KEYFILE));
+ SETMSG(HA_ERR_WRONG_IN_RECORD, ER_DEFAULT(ER_CRASHED_ON_USAGE));
SETMSG(HA_ERR_OUT_OF_MEM, "Table handler out of memory");
SETMSG(HA_ERR_NOT_A_TABLE, "Incorrect file format '%.64s'");
SETMSG(HA_ERR_WRONG_COMMAND, "Command not supported");
- SETMSG(HA_ERR_OLD_FILE, ER(ER_OLD_KEYFILE));
+ SETMSG(HA_ERR_OLD_FILE, ER_DEFAULT(ER_OLD_KEYFILE));
SETMSG(HA_ERR_NO_ACTIVE_RECORD, "No record read in update");
SETMSG(HA_ERR_RECORD_DELETED, "Intern record deleted");
- SETMSG(HA_ERR_RECORD_FILE_FULL, ER(ER_RECORD_FILE_FULL));
+ SETMSG(HA_ERR_RECORD_FILE_FULL, ER_DEFAULT(ER_RECORD_FILE_FULL));
SETMSG(HA_ERR_INDEX_FILE_FULL, "No more room in index file '%.64s'");
SETMSG(HA_ERR_END_OF_FILE, "End in next/prev/first/last");
- SETMSG(HA_ERR_UNSUPPORTED, ER(ER_ILLEGAL_HA));
+ SETMSG(HA_ERR_UNSUPPORTED, ER_DEFAULT(ER_ILLEGAL_HA));
SETMSG(HA_ERR_TO_BIG_ROW, "Too big row");
SETMSG(HA_WRONG_CREATE_OPTION, "Wrong create option");
- SETMSG(HA_ERR_FOUND_DUPP_UNIQUE, ER(ER_DUP_UNIQUE));
+ SETMSG(HA_ERR_FOUND_DUPP_UNIQUE, ER_DEFAULT(ER_DUP_UNIQUE));
SETMSG(HA_ERR_UNKNOWN_CHARSET, "Can't open charset");
- SETMSG(HA_ERR_WRONG_MRG_TABLE_DEF, ER(ER_WRONG_MRG_TABLE));
- SETMSG(HA_ERR_CRASHED_ON_REPAIR, ER(ER_CRASHED_ON_REPAIR));
- SETMSG(HA_ERR_CRASHED_ON_USAGE, ER(ER_CRASHED_ON_USAGE));
- SETMSG(HA_ERR_LOCK_WAIT_TIMEOUT, ER(ER_LOCK_WAIT_TIMEOUT));
- SETMSG(HA_ERR_LOCK_TABLE_FULL, ER(ER_LOCK_TABLE_FULL));
- SETMSG(HA_ERR_READ_ONLY_TRANSACTION, ER(ER_READ_ONLY_TRANSACTION));
- SETMSG(HA_ERR_LOCK_DEADLOCK, ER(ER_LOCK_DEADLOCK));
- SETMSG(HA_ERR_CANNOT_ADD_FOREIGN, ER(ER_CANNOT_ADD_FOREIGN));
- SETMSG(HA_ERR_NO_REFERENCED_ROW, ER(ER_NO_REFERENCED_ROW_2));
- SETMSG(HA_ERR_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED_2));
+ SETMSG(HA_ERR_WRONG_MRG_TABLE_DEF, ER_DEFAULT(ER_WRONG_MRG_TABLE));
+ SETMSG(HA_ERR_CRASHED_ON_REPAIR, ER_DEFAULT(ER_CRASHED_ON_REPAIR));
+ SETMSG(HA_ERR_CRASHED_ON_USAGE, ER_DEFAULT(ER_CRASHED_ON_USAGE));
+ SETMSG(HA_ERR_LOCK_WAIT_TIMEOUT, ER_DEFAULT(ER_LOCK_WAIT_TIMEOUT));
+ SETMSG(HA_ERR_LOCK_TABLE_FULL, ER_DEFAULT(ER_LOCK_TABLE_FULL));
+ SETMSG(HA_ERR_READ_ONLY_TRANSACTION, ER_DEFAULT(ER_READ_ONLY_TRANSACTION));
+ SETMSG(HA_ERR_LOCK_DEADLOCK, ER_DEFAULT(ER_LOCK_DEADLOCK));
+ SETMSG(HA_ERR_CANNOT_ADD_FOREIGN, ER_DEFAULT(ER_CANNOT_ADD_FOREIGN));
+ SETMSG(HA_ERR_NO_REFERENCED_ROW, ER_DEFAULT(ER_NO_REFERENCED_ROW_2));
+ SETMSG(HA_ERR_ROW_IS_REFERENCED, ER_DEFAULT(ER_ROW_IS_REFERENCED_2));
SETMSG(HA_ERR_NO_SAVEPOINT, "No savepoint with that name");
SETMSG(HA_ERR_NON_UNIQUE_BLOCK_SIZE, "Non unique key block size");
SETMSG(HA_ERR_NO_SUCH_TABLE, "No such table: '%.64s'");
- SETMSG(HA_ERR_TABLE_EXIST, ER(ER_TABLE_EXISTS_ERROR));
+ SETMSG(HA_ERR_TABLE_EXIST, ER_DEFAULT(ER_TABLE_EXISTS_ERROR));
SETMSG(HA_ERR_NO_CONNECTION, "Could not connect to storage engine");
- SETMSG(HA_ERR_TABLE_DEF_CHANGED, ER(ER_TABLE_DEF_CHANGED));
+ SETMSG(HA_ERR_TABLE_DEF_CHANGED, ER_DEFAULT(ER_TABLE_DEF_CHANGED));
SETMSG(HA_ERR_FOREIGN_DUPLICATE_KEY, "FK constraint would lead to duplicate key");
- SETMSG(HA_ERR_TABLE_NEEDS_UPGRADE, ER(ER_TABLE_NEEDS_UPGRADE));
- SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY));
- SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED));
- SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE));
- SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER(ER_TOO_MANY_CONCURRENT_TRXS));
+ SETMSG(HA_ERR_TABLE_NEEDS_UPGRADE, ER_DEFAULT(ER_TABLE_NEEDS_UPGRADE));
+ SETMSG(HA_ERR_TABLE_READONLY, ER_DEFAULT(ER_OPEN_AS_READONLY));
+ SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER_DEFAULT(ER_AUTOINC_READ_FAILED));
+ SETMSG(HA_ERR_AUTOINC_ERANGE, ER_DEFAULT(ER_WARN_DATA_OUT_OF_RANGE));
+ SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER_DEFAULT(ER_TOO_MANY_CONCURRENT_TRXS));
/* Register the error messages for use with my_error(). */
- return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
+ return my_error_register(get_handler_errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
}
@@ -414,7 +426,13 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
reuse an array slot. Otherwise the number of uninstall/install
cycles would be limited.
*/
- hton2plugin[hton->slot]= NULL;
+ if (hton->slot != HA_SLOT_UNDEF)
+ {
+ /* Make sure we are not unpluging another plugin */
+ DBUG_ASSERT(hton2plugin[hton->slot] == plugin);
+ DBUG_ASSERT(hton->slot < MAX_HA);
+ hton2plugin[hton->slot]= NULL;
+ }
my_free((uchar*)hton, MYF(0));
@@ -431,6 +449,15 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
hton= (handlerton *)my_malloc(sizeof(handlerton),
MYF(MY_WME | MY_ZEROFILL));
+
+ if (hton == NULL)
+ {
+ sql_print_error("Unable to allocate memory for plugin '%s' handlerton.",
+ plugin->name.str);
+ goto err_no_hton_memory;
+ }
+
+ hton->slot= HA_SLOT_UNDEF;
/* Historical Requirement */
plugin->data= hton; // shortcut for the future
if (plugin->plugin->init && plugin->plugin->init(hton))
@@ -541,6 +568,7 @@ err_deinit:
err:
my_free((uchar*) hton, MYF(0));
+err_no_hton_memory:
plugin->data= NULL;
DBUG_RETURN(1);
}
@@ -1191,6 +1219,7 @@ int ha_commit_trans(THD *thd, bool all)
if (cookie)
tc_log->unlog(cookie, xid);
DBUG_EXECUTE_IF("crash_commit_after", abort(););
+ RUN_HOOK(transaction, after_commit, (thd, FALSE));
end:
if (rw_trans)
start_waiting_global_read_lock(thd);
@@ -1314,7 +1343,7 @@ int ha_rollback_trans(THD *thd, bool all)
trans->no_2pc=0;
if (is_real_trans && thd->transaction_rollback_request &&
thd->transaction.xid_state.xa_state != XA_NOTR)
- thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
+ thd->transaction.xid_state.rm_error= thd->stmt_da->sql_errno();
if (all)
thd->variables.tx_isolation=thd->session_tx_isolation;
}
@@ -1339,6 +1368,7 @@ int ha_rollback_trans(THD *thd, bool all)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARNING_NOT_COMPLETE_ROLLBACK,
ER(ER_WARNING_NOT_COMPLETE_ROLLBACK));
+ RUN_HOOK(transaction, after_rollback, (thd, FALSE));
DBUG_RETURN(error);
}
@@ -1373,7 +1403,14 @@ int ha_autocommit_or_rollback(THD *thd, int error)
thd->variables.tx_isolation=thd->session_tx_isolation;
}
+ else
#endif
+ {
+ if (!error)
+ RUN_HOOK(transaction, after_commit, (thd, FALSE));
+ else
+ RUN_HOOK(transaction, after_rollback, (thd, FALSE));
+ }
DBUG_RETURN(error);
}
@@ -1534,7 +1571,7 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin,
}
// recovery mode
if (info->commit_list ?
- hash_search(info->commit_list, (uchar *)&x, sizeof(x)) != 0 :
+ my_hash_search(info->commit_list, (uchar *)&x, sizeof(x)) != 0 :
tc_heuristic_recover == TC_HEURISTIC_RECOVER_COMMIT)
{
#ifndef DBUG_OFF
@@ -1645,12 +1682,12 @@ bool mysql_xa_recover(THD *thd)
field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
field_list.push_back(new Item_empty_string("data",XIDDATASIZE));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(1);
pthread_mutex_lock(&LOCK_xid_cache);
- while ((xs= (XID_STATE*)hash_element(&xid_cache, i++)))
+ while ((xs= (XID_STATE*) my_hash_element(&xid_cache, i++)))
{
if (xs->xa_state==XA_PREPARED)
{
@@ -1945,23 +1982,28 @@ const char *get_canonical_filename(handler *file, const char *path,
struct Ha_delete_table_error_handler: public Internal_error_handler
{
public:
- virtual bool handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
char buff[MYSQL_ERRMSG_SIZE];
};
bool
Ha_delete_table_error_handler::
-handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
-{
+handle_condition(THD *,
+ uint,
+ const char*,
+ MYSQL_ERROR::enum_warning_level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
+{
+ *cond_hdl= NULL;
/* Grab the error message */
- strmake(buff, message, sizeof(buff)-1);
+ strmake(buff, msg, sizeof(buff)-1);
return TRUE;
}
@@ -2020,7 +2062,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
XXX: should we convert *all* errors to warnings here?
What if the error is fatal?
*/
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error,
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, error,
ha_delete_table_error_handler.buff);
}
delete file;
@@ -2773,6 +2815,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_TABLE_NEEDS_UPGRADE:
textno=ER_TABLE_NEEDS_UPGRADE;
break;
+ case HA_ERR_NO_PARTITION_FOUND:
+ textno=ER_WRONG_PARTITION_NAME;
+ break;
case HA_ERR_TABLE_READONLY:
textno= ER_OPEN_AS_READONLY;
break;
@@ -2965,9 +3010,9 @@ static bool update_frm_version(TABLE *table)
if ((result= my_pwrite(file,(uchar*) version,4,51L,MYF_RW)))
goto err;
- for (entry=(TABLE*) hash_first(&open_cache,(uchar*) key,key_length, &state);
+ for (entry=(TABLE*) my_hash_first(&open_cache,(uchar*) key,key_length, &state);
entry;
- entry= (TABLE*) hash_next(&open_cache,(uchar*) key,key_length, &state))
+ entry= (TABLE*) my_hash_next(&open_cache,(uchar*) key,key_length, &state))
entry->s->mysql_version= MYSQL_VERSION_ID;
}
err:
@@ -4423,7 +4468,7 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
field_list.push_back(new Item_empty_string("Name",FN_REFLEN));
field_list.push_back(new Item_empty_string("Status",10));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
return TRUE;
diff --git a/sql/handler.h b/sql/handler.h
index 7fc2bf2fece..05a9e13653c 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,3 +1,6 @@
+#ifndef HANDLER_INCLUDED
+#define HANDLER_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -214,6 +217,13 @@
#define MAX_HA 15
/*
+ Use this instead of 0 as the initial value for the slot number of
+ handlerton, so that we can distinguish uninitialized slot number
+ from slot 0.
+*/
+#define HA_SLOT_UNDEF ((uint)-1)
+
+/*
Parameters for open() (in register form->filestat)
HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
*/
@@ -504,9 +514,8 @@ class st_alter_tablespace : public Sql_alloc
/* The handler for a table type. Will be included in the TABLE structure */
-struct st_table;
-typedef struct st_table TABLE;
-typedef struct st_table_share TABLE_SHARE;
+struct TABLE;
+struct TABLE_SHARE;
struct st_foreign_key_info;
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
@@ -581,6 +590,7 @@ struct handler_iterator {
void *buffer;
};
+class handler;
/*
handlerton is a singleton structure - one instance per storage engine -
to provide access to storage engine functionality that works on the
@@ -1084,8 +1094,8 @@ class handler :public Sql_alloc
public:
typedef ulonglong Table_flags;
protected:
- struct st_table_share *table_share; /* The table definition */
- struct st_table *table; /* The current open table */
+ TABLE_SHARE *table_share; /* The table definition */
+ TABLE *table; /* The current open table */
Table_flags cached_table_flags; /* Set on init() and open() */
ha_rows estimation_rows_to_insert;
@@ -1161,7 +1171,7 @@ public:
virtual ~handler(void)
{
DBUG_ASSERT(locked == FALSE);
- /* TODO: DBUG_ASSERT(inited == NONE); */
+ DBUG_ASSERT(inited == NONE);
}
virtual handler *clone(MEM_ROOT *mem_root);
/** This is called after create to allow us to set up cached variables */
@@ -2072,3 +2082,4 @@ int ha_binlog_end(THD *thd);
#define ha_binlog_wait(a) do {} while (0)
#define ha_binlog_end(a) do {} while (0)
#endif
+#endif /* HANDLER_INCLUDED */
diff --git a/sql/hash_filo.h b/sql/hash_filo.h
index ab13d338695..5d17b880b4d 100644
--- a/sql/hash_filo.h
+++ b/sql/hash_filo.h
@@ -38,8 +38,8 @@ class hash_filo_element
class hash_filo
{
const uint size, key_offset, key_length;
- const hash_get_key get_key;
- hash_free_key free_element;
+ const my_hash_get_key get_key;
+ my_hash_free_key free_element;
bool init;
CHARSET_INFO *hash_charset;
@@ -49,7 +49,7 @@ public:
HASH cache;
hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg,
- hash_get_key get_key_arg, hash_free_key free_element_arg,
+ my_hash_get_key get_key_arg, my_hash_free_key free_element_arg,
CHARSET_INFO *hash_charset_arg)
:size(size_arg), key_offset(key_offset_arg), key_length(key_length_arg),
get_key(get_key_arg), free_element(free_element_arg),init(0),
@@ -63,7 +63,7 @@ public:
if (init)
{
if (cache.array.buffer) /* Avoid problems with thread library */
- (void) hash_free(&cache);
+ (void) my_hash_free(&cache);
pthread_mutex_destroy(&lock);
}
}
@@ -76,8 +76,8 @@ public:
}
if (!locked)
(void) pthread_mutex_lock(&lock);
- (void) hash_free(&cache);
- (void) hash_init(&cache,hash_charset,size,key_offset,
+ (void) my_hash_free(&cache);
+ (void) my_hash_init(&cache,hash_charset,size,key_offset,
key_length, get_key, free_element,0);
if (!locked)
(void) pthread_mutex_unlock(&lock);
@@ -87,7 +87,7 @@ public:
hash_filo_element *search(uchar* key, size_t length)
{
hash_filo_element *entry=(hash_filo_element*)
- hash_search(&cache,(uchar*) key,length);
+ my_hash_search(&cache,(uchar*) key,length);
if (entry)
{ // Found; link it first
if (entry != first_link)
@@ -113,7 +113,7 @@ public:
{
hash_filo_element *tmp=last_link;
last_link=last_link->prev_used;
- hash_delete(&cache,(uchar*) tmp);
+ my_hash_delete(&cache,(uchar*) tmp);
}
if (my_hash_insert(&cache,(uchar*) entry))
{
diff --git a/sql/hostname.cc b/sql/hostname.cc
index c8cf46383a9..45b10d16ce2 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -64,7 +64,7 @@ bool hostname_cache_init()
uint offset= (uint) ((char*) (&tmp.ip) - (char*) &tmp);
if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE, offset,
sizeof(struct in_addr),NULL,
- (hash_free_key) free,
+ (my_hash_free_key) free,
&my_charset_bin)))
return 1;
hostname_cache->clear();
diff --git a/sql/item.cc b/sql/item.cc
index b35a6ae3d6e..ba920497ec1 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -264,10 +264,11 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
res->ptr(), res->length(), res->charset(),
decimal_value) & E_DEC_BAD_NUM)
{
+ ErrConvString err(res);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "DECIMAL",
- str_value.c_ptr());
+ err.ptr());
}
return decimal_value;
}
@@ -2447,6 +2448,7 @@ double_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
tmp= my_strntod(cs, (char*) cptr, end - cptr, &end, &error);
if (error || (end != org_end && !check_if_only_end_space(cs, end, org_end)))
{
+ ErrConvString err(cptr, cs);
/*
We can use str_value.ptr() here as Item_string is gurantee to put an
end \0 here.
@@ -2454,7 +2456,7 @@ double_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "DOUBLE",
- cptr);
+ err.ptr());
}
return tmp;
}
@@ -2484,10 +2486,11 @@ longlong_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
(err > 0 ||
(end != org_end && !check_if_only_end_space(cs, end, org_end))))
{
+ ErrConvString err(cptr, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
- cptr);
+ err.ptr());
}
return tmp;
}
@@ -2574,7 +2577,8 @@ Item_param::Item_param(uint pos_in_query_arg) :
param_type(MYSQL_TYPE_VARCHAR),
pos_in_query(pos_in_query_arg),
set_param_func(default_set_param_func),
- limit_clause_param(FALSE)
+ limit_clause_param(FALSE),
+ m_out_param_info(NULL)
{
name= (char*) "?";
/*
@@ -2656,6 +2660,17 @@ void Item_param::set_decimal(const char *str, ulong length)
DBUG_VOID_RETURN;
}
+void Item_param::set_decimal(const my_decimal *dv)
+{
+ state= DECIMAL_VALUE;
+
+ my_decimal2decimal(dv, &decimal_value);
+
+ decimals= (uint8) decimal_value.frac;
+ unsigned_flag= !decimal_value.sign();
+ max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
+ decimals, unsigned_flag);
+}
/**
Set parameter value from MYSQL_TIME value.
@@ -3278,6 +3293,158 @@ Item_param::set_param_type_and_swap_value(Item_param *src)
str_value_ptr.swap(src->str_value_ptr);
}
+
+/**
+ This operation is intended to store some item value in Item_param to be
+ used later.
+
+ @param thd thread context
+ @param ctx stored procedure runtime context
+ @param it a pointer to an item in the tree
+
+ @return Error status
+ @retval TRUE on error
+ @retval FALSE on success
+*/
+
+bool
+Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
+{
+ Item *value= *it;
+
+ if (value->is_null())
+ {
+ set_null();
+ return FALSE;
+ }
+
+ null_value= FALSE;
+
+ switch (value->result_type()) {
+ case STRING_RESULT:
+ {
+ char str_buffer[STRING_BUFFER_USUAL_SIZE];
+ String sv_buffer(str_buffer, sizeof(str_buffer), &my_charset_bin);
+ String *sv= value->val_str(&sv_buffer);
+
+ if (!sv)
+ return TRUE;
+
+ set_str(sv->c_ptr_safe(), sv->length());
+ str_value_ptr.set(str_value.ptr(),
+ str_value.length(),
+ str_value.charset());
+ collation.set(str_value.charset(), DERIVATION_COERCIBLE);
+ decimals= 0;
+ param_type= MYSQL_TYPE_STRING;
+
+ break;
+ }
+
+ case REAL_RESULT:
+ set_double(value->val_real());
+ param_type= MYSQL_TYPE_DOUBLE;
+ break;
+
+ case INT_RESULT:
+ set_int(value->val_int(), value->max_length);
+ param_type= MYSQL_TYPE_LONG;
+ break;
+
+ case DECIMAL_RESULT:
+ {
+ my_decimal dv_buf;
+ my_decimal *dv= value->val_decimal(&dv_buf);
+
+ if (!dv)
+ return TRUE;
+
+ set_decimal(dv);
+ param_type= MYSQL_TYPE_NEWDECIMAL;
+
+ break;
+ }
+
+ default:
+ /* That can not happen. */
+
+ DBUG_ASSERT(TRUE); // Abort in debug mode.
+
+ set_null(); // Set to NULL in release mode.
+ return FALSE;
+ }
+
+ item_result_type= value->result_type();
+ item_type= value->type();
+ return FALSE;
+}
+
+
+/**
+ Setter of Item_param::m_out_param_info.
+
+ m_out_param_info is used to store information about store routine
+ OUT-parameters, such as stored routine name, database, stored routine
+ variable name. It is supposed to be set in sp_head::execute() after
+ Item_param::set_value() is called.
+*/
+
+void
+Item_param::set_out_param_info(Send_field *info)
+{
+ m_out_param_info= info;
+}
+
+
+/**
+ Getter of Item_param::m_out_param_info.
+
+ m_out_param_info is used to store information about store routine
+ OUT-parameters, such as stored routine name, database, stored routine
+ variable name. It is supposed to be retrieved in
+ Protocol_binary::send_out_parameters() during creation of OUT-parameter
+ result set.
+*/
+
+const Send_field *
+Item_param::get_out_param_info() const
+{
+ return m_out_param_info;
+}
+
+
+/**
+ Fill meta-data information for the corresponding column in a result set.
+ If this is an OUT-parameter of a stored procedure, preserve meta-data of
+ stored-routine variable.
+
+ @param field container for meta-data to be filled
+*/
+
+void Item_param::make_field(Send_field *field)
+{
+ Item::make_field(field);
+
+ if (!m_out_param_info)
+ return;
+
+ /*
+ This is an OUT-parameter of stored procedure. We should use
+ OUT-parameter info to fill out the names.
+ */
+
+ field->db_name= m_out_param_info->db_name;
+ field->table_name= m_out_param_info->table_name;
+ field->org_table_name= m_out_param_info->org_table_name;
+ field->col_name= m_out_param_info->col_name;
+ field->org_col_name= m_out_param_info->org_col_name;
+ field->length= m_out_param_info->length;
+ field->charsetnr= m_out_param_info->charsetnr;
+ field->flags= m_out_param_info->flags;
+ field->decimals= m_out_param_info->decimals;
+ field->type= m_out_param_info->type;
+}
+
/****************************************************************************
Item_copy
****************************************************************************/
@@ -3509,7 +3676,7 @@ void Item_copy_decimal::copy()
/*
- Functions to convert item to field (for send_fields)
+ Functions to convert item to field (for send_result_set_metadata)
*/
/* ARGSUSED */
@@ -4773,7 +4940,6 @@ String *Item::check_well_formed_result(String *str, bool send_error)
{
THD *thd= current_thd;
char hexbuf[7];
- enum MYSQL_ERROR::enum_warning_level level;
uint diff= str->length() - wlen;
set_if_smaller(diff, 3);
octet2hex(hexbuf, str->ptr() + wlen, diff);
@@ -4786,16 +4952,14 @@ String *Item::check_well_formed_result(String *str, bool send_error)
if ((thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
- level= MYSQL_ERROR::WARN_LEVEL_ERROR;
null_value= 1;
str= 0;
}
else
{
- level= MYSQL_ERROR::WARN_LEVEL_WARN;
str->length(wlen);
}
- push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_INVALID_CHARACTER_STRING,
ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
}
return str;
diff --git a/sql/item.h b/sql/item.h
index 2d429ca6cf3..24d800300e7 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_INCLUDED
+#define ITEM_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -450,6 +453,11 @@ public:
TRUE if error has occured.
*/
virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0;
+
+ virtual void set_out_param_info(Send_field *info) {}
+
+ virtual const Send_field *get_out_param_info() const
+ { return NULL; }
};
@@ -1563,7 +1571,8 @@ public:
/* Item represents one placeholder ('?') of prepared statement */
-class Item_param :public Item
+class Item_param :public Item,
+ private Settable_routine_parameter
{
char cnvbuf[MAX_FIELD_WIDTH];
String cnvstr;
@@ -1651,6 +1660,7 @@ public:
void set_int(longlong i, uint32 max_length_arg);
void set_double(double i);
void set_decimal(const char *str, ulong length);
+ void set_decimal(const my_decimal *dv);
bool set_str(const char *str, ulong length);
bool set_longdata(const char *str, ulong length);
void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg);
@@ -1700,6 +1710,25 @@ public:
/** Item is a argument to a limit clause. */
bool limit_clause_param;
void set_param_type_and_swap_value(Item_param *from);
+
+private:
+ virtual inline Settable_routine_parameter *
+ get_settable_routine_parameter()
+ {
+ return this;
+ }
+
+ virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
+
+ virtual void set_out_param_info(Send_field *info);
+
+public:
+ virtual const Send_field *get_out_param_info() const;
+
+ virtual void make_field(Send_field *field);
+
+private:
+ Send_field *m_out_param_info;
};
@@ -2057,7 +2086,7 @@ public:
/**
Item_empty_string -- is a utility class to put an item into List<Item>
- which is then used in protocol.send_fields() when sending SHOW output to
+ which is then used in protocol.send_result_set_metadata() when sending SHOW output to
the client.
*/
@@ -3162,3 +3191,5 @@ extern Cached_item *new_Cached_item(THD *thd, Item *item);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item);
extern int stored_field_cmp_to_item(THD *thd, Field *field, Item *item);
+
+#endif /* ITEM_INCLUDED */
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 52af6a31c0c..33f1e9b6950 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_CMPFUNC_INCLUDED
+#define ITEM_CMPFUNC_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -1741,5 +1744,7 @@ inline Item *and_conds(Item *a, Item *b)
Item *and_expressions(Item *a, Item *b, Item **org_item);
-bool get_mysql_time_from_str(THD *thd, String *str, timestamp_type warn_type,
+bool get_mysql_time_from_str(THD *thd, String *str, timestamp_type warn_type,
const char *warn_name, MYSQL_TIME *l_time);
+
+#endif /* ITEM_CMPFUNC_INCLUDED */
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 53aa8081da1..c00b5ec1701 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -927,10 +927,10 @@ protected:
};
-class Create_func_format : public Create_func_arg2
+class Create_func_format : public Create_native_func
{
public:
- virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_format s_singleton;
@@ -2052,6 +2052,18 @@ protected:
virtual ~Create_func_to_days() {}
};
+class Create_func_to_seconds : public Create_func_arg1
+{
+public:
+ virtual Item* create(THD *thd, Item *arg1);
+
+ static Create_func_to_seconds s_singleton;
+
+protected:
+ Create_func_to_seconds() {}
+ virtual ~Create_func_to_seconds() {}
+};
+
#ifdef HAVE_SPATIAL
class Create_func_touches : public Create_func_arg2
@@ -3352,9 +3364,34 @@ Create_func_floor::create(THD *thd, Item *arg1)
Create_func_format Create_func_format::s_singleton;
Item*
-Create_func_format::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_format::create_native(THD *thd, LEX_STRING name,
+ List<Item> *item_list)
{
- return new (thd->mem_root) Item_func_format(arg1, arg2);
+ Item *func= NULL;
+ int arg_count= item_list ? item_list->elements : 0;
+
+ switch (arg_count) {
+ case 2:
+ {
+ Item *param_1= item_list->pop();
+ Item *param_2= item_list->pop();
+ func= new (thd->mem_root) Item_func_format(param_1, param_2);
+ break;
+ }
+ case 3:
+ {
+ Item *param_1= item_list->pop();
+ Item *param_2= item_list->pop();
+ Item *param_3= item_list->pop();
+ func= new (thd->mem_root) Item_func_format(param_1, param_2, param_3);
+ break;
+ }
+ default:
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
+ break;
+ }
+
+ return func;
}
@@ -4487,6 +4524,15 @@ Create_func_to_days::create(THD *thd, Item *arg1)
}
+Create_func_to_seconds Create_func_to_seconds::s_singleton;
+
+Item*
+Create_func_to_seconds::create(THD *thd, Item *arg1)
+{
+ return new (thd->mem_root) Item_func_to_seconds(arg1);
+}
+
+
#ifdef HAVE_SPATIAL
Create_func_touches Create_func_touches::s_singleton;
@@ -4925,6 +4971,7 @@ static Native_func_registry func_array[] =
{ { C_STRING_WITH_LEN("TIME_TO_SEC") }, BUILDER(Create_func_time_to_sec)},
{ { C_STRING_WITH_LEN("TOUCHES") }, GEOM_BUILDER(Create_func_touches)},
{ { C_STRING_WITH_LEN("TO_DAYS") }, BUILDER(Create_func_to_days)},
+ { { C_STRING_WITH_LEN("TO_SECONDS") }, BUILDER(Create_func_to_seconds)},
{ { C_STRING_WITH_LEN("UCASE") }, BUILDER(Create_func_ucase)},
{ { C_STRING_WITH_LEN("UNCOMPRESS") }, BUILDER(Create_func_uncompress)},
{ { C_STRING_WITH_LEN("UNCOMPRESSED_LENGTH") }, BUILDER(Create_func_uncompressed_length)},
@@ -4968,14 +5015,14 @@ int item_create_init()
DBUG_ENTER("item_create_init");
- if (hash_init(& native_functions_hash,
- system_charset_info,
- array_elements(func_array),
- 0,
- 0,
- (hash_get_key) get_native_fct_hash_key,
- NULL, /* Nothing to free */
- MYF(0)))
+ if (my_hash_init(& native_functions_hash,
+ system_charset_info,
+ array_elements(func_array),
+ 0,
+ 0,
+ (my_hash_get_key) get_native_fct_hash_key,
+ NULL, /* Nothing to free */
+ MYF(0)))
DBUG_RETURN(1);
for (func= func_array; func->builder != NULL; func++)
@@ -4987,7 +5034,7 @@ int item_create_init()
#ifndef DBUG_OFF
for (uint i=0 ; i < native_functions_hash.records ; i++)
{
- func= (Native_func_registry*) hash_element(& native_functions_hash, i);
+ func= (Native_func_registry*) my_hash_element(& native_functions_hash, i);
DBUG_PRINT("info", ("native function: %s length: %u",
func->name.str, (uint) func->name.length));
}
@@ -5005,7 +5052,7 @@ int item_create_init()
void item_create_cleanup()
{
DBUG_ENTER("item_create_cleanup");
- hash_free(& native_functions_hash);
+ my_hash_free(& native_functions_hash);
DBUG_VOID_RETURN;
}
@@ -5016,9 +5063,9 @@ find_native_function_builder(THD *thd, LEX_STRING name)
Create_func *builder= NULL;
/* Thread safe */
- func= (Native_func_registry*) hash_search(& native_functions_hash,
- (uchar*) name.str,
- name.length);
+ func= (Native_func_registry*) my_hash_search(& native_functions_hash,
+ (uchar*) name.str,
+ name.length);
if (func)
{
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 977a0de39af..49b770c4af0 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -598,7 +598,7 @@ void Item_func::signal_divide_by_null()
{
THD *thd= current_thd;
if (thd->variables.sql_mode & MODE_ERROR_FOR_DIVISION_BY_ZERO)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DIVISION_BY_ZERO,
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_DIVISION_BY_ZERO,
ER(ER_DIVISION_BY_ZERO));
null_value= 1;
}
@@ -1053,7 +1053,7 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
return dec;
err:
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE),
name, 1);
@@ -3283,7 +3283,7 @@ public:
{
if (key)
{
- hash_delete(&hash_user_locks,(uchar*) this);
+ my_hash_delete(&hash_user_locks,(uchar*) this);
my_free(key, MYF(0));
}
pthread_cond_destroy(&cond);
@@ -3307,8 +3307,8 @@ static bool item_user_lock_inited= 0;
void item_user_lock_init(void)
{
pthread_mutex_init(&LOCK_user_locks,MY_MUTEX_INIT_SLOW);
- hash_init(&hash_user_locks,system_charset_info,
- 16,0,0,(hash_get_key) ull_get_key,NULL,0);
+ my_hash_init(&hash_user_locks,system_charset_info,
+ 16,0,0,(my_hash_get_key) ull_get_key,NULL,0);
item_user_lock_inited= 1;
}
@@ -3317,7 +3317,7 @@ void item_user_lock_free(void)
if (item_user_lock_inited)
{
item_user_lock_inited= 0;
- hash_free(&hash_user_locks);
+ my_hash_free(&hash_user_locks);
pthread_mutex_destroy(&LOCK_user_locks);
}
}
@@ -3384,9 +3384,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
this case, we will not be waiting, but rather, just waste CPU and
memory on the whole deal
*/
- if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
- (uchar*) lock_name,
- lock_name_len))))
+ if (!(ull= ((User_level_lock*) my_hash_search(&hash_user_locks,
+ (uchar*) lock_name,
+ lock_name_len))))
{
pthread_mutex_unlock(&LOCK_user_locks);
return;
@@ -3487,9 +3487,9 @@ longlong Item_func_get_lock::val_int()
thd->ull=0;
}
- if (!(ull= ((User_level_lock *) hash_search(&hash_user_locks,
- (uchar*) res->ptr(),
- (size_t) res->length()))))
+ if (!(ull= ((User_level_lock *) my_hash_search(&hash_user_locks,
+ (uchar*) res->ptr(),
+ (size_t) res->length()))))
{
ull= new User_level_lock((uchar*) res->ptr(), (size_t) res->length(),
thd->thread_id);
@@ -3591,9 +3591,9 @@ longlong Item_func_release_lock::val_int()
result=0;
pthread_mutex_lock(&LOCK_user_locks);
- if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
- (const uchar*) res->ptr(),
- (size_t) res->length()))))
+ if (!(ull= ((User_level_lock*) my_hash_search(&hash_user_locks,
+ (const uchar*) res->ptr(),
+ (size_t) res->length()))))
{
null_value=1;
}
@@ -3666,7 +3666,7 @@ longlong Item_func_benchmark::val_int()
{
char buff[22];
llstr(((longlong) loop_count), buff);
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
"count", buff, "benchmark");
}
@@ -3773,12 +3773,12 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
{
user_var_entry *entry;
- if (!(entry = (user_var_entry*) hash_search(hash, (uchar*) name.str,
- name.length)) &&
+ if (!(entry = (user_var_entry*) my_hash_search(hash, (uchar*) name.str,
+ name.length)) &&
create_if_not_exists)
{
uint size=ALIGN_SIZE(sizeof(user_var_entry))+name.length+1+extra_size;
- if (!hash_inited(hash))
+ if (!my_hash_inited(hash))
return 0;
if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME))))
return 0;
@@ -5694,8 +5694,8 @@ longlong Item_func_is_free_lock::val_int()
}
pthread_mutex_lock(&LOCK_user_locks);
- ull= (User_level_lock *) hash_search(&hash_user_locks, (uchar*) res->ptr(),
- (size_t) res->length());
+ ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(),
+ (size_t) res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
return 1;
@@ -5713,8 +5713,8 @@ longlong Item_func_is_used_lock::val_int()
return 0;
pthread_mutex_lock(&LOCK_user_locks);
- ull= (User_level_lock *) hash_search(&hash_user_locks, (uchar*) res->ptr(),
- (size_t) res->length());
+ ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(),
+ (size_t) res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
return 0;
@@ -5795,12 +5795,12 @@ Item_func_sp::func_name() const
}
-int my_missing_function_error(const LEX_STRING &token, const char *func_name)
+void my_missing_function_error(const LEX_STRING &token, const char *func_name)
{
if (token.length && is_lex_native_function (&token))
- return my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
+ my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
else
- return my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 1aae0a5abb5..f22bc0c301c 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_FUNC_INCLUDED
+#define ITEM_FUNC_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -1706,3 +1709,4 @@ public:
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
+#endif /* ITEM_FUNC_INCLUDED */
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index edbe104e307..9a55ea7d5b1 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_GEOFUNC_INCLUDED
+#define ITEM_GEOFUNC_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -386,3 +389,4 @@ public:
#endif
+#endif /* ITEM_GEOFUNC_INCLUDED */
diff --git a/sql/item_row.h b/sql/item_row.h
index 67441f49603..7c08c5888e0 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_ROW_INCLUDED
+#define ITEM_ROW_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -77,3 +80,5 @@ public:
bool null_inside() { return with_null; };
void bring_value();
};
+
+#endif /* ITEM_ROW_INCLUDED */
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 183a628f8e4..86a892a9dcc 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -528,11 +528,11 @@ String *Item_func_des_encrypt::val_str(String *str)
return &tmp_value;
error:
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
code, ER(code),
"des_encrypt");
#else
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_encrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
@@ -605,12 +605,12 @@ String *Item_func_des_decrypt::val_str(String *str)
return &tmp_value;
error:
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
code, ER(code),
"des_decrypt");
wrong_key:
#else
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_decrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
@@ -2041,9 +2041,22 @@ String *Item_func_soundex::val_str(String *str)
const int FORMAT_MAX_DECIMALS= 30;
-Item_func_format::Item_func_format(Item *org, Item *dec)
-: Item_str_func(org, dec)
+
+MY_LOCALE *Item_func_format::get_locale(Item *item)
{
+ DBUG_ASSERT(arg_count == 3);
+ String tmp, *locale_name= args[2]->val_str(&tmp);
+ MY_LOCALE *lc;
+ if (!locale_name ||
+ !(lc= my_locale_by_name(locale_name->c_ptr_safe())))
+ {
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_UNKNOWN_LOCALE,
+ ER(ER_UNKNOWN_LOCALE),
+ locale_name ? locale_name->c_ptr_safe() : "NULL");
+ lc= &my_locale_en_US;
+ }
+ return lc;
}
void Item_func_format::fix_length_and_dec()
@@ -2053,6 +2066,10 @@ void Item_func_format::fix_length_and_dec()
collation.set(default_charset());
max_length= (char_length + max_sep_count + decimals) *
collation.collation->mbmaxlen;
+ if (arg_count == 3)
+ locale= args[2]->basic_const_item() ? get_locale(args[2]) : NULL;
+ else
+ locale= &my_locale_en_US; /* Two arguments */
}
@@ -2064,13 +2081,12 @@ void Item_func_format::fix_length_and_dec()
String *Item_func_format::val_str(String *str)
{
- uint32 length;
uint32 str_length;
/* Number of decimal digits */
int dec;
/* Number of characters used to represent the decimals, including '.' */
uint32 dec_length;
- int diff;
+ MY_LOCALE *lc;
DBUG_ASSERT(fixed == 1);
dec= (int) args[1]->val_int();
@@ -2080,6 +2096,8 @@ String *Item_func_format::val_str(String *str)
return NULL;
}
+ lc= locale ? locale : get_locale(args[2]);
+
dec= set_zone(dec, 0, FORMAT_MAX_DECIMALS);
dec_length= dec ? dec+1 : 0;
null_value=0;
@@ -2094,8 +2112,6 @@ String *Item_func_format::val_str(String *str)
my_decimal_round(E_DEC_FATAL_ERROR, res, dec, false, &rnd_dec);
my_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str);
str_length= str->length();
- if (rnd_dec.sign())
- str_length--;
}
else
{
@@ -2108,31 +2124,51 @@ String *Item_func_format::val_str(String *str)
if (isnan(nr))
return str;
str_length=str->length();
- if (nr < 0)
- str_length--; // Don't count sign
- }
- /* We need this test to handle 'nan' values */
- if (str_length >= dec_length+4)
- {
- char *tmp,*pos;
- length= str->length()+(diff=((int)(str_length- dec_length-1))/3);
- str= copy_if_not_alloced(&tmp_str,str,length);
- str->length(length);
- tmp= (char*) str->ptr()+length - dec_length-1;
- for (pos= (char*) str->ptr()+length-1; pos != tmp; pos--)
- pos[0]= pos[-diff];
- while (diff)
+ }
+ /* We need this test to handle 'nan' and short values */
+ if (lc->grouping[0] > 0 &&
+ str_length >= dec_length + 1 + lc->grouping[0])
+ {
+ char buf[DECIMAL_MAX_STR_LENGTH * 2]; /* 2 - in the worst case when grouping=1 */
+ int count;
+ const char *grouping= lc->grouping;
+ char sign_length= *str->ptr() == '-' ? 1 : 0;
+ const char *src= str->ptr() + str_length - dec_length - 1;
+ const char *src_begin= str->ptr() + sign_length;
+ char *dst= buf + sizeof(buf);
+
+ /* Put the fractional part */
+ if (dec)
+ {
+ dst-= (dec + 1);
+ *dst= lc->decimal_point;
+ memcpy(dst + 1, src + 2, dec);
+ }
+
+ /* Put the integer part with grouping */
+ for (count= *grouping; src >= src_begin; count--)
{
- *pos= *(pos - diff);
- pos--;
- *pos= *(pos - diff);
- pos--;
- *pos= *(pos - diff);
- pos--;
- pos[0]=',';
- pos--;
- diff--;
+ /*
+ When *grouping==0x80 (which means "end of grouping")
+ count will be initialized to -1 and
+ we'll never get into this "if" anymore.
+ */
+ if (!count)
+ {
+ *--dst= lc->thousand_sep;
+ if (grouping[1])
+ grouping++;
+ count= *grouping;
+ }
+ DBUG_ASSERT(dst > buf);
+ *--dst= *src--;
}
+
+ if (sign_length) /* Put '-' */
+ *--dst= *str->ptr();
+
+ /* Put the rest of the integer part without grouping */
+ str->copy(dst, buf + sizeof(buf) - dst, &my_charset_latin1);
}
return str;
}
@@ -3238,7 +3274,7 @@ longlong Item_func_uncompressed_length::val_int()
*/
if (res->length() <= 4)
{
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ZLIB_Z_DATA_ERROR,
ER(ER_ZLIB_Z_DATA_ERROR));
null_value= 1;
@@ -3315,7 +3351,7 @@ String *Item_func_compress::val_str(String *str)
(const Bytef*)res->ptr(), res->length())) != Z_OK)
{
code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
- push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
+ push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,code,ER(code));
null_value= 1;
return 0;
}
@@ -3353,7 +3389,7 @@ String *Item_func_uncompress::val_str(String *str)
/* If length is less than 4 bytes, data is corrupt */
if (res->length() <= 4)
{
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ZLIB_Z_DATA_ERROR,
ER(ER_ZLIB_Z_DATA_ERROR));
goto err;
@@ -3363,7 +3399,7 @@ String *Item_func_uncompress::val_str(String *str)
new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
if (new_size > current_thd->variables.max_allowed_packet)
{
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_BIG_FOR_UNCOMPRESS,
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
current_thd->variables.max_allowed_packet);
@@ -3381,7 +3417,7 @@ String *Item_func_uncompress::val_str(String *str)
code= ((err == Z_BUF_ERROR) ? ER_ZLIB_Z_BUF_ERROR :
((err == Z_MEM_ERROR) ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR));
- push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
+ push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,code,ER(code));
err:
null_value= 1;
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 2cdb45100ae..2233679e40c 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_STRFUNC_INCLUDED
+#define ITEM_STRFUNC_INCLUDED
+
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -498,8 +501,13 @@ public:
class Item_func_format :public Item_str_func
{
String tmp_str;
+ MY_LOCALE *locale;
public:
- Item_func_format(Item *org, Item *dec);
+ Item_func_format(Item *org, Item *dec): Item_str_func(org, dec) {}
+ Item_func_format(Item *org, Item *dec, Item *lang):
+ Item_str_func(org, dec, lang) {}
+
+ MY_LOCALE *get_locale(Item *item);
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "format"; }
@@ -842,3 +850,4 @@ public:
String *val_str(String *);
};
+#endif /* ITEM_STRFUNC_INCLUDED */
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 26d3833f72c..a6499b9584c 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1870,7 +1870,8 @@ void subselect_uniquesubquery_engine::fix_length_and_dec(Item_cache **row)
DBUG_ASSERT(0);
}
-int init_read_record_seq(JOIN_TAB *tab);
+int read_first_record_seq(JOIN_TAB *tab);
+int rr_sequential(READ_RECORD *info);
int join_read_always_key_or_null(JOIN_TAB *tab);
int join_read_next_same_or_null(READ_RECORD *info);
@@ -1952,7 +1953,8 @@ int subselect_single_select_engine::exec()
/* Change the access method to full table scan */
tab->save_read_first_record= tab->read_first_record;
tab->save_read_record= tab->read_record.read_record;
- tab->read_first_record= init_read_record_seq;
+ tab->read_record.read_record= rr_sequential;
+ tab->read_first_record= read_first_record_seq;
tab->read_record.record= tab->table->record[0];
tab->read_record.thd= join->thd;
tab->read_record.ref_length= tab->table->file->ref_length;
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 467e9b22637..3503d42edc0 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_SUBSELECT_INCLUDED
+#define ITEM_SUBSELECT_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -580,4 +583,4 @@ inline bool Item_subselect::is_uncacheable() const
return engine->uncacheable();
}
-
+#endif /* ITEM_SUBSELECT_INCLUDED */
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 4ab8e75ddf5..82b68a87dfd 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -374,6 +374,7 @@ Item_sum::Item_sum(List<Item> &list) :arg_count(list.elements),
args= NULL;
}
mark_as_sum_func();
+ init_aggregator();
list.empty(); // Fields are used
}
@@ -405,6 +406,10 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
}
memcpy(args, item->args, sizeof(Item*)*arg_count);
memcpy(orig_args, item->orig_args, sizeof(Item*)*arg_count);
+ init_aggregator();
+ with_distinct= item->with_distinct;
+ if (item->aggr)
+ set_aggregator(item->aggr->Aggrtype());
}
@@ -550,13 +555,518 @@ void Item_sum::update_used_tables ()
}
-Item *Item_sum::set_arg(int i, THD *thd, Item *new_val)
+Item *Item_sum::set_arg(uint i, THD *thd, Item *new_val)
{
thd->change_item_tree(args + i, new_val);
return new_val;
}
+int Item_sum::set_aggregator(Aggregator::Aggregator_type aggregator)
+{
+ if (aggr)
+ {
+ DBUG_ASSERT(aggregator == aggr->Aggrtype());
+ return FALSE;
+ }
+ switch (aggregator)
+ {
+ case Aggregator::DISTINCT_AGGREGATOR:
+ aggr= new Aggregator_distinct(this);
+ break;
+
+ case Aggregator::SIMPLE_AGGREGATOR:
+ aggr= new Aggregator_simple(this);
+ break;
+ };
+ return aggr ? FALSE : TRUE;
+}
+
+
+void Item_sum::cleanup()
+{
+ if (aggr)
+ {
+ delete aggr;
+ aggr= NULL;
+ }
+ Item_result_field::cleanup();
+ forced_const= FALSE;
+}
+
+
+/**
+ Compare keys consisting of single field that cannot be compared as binary.
+
+ Used by the Unique class to compare keys. Will do correct comparisons
+ for all field types.
+
+ @param arg Pointer to the relevant Field class instance
+ @param key1 left key image
+ @param key2 right key image
+ @return comparison result
+ @retval < 0 if key1 < key2
+ @retval = 0 if key1 = key2
+ @retval > 0 if key1 > key2
+*/
+
+static int simple_str_key_cmp(void* arg, uchar* key1, uchar* key2)
+{
+ Field *f= (Field*) arg;
+ return f->cmp(key1, key2);
+}
+
+
+/**
+ Correctly compare composite keys.
+
+ Used by the Unique class to compare keys. Will do correct comparisons
+ for composite keys with various field types.
+
+ @param arg Pointer to the relevant Aggregator_distinct instance
+ @param key1 left key image
+ @param key2 right key image
+ @return comparison result
+ @retval <0 if key1 < key2
+ @retval =0 if key1 = key2
+ @retval >0 if key1 > key2
+*/
+
+int Aggregator_distinct::composite_key_cmp(void* arg, uchar* key1, uchar* key2)
+{
+ Aggregator_distinct *aggr= (Aggregator_distinct *) arg;
+ Field **field = aggr->table->field;
+ Field **field_end= field + aggr->table->s->fields;
+ uint32 *lengths=aggr->field_lengths;
+ for (; field < field_end; ++field)
+ {
+ Field* f = *field;
+ int len = *lengths++;
+ int res = f->cmp(key1, key2);
+ if (res)
+ return res;
+ key1 += len;
+ key2 += len;
+ }
+ return 0;
+}
+
+
+static enum enum_field_types
+calc_tmp_field_type(enum enum_field_types table_field_type,
+ Item_result result_type)
+{
+ /* Adjust tmp table type according to the chosen aggregation type */
+ switch (result_type) {
+ case STRING_RESULT:
+ case REAL_RESULT:
+ if (table_field_type != MYSQL_TYPE_FLOAT)
+ table_field_type= MYSQL_TYPE_DOUBLE;
+ break;
+ case INT_RESULT:
+ table_field_type= MYSQL_TYPE_LONGLONG;
+ /* fallthrough */
+ case DECIMAL_RESULT:
+ if (table_field_type != MYSQL_TYPE_LONGLONG)
+ table_field_type= MYSQL_TYPE_NEWDECIMAL;
+ break;
+ case ROW_RESULT:
+ default:
+ DBUG_ASSERT(0);
+ }
+ return table_field_type;
+}
+
+
+/***************************************************************************/
+
+C_MODE_START
+
+/* Declarations for auxilary C-callbacks */
+
+static int simple_raw_key_cmp(void* arg, const void* key1, const void* key2)
+{
+ return memcmp(key1, key2, *(uint *) arg);
+}
+
+
+static int item_sum_distinct_walk(void *element, element_count num_of_dups,
+ void *item)
+{
+ return ((Aggregator_distinct*) (item))->unique_walk_function(element);
+}
+
+C_MODE_END
+
+/***************************************************************************/
+/**
+ Called before feeding the first row. Used to allocate/setup
+ the internal structures used for aggregation.
+
+ @param thd Thread descriptor
+ @return status
+ @retval FALSE success
+ @retval TRUE faliure
+
+ Prepares Aggregator_distinct to process the incoming stream.
+ Creates the temporary table and the Unique class if needed.
+ Called by Item_sum::aggregator_setup()
+*/
+
+bool Aggregator_distinct::setup(THD *thd)
+{
+ endup_done= FALSE;
+ /*
+ Setup can be called twice for ROLLUP items. This is a bug.
+ Please add DBUG_ASSERT(tree == 0) here when it's fixed.
+ */
+ if (tree || table || tmp_table_param)
+ return FALSE;
+
+ if (item_sum->setup(thd))
+ return TRUE;
+ if (item_sum->sum_func() == Item_sum::COUNT_FUNC ||
+ item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC)
+ {
+ List<Item> list;
+ SELECT_LEX *select_lex= thd->lex->current_select;
+
+ if (!(tmp_table_param= new TMP_TABLE_PARAM))
+ return TRUE;
+
+ /* Create a table with an unique key over all parameters */
+ for (uint i=0; i < item_sum->get_arg_count() ; i++)
+ {
+ Item *item=item_sum->get_arg(i);
+ if (list.push_back(item))
+ return TRUE; // End of memory
+ if (item->const_item() && item->is_null())
+ always_null= true;
+ }
+ if (always_null)
+ return FALSE;
+ count_field_types(select_lex, tmp_table_param, list, 0);
+ tmp_table_param->force_copy_fields= item_sum->has_force_copy_fields();
+ DBUG_ASSERT(table == 0);
+ /*
+ Make create_tmp_table() convert BIT columns to BIGINT.
+ This is needed because BIT fields store parts of their data in table's
+ null bits, and we don't have methods to compare two table records, which
+ is needed by Unique which is used when HEAP table is used.
+ */
+ {
+ List_iterator_fast<Item> li(list);
+ Item *item;
+ while ((item= li++))
+ {
+ if (item->type() == Item::FIELD_ITEM &&
+ ((Item_field*)item)->field->type() == FIELD_TYPE_BIT)
+ item->marker=4;
+ }
+ }
+ if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
+ 0,
+ (select_lex->options | thd->options),
+ HA_POS_ERROR, (char*)"")))
+ return TRUE;
+ table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
+ table->no_rows=1;
+
+ if (table->s->db_type() == heap_hton)
+ {
+ /*
+ No blobs, otherwise it would have been MyISAM: set up a compare
+ function and its arguments to use with Unique.
+ */
+ qsort_cmp2 compare_key;
+ void* cmp_arg;
+ Field **field= table->field;
+ Field **field_end= field + table->s->fields;
+ bool all_binary= TRUE;
+
+ for (tree_key_length= 0; field < field_end; ++field)
+ {
+ Field *f= *field;
+ enum enum_field_types type= f->type();
+ tree_key_length+= f->pack_length();
+ if ((type == MYSQL_TYPE_VARCHAR) ||
+ (!f->binary() && (type == MYSQL_TYPE_STRING ||
+ type == MYSQL_TYPE_VAR_STRING)))
+ {
+ all_binary= FALSE;
+ break;
+ }
+ }
+ if (all_binary)
+ {
+ cmp_arg= (void*) &tree_key_length;
+ compare_key= (qsort_cmp2) simple_raw_key_cmp;
+ }
+ else
+ {
+ if (table->s->fields == 1)
+ {
+ /*
+ If we have only one field, which is the most common use of
+ count(distinct), it is much faster to use a simpler key
+ compare method that can take advantage of not having to worry
+ about other fields.
+ */
+ compare_key= (qsort_cmp2) simple_str_key_cmp;
+ cmp_arg= (void*) table->field[0];
+ /* tree_key_length has been set already */
+ }
+ else
+ {
+ uint32 *length;
+ compare_key= (qsort_cmp2) composite_key_cmp;
+ cmp_arg= (void*) this;
+ field_lengths= (uint32*) thd->alloc(table->s->fields * sizeof(uint32));
+ for (tree_key_length= 0, length= field_lengths, field= table->field;
+ field < field_end; ++field, ++length)
+ {
+ *length= (*field)->pack_length();
+ tree_key_length+= *length;
+ }
+ }
+ }
+ DBUG_ASSERT(tree == 0);
+ tree= new Unique(compare_key, cmp_arg, tree_key_length,
+ thd->variables.max_heap_table_size);
+ /*
+ The only time tree_key_length could be 0 is if someone does
+ count(distinct) on a char(0) field - stupid thing to do,
+ but this has to be handled - otherwise someone can crash
+ the server with a DoS attack
+ */
+ if (! tree)
+ return TRUE;
+ }
+ return FALSE;
+ }
+ else
+ {
+ List<Create_field> field_list;
+ Create_field field_def; /* field definition */
+ Item *arg;
+ DBUG_ENTER("Aggregator_distinct::setup");
+ /* It's legal to call setup() more than once when in a subquery */
+ if (tree)
+ DBUG_RETURN(FALSE);
+
+ /*
+ Virtual table and the tree are created anew on each re-execution of
+ PS/SP. Hence all further allocations are performed in the runtime
+ mem_root.
+ */
+ if (field_list.push_back(&field_def))
+ DBUG_RETURN(TRUE);
+
+ item_sum->null_value= item_sum->maybe_null= 1;
+ item_sum->quick_group= 0;
+
+ DBUG_ASSERT(item_sum->get_arg(0)->fixed);
+
+ arg= item_sum->get_arg(0);
+ if (arg->const_item())
+ {
+ (void) arg->val_int();
+ if (arg->null_value)
+ always_null= true;
+ }
+
+ if (always_null)
+ DBUG_RETURN(FALSE);
+
+ enum enum_field_types field_type;
+
+ field_type= calc_tmp_field_type(arg->field_type(),
+ arg->result_type());
+ field_def.init_for_tmp_table(field_type,
+ arg->max_length,
+ arg->decimals,
+ arg->maybe_null,
+ arg->unsigned_flag);
+
+ if (! (table= create_virtual_tmp_table(thd, field_list)))
+ DBUG_RETURN(TRUE);
+
+ /* XXX: check that the case of CHAR(0) works OK */
+ tree_key_length= table->s->reclength - table->s->null_bytes;
+
+ /*
+ Unique handles all unique elements in a tree until they can't fit
+ in. Then the tree is dumped to the temporary file. We can use
+ simple_raw_key_cmp because the table contains numbers only; decimals
+ are converted to binary representation as well.
+ */
+ tree= new Unique(simple_raw_key_cmp, &tree_key_length, tree_key_length,
+ thd->variables.max_heap_table_size);
+
+ DBUG_RETURN(tree == 0);
+ }
+}
+
+
+/**
+ Invalidate calculated value and clear the distinct rows.
+
+ Frees space used by the internal data structures.
+ Removes the accumulated distinct rows. Invalidates the calculated result.
+*/
+
+void Aggregator_distinct::clear()
+{
+ endup_done= FALSE;
+ item_sum->clear();
+ if (tree)
+ tree->reset();
+ /* tree and table can be both null only if always_null */
+ if (item_sum->sum_func() == Item_sum::COUNT_FUNC ||
+ item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC)
+ {
+ if (!tree && table)
+ {
+ table->file->extra(HA_EXTRA_NO_CACHE);
+ table->file->ha_delete_all_rows();
+ table->file->extra(HA_EXTRA_WRITE_CACHE);
+ }
+ }
+ else
+ {
+ item_sum->null_value= 1;
+ }
+}
+
+
+/**
+ Process incoming row.
+
+ Add it to Unique/temp hash table if it's unique. Skip the row if
+ not unique.
+ Prepare Aggregator_distinct to process the incoming stream.
+ Create the temporary table and the Unique class if needed.
+ Called by Item_sum::aggregator_add().
+ To actually get the result value in item_sum's buffers
+ Aggregator_distinct::endup() must be called.
+
+ @return status
+ @retval FALSE success
+ @retval TRUE failure
+*/
+
+bool Aggregator_distinct::add()
+{
+ if (always_null)
+ return 0;
+
+ if (item_sum->sum_func() == Item_sum::COUNT_FUNC ||
+ item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC)
+ {
+ int error;
+ copy_fields(tmp_table_param);
+ copy_funcs(tmp_table_param->items_to_copy);
+
+ for (Field **field=table->field ; *field ; field++)
+ if ((*field)->is_real_null(0))
+ return 0; // Don't count NULL
+
+ if (tree)
+ {
+ /*
+ The first few bytes of record (at least one) are just markers
+ for deleted and NULLs. We want to skip them since they will
+ bloat the tree without providing any valuable info. Besides,
+ key_length used to initialize the tree didn't include space for them.
+ */
+ return tree->unique_add(table->record[0] + table->s->null_bytes);
+ }
+ if ((error= table->file->ha_write_row(table->record[0])) &&
+ table->file->is_fatal_error(error, HA_CHECK_DUP))
+ return TRUE;
+ return FALSE;
+ }
+ else
+ {
+ item_sum->get_arg(0)->save_in_field(table->field[0], FALSE);
+ if (table->field[0]->is_null())
+ return 0;
+ DBUG_ASSERT(tree);
+ item_sum->null_value= 0;
+ /*
+ '0' values are also stored in the tree. This doesn't matter
+ for SUM(DISTINCT), but is important for AVG(DISTINCT)
+ */
+ return tree->unique_add(table->field[0]->ptr);
+ }
+}
+
+
+/**
+ Calculate the aggregate function value.
+
+ Since Distinct_aggregator::add() just collects the distinct rows,
+ we must go over the distinct rows and feed them to the aggregation
+ function before returning its value.
+ This is what endup () does. It also sets the result validity flag
+ endup_done to TRUE so it will not recalculate the aggregate value
+ again if the Item_sum hasn't been reset.
+*/
+
+void Aggregator_distinct::endup()
+{
+ /* prevent consecutive recalculations */
+ if (endup_done)
+ return;
+
+ /* we are going to calculate the aggregate value afresh */
+ item_sum->clear();
+
+ /* The result will definitely be null : no more calculations needed */
+ if (always_null)
+ return;
+
+ if (item_sum->sum_func() == Item_sum::COUNT_FUNC ||
+ item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC)
+ {
+ DBUG_ASSERT(item_sum->fixed == 1);
+ Item_sum_count *sum= (Item_sum_count *)item_sum;
+ if (tree && tree->elements == 0)
+ {
+ /* everything fits in memory */
+ sum->count= (longlong) tree->elements_in_tree();
+ endup_done= TRUE;
+ }
+ if (!tree)
+ {
+ /* there were blobs */
+ table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
+ sum->count= table->file->stats.records;
+ endup_done= TRUE;
+ }
+ }
+ else
+ {
+ /*
+ We don't have a tree only if 'setup()' hasn't been called;
+ this is the case of sql_select.cc:return_zero_rows.
+ */
+ if (tree)
+ table->field[0]->set_notnull();
+ }
+
+ if (tree && !endup_done)
+ {
+ /* go over the tree of distinct keys and calculate the aggregate value */
+ use_distinct_values= TRUE;
+ tree->walk(item_sum_distinct_walk, (void*) this);
+ use_distinct_values= FALSE;
+ }
+ /* prevent consecutive recalculations */
+ endup_done= TRUE;
+}
+
+
String *
Item_sum_num::val_str(String *str)
{
@@ -815,10 +1325,27 @@ void Item_sum_sum::fix_length_and_dec()
bool Item_sum_sum::add()
{
DBUG_ENTER("Item_sum_sum::add");
+ bool arg_is_null;
if (hybrid_type == DECIMAL_RESULT)
{
- my_decimal value, *val= args[0]->val_decimal(&value);
- if (!args[0]->null_value)
+ my_decimal value, *val;
+ if (aggr->use_distinct_values)
+ {
+ /*
+ We are aggregating distinct rows. Get the value from the distinct
+ table pointer
+ */
+ Aggregator_distinct *daggr= (Aggregator_distinct *)aggr;
+ val= daggr->table->field[0]->val_decimal (&value);
+ arg_is_null= daggr->table->field[0]->is_null();
+ }
+ else
+ {
+ /* non-distinct aggregation */
+ val= args[0]->val_decimal(&value);
+ arg_is_null= args[0]->null_value;
+ }
+ if (!arg_is_null)
{
my_decimal_add(E_DEC_FATAL_ERROR, dec_buffs + (curr_dec_buff^1),
val, dec_buffs + curr_dec_buff);
@@ -828,8 +1355,25 @@ bool Item_sum_sum::add()
}
else
{
- sum+= args[0]->val_real();
- if (!args[0]->null_value)
+ double val;
+ if (aggr->use_distinct_values)
+ {
+ /*
+ We are aggregating distinct rows. Get the value from the distinct
+ table pointer
+ */
+ Aggregator_distinct *daggr= (Aggregator_distinct *)aggr;
+ val= daggr->table->field[0]->val_real ();
+ arg_is_null= daggr->table->field[0]->is_null();
+ }
+ else
+ {
+ /* non-distinct aggregation */
+ val= args[0]->val_real();
+ arg_is_null= args[0]->null_value;
+ }
+ sum+= val;
+ if (!arg_is_null)
null_value= 0;
}
DBUG_RETURN(0);
@@ -839,6 +1383,8 @@ bool Item_sum_sum::add()
longlong Item_sum_sum::val_int()
{
DBUG_ASSERT(fixed == 1);
+ if (aggr)
+ aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
{
longlong result;
@@ -853,6 +1399,8 @@ longlong Item_sum_sum::val_int()
double Item_sum_sum::val_real()
{
DBUG_ASSERT(fixed == 1);
+ if (aggr)
+ aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
my_decimal2double(E_DEC_FATAL_ERROR, dec_buffs + curr_dec_buff, &sum);
return sum;
@@ -861,6 +1409,8 @@ double Item_sum_sum::val_real()
String *Item_sum_sum::val_str(String *str)
{
+ if (aggr)
+ aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
return val_string_from_decimal(str);
return val_string_from_real(str);
@@ -869,311 +1419,54 @@ String *Item_sum_sum::val_str(String *str)
my_decimal *Item_sum_sum::val_decimal(my_decimal *val)
{
+ if (aggr)
+ aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
return (dec_buffs + curr_dec_buff);
return val_decimal_from_real(val);
}
-/***************************************************************************/
-
-C_MODE_START
-
-/* Declarations for auxilary C-callbacks */
-
-static int simple_raw_key_cmp(void* arg, const void* key1, const void* key2)
-{
- return memcmp(key1, key2, *(uint *) arg);
-}
-
-
-static int item_sum_distinct_walk(void *element, element_count num_of_dups,
- void *item)
-{
- return ((Item_sum_distinct*) (item))->unique_walk_function(element);
-}
-
-C_MODE_END
-
-/* Item_sum_distinct */
-
-Item_sum_distinct::Item_sum_distinct(Item *item_arg)
- :Item_sum_num(item_arg), tree(0)
-{
- /*
- quick_group is an optimizer hint, which means that GROUP BY can be
- handled with help of index on grouped columns.
- By setting quick_group to zero we force creation of temporary table
- to perform GROUP BY.
- */
- quick_group= 0;
-}
-
-
-Item_sum_distinct::Item_sum_distinct(THD *thd, Item_sum_distinct *original)
- :Item_sum_num(thd, original), val(original->val), tree(0),
- table_field_type(original->table_field_type)
-{
- quick_group= 0;
-}
-
-
/**
- Behaves like an Integer except to fix_length_and_dec().
- Additionally div() converts val with this traits to a val with true
- decimal traits along with conversion of integer value to decimal value.
- This is to speedup SUM/AVG(DISTINCT) evaluation for 8-32 bit integer
- values.
+ Aggregate a distinct row from the distinct hash table.
+
+ Called for each row into the hash table 'Aggregator_distinct::table'.
+ Includes the current distinct row into the calculation of the
+ aggregate value. Uses the Field classes to get the value from the row.
+ This function is used for AVG/SUM(DISTINCT). For COUNT(DISTINCT)
+ it's called only when there are no blob arguments and the data don't
+ fit into memory (so Unique makes persisted trees on disk).
+
+ @param element pointer to the row data.
+
+ @return status
+ @retval FALSE success
+ @retval TRUE failure
*/
-struct Hybrid_type_traits_fast_decimal: public
- Hybrid_type_traits_integer
-{
- virtual Item_result type() const { return DECIMAL_RESULT; }
- virtual void fix_length_and_dec(Item *item, Item *arg) const
- { Hybrid_type_traits_decimal::instance()->fix_length_and_dec(item, arg); }
-
- virtual void div(Hybrid_type *val, ulonglong u) const
- {
- int2my_decimal(E_DEC_FATAL_ERROR, val->integer, 0, val->dec_buf);
- val->used_dec_buf_no= 0;
- val->traits= Hybrid_type_traits_decimal::instance();
- val->traits->div(val, u);
- }
- static const Hybrid_type_traits_fast_decimal *instance();
- Hybrid_type_traits_fast_decimal() {};
-};
-
-static const Hybrid_type_traits_fast_decimal fast_decimal_traits_instance;
-
-const Hybrid_type_traits_fast_decimal
- *Hybrid_type_traits_fast_decimal::instance()
-{
- return &fast_decimal_traits_instance;
-}
-
-void Item_sum_distinct::fix_length_and_dec()
+
+bool Aggregator_distinct::unique_walk_function(void *element)
{
- DBUG_ASSERT(args[0]->fixed);
-
- table_field_type= args[0]->field_type();
-
- /* Adjust tmp table type according to the chosen aggregation type */
- switch (args[0]->result_type()) {
- case STRING_RESULT:
- case REAL_RESULT:
- val.traits= Hybrid_type_traits::instance();
- if (table_field_type != MYSQL_TYPE_FLOAT)
- table_field_type= MYSQL_TYPE_DOUBLE;
- break;
- case INT_RESULT:
- /*
- Preserving int8, int16, int32 field types gives ~10% performance boost
- as the size of result tree becomes significantly smaller.
- Another speed up we gain by using longlong for intermediate
- calculations. The range of int64 is enough to hold sum 2^32 distinct
- integers each <= 2^32.
- */
- if (table_field_type == MYSQL_TYPE_INT24 ||
- (table_field_type >= MYSQL_TYPE_TINY &&
- table_field_type <= MYSQL_TYPE_LONG))
- {
- val.traits= Hybrid_type_traits_fast_decimal::instance();
- break;
- }
- table_field_type= MYSQL_TYPE_LONGLONG;
- /* fallthrough */
- case DECIMAL_RESULT:
- val.traits= Hybrid_type_traits_decimal::instance();
- if (table_field_type != MYSQL_TYPE_LONGLONG)
- table_field_type= MYSQL_TYPE_NEWDECIMAL;
- break;
- case ROW_RESULT:
- default:
- DBUG_ASSERT(0);
- }
- val.traits->fix_length_and_dec(this, args[0]);
+ memcpy(table->field[0]->ptr, element, tree_key_length);
+ item_sum->add();
+ return 0;
}
-/**
- @todo
- check that the case of CHAR(0) works OK
-*/
-bool Item_sum_distinct::setup(THD *thd)
+Aggregator_distinct::~Aggregator_distinct()
{
- List<Create_field> field_list;
- Create_field field_def; /* field definition */
- DBUG_ENTER("Item_sum_distinct::setup");
- /* It's legal to call setup() more than once when in a subquery */
if (tree)
- DBUG_RETURN(FALSE);
-
- /*
- Virtual table and the tree are created anew on each re-execution of
- PS/SP. Hence all further allocations are performed in the runtime
- mem_root.
- */
- if (field_list.push_back(&field_def))
- DBUG_RETURN(TRUE);
-
- null_value= maybe_null= 1;
- quick_group= 0;
-
- DBUG_ASSERT(args[0]->fixed);
-
- field_def.init_for_tmp_table(table_field_type, args[0]->max_length,
- args[0]->decimals, args[0]->maybe_null,
- args[0]->unsigned_flag);
-
- if (! (table= create_virtual_tmp_table(thd, field_list)))
- DBUG_RETURN(TRUE);
-
- /* XXX: check that the case of CHAR(0) works OK */
- tree_key_length= table->s->reclength - table->s->null_bytes;
-
- /*
- Unique handles all unique elements in a tree until they can't fit
- in. Then the tree is dumped to the temporary file. We can use
- simple_raw_key_cmp because the table contains numbers only; decimals
- are converted to binary representation as well.
- */
- tree= new Unique(simple_raw_key_cmp, &tree_key_length, tree_key_length,
- thd->variables.max_heap_table_size);
-
- is_evaluated= FALSE;
- DBUG_RETURN(tree == 0);
-}
-
-
-bool Item_sum_distinct::add()
-{
- args[0]->save_in_field(table->field[0], FALSE);
- is_evaluated= FALSE;
- if (!table->field[0]->is_null())
{
- DBUG_ASSERT(tree);
- null_value= 0;
- /*
- '0' values are also stored in the tree. This doesn't matter
- for SUM(DISTINCT), but is important for AVG(DISTINCT)
- */
- return tree->unique_add(table->field[0]->ptr);
+ delete tree;
+ tree= NULL;
}
- return 0;
-}
-
-
-bool Item_sum_distinct::unique_walk_function(void *element)
-{
- memcpy(table->field[0]->ptr, element, tree_key_length);
- ++count;
- val.traits->add(&val, table->field[0]);
- return 0;
-}
-
-
-void Item_sum_distinct::clear()
-{
- DBUG_ENTER("Item_sum_distinct::clear");
- DBUG_ASSERT(tree != 0); /* we always have a tree */
- null_value= 1;
- tree->reset();
- is_evaluated= FALSE;
- DBUG_VOID_RETURN;
-}
-
-void Item_sum_distinct::cleanup()
-{
- Item_sum_num::cleanup();
- delete tree;
- tree= 0;
- table= 0;
- is_evaluated= FALSE;
-}
-
-Item_sum_distinct::~Item_sum_distinct()
-{
- delete tree;
- /* no need to free the table */
-}
-
-
-void Item_sum_distinct::calculate_val_and_count()
-{
- if (!is_evaluated)
+ if (table)
{
- count= 0;
- val.traits->set_zero(&val);
- /*
- We don't have a tree only if 'setup()' hasn't been called;
- this is the case of sql_select.cc:return_zero_rows.
- */
- if (tree)
- {
- table->field[0]->set_notnull();
- tree->walk(item_sum_distinct_walk, (void*) this);
- }
- is_evaluated= TRUE;
+ free_tmp_table(table->in_use, table);
+ table=NULL;
}
-}
-
-
-double Item_sum_distinct::val_real()
-{
- calculate_val_and_count();
- return val.traits->val_real(&val);
-}
-
-
-my_decimal *Item_sum_distinct::val_decimal(my_decimal *to)
-{
- calculate_val_and_count();
- if (null_value)
- return 0;
- return val.traits->val_decimal(&val, to);
-}
-
-
-longlong Item_sum_distinct::val_int()
-{
- calculate_val_and_count();
- return val.traits->val_int(&val, unsigned_flag);
-}
-
-
-String *Item_sum_distinct::val_str(String *str)
-{
- calculate_val_and_count();
- if (null_value)
- return 0;
- return val.traits->val_str(&val, str, decimals);
-}
-
-/* end of Item_sum_distinct */
-
-/* Item_sum_avg_distinct */
-
-void
-Item_sum_avg_distinct::fix_length_and_dec()
-{
- Item_sum_distinct::fix_length_and_dec();
- prec_increment= current_thd->variables.div_precincrement;
- /*
- AVG() will divide val by count. We need to reserve digits
- after decimal point as the result can be fractional.
- */
- decimals= min(decimals + prec_increment, NOT_FIXED_DEC);
-}
-
-
-void
-Item_sum_avg_distinct::calculate_val_and_count()
-{
- if (!is_evaluated)
+ if (tmp_table_param)
{
- Item_sum_distinct::calculate_val_and_count();
- if (count)
- val.traits->div(&val, count);
- is_evaluated= TRUE;
+ delete tmp_table_param;
+ tmp_table_param= NULL;
}
}
@@ -1200,6 +1493,8 @@ bool Item_sum_count::add()
longlong Item_sum_count::val_int()
{
DBUG_ASSERT(fixed == 1);
+ if (aggr)
+ aggr->endup();
return (longlong) count;
}
@@ -1289,6 +1584,8 @@ bool Item_sum_avg::add()
double Item_sum_avg::val_real()
{
DBUG_ASSERT(fixed == 1);
+ if (aggr)
+ aggr->endup();
if (!count)
{
null_value=1;
@@ -1303,6 +1600,8 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val)
my_decimal sum_buff, cnt;
const my_decimal *sum_dec;
DBUG_ASSERT(fixed == 1);
+ if (aggr)
+ aggr->endup();
if (!count)
{
null_value=1;
@@ -1325,6 +1624,8 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val)
String *Item_sum_avg::val_str(String *str)
{
+ if (aggr)
+ aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
return val_string_from_decimal(str);
return val_string_from_real(str);
@@ -1857,6 +2158,7 @@ void Item_sum_hybrid::reset_field()
void Item_sum_sum::reset_field()
{
+ DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR);
if (hybrid_type == DECIMAL_RESULT)
{
my_decimal value, *arg_val= args[0]->val_decimal(&value);
@@ -1881,6 +2183,7 @@ void Item_sum_count::reset_field()
{
uchar *res=result_field->ptr;
longlong nr=0;
+ DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR);
if (!args[0]->maybe_null || !args[0]->is_null())
nr=1;
@@ -1891,6 +2194,7 @@ void Item_sum_count::reset_field()
void Item_sum_avg::reset_field()
{
uchar *res=result_field->ptr;
+ DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR);
if (hybrid_type == DECIMAL_RESULT)
{
longlong tmp;
@@ -1944,6 +2248,7 @@ void Item_sum_bit::update_field()
void Item_sum_sum::update_field()
{
+ DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR);
if (hybrid_type == DECIMAL_RESULT)
{
my_decimal value, *arg_val= args[0]->val_decimal(&value);
@@ -1996,6 +2301,9 @@ void Item_sum_avg::update_field()
{
longlong field_count;
uchar *res=result_field->ptr;
+
+ DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR);
+
if (hybrid_type == DECIMAL_RESULT)
{
my_decimal value, *arg_val= args[0]->val_decimal(&value);
@@ -2299,318 +2607,6 @@ double Item_variance_field::val_real()
/****************************************************************************
-** COUNT(DISTINCT ...)
-****************************************************************************/
-
-int simple_str_key_cmp(void* arg, uchar* key1, uchar* key2)
-{
- Field *f= (Field*) arg;
- return f->cmp(key1, key2);
-}
-
-/**
- Did not make this one static - at least gcc gets confused when
- I try to declare a static function as a friend. If you can figure
- out the syntax to make a static function a friend, make this one
- static
-*/
-
-int composite_key_cmp(void* arg, uchar* key1, uchar* key2)
-{
- Item_sum_count_distinct* item = (Item_sum_count_distinct*)arg;
- Field **field = item->table->field;
- Field **field_end= field + item->table->s->fields;
- uint32 *lengths=item->field_lengths;
- for (; field < field_end; ++field)
- {
- Field* f = *field;
- int len = *lengths++;
- int res = f->cmp(key1, key2);
- if (res)
- return res;
- key1 += len;
- key2 += len;
- }
- return 0;
-}
-
-
-C_MODE_START
-
-static int count_distinct_walk(void *elem, element_count count, void *arg)
-{
- (*((ulonglong*)arg))++;
- return 0;
-}
-
-C_MODE_END
-
-
-void Item_sum_count_distinct::cleanup()
-{
- DBUG_ENTER("Item_sum_count_distinct::cleanup");
- Item_sum_int::cleanup();
-
- /* Free objects only if we own them. */
- if (!original)
- {
- /*
- We need to delete the table and the tree in cleanup() as
- they were allocated in the runtime memroot. Using the runtime
- memroot reduces memory footprint for PS/SP and simplifies setup().
- */
- delete tree;
- tree= 0;
- is_evaluated= FALSE;
- if (table)
- {
- free_tmp_table(table->in_use, table);
- table= 0;
- }
- delete tmp_table_param;
- tmp_table_param= 0;
- }
- always_null= FALSE;
- DBUG_VOID_RETURN;
-}
-
-
-/**
- This is used by rollup to create a separate usable copy of
- the function.
-*/
-
-void Item_sum_count_distinct::make_unique()
-{
- table=0;
- original= 0;
- force_copy_fields= 1;
- tree= 0;
- is_evaluated= FALSE;
- tmp_table_param= 0;
- always_null= FALSE;
-}
-
-
-Item_sum_count_distinct::~Item_sum_count_distinct()
-{
- cleanup();
-}
-
-
-bool Item_sum_count_distinct::setup(THD *thd)
-{
- List<Item> list;
- SELECT_LEX *select_lex= thd->lex->current_select;
-
- /*
- Setup can be called twice for ROLLUP items. This is a bug.
- Please add DBUG_ASSERT(tree == 0) here when it's fixed.
- It's legal to call setup() more than once when in a subquery
- */
- if (tree || table || tmp_table_param)
- return FALSE;
-
- if (!(tmp_table_param= new TMP_TABLE_PARAM))
- return TRUE;
-
- /* Create a table with an unique key over all parameters */
- for (uint i=0; i < arg_count ; i++)
- {
- Item *item=args[i];
- if (list.push_back(item))
- return TRUE; // End of memory
- if (item->const_item() && item->is_null())
- always_null= 1;
- }
- if (always_null)
- return FALSE;
- count_field_types(select_lex, tmp_table_param, list, 0);
- tmp_table_param->force_copy_fields= force_copy_fields;
- DBUG_ASSERT(table == 0);
- /*
- Make create_tmp_table() convert BIT columns to BIGINT.
- This is needed because BIT fields store parts of their data in table's
- null bits, and we don't have methods to compare two table records, which
- is needed by Unique which is used when HEAP table is used.
- */
- {
- List_iterator_fast<Item> li(list);
- Item *item;
- while ((item= li++))
- {
- if (item->type() == Item::FIELD_ITEM &&
- ((Item_field*)item)->field->type() == FIELD_TYPE_BIT)
- item->marker=4;
- }
- }
-
- if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
- 0,
- (select_lex->options | thd->options),
- HA_POS_ERROR, (char*)"")))
- return TRUE;
- table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
- table->no_rows=1;
-
- if (table->s->db_type() == heap_hton)
- {
- /*
- No blobs, otherwise it would have been MyISAM: set up a compare
- function and its arguments to use with Unique.
- */
- qsort_cmp2 compare_key;
- void* cmp_arg;
- Field **field= table->field;
- Field **field_end= field + table->s->fields;
- bool all_binary= TRUE;
-
- for (tree_key_length= 0; field < field_end; ++field)
- {
- Field *f= *field;
- enum enum_field_types f_type= f->type();
- tree_key_length+= f->pack_length();
- if ((f_type == MYSQL_TYPE_VARCHAR) ||
- (!f->binary() && (f_type == MYSQL_TYPE_STRING ||
- f_type == MYSQL_TYPE_VAR_STRING)))
- {
- all_binary= FALSE;
- break;
- }
- }
- if (all_binary)
- {
- cmp_arg= (void*) &tree_key_length;
- compare_key= (qsort_cmp2) simple_raw_key_cmp;
- }
- else
- {
- if (table->s->fields == 1)
- {
- /*
- If we have only one field, which is the most common use of
- count(distinct), it is much faster to use a simpler key
- compare method that can take advantage of not having to worry
- about other fields.
- */
- compare_key= (qsort_cmp2) simple_str_key_cmp;
- cmp_arg= (void*) table->field[0];
- /* tree_key_length has been set already */
- }
- else
- {
- uint32 *length;
- compare_key= (qsort_cmp2) composite_key_cmp;
- cmp_arg= (void*) this;
- field_lengths= (uint32*) thd->alloc(table->s->fields * sizeof(uint32));
- for (tree_key_length= 0, length= field_lengths, field= table->field;
- field < field_end; ++field, ++length)
- {
- *length= (*field)->pack_length();
- tree_key_length+= *length;
- }
- }
- }
- DBUG_ASSERT(tree == 0);
- tree= new Unique(compare_key, cmp_arg, tree_key_length,
- thd->variables.max_heap_table_size);
- /*
- The only time tree_key_length could be 0 is if someone does
- count(distinct) on a char(0) field - stupid thing to do,
- but this has to be handled - otherwise someone can crash
- the server with a DoS attack
- */
- is_evaluated= FALSE;
- if (! tree)
- return TRUE;
- }
- return FALSE;
-}
-
-
-Item *Item_sum_count_distinct::copy_or_same(THD* thd)
-{
- return new (thd->mem_root) Item_sum_count_distinct(thd, this);
-}
-
-
-void Item_sum_count_distinct::clear()
-{
- /* tree and table can be both null only if always_null */
- is_evaluated= FALSE;
- if (tree)
- {
- tree->reset();
- }
- else if (table)
- {
- table->file->extra(HA_EXTRA_NO_CACHE);
- table->file->ha_delete_all_rows();
- table->file->extra(HA_EXTRA_WRITE_CACHE);
- }
-}
-
-bool Item_sum_count_distinct::add()
-{
- int error;
- if (always_null)
- return 0;
- copy_fields(tmp_table_param);
- copy_funcs(tmp_table_param->items_to_copy);
-
- for (Field **field=table->field ; *field ; field++)
- if ((*field)->is_real_null(0))
- return 0; // Don't count NULL
-
- is_evaluated= FALSE;
- if (tree)
- {
- /*
- The first few bytes of record (at least one) are just markers
- for deleted and NULLs. We want to skip them since they will
- bloat the tree without providing any valuable info. Besides,
- key_length used to initialize the tree didn't include space for them.
- */
- return tree->unique_add(table->record[0] + table->s->null_bytes);
- }
- if ((error= table->file->ha_write_row(table->record[0])) &&
- table->file->is_fatal_error(error, HA_CHECK_DUP))
- return TRUE;
- return FALSE;
-}
-
-
-longlong Item_sum_count_distinct::val_int()
-{
- int error;
- DBUG_ASSERT(fixed == 1);
- if (!table) // Empty query
- return LL(0);
- if (tree)
- {
- if (is_evaluated)
- return count;
-
- if (tree->elements == 0)
- return (longlong) tree->elements_in_tree(); // everything fits in memory
- count= 0;
- tree->walk(count_distinct_walk, (void*) &count);
- is_evaluated= TRUE;
- return (longlong) count;
- }
-
- error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
-
- if(error)
- {
- table->file->print_error(error, MYF(0));
- }
-
- return table->file->stats.records;
-}
-
-
-/****************************************************************************
** Functions to handle dynamic loadable aggregates
** Original source by: Alexis Mikhailov <root@medinf.chuvashia.su>
** Adapted for UDAs by: Andreas F. Bobak <bobak@relog.ch>.
@@ -2931,6 +2927,8 @@ int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
result->append(*res);
}
+ item->row_count++;
+
/* stop if length of result more than max_length */
if (result->length() > item->max_length)
{
@@ -2949,8 +2947,11 @@ int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
result->length(),
&well_formed_error);
result->length(old_length + add_length);
- item->count_cut_values++;
item->warning_for_row= TRUE;
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_CUT_VALUE_GROUP_CONCAT, ER(ER_CUT_VALUE_GROUP_CONCAT),
+ item->row_count);
+
return 1;
}
return 0;
@@ -2970,12 +2971,12 @@ Item_func_group_concat::
Item_func_group_concat(Name_resolution_context *context_arg,
bool distinct_arg, List<Item> *select_list,
SQL_LIST *order_list, String *separator_arg)
- :tmp_table_param(0), warning(0),
- separator(separator_arg), tree(0), unique_filter(NULL), table(0),
+ :tmp_table_param(0), separator(separator_arg), tree(0),
+ unique_filter(NULL), table(0),
order(0), context(context_arg),
arg_count_order(order_list ? order_list->elements : 0),
arg_count_field(select_list->elements),
- count_cut_values(0),
+ row_count(0),
distinct(distinct_arg),
warning_for_row(FALSE),
force_copy_fields(0), original(0)
@@ -3029,7 +3030,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
Item_func_group_concat *item)
:Item_sum(thd, item),
tmp_table_param(item->tmp_table_param),
- warning(item->warning),
separator(item->separator),
tree(item->tree),
unique_filter(item->unique_filter),
@@ -3038,7 +3038,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
context(item->context),
arg_count_order(item->arg_count_order),
arg_count_field(item->arg_count_field),
- count_cut_values(item->count_cut_values),
+ row_count(item->row_count),
distinct(item->distinct),
warning_for_row(item->warning_for_row),
always_null(item->always_null),
@@ -3056,15 +3056,6 @@ void Item_func_group_concat::cleanup()
DBUG_ENTER("Item_func_group_concat::cleanup");
Item_sum::cleanup();
- /* Adjust warning message to include total number of cut values */
- if (warning)
- {
- char warn_buff[MYSQL_ERRMSG_SIZE];
- sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values);
- warning->set_msg(current_thd, warn_buff);
- warning= 0;
- }
-
/*
Free table and tree if they belong to this item (if item have not pointer
to original item from which was made copy => it own its objects )
@@ -3088,15 +3079,8 @@ void Item_func_group_concat::cleanup()
delete unique_filter;
unique_filter= NULL;
}
- if (warning)
- {
- char warn_buff[MYSQL_ERRMSG_SIZE];
- sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values);
- warning->set_msg(thd, warn_buff);
- warning= 0;
- }
}
- DBUG_ASSERT(tree == 0 && warning == 0);
+ DBUG_ASSERT(tree == 0);
}
DBUG_VOID_RETURN;
}
@@ -3385,17 +3369,6 @@ String* Item_func_group_concat::val_str(String* str)
/* Tree is used for sorting as in ORDER BY */
tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
left_root_right);
- if (count_cut_values && !warning)
- {
- /*
- ER_CUT_VALUE_GROUP_CONCAT needs an argument, but this gets set in
- Item_func_group_concat::cleanup().
- */
- DBUG_ASSERT(table);
- warning= push_warning(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CUT_VALUE_GROUP_CONCAT,
- ER(ER_CUT_VALUE_GROUP_CONCAT));
- }
return &result;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index f70da52bcd1..88be83137cb 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_SUM_INCLUDED
+#define ITEM_SUM_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -22,7 +25,87 @@
#include <my_tree.h>
-/*
+class Item_sum;
+class Aggregator_distinct;
+class Aggregator_simple;
+
+/**
+ The abstract base class for the Aggregator_* classes.
+ It implements the data collection functions (setup/add/clear)
+ as either pass-through to the real functionality or
+ as collectors into an Unique (for distinct) structure.
+
+ Note that update_field/reset_field are not in that
+ class, because they're simply not called when
+ GROUP BY/DISTINCT can be handled with help of index on grouped
+ fields (quick_group = 0);
+*/
+
+class Aggregator : public Sql_alloc
+{
+ friend class Item_sum;
+ friend class Item_sum_sum;
+ friend class Item_sum_count;
+ friend class Item_sum_avg;
+
+ /*
+ All members are protected as this class is not usable outside of an
+ Item_sum descendant.
+ */
+protected:
+ /* the aggregate function class to act on */
+ Item_sum *item_sum;
+
+ /**
+ When feeding back the data in endup() from Unique/temp table back to
+ Item_sum::add() methods we must read the data from Unique (and not
+ recalculate the functions that are given as arguments to the aggregate
+ function.
+ This flag is to tell the add() methods to take the data from the Unique
+ instead by calling the relevant val_..() method
+ */
+
+ bool use_distinct_values;
+
+public:
+ Aggregator (Item_sum *arg): item_sum(arg), use_distinct_values(FALSE) {}
+ virtual ~Aggregator () {} /* Keep gcc happy */
+
+ enum Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR };
+ virtual Aggregator_type Aggrtype() = 0;
+
+ /**
+ Called before adding the first row.
+ Allocates and sets up the internal aggregation structures used,
+ e.g. the Unique instance used to calculate distinct.
+ */
+ virtual bool setup(THD *) = 0;
+
+ /**
+ Called when we need to wipe out all the data from the aggregator :
+ all the values acumulated and all the state.
+ Cleans up the internal structures and resets them to their initial state.
+ */
+ virtual void clear() = 0;
+
+ /**
+ Called when there's a new value to be aggregated.
+ Updates the internal state of the aggregator to reflect the new value.
+ */
+ virtual bool add() = 0;
+
+ /**
+ Called when there are no more data and the final value is to be retrieved.
+ Finalises the state of the aggregator, so the final result can be retrieved.
+ */
+ virtual void endup() = 0;
+
+};
+
+
+class st_select_lex;
+
+/**
Class Item_sum is the base class used for special expressions that SQL calls
'set functions'. These expressions are formed with the help of aggregate
functions such as SUM, MAX, GROUP_CONCAT etc.
@@ -215,13 +298,38 @@
TODO: to catch queries where the limit is exceeded to make the
code clean here.
-*/
-
-class st_select_lex;
+*/
class Item_sum :public Item_result_field
{
+protected:
+ /**
+ Aggregator class instance. Not set initially. Allocated only after
+ it is determined if the incoming data are already distinct.
+ */
+ Aggregator *aggr;
+
+private:
+ /**
+ Used in making ROLLUP. Set for the ROLLUP copies of the original
+ Item_sum and passed to create_tmp_field() to cause it to work
+ over the temp table buffer that is referenced by
+ Item_result_field::result_field.
+ */
+ bool force_copy_fields;
+
+ /**
+ Indicates how the aggregate function was specified by the parser :
+ 1 if it was written as AGGREGATE(DISTINCT),
+ 0 if it was AGGREGATE()
+ */
+ bool with_distinct;
+
public:
+
+ bool has_force_copy_fields() const { return force_copy_fields; }
+ bool has_with_distinct() const { return with_distinct; }
+
enum Sumfunctype
{ COUNT_FUNC, COUNT_DISTINCT_FUNC, SUM_FUNC, SUM_DISTINCT_FUNC, AVG_FUNC,
AVG_DISTINCT_FUNC, MIN_FUNC, MAX_FUNC, STD_FUNC,
@@ -263,47 +371,28 @@ public:
Item_sum() :quick_group(1), arg_count(0), forced_const(FALSE)
{
mark_as_sum_func();
+ init_aggregator();
}
Item_sum(Item *a) :quick_group(1), arg_count(1), args(tmp_args),
orig_args(tmp_orig_args), forced_const(FALSE)
{
args[0]=a;
mark_as_sum_func();
+ init_aggregator();
}
Item_sum( Item *a, Item *b ) :quick_group(1), arg_count(2), args(tmp_args),
orig_args(tmp_orig_args), forced_const(FALSE)
{
args[0]=a; args[1]=b;
mark_as_sum_func();
+ init_aggregator();
}
Item_sum(List<Item> &list);
//Copy constructor, need to perform subselects with temporary tables
Item_sum(THD *thd, Item_sum *item);
enum Type type() const { return SUM_FUNC_ITEM; }
virtual enum Sumfunctype sum_func () const=0;
-
- /*
- This method is similar to add(), but it is called when the current
- aggregation group changes. Thus it performs a combination of
- clear() and add().
- */
- inline bool reset() { clear(); return add(); };
-
- /*
- Prepare this item for evaluation of an aggregate value. This is
- called by reset() when a group changes, or, for correlated
- subqueries, between subquery executions. E.g. for COUNT(), this
- method should set count= 0;
- */
- virtual void clear()= 0;
-
- /*
- This method is called for the next row in the same group. Its
- purpose is to aggregate the new value to the previous values in
- the group (i.e. since clear() was called last time). For example,
- for COUNT(), do count++.
- */
- virtual bool add()=0;
+ inline bool reset() { aggregator_clear(); return aggregator_add(); };
/*
Called when new group is started and results are being saved in
@@ -327,11 +416,6 @@ public:
{ return new Item_field(field); }
table_map used_tables() const { return used_tables_cache; }
void update_used_tables ();
- void cleanup()
- {
- Item::cleanup();
- forced_const= FALSE;
- }
bool is_null() { return null_value; }
void make_const ()
{
@@ -343,7 +427,9 @@ public:
virtual void print(String *str, enum_query_type query_type);
void fix_num_length_and_dec();
- /*
+ /**
+ Mark an aggregate as having no rows.
+
This function is called by the execution engine to assign 'NO ROWS
FOUND' value to an aggregate item, when the underlying result set
has no rows. Such value, in a general case, may be different from
@@ -351,10 +437,15 @@ public:
may be initialized to 0 by clear() and to NULL by
no_rows_in_result().
*/
- void no_rows_in_result() { clear(); }
-
- virtual bool setup(THD *thd) {return 0;}
- virtual void make_unique() {}
+ virtual void no_rows_in_result()
+ {
+ if (!aggr)
+ set_aggregator(with_distinct ?
+ Aggregator::DISTINCT_AGGREGATOR :
+ Aggregator::SIMPLE_AGGREGATOR);
+ reset();
+ }
+ virtual void make_unique() { force_copy_fields= TRUE; }
Item *get_tmp_table_item(THD *thd);
virtual Field *create_tmp_field(bool group, TABLE *table,
uint convert_blob_length);
@@ -365,9 +456,170 @@ public:
st_select_lex *depended_from()
{ return (nest_level == aggr_level ? 0 : aggr_sel); }
- Item *get_arg(int i) { return args[i]; }
- Item *set_arg(int i, THD *thd, Item *new_val);
+ Item *get_arg(uint i) { return args[i]; }
+ Item *set_arg(uint i, THD *thd, Item *new_val);
uint get_arg_count() { return arg_count; }
+
+ /* Initialization of distinct related members */
+ void init_aggregator()
+ {
+ aggr= NULL;
+ with_distinct= FALSE;
+ force_copy_fields= FALSE;
+ }
+
+ /**
+ Called to initialize the aggregator.
+ */
+
+ inline bool aggregator_setup(THD *thd) { return aggr->setup(thd); };
+
+ /**
+ Called to cleanup the aggregator.
+ */
+
+ inline void aggregator_clear() { aggr->clear(); }
+
+ /**
+ Called to add value to the aggregator.
+ */
+
+ inline bool aggregator_add() { return aggr->add(); };
+
+ /* stores the declared DISTINCT flag (from the parser) */
+ void set_distinct(bool distinct)
+ {
+ with_distinct= distinct;
+ quick_group= with_distinct ? 0 : 1;
+ }
+
+ /**
+ Set the type of aggregation : DISTINCT or not.
+
+ Called when the final determination is done about the aggregation
+ type and the object is about to be used.
+ */
+
+ int set_aggregator(Aggregator::Aggregator_type aggregator);
+
+ virtual void clear()= 0;
+ virtual bool add()= 0;
+ virtual bool setup(THD *thd) { return false; }
+
+ virtual void cleanup();
+};
+
+
+class Unique;
+
+
+/**
+ The distinct aggregator.
+ Implements AGGFN (DISTINCT ..)
+ Collects all the data into an Unique (similarly to what Item_sum_distinct
+ does currently) and then (if applicable) iterates over the list of
+ unique values and pumps them back into its object
+*/
+
+class Aggregator_distinct : public Aggregator
+{
+ friend class Item_sum_sum;
+
+ /*
+ flag to prevent consecutive runs of endup(). Normally in endup there are
+ expensive calculations (like walking the distinct tree for example)
+ which we must do only once if there are no data changes.
+ We can re-use the data for the second and subsequent val_xxx() calls.
+ endup_done set to TRUE also means that the calculated values for
+ the aggregate functions are correct and don't need recalculation.
+ */
+ bool endup_done;
+
+ /*
+ Used depending on the type of the aggregate function and the presence of
+ blob columns in it:
+ - For COUNT(DISTINCT) and no blob fields this points to a real temporary
+ table. It's used as a hash table.
+ - For AVG/SUM(DISTINCT) or COUNT(DISTINCT) with blob fields only the
+ in-memory data structure of a temporary table is constructed.
+ It's used by the Field classes to transform data into row format.
+ */
+ TABLE *table;
+
+ /*
+ An array of field lengths on row allocated and used only for
+ COUNT(DISTINCT) with multiple columns and no blobs. Used in
+ Aggregator_distinct::composite_key_cmp (called from Unique to compare
+ nodes
+ */
+ uint32 *field_lengths;
+
+ /*
+ Used in conjunction with 'table' to support the access to Field classes
+ for COUNT(DISTINCT). Needed by copy_fields()/copy_funcs().
+ */
+ TMP_TABLE_PARAM *tmp_table_param;
+
+ /*
+ If there are no blobs in the COUNT(DISTINCT) arguments, we can use a tree,
+ which is faster than heap table. In that case, we still use the table
+ to help get things set up, but we insert nothing in it.
+ For AVG/SUM(DISTINCT) we always use this tree (as it takes a single
+ argument) to get the distinct rows.
+ */
+ Unique *tree;
+
+ /*
+ The length of the temp table row. Must be a member of the class as it
+ gets passed down to simple_raw_key_cmp () as a compare function argument
+ to Unique. simple_raw_key_cmp () is used as a fast comparison function
+ when the entire row can be binary compared.
+ */
+ uint tree_key_length;
+
+ /*
+ Set to true if the result is known to be always NULL.
+ If set deactivates creation and usage of the temporary table (in the
+ 'table' member) and the Unique instance (in the 'tree' member) as well as
+ the calculation of the final value on the first call to
+ Item_[sum|avg|count]::val_xxx().
+ */
+ bool always_null;
+
+public:
+ Aggregator_distinct (Item_sum *sum) :
+ Aggregator(sum), table(NULL), tmp_table_param(NULL), tree(NULL),
+ always_null(FALSE) {}
+ virtual ~Aggregator_distinct ();
+ Aggregator_type Aggrtype() { return DISTINCT_AGGREGATOR; }
+
+ bool setup(THD *);
+ void clear();
+ bool add();
+ void endup();
+
+ bool unique_walk_function(void *element);
+ static int composite_key_cmp(void* arg, uchar* key1, uchar* key2);
+};
+
+
+/**
+ The pass-through aggregator.
+ Implements AGGFN (DISTINCT ..) by knowing it gets distinct data on input.
+ So it just pumps them back to the Item_sum descendant class.
+*/
+class Aggregator_simple : public Aggregator
+{
+public:
+
+ Aggregator_simple (Item_sum *sum) :
+ Aggregator(sum) {}
+ Aggregator_type Aggrtype() { return Aggregator::SIMPLE_AGGREGATOR; }
+
+ bool setup(THD * thd) { return item_sum->setup(thd); }
+ void clear() { item_sum->clear(); }
+ bool add() { return item_sum->add(); }
+ void endup() {};
};
@@ -427,9 +679,15 @@ protected:
void fix_length_and_dec();
public:
- Item_sum_sum(Item *item_par) :Item_sum_num(item_par) {}
+ Item_sum_sum(Item *item_par, bool distinct) :Item_sum_num(item_par)
+ {
+ set_distinct(distinct);
+ }
Item_sum_sum(THD *thd, Item_sum_sum *item);
- enum Sumfunctype sum_func () const {return SUM_FUNC;}
+ enum Sumfunctype sum_func () const
+ {
+ return has_with_distinct() ? SUM_DISTINCT_FUNC : SUM_FUNC;
+ }
void clear();
bool add();
double val_real();
@@ -440,109 +698,50 @@ public:
void reset_field();
void update_field();
void no_rows_in_result() {}
- const char *func_name() const { return "sum("; }
+ const char *func_name() const
+ {
+ return has_with_distinct() ? "sum(distinct " : "sum(";
+ }
Item *copy_or_same(THD* thd);
};
-
-/* Common class for SUM(DISTINCT), AVG(DISTINCT) */
-
-class Unique;
-
-class Item_sum_distinct :public Item_sum_num
+class Item_sum_count :public Item_sum_int
{
-protected:
- /* storage for the summation result */
- ulonglong count;
- Hybrid_type val;
- /* storage for unique elements */
- Unique *tree;
- TABLE *table;
- enum enum_field_types table_field_type;
- uint tree_key_length;
-protected:
- Item_sum_distinct(THD *thd, Item_sum_distinct *item);
-public:
- Item_sum_distinct(Item *item_par);
- ~Item_sum_distinct();
+ longlong count;
+
+ friend class Aggregator_distinct;
- bool setup(THD *thd);
void clear();
- void cleanup();
bool add();
- double val_real();
- my_decimal *val_decimal(my_decimal *);
- longlong val_int();
- String *val_str(String *str);
-
- /* XXX: does it need make_unique? */
-
- enum Sumfunctype sum_func () const { return SUM_DISTINCT_FUNC; }
- void reset_field() {} // not used
- void update_field() {} // not used
- virtual void no_rows_in_result() {}
- void fix_length_and_dec();
- enum Item_result result_type () const { return val.traits->type(); }
- virtual void calculate_val_and_count();
- virtual bool unique_walk_function(void *elem);
-};
-
-
-/*
- Item_sum_sum_distinct - implementation of SUM(DISTINCT expr).
- See also: MySQL manual, chapter 'Adding New Functions To MySQL'
- and comments in item_sum.cc.
-*/
-
-class Item_sum_sum_distinct :public Item_sum_distinct
-{
-private:
- Item_sum_sum_distinct(THD *thd, Item_sum_sum_distinct *item)
- :Item_sum_distinct(thd, item) {}
-public:
- Item_sum_sum_distinct(Item *item_arg) :Item_sum_distinct(item_arg) {}
-
- enum Sumfunctype sum_func () const { return SUM_DISTINCT_FUNC; }
- const char *func_name() const { return "sum(distinct "; }
- Item *copy_or_same(THD* thd) { return new Item_sum_sum_distinct(thd, this); }
-};
-
-
-/* Item_sum_avg_distinct - SELECT AVG(DISTINCT expr) FROM ... */
-
-class Item_sum_avg_distinct: public Item_sum_distinct
-{
-private:
- Item_sum_avg_distinct(THD *thd, Item_sum_avg_distinct *original)
- :Item_sum_distinct(thd, original) {}
-public:
- uint prec_increment;
- Item_sum_avg_distinct(Item *item_arg) : Item_sum_distinct(item_arg) {}
-
- void fix_length_and_dec();
- virtual void calculate_val_and_count();
- enum Sumfunctype sum_func () const { return AVG_DISTINCT_FUNC; }
- const char *func_name() const { return "avg(distinct "; }
- Item *copy_or_same(THD* thd) { return new Item_sum_avg_distinct(thd, this); }
-};
-
-
-class Item_sum_count :public Item_sum_int
-{
- longlong count;
+ void cleanup();
public:
Item_sum_count(Item *item_par)
:Item_sum_int(item_par),count(0)
{}
+
+ /**
+ Constructs an instance for COUNT(DISTINCT)
+
+ @param list a list of the arguments to the aggregate function
+
+ This constructor is called by the parser only for COUNT (DISTINCT).
+ */
+
+ Item_sum_count(List<Item> &list)
+ :Item_sum_int(list),count(0)
+ {
+ set_distinct(TRUE);
+ }
Item_sum_count(THD *thd, Item_sum_count *item)
:Item_sum_int(thd, item), count(item->count)
{}
- enum Sumfunctype sum_func () const { return COUNT_FUNC; }
- void clear();
+ enum Sumfunctype sum_func () const
+ {
+ return has_with_distinct() ? COUNT_DISTINCT_FUNC : COUNT_FUNC;
+ }
void no_rows_in_result() { count=0; }
- bool add();
void make_const(longlong count_arg)
{
count=count_arg;
@@ -550,76 +749,12 @@ class Item_sum_count :public Item_sum_int
}
longlong val_int();
void reset_field();
- void cleanup();
void update_field();
- const char *func_name() const { return "count("; }
- Item *copy_or_same(THD* thd);
-};
-
-
-class TMP_TABLE_PARAM;
-
-class Item_sum_count_distinct :public Item_sum_int
-{
- TABLE *table;
- uint32 *field_lengths;
- TMP_TABLE_PARAM *tmp_table_param;
- bool force_copy_fields;
- /*
- If there are no blobs, we can use a tree, which
- is faster than heap table. In that case, we still use the table
- to help get things set up, but we insert nothing in it
- */
- Unique *tree;
- /*
- Storage for the value of count between calls to val_int() so val_int()
- will not recalculate on each call. Validitiy of the value is stored in
- is_evaluated.
- */
- longlong count;
- /*
- Following is 0 normal object and pointer to original one for copy
- (to correctly free resources)
- */
- Item_sum_count_distinct *original;
- uint tree_key_length;
-
-
- bool always_null; // Set to 1 if the result is always NULL
-
-
- friend int composite_key_cmp(void* arg, uchar* key1, uchar* key2);
- friend int simple_str_key_cmp(void* arg, uchar* key1, uchar* key2);
-
-public:
- Item_sum_count_distinct(List<Item> &list)
- :Item_sum_int(list), table(0), field_lengths(0), tmp_table_param(0),
- force_copy_fields(0), tree(0), count(0),
- original(0), always_null(FALSE)
- { quick_group= 0; }
- Item_sum_count_distinct(THD *thd, Item_sum_count_distinct *item)
- :Item_sum_int(thd, item), table(item->table),
- field_lengths(item->field_lengths),
- tmp_table_param(item->tmp_table_param),
- force_copy_fields(0), tree(item->tree), count(item->count),
- original(item), tree_key_length(item->tree_key_length),
- always_null(item->always_null)
- {}
- ~Item_sum_count_distinct();
-
- void cleanup();
-
- enum Sumfunctype sum_func () const { return COUNT_DISTINCT_FUNC; }
- void clear();
- bool add();
- longlong val_int();
- void reset_field() { return ;} // Never called
- void update_field() { return ; } // Never called
- const char *func_name() const { return "count(distinct "; }
- bool setup(THD *thd);
- void make_unique();
+ const char *func_name() const
+ {
+ return has_with_distinct() ? "count(distinct " : "count(";
+ }
Item *copy_or_same(THD* thd);
- void no_rows_in_result() {}
};
@@ -659,13 +794,18 @@ public:
uint prec_increment;
uint f_precision, f_scale, dec_bin_size;
- Item_sum_avg(Item *item_par) :Item_sum_sum(item_par), count(0) {}
+ Item_sum_avg(Item *item_par, bool distinct)
+ :Item_sum_sum(item_par, distinct), count(0)
+ {}
Item_sum_avg(THD *thd, Item_sum_avg *item)
:Item_sum_sum(thd, item), count(item->count),
prec_increment(item->prec_increment) {}
void fix_length_and_dec();
- enum Sumfunctype sum_func () const {return AVG_FUNC;}
+ enum Sumfunctype sum_func () const
+ {
+ return has_with_distinct() ? AVG_DISTINCT_FUNC : AVG_FUNC;
+ }
void clear();
bool add();
double val_real();
@@ -678,7 +818,10 @@ public:
Item *result_item(Field *field)
{ return new Item_avg_field(hybrid_type, this); }
void no_rows_in_result() {}
- const char *func_name() const { return "avg("; }
+ const char *func_name() const
+ {
+ return has_with_distinct() ? "avg(distinct " : "avg(";
+ }
Item *copy_or_same(THD* thd);
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
void cleanup()
@@ -1172,12 +1315,9 @@ public:
#endif /* HAVE_DLOPEN */
-class MYSQL_ERROR;
-
class Item_func_group_concat : public Item_sum
{
TMP_TABLE_PARAM *tmp_table_param;
- MYSQL_ERROR *warning;
String result;
String *separator;
TREE tree_base;
@@ -1198,7 +1338,7 @@ class Item_func_group_concat : public Item_sum
uint arg_count_order;
/** The number of selected items, aka the expr list. */
uint arg_count_field;
- uint count_cut_values;
+ uint row_count;
bool distinct;
bool warning_for_row;
bool always_null;
@@ -1270,3 +1410,5 @@ public:
virtual bool change_context_processor(uchar *cntx)
{ context= (Name_resolution_context *)cntx; return FALSE; }
};
+
+#endif /* ITEM_SUM_INCLUDED */
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b293145cc27..8208b0b930d 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -597,7 +597,7 @@ err:
{
char buff[128];
strmake(buff, val_begin, min(length, sizeof(buff)-1));
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
date_time_type, buff, "str_to_date");
}
@@ -936,6 +936,48 @@ longlong Item_func_to_days::val_int()
}
+longlong Item_func_to_seconds::val_int_endpoint(bool left_endp,
+ bool *incl_endp)
+{
+ DBUG_ASSERT(fixed == 1);
+ MYSQL_TIME ltime;
+ longlong seconds;
+ longlong days;
+ int dummy; /* unused */
+ if (get_arg0_date(&ltime, TIME_FUZZY_DATE))
+ {
+ /* got NULL, leave the incl_endp intact */
+ return LONGLONG_MIN;
+ }
+ seconds= ltime.hour * 3600L + ltime.minute * 60 + ltime.second;
+ seconds= ltime.neg ? -seconds : seconds;
+ days= (longlong) calc_daynr(ltime.year, ltime.month, ltime.day);
+ seconds+= days * 24L * 3600L;
+ /* Set to NULL if invalid date, but keep the value */
+ null_value= check_date(&ltime,
+ (ltime.year || ltime.month || ltime.day),
+ (TIME_NO_ZERO_IN_DATE | TIME_NO_ZERO_DATE),
+ &dummy);
+ /*
+ Even if the evaluation return NULL, seconds is useful for pruning
+ */
+ return seconds;
+}
+
+longlong Item_func_to_seconds::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ MYSQL_TIME ltime;
+ longlong seconds;
+ longlong days;
+ if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
+ return 0;
+ seconds= ltime.hour * 3600L + ltime.minute * 60 + ltime.second;
+ seconds=ltime.neg ? -seconds : seconds;
+ days= (longlong) calc_daynr(ltime.year, ltime.month, ltime.day);
+ return seconds + days * 24L * 3600L;
+}
+
/*
Get information about this Item tree monotonicity
@@ -962,6 +1004,17 @@ enum_monotonicity_info Item_func_to_days::get_monotonicity_info() const
return NON_MONOTONIC;
}
+enum_monotonicity_info Item_func_to_seconds::get_monotonicity_info() const
+{
+ if (args[0]->type() == Item::FIELD_ITEM)
+ {
+ if (args[0]->field_type() == MYSQL_TYPE_DATE ||
+ args[0]->field_type() == MYSQL_TYPE_DATETIME)
+ return MONOTONIC_STRICT_INCREASING_NOT_NULL;
+ }
+ return NON_MONOTONIC;
+}
+
longlong Item_func_to_days::val_int_endpoint(bool left_endp, bool *incl_endp)
{
@@ -2493,10 +2546,11 @@ String *Item_char_typecast::val_str(String *str)
str_value= *res; // Not malloced string
res= &str_value;
}
+ ErrConvString err(res);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), char_type,
- res->c_ptr_safe());
+ err.ptr());
res->length((uint) length);
}
else if (cast_cs == &my_charset_bin && res->length() < (uint) cast_length)
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 9e3c2e8c89f..cdd74c8c601 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_TIMEFUNC_INCLUDED
+#define ITEM_TIMEFUNC_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -73,6 +76,24 @@ public:
};
+class Item_func_to_seconds :public Item_int_func
+{
+public:
+ Item_func_to_seconds(Item *a) :Item_int_func(a) {}
+ longlong val_int();
+ const char *func_name() const { return "to_seconds"; }
+ void fix_length_and_dec()
+ {
+ decimals=0;
+ max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
+ maybe_null=1;
+ }
+ enum_monotonicity_info get_monotonicity_info() const;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp);
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
+};
+
+
class Item_func_dayofmonth :public Item_int_func
{
public:
@@ -871,6 +892,7 @@ public:
{
decimals=0;
max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ maybe_null= 1;
}
longlong val_int();
};
@@ -1025,4 +1047,11 @@ public:
Item_func_last_day(Item *a) :Item_date(a) {}
const char *func_name() const { return "last_day"; }
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ void fix_length_and_dec()
+ {
+ Item_date::fix_length_and_dec();
+ maybe_null= 1;
+ }
};
+
+#endif /* ITEM_TIMEFUNC_INCLUDED */
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index dadbb5ccf42..6373bde0aab 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -1,3 +1,6 @@
+#ifndef ITEM_XMLFUNC_INCLUDED
+#define ITEM_XMLFUNC_INCLUDED
+
/* Copyright (C) 2000-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -61,3 +64,4 @@ public:
String *val_str(String *);
};
+#endif /* ITEM_XMLFUNC_INCLUDED */
diff --git a/sql/key.cc b/sql/key.cc
index 5b2ae8029dd..93197ec4ff5 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -349,10 +349,29 @@ void key_unpack(String *to,TABLE *table,uint idx)
}
if ((field=key_part->field))
{
+ CHARSET_INFO *cs= field->charset();
field->val_str(&tmp);
+ if (cs->mbmaxlen > 1 &&
+ table->field[key_part->fieldnr - 1]->field_length !=
+ key_part->length)
+ {
+ /*
+ Prefix key, multi-byte charset.
+ For the columns of type CHAR(N), the above val_str()
+ call will return exactly "key_part->length" bytes,
+ which can break a multi-byte characters in the middle.
+ Align, returning not more than "char_length" characters.
+ */
+ uint charpos, char_length= key_part->length / cs->mbmaxlen;
+ if ((charpos= my_charpos(cs, tmp.ptr(),
+ tmp.ptr() + tmp.length(),
+ char_length)) < tmp.length())
+ tmp.length(charpos);
+ }
if (key_part->length < field->pack_length())
tmp.length(min(tmp.length(),key_part->length));
- to->append(tmp);
+ ErrConvString err(&tmp);
+ to->append(err.ptr());
}
else
to->append(STRING_WITH_LEN("???"));
diff --git a/sql/lex.h b/sql/lex.h
index 0a85824f6f7..cd0c042159f 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -1,3 +1,6 @@
+#ifndef LEX_INCLUDED
+#define LEX_INCLUDED
+
/* Copyright (C) 2000-2002 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -96,6 +99,7 @@ static SYMBOL symbols[] = {
{ "CASCADE", SYM(CASCADE)},
{ "CASCADED", SYM(CASCADED)},
{ "CASE", SYM(CASE_SYM)},
+ { "CATALOG_NAME", SYM(CATALOG_NAME_SYM)},
{ "CHAIN", SYM(CHAIN_SYM)},
{ "CHANGE", SYM(CHANGE)},
{ "CHANGED", SYM(CHANGED)},
@@ -105,6 +109,7 @@ static SYMBOL symbols[] = {
{ "CHECK", SYM(CHECK_SYM)},
{ "CHECKSUM", SYM(CHECKSUM_SYM)},
{ "CIPHER", SYM(CIPHER_SYM)},
+ { "CLASS_ORIGIN", SYM(CLASS_ORIGIN_SYM)},
{ "CLIENT", SYM(CLIENT_SYM)},
{ "CLOSE", SYM(CLOSE_SYM)},
{ "COALESCE", SYM(COALESCE)},
@@ -112,6 +117,7 @@ static SYMBOL symbols[] = {
{ "COLLATE", SYM(COLLATE_SYM)},
{ "COLLATION", SYM(COLLATION_SYM)},
{ "COLUMN", SYM(COLUMN_SYM)},
+ { "COLUMN_NAME", SYM(COLUMN_NAME_SYM)},
{ "COLUMNS", SYM(COLUMNS)},
{ "COMMENT", SYM(COMMENT_SYM)},
{ "COMMIT", SYM(COMMIT_SYM)},
@@ -124,6 +130,9 @@ static SYMBOL symbols[] = {
{ "CONNECTION", SYM(CONNECTION_SYM)},
{ "CONSISTENT", SYM(CONSISTENT_SYM)},
{ "CONSTRAINT", SYM(CONSTRAINT)},
+ { "CONSTRAINT_CATALOG", SYM(CONSTRAINT_CATALOG_SYM)},
+ { "CONSTRAINT_NAME", SYM(CONSTRAINT_NAME_SYM)},
+ { "CONSTRAINT_SCHEMA", SYM(CONSTRAINT_SCHEMA_SYM)},
{ "CONTAINS", SYM(CONTAINS_SYM)},
{ "CONTEXT", SYM(CONTEXT_SYM)},
{ "CONTINUE", SYM(CONTINUE_SYM)},
@@ -138,6 +147,7 @@ static SYMBOL symbols[] = {
{ "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
{ "CURRENT_USER", SYM(CURRENT_USER)},
{ "CURSOR", SYM(CURSOR_SYM)},
+ { "CURSOR_NAME", SYM(CURSOR_NAME_SYM)},
{ "DATA", SYM(DATA_SYM)},
{ "DATABASE", SYM(DATABASE)},
{ "DATABASES", SYM(DATABASES)},
@@ -241,6 +251,7 @@ static SYMBOL symbols[] = {
{ "IDENTIFIED", SYM(IDENTIFIED_SYM)},
{ "IF", SYM(IF)},
{ "IGNORE", SYM(IGNORE_SYM)},
+ { "IGNORE_SERVER_IDS", SYM(IGNORE_SERVER_IDS_SYM)},
{ "IMPORT", SYM(IMPORT)},
{ "IN", SYM(IN_SYM)},
{ "INDEX", SYM(INDEX_SYM)},
@@ -320,6 +331,7 @@ static SYMBOL symbols[] = {
{ "MASTER_SSL_KEY", SYM(MASTER_SSL_KEY_SYM)},
{ "MASTER_SSL_VERIFY_SERVER_CERT", SYM(MASTER_SSL_VERIFY_SERVER_CERT_SYM)},
{ "MASTER_USER", SYM(MASTER_USER_SYM)},
+ { "MASTER_HEARTBEAT_PERIOD", SYM(MASTER_HEARTBEAT_PERIOD_SYM)},
{ "MATCH", SYM(MATCH)},
{ "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
{ "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
@@ -334,6 +346,7 @@ static SYMBOL symbols[] = {
{ "MEDIUMTEXT", SYM(MEDIUMTEXT)},
{ "MEMORY", SYM(MEMORY_SYM)},
{ "MERGE", SYM(MERGE_SYM)},
+ { "MESSAGE_TEXT", SYM(MESSAGE_TEXT_SYM)},
{ "MICROSECOND", SYM(MICROSECOND_SYM)},
{ "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */
{ "MIGRATE", SYM(MIGRATE_SYM)},
@@ -350,6 +363,7 @@ static SYMBOL symbols[] = {
{ "MULTIPOINT", SYM(MULTIPOINT)},
{ "MULTIPOLYGON", SYM(MULTIPOLYGON)},
{ "MUTEX", SYM(MUTEX_SYM)},
+ { "MYSQL_ERRNO", SYM(MYSQL_ERRNO_SYM)},
{ "NAME", SYM(NAME_SYM)},
{ "NAMES", SYM(NAMES_SYM)},
{ "NATIONAL", SYM(NATIONAL_SYM)},
@@ -426,6 +440,7 @@ static SYMBOL symbols[] = {
{ "REDUNDANT", SYM(REDUNDANT_SYM)},
{ "REFERENCES", SYM(REFERENCES)},
{ "REGEXP", SYM(REGEXP)},
+ { "RELAYLOG", SYM(RELAYLOG_SYM)},
{ "RELAY_LOG_FILE", SYM(RELAY_LOG_FILE_SYM)},
{ "RELAY_LOG_POS", SYM(RELAY_LOG_POS_SYM)},
{ "RELAY_THREAD", SYM(RELAY_THREAD)},
@@ -441,6 +456,7 @@ static SYMBOL symbols[] = {
{ "REPEAT", SYM(REPEAT_SYM)},
{ "REQUIRE", SYM(REQUIRE_SYM)},
{ "RESET", SYM(RESET_SYM)},
+ { "RESIGNAL", SYM(RESIGNAL_SYM)},
{ "RESTORE", SYM(RESTORE_SYM)},
{ "RESTRICT", SYM(RESTRICT)},
{ "RESUME", SYM(RESUME_SYM)},
@@ -459,6 +475,7 @@ static SYMBOL symbols[] = {
{ "SAVEPOINT", SYM(SAVEPOINT_SYM)},
{ "SCHEDULE", SYM(SCHEDULE_SYM)},
{ "SCHEMA", SYM(DATABASE)},
+ { "SCHEMA_NAME", SYM(SCHEMA_NAME_SYM)},
{ "SCHEMAS", SYM(DATABASES)},
{ "SECOND", SYM(SECOND_SYM)},
{ "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM)},
@@ -474,6 +491,7 @@ static SYMBOL symbols[] = {
{ "SHARE", SYM(SHARE_SYM)},
{ "SHOW", SYM(SHOW)},
{ "SHUTDOWN", SYM(SHUTDOWN)},
+ { "SIGNAL", SYM(SIGNAL_SYM)},
{ "SIGNED", SYM(SIGNED_SYM)},
{ "SIMPLE", SYM(SIMPLE_SYM)},
{ "SLAVE", SYM(SLAVE)},
@@ -515,6 +533,7 @@ static SYMBOL symbols[] = {
{ "STORAGE", SYM(STORAGE_SYM)},
{ "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN)},
{ "STRING", SYM(STRING_SYM)},
+ { "SUBCLASS_ORIGIN", SYM(SUBCLASS_ORIGIN_SYM)},
{ "SUBJECT", SYM(SUBJECT_SYM)},
{ "SUBPARTITION", SYM(SUBPARTITION_SYM)},
{ "SUBPARTITIONS", SYM(SUBPARTITIONS_SYM)},
@@ -523,6 +542,7 @@ static SYMBOL symbols[] = {
{ "SWAPS", SYM(SWAPS_SYM)},
{ "SWITCHES", SYM(SWITCHES_SYM)},
{ "TABLE", SYM(TABLE_SYM)},
+ { "TABLE_NAME", SYM(TABLE_NAME_SYM)},
{ "TABLES", SYM(TABLES)},
{ "TABLESPACE", SYM(TABLESPACE)},
{ "TABLE_CHECKSUM", SYM(TABLE_CHECKSUM_SYM)},
@@ -593,6 +613,7 @@ static SYMBOL symbols[] = {
{ "X509", SYM(X509_SYM)},
{ "XOR", SYM(XOR)},
{ "XA", SYM(XA_SYM)},
+ { "XML", SYM(XML_SYM)}, /* LOAD XML Arnold/Erik */
{ "YEAR", SYM(YEAR_SYM)},
{ "YEAR_MONTH", SYM(YEAR_MONTH_SYM)},
{ "ZEROFILL", SYM(ZEROFILL)},
@@ -634,3 +655,5 @@ static SYMBOL sql_functions[] = {
{ "VAR_POP", SYM(VARIANCE_SYM)},
{ "VAR_SAMP", SYM(VAR_SAMP_SYM)},
};
+
+#endif /* LEX_INCLUDED */
diff --git a/sql/lock.cc b/sql/lock.cc
index 93d8b868688..c0cda1dbf03 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1029,11 +1029,11 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use)
if (check_in_use)
{
/* Only insert the table if we haven't insert it already */
- for (table=(TABLE*) hash_first(&open_cache, (uchar*)key,
- key_length, &state);
+ for (table=(TABLE*) my_hash_first(&open_cache, (uchar*)key,
+ key_length, &state);
table ;
- table = (TABLE*) hash_next(&open_cache,(uchar*) key,
- key_length, &state))
+ table = (TABLE*) my_hash_next(&open_cache,(uchar*) key,
+ key_length, &state))
{
if (table->in_use == thd)
{
@@ -1060,7 +1060,7 @@ void unlock_table_name(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table)
{
- hash_delete(&open_cache, (uchar*) table_list->table);
+ my_hash_delete(&open_cache, (uchar*) table_list->table);
broadcast_refresh();
}
}
@@ -1235,11 +1235,11 @@ is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
HASH_SEARCH_STATE state;
TABLE *table;
- for (table= (TABLE*) hash_first(&open_cache, key,
- key_length, &state);
+ for (table= (TABLE*) my_hash_first(&open_cache, key,
+ key_length, &state);
table ;
- table= (TABLE*) hash_next(&open_cache, key,
- key_length, &state))
+ table= (TABLE*) my_hash_next(&open_cache, key,
+ key_length, &state))
{
if (table->in_use == thd &&
table->open_placeholder == 1 &&
diff --git a/sql/log.cc b/sql/log.cc
index b4c9e5eb4cc..64a4def103c 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -33,11 +33,12 @@
#include <stdarg.h>
#include <m_ctype.h> // For test_if_number
-#ifdef __NT__
+#ifdef _WIN32
#include "message.h"
#endif
#include <mysql/plugin.h>
+#include "rpl_handler.h"
/* max size of the log message */
#define MAX_LOG_BUFFER_SIZE 1024
@@ -49,8 +50,7 @@
LOGGER logger;
-MYSQL_BIN_LOG mysql_bin_log;
-ulong sync_binlog_counter= 0;
+MYSQL_BIN_LOG mysql_bin_log(&sync_binlog_period);
static bool test_if_number(const char *str,
long *res, bool allow_wildcards);
@@ -80,23 +80,28 @@ public:
virtual ~Silence_log_table_errors() {}
- virtual bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sql_state,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
const char *message() const { return m_message; }
};
bool
-Silence_log_table_errors::handle_error(uint /* sql_errno */,
- const char *message_arg,
- MYSQL_ERROR::enum_warning_level /* level */,
- THD * /* thd */)
-{
- strmake(m_message, message_arg, sizeof(m_message)-1);
+Silence_log_table_errors::handle_condition(THD *,
+ uint,
+ const char*,
+ MYSQL_ERROR::enum_warning_level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
+{
+ *cond_hdl= NULL;
+ strmake(m_message, msg, sizeof(m_message)-1);
return TRUE;
}
-
sql_print_message_func sql_print_message_handlers[3] =
{
sql_print_information,
@@ -105,9 +110,16 @@ sql_print_message_func sql_print_message_handlers[3] =
};
+/**
+ Create the name of the default general log file
+
+ @param[IN] buff Location for building new string.
+ @param[IN] log_ext The extension for the file (e.g .log)
+ @returns Pointer to a new string containing the name
+*/
char *make_default_log_name(char *buff,const char* log_ext)
{
- strmake(buff, pidfile_name, FN_REFLEN-5);
+ strmake(buff, default_logfile_name, FN_REFLEN-5);
return fn_format(buff, buff, mysql_data_home, log_ext,
MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT));
}
@@ -964,6 +976,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
uint user_host_len= 0;
ulonglong query_utime, lock_utime;
+ DBUG_ASSERT(thd->enable_slow_log);
/*
Print the message to the buffer if we have slow log enabled
*/
@@ -1670,7 +1683,7 @@ bool MYSQL_BIN_LOG::check_write_error(THD *thd)
if (!thd->is_error())
DBUG_RETURN(checked);
- switch (thd->main_da.sql_errno())
+ switch (thd->stmt_da->sql_errno())
{
case ER_TRANS_CACHE_FULL:
case ER_ERROR_ON_WRITE:
@@ -1798,7 +1811,7 @@ err:
DBUG_RETURN(-1);
}
-#ifdef __NT__
+#ifdef _WIN32
static int eventSource = 0;
static void setup_windows_event_source()
@@ -1833,7 +1846,7 @@ static void setup_windows_event_source()
RegCloseKey(hRegKey);
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
/**
@@ -1964,7 +1977,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
#ifdef EMBEDDED_LIBRARY
"embedded library\n",
my_progname, server_version, MYSQL_COMPILATION_COMMENT
-#elif __NT__
+#elif _WIN32
"started with:\nTCP Port: %d, Named Pipe: %s\n",
my_progname, server_version, MYSQL_COMPILATION_COMMENT,
mysqld_port, mysqld_unix_port
@@ -2415,10 +2428,11 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
-MYSQL_BIN_LOG::MYSQL_BIN_LOG()
+MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period)
:bytes_written(0), prepared_xids(0), file_id(1), open_count(1),
need_start_event(TRUE), m_table_map_version(0),
- is_relay_log(0),
+ sync_period_ptr(sync_period),
+ is_relay_log(0), signal_cnt(0),
description_event_for_exec(0), description_event_for_queue(0)
{
/*
@@ -2926,7 +2940,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
}
else
{
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@@ -2957,7 +2971,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
}
else
{
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@@ -3288,7 +3302,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
*/
if (thd)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with getting info on being purged %s; "
"consider examining correspondence "
@@ -3334,7 +3348,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
{
if (thd)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@@ -3433,7 +3447,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
*/
if (thd)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with getting info on being purged %s; "
"consider examining correspondence "
@@ -3650,6 +3664,8 @@ bool MYSQL_BIN_LOG::append(Log_event* ev)
}
bytes_written+= ev->data_written;
DBUG_PRINT("info",("max_size: %lu",max_size));
+ if (flush_and_sync(0))
+ goto err;
if ((uint) my_b_append_tell(&log_file) > max_size)
new_file_without_locking();
@@ -3680,6 +3696,8 @@ bool MYSQL_BIN_LOG::appendv(const char* buf, uint len,...)
bytes_written += len;
} while ((buf=va_arg(args,const char*)) && (len=va_arg(args,uint)));
DBUG_PRINT("info",("max_size: %lu",max_size));
+ if (flush_and_sync(0))
+ goto err;
if ((uint) my_b_append_tell(&log_file) > max_size)
new_file_without_locking();
@@ -3689,17 +3707,21 @@ err:
DBUG_RETURN(error);
}
-
-bool MYSQL_BIN_LOG::flush_and_sync()
+bool MYSQL_BIN_LOG::flush_and_sync(bool *synced)
{
int err=0, fd=log_file.file;
+ if (synced)
+ *synced= 0;
safe_mutex_assert_owner(&LOCK_log);
if (flush_io_cache(&log_file))
return 1;
- if (++sync_binlog_counter >= sync_binlog_period && sync_binlog_period)
+ uint sync_period= get_sync_period();
+ if (sync_period && ++sync_counter >= sync_period)
{
- sync_binlog_counter= 0;
+ sync_counter= 0;
err=my_sync(fd, MYF(MY_WME));
+ if (synced)
+ *synced= 1;
}
return err;
}
@@ -3990,7 +4012,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
if (file == &log_file)
{
- error= flush_and_sync();
+ error= flush_and_sync(0);
if (!error)
{
signal_update();
@@ -4176,8 +4198,16 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
if (file == &log_file) // we are writing to the real log (disk)
{
- if (flush_and_sync())
+ bool synced= 0;
+ if (flush_and_sync(&synced))
goto err;
+
+ if (RUN_HOOK(binlog_storage, after_flush,
+ (thd, log_file_name, file->pos_in_file, synced))) {
+ sql_print_error("Failed to run 'after_flush' hooks");
+ goto err;
+ }
+
signal_update();
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
}
@@ -4432,7 +4462,7 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log)
DBUG_ASSERT(carry == 0);
if (sync_log)
- flush_and_sync();
+ return flush_and_sync(0);
return 0; // All OK
}
@@ -4446,9 +4476,9 @@ int query_error_code(THD *thd, bool not_killed)
if (not_killed)
{
- error= thd->is_error() ? thd->main_da.sql_errno() : 0;
+ error= thd->is_error() ? thd->stmt_da->sql_errno() : 0;
- /* thd->main_da.sql_errno() might be ER_SERVER_SHUTDOWN or
+ /* thd->stmt_da->sql_errno() might be ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED, So here we need to make sure that error
is not set to these errors when specified not_killed by the
caller.
@@ -4479,7 +4509,7 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock)
ev.write(&log_file);
if (lock)
{
- if (!error && !(error= flush_and_sync()))
+ if (!error && !(error= flush_and_sync(0)))
{
signal_update();
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
@@ -4567,7 +4597,8 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
if (incident && write_incident(thd, FALSE))
goto err;
- if (flush_and_sync())
+ bool synced= 0;
+ if (flush_and_sync(&synced))
goto err;
DBUG_EXECUTE_IF("half_binlogged_transaction", abort(););
if (cache->error) // Error on read
@@ -4576,6 +4607,15 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
write_error=1; // Don't give more errors
goto err;
}
+
+ if (RUN_HOOK(binlog_storage, after_flush,
+ (thd, log_file_name, log_file.pos_in_file, synced)))
+ {
+ sql_print_error("Failed to run 'after_flush' hooks");
+ write_error=1;
+ goto err;
+ }
+
signal_update();
}
@@ -4612,12 +4652,9 @@ err:
/**
- Wait until we get a signal that the binary log has been updated.
+ Wait until we get a signal that the relay log has been updated.
@param thd Thread variable
- @param is_slave If 0, the caller is the Binlog_dump thread from master;
- if 1, the caller is the SQL thread from the slave. This
- influences only thd->proc_info.
@note
One must have a lock on LOCK_log before calling this function.
@@ -4625,22 +4662,53 @@ err:
THD::enter_cond() (see NOTES in sql_class.h).
*/
-void MYSQL_BIN_LOG::wait_for_update(THD* thd, bool is_slave)
+void MYSQL_BIN_LOG::wait_for_update_relay_log(THD* thd)
{
const char *old_msg;
- DBUG_ENTER("wait_for_update");
+ DBUG_ENTER("wait_for_update_relay_log");
old_msg= thd->enter_cond(&update_cond, &LOCK_log,
- is_slave ?
- "Has read all relay log; waiting for the slave I/O "
- "thread to update it" :
- "Has sent all binlog to slave; waiting for binlog "
- "to be updated");
+ "Slave has read all relay log; "
+ "waiting for the slave I/O "
+ "thread to update it" );
pthread_cond_wait(&update_cond, &LOCK_log);
thd->exit_cond(old_msg);
DBUG_VOID_RETURN;
}
+/**
+ Wait until we get a signal that the binary log has been updated.
+ Applies to master only.
+
+ NOTES
+ @param[in] thd a THD struct
+ @param[in] timeout a pointer to a timespec;
+ NULL means to wait w/o timeout.
+ @retval 0 if got signalled on update
+ @retval non-0 if wait timeout elapsed
+ @note
+ LOCK_log must be taken before calling this function.
+ LOCK_log is being released while the thread is waiting.
+ LOCK_log is released by the caller.
+*/
+
+int MYSQL_BIN_LOG::wait_for_update_bin_log(THD* thd,
+ const struct timespec *timeout)
+{
+ int ret= 0;
+ const char* old_msg = thd->proc_info;
+ DBUG_ENTER("wait_for_update_bin_log");
+ old_msg= thd->enter_cond(&update_cond, &LOCK_log,
+ "Master has sent all binlog to slave; "
+ "waiting for binlog to be updated");
+ if (!timeout)
+ pthread_cond_wait(&update_cond, &LOCK_log);
+ else
+ ret= pthread_cond_timedwait(&update_cond, &LOCK_log,
+ const_cast<struct timespec *>(timeout));
+ DBUG_RETURN(ret);
+}
+
/**
Close the log file.
@@ -4853,11 +4921,12 @@ bool flush_error_log()
void MYSQL_BIN_LOG::signal_update()
{
DBUG_ENTER("MYSQL_BIN_LOG::signal_update");
+ signal_cnt++;
pthread_cond_broadcast(&update_cond);
DBUG_VOID_RETURN;
}
-#ifdef __NT__
+#ifdef _WIN32
static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
size_t length, size_t buffLen)
{
@@ -4890,7 +4959,7 @@ static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
DBUG_VOID_RETURN;
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
/**
@@ -4952,7 +5021,7 @@ int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
length= my_vsnprintf(buff, sizeof(buff), format, args);
print_buffer_to_file(level, buff);
-#ifdef __NT__
+#ifdef _WIN32
print_buffer_to_nt_eventlog(level, buff, length, sizeof(buff));
#endif
@@ -5432,8 +5501,8 @@ int TC_LOG_MMAP::recover()
goto err1;
}
- if (hash_init(&xids, &my_charset_bin, tc_log_page_size/3, 0,
- sizeof(my_xid), 0, 0, MYF(0)))
+ if (my_hash_init(&xids, &my_charset_bin, tc_log_page_size/3, 0,
+ sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
for ( ; p < end_p ; p++)
@@ -5446,12 +5515,12 @@ int TC_LOG_MMAP::recover()
if (ha_recover(&xids))
goto err2;
- hash_free(&xids);
+ my_hash_free(&xids);
bzero(data, (size_t)file_length);
return 0;
err2:
- hash_free(&xids);
+ my_hash_free(&xids);
err1:
sql_print_error("Crash recovery failed. Either correct the problem "
"(if it's, for example, out of memory error) and restart, "
@@ -5635,8 +5704,8 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
MEM_ROOT mem_root;
if (! fdle->is_valid() ||
- hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
- sizeof(my_xid), 0, 0, MYF(0)))
+ my_hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
+ sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE);
@@ -5660,12 +5729,12 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
goto err2;
free_root(&mem_root, MYF(0));
- hash_free(&xids);
+ my_hash_free(&xids);
return 0;
err2:
free_root(&mem_root, MYF(0));
- hash_free(&xids);
+ my_hash_free(&xids);
err1:
sql_print_error("Crash recovery failed. Either correct the problem "
"(if it's, for example, out of memory error) and restart, "
diff --git a/sql/log.h b/sql/log.h
index d306d6f7182..a31be6dcce6 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -269,6 +269,18 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
ulonglong m_table_map_version;
+ /* pointer to the sync period variable, for binlog this will be
+ sync_binlog_period, for relay log this will be
+ sync_relay_log_period
+ */
+ uint *sync_period_ptr;
+ uint sync_counter;
+
+ inline uint get_sync_period()
+ {
+ return *sync_period_ptr;
+ }
+
int write_to_file(IO_CACHE *cache);
/*
This is used to start writing to a new log file. The difference from
@@ -284,7 +296,7 @@ public:
/* This is relay log */
bool is_relay_log;
-
+ ulong signal_cnt; // update of the counter is checked by heartbeat
/*
These describe the log's format. This is used only for relay logs.
_for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
@@ -296,7 +308,7 @@ public:
Format_description_log_event *description_event_for_exec,
*description_event_for_queue;
- MYSQL_BIN_LOG();
+ MYSQL_BIN_LOG(uint *sync_period);
/*
note that there's no destructor ~MYSQL_BIN_LOG() !
The reason is that we don't want it to be automatically called
@@ -339,7 +351,8 @@ public:
}
void set_max_size(ulong max_size_arg);
void signal_update();
- void wait_for_update(THD* thd, bool master_or_slave);
+ void wait_for_update_relay_log(THD* thd);
+ int wait_for_update_bin_log(THD* thd, const struct timespec * timeout);
void set_need_start_event() { need_start_event = 1; }
void init(bool no_auto_events_arg, ulong max_size);
void init_pthread_objects();
@@ -378,7 +391,20 @@ public:
bool is_active(const char* log_file_name);
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
void rotate_and_purge(uint flags);
- bool flush_and_sync();
+ /**
+ Flush binlog cache and synchronize to disk.
+
+ This function flushes events in binlog cache to binary log file,
+ it will do synchronizing according to the setting of system
+ variable 'sync_binlog'. If file is synchronized, @c synced will
+ be set to 1, otherwise 0.
+
+ @param[out] synced if not NULL, set to 1 if file is synchronized, otherwise 0
+
+ @retval 0 Success
+ @retval other Failure
+ */
+ bool flush_and_sync(bool *synced);
int purge_logs(const char *to_log, bool included,
bool need_mutex, bool need_update_threads,
ulonglong *decrease_log_space);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 5e49f7b3312..3a54717a45f 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -134,7 +134,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
char buff[MAX_SLAVE_ERRMSG], *slider;
const char *buff_end= buff + sizeof(buff);
uint len;
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
buff[0]= 0;
@@ -142,10 +142,11 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
slider += len, err= it++)
{
len= my_snprintf(slider, buff_end - slider,
- " %s, Error_code: %d;", err->msg, err->code);
+ " %s, Error_code: %d;", err->get_message_text(),
+ err->get_sql_errno());
}
- rli->report(level, thd->is_error()? thd->main_da.sql_errno() : 0,
+ rli->report(level, thd->is_error()? thd->stmt_da->sql_errno() : 0,
"Could not execute %s event on table %s.%s;"
"%s handler error %s; "
"the event's master log %s, end_log_pos %lu",
@@ -353,13 +354,13 @@ inline int ignored_error_code(int err_code)
*/
int convert_handler_error(int error, THD* thd, TABLE *table)
{
- uint actual_error= (thd->is_error() ? thd->main_da.sql_errno() :
+ uint actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
0);
if (actual_error == 0)
{
table->file->print_error(error, MYF(0));
- actual_error= (thd->is_error() ? thd->main_da.sql_errno() :
+ actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
ER_UNKNOWN_ERROR);
if (actual_error == ER_UNKNOWN_ERROR)
if (global_system_variables.log_warnings)
@@ -1199,14 +1200,14 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
*/
if (description_event->event_type_permutation)
{
- IF_DBUG({
- int new_event_type=
- description_event->event_type_permutation[event_type];
- DBUG_PRINT("info",
- ("converting event type %d to %d (%s)",
- event_type, new_event_type,
- get_type_str((Log_event_type)new_event_type)));
- });
+#ifndef DBUG_OFF
+ int new_event_type=
+ description_event->event_type_permutation[event_type];
+ DBUG_PRINT("info",
+ ("converting event type %d to %d (%s)",
+ event_type, new_event_type,
+ get_type_str((Log_event_type)new_event_type)));
+#endif
event_type= description_event->event_type_permutation[event_type];
}
@@ -2393,13 +2394,29 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
charset_database_number= thd_arg->variables.collation_database->number;
/*
- If we don't use flags2 for anything else than options contained in
- thd_arg->options, it would be more efficient to flags2=thd_arg->options
- (OPTIONS_WRITTEN_TO_BIN_LOG would be used only at reading time).
- But it's likely that we don't want to use 32 bits for 3 bits; in the future
- we will probably want to reclaim the 29 bits. So we need the &.
+ We only replicate over the bits of flags2 that we need: the rest
+ are masked out by "& OPTIONS_WRITTEN_TO_BINLOG".
+
+ We also force AUTOCOMMIT=1. Rationale (cf. BUG#29288): After
+ fixing BUG#26395, we always write BEGIN and COMMIT around all
+ transactions (even single statements in autocommit mode). This is
+ so that replication from non-transactional to transactional table
+ and error recovery from XA to non-XA table should work as
+ expected. The BEGIN/COMMIT are added in log.cc. However, there is
+ one exception: MyISAM bypasses log.cc and writes directly to the
+ binlog. So if autocommit is off, master has MyISAM, and slave has
+ a transactional engine, then the slave will just see one long
+ never-ending transaction. The only way to bypass explicit
+ BEGIN/COMMIT in the binlog is by using a non-transactional table.
+ So setting AUTOCOMMIT=1 will make this work as expected.
+
+ Note: explicitly replicate AUTOCOMMIT=1 from master. We do not
+ assume AUTOCOMMIT=1 on slave; the slave still reads the state of
+ the autocommit flag as written by the master to the binlog. This
+ behavior may change after WL#4162 has been implemented.
*/
- flags2= (uint32) (thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG);
+ flags2= (uint32) (thd_arg->options &
+ (OPTIONS_WRITTEN_TO_BIN_LOG & ~OPTION_NOT_AUTOCOMMIT));
DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_server->number < 256*256);
@@ -3166,7 +3183,7 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
}
/* If the query was not ignored, it is printed to the general log */
- if (!thd->is_error() || thd->main_da.sql_errno() != ER_SLAVE_IGNORED_TABLE)
+ if (!thd->is_error() || thd->stmt_da->sql_errno() != ER_SLAVE_IGNORED_TABLE)
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
compare_errors:
@@ -3175,7 +3192,7 @@ compare_errors:
If we expected a non-zero error code, and we don't get the same error
code, and it should be ignored or is related to a concurrency issue.
*/
- actual_error= thd->is_error() ? thd->main_da.sql_errno() : 0;
+ actual_error= thd->is_error() ? thd->stmt_da->sql_errno() : 0;
DBUG_PRINT("info",("expected_error: %d sql_errno: %d",
expected_error, actual_error));
if ((expected_error && expected_error != actual_error &&
@@ -3190,7 +3207,7 @@ Error on master: '%s' (%d), Error on slave: '%s' (%d). \
Default database: '%s'. Query: '%s'",
ER_SAFE(expected_error),
expected_error,
- actual_error ? thd->main_da.message() : "no error",
+ actual_error ? thd->stmt_da->message() : "no error",
actual_error,
print_slave_db_safe(db), query_arg);
thd->is_slave_error= 1;
@@ -3231,7 +3248,7 @@ Default database: '%s'. Query: '%s'",
{
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on query. Default database: '%s'. Query: '%s'",
- (actual_error ? thd->main_da.message() :
+ (actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"),
print_slave_db_safe(thd->db), query_arg);
thd->is_slave_error= 1;
@@ -3260,6 +3277,21 @@ Default database: '%s'. Query: '%s'",
*/
} /* End of if (db_ok(... */
+ {/**
+ The following failure injecion works in cooperation with tests
+ setting @@global.debug= 'd,stop_slave_middle_group'.
+ The sql thread receives the killed status and will proceed
+ to shutdown trying to finish incomplete events group.
+ */
+ DBUG_EXECUTE_IF("stop_slave_middle_group",
+ if (strcmp("COMMIT", query) != 0 &&
+ strcmp("BEGIN", query) != 0)
+ {
+ if (thd->transaction.all.modified_non_trans_table)
+ const_cast<Relay_log_info*>(rli)->abort_slave= 1;
+ };);
+ }
+
end:
/*
Probably we have set thd->query, thd->db, thd->catalog to point to places
@@ -3577,10 +3609,12 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
*/
if (post_header_len)
{
+#ifndef DBUG_OFF
// Allows us to sanity-check that all events initialized their
// events (see the end of this 'if' block).
- IF_DBUG(memset(post_header_len, 255,
- number_of_event_types*sizeof(uint8)););
+ memset(post_header_len, 255,
+ number_of_event_types*sizeof(uint8));
+#endif
/* Note: all event types must explicitly fill in their lengths here. */
post_header_len[START_EVENT_V3-1]= START_V3_HEADER_LEN;
@@ -3631,13 +3665,12 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
post_header_len[UPDATE_ROWS_EVENT-1]=
post_header_len[DELETE_ROWS_EVENT-1]= 6;);
post_header_len[INCIDENT_EVENT-1]= INCIDENT_HEADER_LEN;
+ post_header_len[HEARTBEAT_LOG_EVENT-1]= 0;
// Sanity-check that all post header lengths are initialized.
- IF_DBUG({
- int i;
- for (i=0; i<number_of_event_types; i++)
- assert(post_header_len[i] != 255);
- });
+ int i;
+ for (i=0; i<number_of_event_types; i++)
+ DBUG_ASSERT(post_header_len[i] != 255);
}
break;
@@ -4551,13 +4584,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = next_query_id();
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- /*
- Initing thd->row_count is not necessary in theory as this variable has no
- influence in the case of the slave SQL thread (it is used to generate a
- "data truncated" warning but which is absorbed and never gets to the
- error log); still we init it to avoid a Valgrind message.
- */
- mysql_reset_errors(thd, 0);
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
TABLE_LIST tables;
bzero((char*) &tables,sizeof(tables));
@@ -4717,8 +4744,8 @@ error:
int sql_errno;
if (thd->is_error())
{
- err= thd->main_da.message();
- sql_errno= thd->main_da.sql_errno();
+ err= thd->stmt_da->message();
+ sql_errno= thd->stmt_da->sql_errno();
}
else
{
@@ -7281,7 +7308,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
if (simple_open_n_lock_tables(thd, rli->tables_to_lock))
{
- uint actual_error= thd->main_da.sql_errno();
+ uint actual_error= thd->stmt_da->sql_errno();
if (thd->is_slave_error || thd->is_fatal_error)
{
/*
@@ -7292,7 +7319,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
*/
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on opening tables",
- (actual_error ? thd->main_da.message() :
+ (actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"));
thd->is_slave_error= 1;
}
@@ -7474,8 +7501,16 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
thd->transaction.stmt.modified_non_trans_table= TRUE;
} // row processing loop
- DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
- const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
+ {/**
+ The following failure injecion works in cooperation with tests
+ setting @@global.debug= 'd,stop_slave_middle_group'.
+ The sql thread receives the killed status and will proceed
+ to shutdown trying to finish incomplete events group.
+ */
+ DBUG_EXECUTE_IF("stop_slave_middle_group",
+ if (thd->transaction.all.modified_non_trans_table)
+ const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
+ }
if ((error= do_after_row_operations(rli, error)) &&
ignored_error_code(convert_handler_error(error, thd, table)))
@@ -7513,32 +7548,6 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
thd->is_slave_error= 1;
DBUG_RETURN(error);
}
- /*
- This code would ideally be placed in do_update_pos() instead, but
- since we have no access to table there, we do the setting of
- last_event_start_time here instead.
- */
- else if (table && (table->s->primary_key == MAX_KEY) &&
- !cache_stmt && get_flags(STMT_END_F) == RLE_NO_FLAGS)
- {
- /*
- ------------ Temporary fix until WL#2975 is implemented ---------
-
- This event is not the last one (no STMT_END_F). If we stop now
- (in case of terminate_slave_thread()), how will we restart? We
- have to restart from Table_map_log_event, but as this table is
- not transactional, the rows already inserted will still be
- present, and idempotency is not guaranteed (no PK) so we risk
- that repeating leads to double insert. So we desperately try to
- continue, hope we'll eventually leave this buggy situation (by
- executing the final Rows_log_event). If we are in a hopeless
- wait (reached end of last relay log and nothing gets appended
- there), we timeout after one minute, and notify DBA about the
- problem. When WL#2975 is implemented, just remove the member
- Relay_log_info::last_event_start_time and all its occurrences.
- */
- const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
- }
if (get_flags(STMT_END_F))
if ((error= rows_event_stmt_cleanup(rli, thd)))
@@ -9441,3 +9450,16 @@ st_print_event_info::st_print_event_info()
open_cached_file(&body_cache, NULL, NULL, 0, flags);
}
#endif
+
+
+#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
+Heartbeat_log_event::Heartbeat_log_event(const char* buf, uint event_len,
+ const Format_description_log_event* description_event)
+ :Log_event(buf, description_event)
+{
+ uint8 header_size= description_event->common_header_len;
+ ident_len = event_len - header_size;
+ set_if_smaller(ident_len,FN_REFLEN-1);
+ log_ident= buf + header_size;
+}
+#endif
diff --git a/sql/log_event.h b/sql/log_event.h
index 0b4c63a73af..cd5e659c910 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -250,6 +250,7 @@ struct sql_ex_info
#define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
#define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
#define INCIDENT_HEADER_LEN 2
+#define HEARTBEAT_HEADER_LEN 0
/*
Max number of possible extra bytes in a replication event compared to a
packet (i.e. a query) sent from client to master;
@@ -575,6 +576,12 @@ enum Log_event_type
INCIDENT_EVENT= 26,
/*
+ Heartbeat event to be send by master at its idle time
+ to ensure master's online status to slave
+ */
+ HEARTBEAT_LOG_EVENT= 27,
+
+ /*
Add new events here - right above this comment!
Existing events (except ENUM_END_EVENT) should never change their numbers
*/
@@ -689,6 +696,20 @@ typedef struct st_print_event_info
} PRINT_EVENT_INFO;
#endif
+/**
+ the struct aggregates two paramenters that identify an event
+ uniquely in scope of communication of a particular master and slave couple.
+ I.e there can not be 2 events from the same staying connected master which
+ have the same coordinates.
+ @note
+ Such identifier is not yet unique generally as the event originating master
+ is resetable. Also the crashed master can be replaced with some other.
+*/
+struct event_coordinates
+{
+ char * file_name; // binlog file name (directories stripped)
+ my_off_t pos; // event's position in the binlog file
+};
/**
@class Log_event
@@ -3920,6 +3941,42 @@ static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache,
reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
}
+#ifndef MYSQL_CLIENT
+/*****************************************************************************
+
+ Heartbeat Log Event class
+
+ Replication event to ensure to slave that master is alive.
+ The event is originated by master's dump thread and sent straight to
+ slave without being logged. Slave itself does not store it in relay log
+ but rather uses a data for immediate checks and throws away the event.
+
+ Two members of the class log_ident and Log_event::log_pos comprise
+ @see the event_coordinates instance. The coordinates that a heartbeat
+ instance carries correspond to the last event master has sent from
+ its binlog.
+
+ ****************************************************************************/
+class Heartbeat_log_event: public Log_event
+{
+public:
+ Heartbeat_log_event(const char* buf, uint event_len,
+ const Format_description_log_event* description_event);
+ Log_event_type get_type_code() { return HEARTBEAT_LOG_EVENT; }
+ bool is_valid() const
+ {
+ return (log_ident != NULL &&
+ log_pos >= BIN_LOG_HEADER_SIZE);
+ }
+ const char * get_log_ident() { return log_ident; }
+ uint get_ident_len() { return ident_len; }
+
+private:
+ const char* log_ident;
+ uint ident_len;
+};
+#endif
+
/**
@} (end of group Replication)
*/
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 357bc78b1cd..fbcbb388236 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -78,7 +78,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (simple_open_n_lock_tables(thd, rli->tables_to_lock))
{
- uint actual_error= thd->main_da.sql_errno();
+ uint actual_error= thd->stmt_da->sql_errno();
if (thd->is_slave_error || thd->is_fatal_error)
{
/*
@@ -87,7 +87,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
*/
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on opening tables",
- (actual_error ? thd->main_da.message() :
+ (actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"));
thd->is_slave_error= 1;
}
@@ -216,17 +216,17 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
break;
default:
- rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Error in %s event: row application failed. %s",
ev->get_type_str(),
- thd->is_error() ? thd->main_da.message() : "");
+ thd->is_error() ? thd->stmt_da->message() : "");
thd->is_slave_error= 1;
break;
}
row_start= row_end;
}
- DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
+ DBUG_EXECUTE_IF("stop_slave_middle_group",
const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
error= do_after_row_operations(table, error);
if (!ev->cache_stmt)
@@ -245,12 +245,12 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (error)
{ /* error has occured during the transaction */
- rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
ev->get_type_str(), table->s->db.str,
table->s->table_name.str,
- thd->is_error() ? thd->main_da.message() : "");
+ thd->is_error() ? thd->stmt_da->message() : "");
/*
If one day we honour --skip-slave-errors in row-based replication, and
@@ -269,34 +269,6 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
DBUG_RETURN(error);
}
- /*
- This code would ideally be placed in do_update_pos() instead, but
- since we have no access to table there, we do the setting of
- last_event_start_time here instead.
- */
- if (table && (table->s->primary_key == MAX_KEY) &&
- !ev->cache_stmt &&
- ev->get_flags(Old_rows_log_event::STMT_END_F) == Old_rows_log_event::RLE_NO_FLAGS)
- {
- /*
- ------------ Temporary fix until WL#2975 is implemented ---------
-
- This event is not the last one (no STMT_END_F). If we stop now
- (in case of terminate_slave_thread()), how will we restart? We
- have to restart from Table_map_log_event, but as this table is
- not transactional, the rows already inserted will still be
- present, and idempotency is not guaranteed (no PK) so we risk
- that repeating leads to double insert. So we desperately try to
- continue, hope we'll eventually leave this buggy situation (by
- executing the final Old_rows_log_event). If we are in a hopeless
- wait (reached end of last relay log and nothing gets appended
- there), we timeout after one minute, and notify DBA about the
- problem. When WL#2975 is implemented, just remove the member
- st_relay_log_info::last_event_start_time and all its occurences.
- */
- const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
- }
-
DBUG_RETURN(0);
}
#endif
@@ -1744,7 +1716,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
} // row processing loop
- DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
+ DBUG_EXECUTE_IF("stop_slave_middle_group",
const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
error= do_after_row_operations(rli, error);
if (!cache_stmt)
diff --git a/sql/message.h b/sql/message.h
index 0e7c282d5a1..97d039352b4 100644
--- a/sql/message.h
+++ b/sql/message.h
@@ -1,3 +1,6 @@
+#ifndef MESSAGE_INCLUDED
+#define MESSAGE_INCLUDED
+
/*
To change or add messages mysqld writes to the Windows error log, run
mc.exe message.mc
@@ -6,6 +9,8 @@
mc.exe can be installed with Windows SDK, some Visual Studio distributions
do not include it.
*/
+
+
//
// Values are 32 bit values layed out as follows:
//
@@ -53,3 +58,5 @@
//
#define MSG_DEFAULT 0xC0000064L
+#endif /* MESSAGE_INCLUDED */
+
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 208ddefb890..16d07526a0f 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -41,17 +41,17 @@ int decimal_operation_results(int result)
"", (long)-1);
break;
case E_DEC_OVERFLOW:
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
"DECIMAL", "");
break;
case E_DEC_DIV_ZERO:
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
break;
case E_DEC_BAD_NUM:
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"decimal", "", "", (long)-1);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index e4effd12af7..b539e004481 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -28,6 +28,16 @@
#ifndef MYSQL_CLIENT
+/*
+ the following #define adds server-only members to enum_mysql_show_type,
+ that is defined in mysql/plugin.h
+ it has to be before mysql/plugin.h is included.
+*/
+#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
+ SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
+ SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
+ SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS
+
#include <my_global.h>
#include <mysql_version.h>
#include <mysql_embed.h>
@@ -128,6 +138,10 @@ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
+/**
+ Character set of the buildin error messages loaded from errmsg.sys.
+*/
+extern CHARSET_INFO *error_message_charset_info;
enum Derivation
{
@@ -140,6 +154,14 @@ enum Derivation
};
+typedef struct my_locale_errmsgs
+{
+ const char *language;
+ const char **errmsgs;
+} MY_LOCALE_ERRMSGS;
+
+extern char err_shared_dir[];
+
typedef struct my_locale_st
{
uint number;
@@ -152,29 +174,42 @@ typedef struct my_locale_st
TYPELIB *ab_day_names;
uint max_month_name_length;
uint max_day_name_length;
+ uint decimal_point;
+ uint thousand_sep;
+ const char *grouping;
+ MY_LOCALE_ERRMSGS *errmsgs;
#ifdef __cplusplus
my_locale_st(uint number_par,
const char *name_par, const char *descr_par, bool is_ascii_par,
TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
- uint max_month_name_length_par, uint max_day_name_length_par) :
+ uint max_month_name_length_par, uint max_day_name_length_par,
+ uint decimal_point_par, uint thousand_sep_par,
+ const char *grouping_par, MY_LOCALE_ERRMSGS *errmsgs_par) :
number(number_par),
name(name_par), description(descr_par), is_ascii(is_ascii_par),
month_names(month_names_par), ab_month_names(ab_month_names_par),
day_names(day_names_par), ab_day_names(ab_day_names_par),
max_month_name_length(max_month_name_length_par),
- max_day_name_length(max_day_name_length_par)
+ max_day_name_length(max_day_name_length_par),
+ decimal_point(decimal_point_par),
+ thousand_sep(thousand_sep_par),
+ grouping(grouping_par),
+ errmsgs(errmsgs_par)
{}
#endif
} MY_LOCALE;
extern MY_LOCALE my_locale_en_US;
extern MY_LOCALE *my_locales[];
+extern MY_LOCALE *my_default_lc_messages;
extern MY_LOCALE *my_default_lc_time_names;
MY_LOCALE *my_locale_by_name(const char *name);
MY_LOCALE *my_locale_by_number(uint number);
+void cleanup_errmsgs(void);
+
/*************************************************************************/
/**
@@ -270,7 +305,7 @@ protected:
#define TABLE_OPEN_CACHE_DEFAULT 400
#define TABLE_DEF_CACHE_DEFAULT 400
/**
- We must have room for at least 256 table definitions in the table
+ We must have room for at least 400 table definitions in the table
cache, since otherwise there is no chance prepared
statements that use these many tables can work.
Prepared statements use table definition cache ids (table_map_id)
@@ -637,7 +672,6 @@ enum enum_parsing_place
IN_ON
};
-struct st_table;
#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
class THD;
@@ -875,6 +909,7 @@ bool general_log_write(THD *thd, enum enum_server_command command,
#include "tztime.h"
#ifdef MYSQL_SERVER
#include "sql_servers.h"
+#include "records.h"
#include "opt_range.h"
#ifdef HAVE_QUERY_CACHE
@@ -882,7 +917,7 @@ struct Query_cache_query_flags
{
unsigned int client_long_flag:1;
unsigned int client_protocol_41:1;
- unsigned int result_in_binary_protocol:1;
+ unsigned int protocol_type:2;
unsigned int more_results_exists:1;
unsigned int in_trans:1;
unsigned int autocommit:1;
@@ -901,6 +936,8 @@ struct Query_cache_query_flags
};
#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
#include "sql_cache.h"
+#define query_cache_abort(A) query_cache.abort(A)
+#define query_cache_end_of_result(A) query_cache.end_of_result(A)
#define query_cache_store_query(A, B) query_cache.store_query(A, B)
#define query_cache_destroy() query_cache.destroy()
#define query_cache_result_size_limit(A) query_cache.result_size_limit(A)
@@ -938,100 +975,6 @@ struct Query_cache_query_flags
#define query_cache_is_cacheable_query(L) 0
#endif /*HAVE_QUERY_CACHE*/
-/*
- Error injector Macros to enable easy testing of recovery after failures
- in various error cases.
-*/
-#ifndef ERROR_INJECT_SUPPORT
-
-#define ERROR_INJECT(x) 0
-#define ERROR_INJECT_ACTION(x,action) 0
-#define ERROR_INJECT_CRASH(x) 0
-#define ERROR_INJECT_VALUE(x) 0
-#define ERROR_INJECT_VALUE_ACTION(x,action) 0
-#define ERROR_INJECT_VALUE_CRASH(x) 0
-#define SET_ERROR_INJECT_VALUE(x)
-
-#else
-
-inline bool check_and_unset_keyword(const char *dbug_str)
-{
- const char *extra_str= "-d,";
- char total_str[200];
- if (_db_strict_keyword_ (dbug_str))
- {
- strxmov(total_str, extra_str, dbug_str, NullS);
- DBUG_SET(total_str);
- return 1;
- }
- return 0;
-}
-
-
-inline bool
-check_and_unset_inject_value(int value)
-{
- THD *thd= current_thd;
- if (thd->error_inject_value == (uint)value)
- {
- thd->error_inject_value= 0;
- return 1;
- }
- return 0;
-}
-
-/*
- ERROR INJECT MODULE:
- --------------------
- These macros are used to insert macros from the application code.
- The event that activates those error injections can be activated
- from SQL by using:
- SET SESSION dbug=+d,code;
-
- After the error has been injected, the macros will automatically
- remove the debug code, thus similar to using:
- SET SESSION dbug=-d,code
- from SQL.
-
- ERROR_INJECT_CRASH will inject a crash of the MySQL Server if code
- is set when macro is called. ERROR_INJECT_CRASH can be used in
- if-statements, it will always return FALSE unless of course it
- crashes in which case it doesn't return at all.
-
- ERROR_INJECT_ACTION will inject the action specified in the action
- parameter of the macro, before performing the action the code will
- be removed such that no more events occur. ERROR_INJECT_ACTION
- can also be used in if-statements and always returns FALSE.
- ERROR_INJECT can be used in a normal if-statement, where the action
- part is performed in the if-block. The macro returns TRUE if the
- error was activated and otherwise returns FALSE. If activated the
- code is removed.
-
- Sometimes it is necessary to perform error inject actions as a serie
- of events. In this case one can use one variable on the THD object.
- Thus one sets this value by using e.g. SET_ERROR_INJECT_VALUE(100).
- Then one can later test for it by using ERROR_INJECT_CRASH_VALUE,
- ERROR_INJECT_ACTION_VALUE and ERROR_INJECT_VALUE. This have the same
- behaviour as the above described macros except that they use the
- error inject value instead of a code used by DBUG macros.
-*/
-#define SET_ERROR_INJECT_VALUE(x) \
- current_thd->error_inject_value= (x)
-#define ERROR_INJECT_CRASH(code) \
- DBUG_EVALUATE_IF(code, (abort(), 0), 0)
-#define ERROR_INJECT_ACTION(code, action) \
- (check_and_unset_keyword(code) ? ((action), 0) : 0)
-#define ERROR_INJECT(code) \
- check_and_unset_keyword(code)
-#define ERROR_INJECT_VALUE(value) \
- check_and_unset_inject_value(value)
-#define ERROR_INJECT_VALUE_ACTION(value,action) \
- (check_and_unset_inject_value(value) ? (action) : 0)
-#define ERROR_INJECT_VALUE_CRASH(value) \
- ERROR_INJECT_VALUE_ACTION(value, (abort(), 0))
-
-#endif
-
void write_bin_log(THD *thd, bool clear_error,
char const *query, ulong query_length);
@@ -1116,9 +1059,11 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
bool *write_to_binlog);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool check_access(THD *thd, ulong access, const char *db, ulong *save_priv,
- bool no_grant, bool no_errors, bool schema_db);
-bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
- uint number, bool no_errors);
+ bool no_grant, bool no_errors, bool schema_db);
+bool check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
+ bool any_combination_of_privileges_will_do,
+ uint number,
+ bool no_errors);
#else
inline bool check_access(THD *thd, ulong access, const char *db,
ulong *save_priv, bool no_grant, bool no_errors,
@@ -1128,8 +1073,10 @@ inline bool check_access(THD *thd, ulong access, const char *db,
*save_priv= GLOBAL_ACLS;
return false;
}
-inline bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
- uint number, bool no_errors)
+inline bool check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
+ bool no_errors,
+ bool any_combination_of_privileges_will_do,
+ uint number)
{ return false; }
#endif /*NO_EMBEDDED_ACCESS_CHECKS*/
@@ -1222,6 +1169,8 @@ int prepare_create_field(Create_field *sql_field,
uint *blob_columns,
int *timestamps, int *timestamps_with_niladic,
longlong table_flags);
+CHARSET_INFO* get_sql_field_charset(Create_field *sql_field,
+ HA_CREATE_INFO *create_info);
bool mysql_create_table(THD *thd,const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
Alter_info *alter_info,
@@ -1393,7 +1342,6 @@ void remove_status_vars(SHOW_VAR *list);
void init_status_vars();
void free_status_vars();
void reset_status_vars();
-
/* information schema */
extern LEX_STRING INFORMATION_SCHEMA_NAME;
/* log tables */
@@ -1420,19 +1368,6 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table);
#define is_schema_db(X) \
!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X))
-/* sql_prepare.cc */
-
-void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length);
-void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length);
-void mysqld_stmt_close(THD *thd, char *packet);
-void mysql_sql_stmt_prepare(THD *thd);
-void mysql_sql_stmt_execute(THD *thd);
-void mysql_sql_stmt_close(THD *thd);
-void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length);
-void mysqld_stmt_reset(THD *thd, char *packet);
-void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
-void reinit_stmt_before_use(THD *thd, LEX *lex);
-
/* sql_handler.cc */
bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen);
bool mysql_ha_close(THD *thd, TABLE_LIST *tables);
@@ -1611,6 +1546,11 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
handlerton *old_db_type,
bool *partition_changed,
uint *fast_alter_partition);
+char *generate_partition_syntax(partition_info *part_info,
+ uint *buf_length, bool use_sql_alloc,
+ bool show_partition_options,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info);
#endif
/* bits for last argument to remove_table_from_cache() */
@@ -1829,6 +1769,8 @@ extern "C" int key_rec_cmp(void *key_info, uchar *a, uchar *b);
bool init_errmessage(void);
#endif /* MYSQL_SERVER */
void sql_perror(const char *message);
+bool read_texts(const char *file_name, const char *language,
+ const char ***point, uint error_messages);
bool fn_format_relative_to_data_home(char * to, const char *name,
const char *dir, const char *extension);
@@ -1921,7 +1863,7 @@ extern Gt_creator gt_creator;
extern Lt_creator lt_creator;
extern Ge_creator ge_creator;
extern Le_creator le_creator;
-extern char language[FN_REFLEN];
+extern char lc_messages_dir[FN_REFLEN];
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
@@ -1930,6 +1872,7 @@ extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;
#ifdef MYSQL_SERVER
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
+extern char default_logfile_name[FN_REFLEN];
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
@@ -1964,10 +1907,13 @@ extern ulong MYSQL_PLUGIN_IMPORT specialflag;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern ulong current_pid;
-extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter;
+extern ulong expire_logs_days;
+extern uint sync_binlog_period, sync_relaylog_period,
+ sync_relayloginfo_period, sync_masterinfo_period;
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
+extern my_bool relay_log_recovery;
extern uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
extern uint delay_key_write_options;
@@ -2027,14 +1973,13 @@ extern FILE *bootstrap_file;
extern int bootstrap_error;
extern FILE *stderror_file;
extern pthread_key(MEM_ROOT**,THR_MALLOC);
-extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
+extern pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_lock_db,
LOCK_mapped_file,LOCK_user_locks, LOCK_status,
LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
LOCK_global_system_variables, LOCK_user_conn,
- LOCK_prepared_stmt_count,
- LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count;
+ LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_connection_count;
extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count;
#ifdef HAVE_OPENSSL
extern pthread_mutex_t LOCK_des_key_file;
@@ -2078,7 +2023,7 @@ extern uint sql_command_flags[];
extern TYPELIB log_output_typelib;
/* optional things, have_* variables */
-extern SHOW_COMP_OPTION have_community_features;
+extern SHOW_COMP_OPTION have_profiling;
extern handlerton *partition_hton;
extern handlerton *myisam_hton;
@@ -2229,12 +2174,6 @@ longlong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
int test_if_number(char *str,int *res,bool allow_wildcards);
void change_byte(uchar *,uint,char,char);
-void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
- SQL_SELECT *select, int use_record_cache,
- bool print_errors, bool disable_rr_cache);
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
- bool print_error, uint idx);
-void end_read_record(READ_RECORD *info);
ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder,
uint s_length, SQL_SELECT *select,
ha_rows max_rows, bool sort_positions,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1926d447ef7..5916cace54e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -33,6 +33,8 @@
#include "rpl_injector.h"
+#include "rpl_handler.h"
+
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
@@ -400,9 +402,10 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on,"
"index_merge_sort_union=on,"
"index_merge_intersection=on";
static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
-static char *opt_init_slave, *language_ptr, *opt_init_connect;
+static char *opt_init_slave, *lc_messages_dir_ptr, *opt_init_connect;
static char *default_character_set_name;
static char *character_set_filesystem_name;
+static char *lc_messages;
static char *lc_time_names_name;
static char *my_bind_addr_str;
static char *default_collation_name;
@@ -489,6 +492,7 @@ extern const char *opt_ndb_distribution;
extern enum ndb_distribution opt_ndb_distribution_id;
#endif
my_bool opt_readonly, use_temp_pool, relay_log_purge;
+my_bool relay_log_recovery;
my_bool opt_sync_frm, opt_allow_suspicious_udfs;
my_bool opt_secure_auth= 0;
char* opt_secure_file_priv= 0;
@@ -568,7 +572,9 @@ ulong max_prepared_stmt_count;
*/
ulong prepared_stmt_count=0;
ulong thread_id=1L,current_pid;
-ulong slow_launch_threads = 0, sync_binlog_period;
+ulong slow_launch_threads = 0;
+uint sync_binlog_period= 0, sync_relaylog_period= 0,
+ sync_relayloginfo_period= 0, sync_masterinfo_period= 0;
ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
const char *log_output_str= "FILE";
@@ -576,12 +582,15 @@ const char *log_output_str= "FILE";
time_t server_start_time, flush_status_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
+char default_logfile_name[FN_REFLEN];
char *default_tz_name;
char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
char mysql_real_data_home[FN_REFLEN],
- language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
+ lc_messages_dir[FN_REFLEN], reg_ext[FN_EXTLEN],
+ mysql_charsets_dir[FN_REFLEN],
*opt_init_file, *opt_tc_log_file,
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
+char err_shared_dir[FN_REFLEN];
char mysql_unpacked_real_data_home[FN_REFLEN];
int mysql_unpacked_real_data_home_len;
uint reg_ext_length;
@@ -594,7 +603,6 @@ uint mysql_data_home_len;
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
char server_version[SERVER_VERSION_LENGTH];
char *mysqld_unix_port, *opt_mysql_tmpdir;
-const char **errmesg; /**< Error messages */
const char *myisam_recover_options_str="OFF";
const char *myisam_stats_method_str="nulls_unequal";
@@ -632,26 +640,28 @@ MY_BITMAP temp_pool;
CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
CHARSET_INFO *character_set_filesystem;
+CHARSET_INFO *error_message_charset_info;
+MY_LOCALE *my_default_lc_messages;
MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress;
-SHOW_COMP_OPTION have_community_features;
+SHOW_COMP_OPTION have_profiling;
/* Thread specific variables */
pthread_key(MEM_ROOT**,THR_MALLOC);
pthread_key(THD*, THR_THD);
-pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
+pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_thread_count,
LOCK_mapped_file, LOCK_status, LOCK_global_read_lock,
LOCK_error_log, LOCK_uuid_generator,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
- LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
+ LOCK_crypt,
LOCK_global_system_variables,
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
- LOCK_connection_count;
+ LOCK_connection_count, LOCK_error_messages;
/**
The below lock protects access to two global server variables:
max_prepared_stmt_count and prepared_stmt_count. These variables
@@ -735,7 +745,7 @@ static NTService Service; ///< Service object for WinNT
#endif /* EMBEDDED_LIBRARY */
#endif /* __WIN__ */
-#ifdef __NT__
+#ifdef _WIN32
static char pipe_name[512];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
@@ -808,11 +818,14 @@ static void set_server_version(void);
static int init_thread_environment();
static char *get_relative_path(const char *path);
static int fix_paths(void);
-pthread_handler_t handle_connections_sockets(void *arg);
+void handle_connections_sockets();
+#ifdef _WIN32
+pthread_handler_t handle_connections_sockets_thread(void *arg);
+#endif
pthread_handler_t kill_server_thread(void *arg);
static void bootstrap(FILE *file);
static bool read_init_file(char *file_name);
-#ifdef __NT__
+#ifdef _WIN32
pthread_handler_t handle_connections_namedpipes(void *arg);
#endif
#ifdef HAVE_SMEM
@@ -898,7 +911,7 @@ static void close_connections(void)
ip_sock= INVALID_SOCKET;
}
}
-#ifdef __NT__
+#ifdef _WIN32
if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
{
HANDLE temp;
@@ -994,7 +1007,7 @@ static void close_connections(void)
if (tmp->vio_ok())
{
if (global_system_variables.log_warnings)
- sql_print_warning(ER(ER_FORCING_CLOSE),my_progname,
+ sql_print_warning(ER_DEFAULT(ER_FORCING_CLOSE),my_progname,
tmp->thread_id,
(tmp->main_security_ctx.user ?
tmp->main_security_ctx.user : ""));
@@ -1146,9 +1159,9 @@ static void __cdecl kill_server(int sig_ptr)
if (sig != 0) // 0 is not a valid signal number
my_sigset(sig, SIG_IGN); /* purify inspected */
if (sig == MYSQL_KILL_SIGNAL || sig == 0)
- sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname);
+ sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN),my_progname);
else
- sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
+ sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
#if defined(HAVE_SMEM) && defined(__WIN__)
/*
@@ -1310,6 +1323,7 @@ void clean_up(bool print_message)
ha_end();
if (tc_log)
tc_log->close();
+ delegates_destroy();
xid_cache_free();
delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache);
multi_keycache_free();
@@ -1358,12 +1372,11 @@ void clean_up(bool print_message)
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist
#endif
- if (print_message && errmesg && server_start_time)
- sql_print_information(ER(ER_SHUTDOWN_COMPLETE),my_progname);
+ if (print_message && /*errmesg &&*/ server_start_time)
+ sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname);
+ cleanup_errmsgs();
thread_scheduler.end();
finish_client_errs();
- my_free((uchar*) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST),
- MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
DBUG_PRINT("quit", ("Error messages freed"));
/* Tell main we are ready */
logger.cleanup_end();
@@ -1410,7 +1423,6 @@ static void clean_up_mutexes()
{
(void) pthread_mutex_destroy(&LOCK_mysql_create_db);
(void) pthread_mutex_destroy(&LOCK_lock_db);
- (void) pthread_mutex_destroy(&LOCK_Acl);
(void) rwlock_destroy(&LOCK_grant);
(void) pthread_mutex_destroy(&LOCK_open);
(void) pthread_mutex_destroy(&LOCK_thread_count);
@@ -1422,8 +1434,6 @@ static void clean_up_mutexes()
(void) pthread_mutex_destroy(&LOCK_delayed_create);
(void) pthread_mutex_destroy(&LOCK_manager);
(void) pthread_mutex_destroy(&LOCK_crypt);
- (void) pthread_mutex_destroy(&LOCK_bytes_sent);
- (void) pthread_mutex_destroy(&LOCK_bytes_received);
(void) pthread_mutex_destroy(&LOCK_user_conn);
(void) pthread_mutex_destroy(&LOCK_connection_count);
Events::destroy_mutexes();
@@ -1447,6 +1457,7 @@ static void clean_up_mutexes()
(void) pthread_mutex_destroy(&LOCK_global_read_lock);
(void) pthread_mutex_destroy(&LOCK_uuid_generator);
(void) pthread_mutex_destroy(&LOCK_prepared_stmt_count);
+ (void) pthread_mutex_destroy(&LOCK_error_messages);
(void) pthread_cond_destroy(&COND_thread_count);
(void) pthread_cond_destroy(&COND_refresh);
(void) pthread_cond_destroy(&COND_global_read_lock);
@@ -1704,7 +1715,7 @@ static void network_init(void)
}
}
-#ifdef __NT__
+#ifdef _WIN32
/* create named pipe */
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
@@ -1819,14 +1830,15 @@ void close_connection(THD *thd, uint errcode, bool lock)
DBUG_PRINT("enter",("fd: %s error: '%s'",
thd->net.vio ? vio_description(thd->net.vio) :
"(not connected)",
- errcode ? ER(errcode) : ""));
+ errcode ? ER_DEFAULT(errcode) : ""));
if (lock)
(void) pthread_mutex_lock(&LOCK_thread_count);
thd->killed= THD::KILL_CONNECTION;
if ((vio= thd->net.vio) != 0)
{
if (errcode)
- net_send_error(thd, errcode, ER(errcode)); /* purecov: inspected */
+ net_send_error(thd, errcode,
+ ER_DEFAULT(errcode), NULL); /* purecov: inspected */
vio_close(vio); /* vio is freed in delete thd */
}
if (lock)
@@ -2051,29 +2063,7 @@ static BOOL WINAPI console_event_handler( DWORD type )
}
-/*
- In Visual Studio 2005 and later, default SIGABRT handler will overwrite
- any unhandled exception filter set by the application and will try to
- call JIT debugger. This is not what we want, this we calling __debugbreak
- to stop in debugger, if process is being debugged or to generate
- EXCEPTION_BREAKPOINT and then handle_segfault will do its magic.
-*/
-
-#if (_MSC_VER >= 1400)
-static void my_sigabrt_handler(int sig)
-{
- __debugbreak();
-}
-#endif /*_MSC_VER >=1400 */
-void win_install_sigabrt_handler(void)
-{
-#if (_MSC_VER >=1400)
- /*abort() should not override our exception filter*/
- _set_abort_behavior(0,_CALL_REPORTFAULT);
- signal(SIGABRT,my_sigabrt_handler);
-#endif /* _MSC_VER >=1400 */
-}
#ifdef DEBUG_UNHANDLED_EXCEPTION_FILTER
#define DEBUGGER_ATTACH_TIMEOUT 120
@@ -2152,7 +2142,6 @@ LONG WINAPI my_unhandler_exception_filter(EXCEPTION_POINTERS *ex_pointers)
static void init_signals(void)
{
- win_install_sigabrt_handler();
if(opt_console)
SetConsoleCtrlHandler(console_event_handler,TRUE);
@@ -2874,11 +2863,11 @@ static void check_data_home(const char *path)
for the client.
*/
/* ARGSUSED */
-extern "C" int my_message_sql(uint error, const char *str, myf MyFlags);
+extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
-int my_message_sql(uint error, const char *str, myf MyFlags)
+void my_message_sql(uint error, const char *str, myf MyFlags)
{
- THD *thd;
+ THD *thd= current_thd;
DBUG_ENTER("my_message_sql");
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
@@ -2900,70 +2889,18 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
error= ER_UNKNOWN_ERROR;
}
- if ((thd= current_thd))
+ if (thd)
{
- /*
- TODO: There are two exceptions mechanism (THD and sp_rcontext),
- this could be improved by having a common stack of handlers.
- */
- if (thd->handle_error(error, str,
- MYSQL_ERROR::WARN_LEVEL_ERROR))
- DBUG_RETURN(0);
-
- thd->is_slave_error= 1; // needed to catch query errors during replication
-
- /*
- thd->lex->current_select == 0 if lex structure is not inited
- (not query command (COM_QUERY))
- */
- if (thd->lex->current_select &&
- thd->lex->current_select->no_error && !thd->is_fatal_error)
- {
- DBUG_PRINT("error",
- ("Error converted to warning: current_select: no_error %d "
- "fatal_error: %d",
- (thd->lex->current_select ?
- thd->lex->current_select->no_error : 0),
- (int) thd->is_fatal_error));
- }
- else
- {
- if (! thd->main_da.is_error()) // Return only first message
- {
- thd->main_da.set_error_status(thd, error, str);
- }
- query_cache_abort(&thd->net);
- }
- /*
- If a continue handler is found, the error message will be cleared
- by the stored procedures code.
- */
- if (thd->spcont &&
- ! (MyFlags & ME_NO_SP_HANDLER) &&
- thd->spcont->handle_error(error, MYSQL_ERROR::WARN_LEVEL_ERROR, thd))
- {
- /*
- Do not push any warnings, a handled error must be completely
- silenced.
- */
- DBUG_RETURN(0);
- }
-
- if (!thd->no_warnings_for_error &&
- !(MyFlags & ME_NO_WARNING_FOR_ERROR))
- {
- /*
- Suppress infinite recursion if there a memory allocation error
- inside push_warning.
- */
- thd->no_warnings_for_error= TRUE;
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
- thd->no_warnings_for_error= FALSE;
- }
+ if (MyFlags & ME_FATALERROR)
+ thd->is_fatal_error= 1;
+ (void) thd->raise_condition(error,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_ERROR,
+ str);
}
if (!thd || MyFlags & ME_NOREFRESH)
sql_print_error("%s: %s",my_progname,str); /* purecov: inspected */
- DBUG_RETURN(0);
+ DBUG_VOID_RETURN;
}
@@ -3127,6 +3064,7 @@ SHOW_VAR com_status_vars[]= {
{"replace", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE]), SHOW_LONG_STATUS},
{"replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS},
{"reset", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS},
+ {"resignal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESIGNAL]), SHOW_LONG_STATUS},
{"restore_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESTORE_TABLE]), SHOW_LONG_STATUS},
{"revoke", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE]), SHOW_LONG_STATUS},
{"revoke_all", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE_ALL]), SHOW_LONG_STATUS},
@@ -3135,12 +3073,12 @@ SHOW_VAR com_status_vars[]= {
{"savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SAVEPOINT]), SHOW_LONG_STATUS},
{"select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SELECT]), SHOW_LONG_STATUS},
{"set_option", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SET_OPTION]), SHOW_LONG_STATUS},
+ {"signal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SIGNAL]), SHOW_LONG_STATUS},
{"show_authors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_AUTHORS]), SHOW_LONG_STATUS},
{"show_binlog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS},
{"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
{"show_charsets", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS},
{"show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
- {"show_column_types", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLUMN_TYPES]), SHOW_LONG_STATUS},
{"show_contributors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS},
{"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
{"show_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_EVENT]), SHOW_LONG_STATUS},
@@ -3173,6 +3111,7 @@ SHOW_VAR com_status_vars[]= {
{"show_processlist", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROCESSLIST]), SHOW_LONG_STATUS},
{"show_profile", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROFILE]), SHOW_LONG_STATUS},
{"show_profiles", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROFILES]), SHOW_LONG_STATUS},
+ {"show_relaylog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_RELAYLOG_EVENTS]), SHOW_LONG_STATUS},
{"show_slave_hosts", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_HOSTS]), SHOW_LONG_STATUS},
{"show_slave_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_STAT]), SHOW_LONG_STATUS},
{"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
@@ -3257,10 +3196,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmake(glob_hostname, STRING_WITH_LEN("localhost"));
sql_print_warning("gethostname failed, using '%s' as hostname",
glob_hostname);
- strmake(pidfile_name, STRING_WITH_LEN("mysql"));
+ strmake(default_logfile_name, STRING_WITH_LEN("mysql"));
}
else
- strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+ strmake(default_logfile_name, glob_hostname,
+ sizeof(default_logfile_name)-5);
+
+ strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/*
@@ -3432,6 +3374,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
open_files_limit= files;
}
unireg_init(opt_specialflag); /* Set up extern variabels */
+ if (!(my_default_lc_messages=
+ my_locale_by_name(lc_messages)))
+ {
+ sql_print_error("Unknown locale: '%s'", lc_messages);
+ return 1;
+ }
+ global_system_variables.lc_messages= my_default_lc_messages;
if (init_errmessage()) /* Read error messages from file */
return 1;
init_client_errs();
@@ -3482,12 +3431,12 @@ static int init_common_variables(const char *conf_file_name, int argc,
default_collation= get_charset_by_name(default_collation_name, MYF(0));
if (!default_collation)
{
- sql_print_error(ER(ER_UNKNOWN_COLLATION), default_collation_name);
+ sql_print_error(ER_DEFAULT(ER_UNKNOWN_COLLATION), default_collation_name);
return 1;
}
if (!my_charset_same(default_charset_info, default_collation))
{
- sql_print_error(ER(ER_COLLATION_CHARSET_MISMATCH),
+ sql_print_error(ER_DEFAULT(ER_COLLATION_CHARSET_MISMATCH),
default_collation_name,
default_charset_info->csname);
return 1;
@@ -3539,7 +3488,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
if (opt_slow_log && opt_slow_logname && !(log_output_options & LOG_FILE)
&& !(log_output_options & LOG_NONE))
sql_print_warning("Although a path was specified for the "
- "--log_slow_queries option, log tables are used. "
+ "--log-slow-queries option, log tables are used. "
"To enable logging to files use the --log-output=file option.");
s= opt_logname ? opt_logname : make_default_log_name(buff, ".log");
@@ -3622,7 +3571,6 @@ static int init_thread_environment()
{
(void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_lock_db,MY_MUTEX_INIT_SLOW);
- (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_open, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
@@ -3633,14 +3581,13 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST);
- (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
- (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
(void) my_rwlock_init(&LOCK_system_variables_hash, NULL);
(void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_error_messages, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_connection_count, MY_MUTEX_INIT_FAST);
#ifdef HAVE_OPENSSL
@@ -3866,6 +3813,13 @@ static int init_server_components()
unireg_abort(1);
}
+ /* initialize delegates for extension observers */
+ if (delegates_init())
+ {
+ sql_print_error("Initialize extension delegates failed");
+ unireg_abort(1);
+ }
+
/* need to configure logging before initializing storage engines */
if (opt_update_log)
{
@@ -3924,17 +3878,17 @@ with --log-bin instead.");
}
if (opt_log_slave_updates && !opt_bin_log)
{
- sql_print_error("You need to use --log-bin to make "
+ sql_print_warning("You need to use --log-bin to make "
"--log-slave-updates work.");
- unireg_abort(1);
}
if (!opt_bin_log)
{
if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC)
{
- sql_print_error("You need to use --log-bin to make "
- "--binlog-format work.");
- unireg_abort(1);
+ sql_print_warning("You need to use --log-bin to make "
+ "--binlog-format work.");
+
+ global_system_variables.binlog_format= opt_binlog_format_id;
}
else
{
@@ -3956,11 +3910,17 @@ with --log-bin instead.");
#ifdef HAVE_REPLICATION
if (opt_log_slave_updates && replicate_same_server_id)
{
- sql_print_error("\
-using --replicate-same-server-id in conjunction with \
+ if (opt_bin_log)
+ {
+ sql_print_error("using --replicate-same-server-id in conjunction with \
--log-slave-updates is impossible, it would lead to infinite loops in this \
server.");
- unireg_abort(1);
+ unireg_abort(1);
+ }
+ else
+ sql_print_warning("using --replicate-same-server-id in conjunction with \
+--log-slave-updates would lead to infinite loops in this server. However this \
+will be ignored as the --log-bin option is not defined.");
}
#endif
@@ -4069,8 +4029,8 @@ a file name for --log-bin-index option", opt_binlog_index_name);
}
/* if the errmsg.sys is not loaded, terminate to maintain behaviour */
- if (!errmesg[0][0])
- unireg_abort(1);
+ if (!DEFAULT_ERRMSGS[0][0])
+ unireg_abort(1);
/* We have to initialize the storage engines before CSV logging */
if (ha_init())
@@ -4240,12 +4200,11 @@ static void create_shutdown_thread()
#endif /* EMBEDDED_LIBRARY */
-#if (defined(__NT__) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY)
+#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY)
static void handle_connections_methods()
{
pthread_t hThread;
DBUG_ENTER("handle_connections_methods");
-#ifdef __NT__
if (hPipe == INVALID_HANDLE_VALUE &&
(!have_tcpip || opt_disable_networking) &&
!opt_enable_shared_memory)
@@ -4253,12 +4212,10 @@ static void handle_connections_methods()
sql_print_error("TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS");
unireg_abort(1); // Will not return
}
-#endif
pthread_mutex_lock(&LOCK_thread_count);
(void) pthread_cond_init(&COND_handler_count,NULL);
handler_count=0;
-#ifdef __NT__
if (hPipe != INVALID_HANDLE_VALUE)
{
handler_count++;
@@ -4269,12 +4226,11 @@ static void handle_connections_methods()
handler_count--;
}
}
-#endif /* __NT__ */
if (have_tcpip && !opt_disable_networking)
{
handler_count++;
if (pthread_create(&hThread,&connection_attrib,
- handle_connections_sockets, 0))
+ handle_connections_sockets_thread, 0))
{
sql_print_warning("Can't create thread to handle TCP/IP");
handler_count--;
@@ -4309,7 +4265,7 @@ void decrement_handler_count()
}
#else
#define decrement_handler_count()
-#endif /* defined(__NT__) || defined(HAVE_SMEM) */
+#endif /* defined(_WIN32) || defined(HAVE_SMEM) */
#ifndef EMBEDDED_LIBRARY
@@ -4587,7 +4543,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
create_shutdown_thread();
start_handle_manager();
- sql_print_information(ER(ER_STARTUP),my_progname,server_version,
+ sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version,
((unix_sock == INVALID_SOCKET) ? (char*) ""
: mysqld_unix_port),
mysqld_port,
@@ -4603,18 +4559,11 @@ we force server id to 2, but this MySQL server will not act as a slave.");
pthread_cond_signal(&COND_server_started);
pthread_mutex_unlock(&LOCK_server_started);
-#if defined(__NT__) || defined(HAVE_SMEM)
+#if defined(_WIN32) || defined(HAVE_SMEM)
handle_connections_methods();
#else
-#ifdef __WIN__
- if (!have_tcpip || opt_disable_networking)
- {
- sql_print_error("TCP/IP unavailable or disabled with --skip-networking; no available interfaces");
- unireg_abort(1);
- }
-#endif
- handle_connections_sockets(0);
-#endif /* __NT__ */
+ handle_connections_sockets();
+#endif /* _WIN32 || HAVE_SMEM */
/* (void) pthread_attr_destroy(&connection_attrib); */
@@ -4987,7 +4936,7 @@ void create_thread_to_handle_connection(THD *thd)
/* Can't use my_error() since store_globals has not been called. */
my_snprintf(error_message_buff, sizeof(error_message_buff),
ER(ER_CANT_CREATE_THREAD), error);
- net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff);
+ net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL);
(void) pthread_mutex_lock(&LOCK_thread_count);
close_connection(thd,0,0);
delete thd;
@@ -5019,9 +4968,6 @@ static void create_new_thread(THD *thd)
NET *net=&thd->net;
DBUG_ENTER("create_new_thread");
- if (protocol_version > 9)
- net->return_errno=1;
-
/*
Don't allow too many connections. We roughly check here that we allow
only (max_connections + 1) connections.
@@ -5089,7 +5035,7 @@ inline void kill_broken_server()
/* Handle new connections and spawn new process to handle them */
#ifndef EMBEDDED_LIBRARY
-pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
+void handle_connections_sockets()
{
my_socket sock,new_sock;
uint error_count=0;
@@ -5292,13 +5238,19 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
create_new_thread(thd);
}
+ DBUG_VOID_RETURN;
+}
+
+#ifdef _WIN32
+pthread_handler_t handle_connections_sockets_thread(void *arg)
+{
+ my_thread_init();
+ handle_connections_sockets();
decrement_handler_count();
- DBUG_RETURN(0);
+ return 0;
}
-
-#ifdef __NT__
pthread_handler_t handle_connections_namedpipes(void *arg)
{
HANDLE hConnectedPipe;
@@ -5393,7 +5345,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg)
decrement_handler_count();
DBUG_RETURN(0);
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
#ifdef HAVE_SMEM
@@ -5739,6 +5691,7 @@ enum options_mysqld
OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER,
OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT,
OPT_RELAY_LOG_PURGE,
+ OPT_RELAY_LOG_RECOVERY,
OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
OPT_SLAVE_TRANS_RETRIES, OPT_READONLY, OPT_DEBUGGING,
OPT_SORT_BUFFER, OPT_TABLE_OPEN_CACHE, OPT_TABLE_DEF_CACHE,
@@ -5763,6 +5716,7 @@ enum options_mysqld
OPT_DEFAULT_COLLATION,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
OPT_CHARACTER_SET_FILESYSTEM,
+ OPT_LC_ERROR_MESSAGES,
OPT_LC_TIME_NAMES,
OPT_INIT_CONNECT,
OPT_INIT_SLAVE,
@@ -5806,7 +5760,10 @@ enum options_mysqld
OPT_SLAVE_EXEC_MODE,
OPT_GENERAL_LOG_FILE,
OPT_SLOW_QUERY_LOG_FILE,
- OPT_IGNORE_BUILTIN_INNODB
+ OPT_IGNORE_BUILTIN_INNODB,
+ OPT_SYNC_RELAY_LOG,
+ OPT_SYNC_RELAY_LOG_INFO,
+ OPT_SYNC_MASTER_INFO
};
@@ -5942,10 +5899,6 @@ struct my_option my_long_options[] =
"Set the default storage engine (table type) for tables.",
(uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"default-table-type", OPT_STORAGE_ENGINE,
- "(deprecated) Use --default-storage-engine.",
- (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.",
(uchar**) &default_tz_name, (uchar**) &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
@@ -5971,7 +5924,7 @@ struct my_option my_long_options[] =
"Deprecated option, use --external-locking instead.",
(uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef __NT__
+#ifdef _WIN32
{"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
(uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -6034,9 +5987,17 @@ Disable with --skip-super-large-pages.",
(uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"language", 'L',
- "Client error messages in given language. May be given as a full path.",
- (uchar**) &language_ptr, (uchar**) &language_ptr, 0, GET_STR, REQUIRED_ARG,
- 0, 0, 0, 0, 0, 0},
+ "Client error messages in given language. May be given as a full path. "
+ "Deprecated. Use --lc-messages-dir instead.",
+ (uchar**) &lc_messages_dir_ptr, (uchar**) &lc_messages_dir_ptr, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"lc-messages-dir", 'L',
+ "Directory where error messages are.", (uchar**) &lc_messages_dir_ptr,
+ (uchar**) &lc_messages_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"lc-messages", OPT_LC_ERROR_MESSAGES,
+ "Set the language used for the error messages.",
+ (uchar**) &lc_messages, (uchar**) &lc_messages, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0 },
{"lc-time-names", OPT_LC_TIME_NAMES,
"Set the language used for the month names and the days of the week.",
(uchar**) &lc_time_names_name,
@@ -6126,14 +6087,14 @@ Disable with --skip-super-large-pages.",
(uchar**) &opt_log_slow_slave_statements,
(uchar**) &opt_log_slow_slave_statements,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log_slow_queries", OPT_SLOW_QUERY_LOG,
- "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-queries", OPT_SLOW_QUERY_LOG,
+ "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.",
(uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
- {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE,
+ {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE,
"Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
(uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -6371,7 +6332,7 @@ master-ssl",
"Maximum time in seconds to wait for the port to become free. "
"(Default: no wait)", (uchar**) &mysqld_port_timeout,
(uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
{"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory",
(uchar**) &global_system_variables.profiling_history_size,
(uchar**) &max_system_variables.profiling_history_size,
@@ -6854,7 +6815,7 @@ The minimum value for this variable is 4096.",
(uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
{"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
- "Don't log queries which examine less than min_examined_row_limit rows to file.",
+ "Don't write queries to slow log that examine fewer than min_examined_row_limit rows.",
(uchar**) &global_system_variables.min_examined_row_limit,
(uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0},
@@ -7039,6 +7000,13 @@ The minimum value for this variable is 4096.",
(uchar**) &relay_log_purge,
(uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG,
1, 0, 1, 0, 1, 0},
+ {"relay_log_recovery", OPT_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.",
+ (uchar**) &relay_log_recovery,
+ (uchar**) &relay_log_recovery, 0, GET_BOOL, NO_ARG,
+ 0, 0, 1, 0, 1, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
"Maximum space to use for all relay logs.",
(uchar**) &relay_log_space_limit,
@@ -7073,8 +7041,23 @@ The minimum value for this variable is 4096.",
{"sync-binlog", OPT_SYNC_BINLOG,
"Synchronously flush binary log to disk after every #th event. "
"Use 0 (default) to disable synchronous flushing.",
- (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0},
+ (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
+ {"sync-relay-log", OPT_SYNC_RELAY_LOG,
+ "Synchronously flush relay log to disk after every #th event. "
+ "Use 0 (default) to disable synchronous flushing.",
+ (uchar**) &sync_relaylog_period, (uchar**) &sync_relaylog_period, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
+ {"sync-relay-log-info", OPT_SYNC_RELAY_LOG_INFO,
+ "Synchronously flush relay log info to disk after #th transaction. "
+ "Use 0 (default) to disable synchronous flushing.",
+ (uchar**) &sync_relayloginfo_period, (uchar**) &sync_relayloginfo_period, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
+ {"sync-master-info", OPT_SYNC_MASTER_INFO,
+ "Synchronously flush master info to disk after every #th event. "
+ "Use 0 (default) to disable synchronous flushing.",
+ (uchar**) &sync_masterinfo_period, (uchar**) &sync_masterinfo_period, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
(uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
0, 0, 0, 0},
@@ -7177,7 +7160,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff)
return 0;
}
-#ifdef COMMUNITY_SERVER
+#ifdef ENABLED_PROFILING
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_LONG;
@@ -7200,7 +7183,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
var->type= SHOW_MY_BOOL;
pthread_mutex_lock(&LOCK_active_mi);
var->value= buff;
- *((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running &&
+ *((my_bool *)buff)= (my_bool) (active_mi &&
+ active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT &&
active_mi->rli.slave_running);
pthread_mutex_unlock(&LOCK_active_mi);
return 0;
@@ -7226,6 +7210,40 @@ static int show_slave_retried_trans(THD *thd, SHOW_VAR *var, char *buff)
pthread_mutex_unlock(&LOCK_active_mi);
return 0;
}
+
+static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff)
+{
+ pthread_mutex_lock(&LOCK_active_mi);
+ if (active_mi)
+ {
+ var->type= SHOW_LONGLONG;
+ var->value= buff;
+ pthread_mutex_lock(&active_mi->rli.data_lock);
+ *((longlong *)buff)= active_mi->received_heartbeats;
+ pthread_mutex_unlock(&active_mi->rli.data_lock);
+ }
+ else
+ var->type= SHOW_UNDEF;
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return 0;
+}
+
+static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff)
+{
+ pthread_mutex_lock(&LOCK_active_mi);
+ if (active_mi)
+ {
+ var->type= SHOW_CHAR;
+ var->value= buff;
+ my_sprintf(buff, (buff, "%.3f",active_mi->heartbeat_period));
+ }
+ else
+ var->type= SHOW_UNDEF;
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return 0;
+}
+
+
#endif /* HAVE_REPLICATION */
static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff)
@@ -7590,6 +7608,8 @@ SHOW_VAR status_vars[]= {
{"Slave_open_temp_tables", (char*) &slave_open_temp_tables, SHOW_LONG},
#ifdef HAVE_REPLICATION
{"Slave_retried_transactions",(char*) &show_slave_retried_trans, SHOW_FUNC},
+ {"Slave_heartbeat_period", (char*) &show_heartbeat_period, SHOW_FUNC},
+ {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_FUNC},
{"Slave_running", (char*) &show_slave_running, SHOW_FUNC},
#endif
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
@@ -7635,7 +7655,7 @@ SHOW_VAR status_vars[]= {
{"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH},
{"Threads_running", (char*) &thread_running, SHOW_INT},
{"Uptime", (char*) &show_starttime, SHOW_FUNC},
-#ifdef COMMUNITY_SERVER
+#ifdef ENABLED_PROFILING
{"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC},
#endif
{NullS, NullS, SHOW_LONG}
@@ -7645,10 +7665,7 @@ SHOW_VAR status_vars[]= {
static void print_version(void)
{
set_server_version();
- /*
- Note: the instance manager keys off the string 'Ver' so it can find the
- version from the output of 'mysqld --version', so don't change it!
- */
+
printf("%s Ver %s for %s on %s (%s)\n",my_progname,
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
@@ -7765,7 +7782,6 @@ static int mysql_init_variables(void)
max_used_connections= slow_launch_threads = 0;
mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
prepared_stmt_count= 0;
- errmesg= 0;
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
bzero((uchar*) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
bzero((char *) &global_status_var, sizeof(global_status_var));
@@ -7798,7 +7814,7 @@ static int mysql_init_variables(void)
mysql_home_ptr= mysql_home;
pidfile_name_ptr= pidfile_name;
log_error_file_ptr= log_error_file;
- language_ptr= language;
+ lc_messages_dir_ptr= lc_messages_dir;
mysql_data_home= mysql_real_data_home;
thd_startup_options= (OPTION_AUTO_IS_NULL | OPTION_BIN_LOG |
OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES);
@@ -7823,7 +7839,6 @@ static int mysql_init_variables(void)
multi_keycache_init();
/* Set directory paths */
- strmake(language, LANGUAGE, sizeof(language)-1);
strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR),
sizeof(mysql_real_data_home)-1);
mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
@@ -7846,6 +7861,7 @@ static int mysql_init_variables(void)
default_collation_name= compiled_default_collation_name;
sys_charset_system.value= (char*) system_charset_info->csname;
character_set_filesystem_name= (char*) "binary";
+ lc_messages= (char*) "en_US";
lc_time_names_name= (char*) "en_US";
/* Set default values for some option variables */
default_storage_engine_str= (char*) "MyISAM";
@@ -7871,10 +7887,10 @@ static int mysql_init_variables(void)
"d:t:i:o,/tmp/mysqld.trace");
#endif
opt_error_log= IF_WIN(1,0);
-#ifdef COMMUNITY_SERVER
- have_community_features = SHOW_OPTION_YES;
+#ifdef ENABLED_PROFILING
+ have_profiling = SHOW_OPTION_YES;
#else
- have_community_features = SHOW_OPTION_NO;
+ have_profiling = SHOW_OPTION_NO;
#endif
global_system_variables.ndb_index_stat_enable=FALSE;
max_system_variables.ndb_index_stat_enable=TRUE;
@@ -7992,7 +8008,7 @@ mysqld_get_one_option(int optid,
default_collation_name= 0;
break;
case 'l':
- WARN_DEPRECATED(NULL, "7.0", "--log", "'--general_log'/'--general_log_file'");
+ WARN_DEPRECATED(NULL, "7.0", "--log", "'--general-log'/'--general-log-file'");
opt_log=1;
break;
case 'h':
@@ -8008,7 +8024,7 @@ mysqld_get_one_option(int optid,
sql_print_warning("Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", argument, mysqld_user);
break;
case 'L':
- strmake(language, argument, sizeof(language)-1);
+ strmake(lc_messages_dir, argument, sizeof(lc_messages_dir)-1);
break;
#ifdef HAVE_REPLICATION
case OPT_SLAVE_SKIP_ERRORS:
@@ -8166,7 +8182,8 @@ mysqld_get_one_option(int optid,
}
#endif /* HAVE_REPLICATION */
case (int) OPT_SLOW_QUERY_LOG:
- WARN_DEPRECATED(NULL, "7.0", "--log_slow_queries", "'--slow_query_log'/'--slow_query_log_file'");
+ WARN_DEPRECATED(NULL, "7.0", "--log-slow-queries",
+ "'--slow-query-log'/'--slow-query-log-file'");
opt_slow_log= 1;
break;
#ifdef WITH_CSV_STORAGE_ENGINE
@@ -8763,7 +8780,7 @@ static int fix_paths(void)
pos[0]= FN_LIBCHAR;
pos[1]= 0;
}
- convert_dirname(language,language,NullS);
+ convert_dirname(lc_messages_dir, lc_messages_dir, NullS);
convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS);
(void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
@@ -8784,7 +8801,7 @@ static int fix_paths(void)
else
strxnmov(buff,sizeof(buff)-1,mysql_home,sharedir,NullS);
convert_dirname(buff,buff,NullS);
- (void) my_load_path(language,language,buff);
+ (void) my_load_path(lc_messages_dir, lc_messages_dir, buff);
/* If --character-sets-dir isn't given, use shared library dir */
if (charsets_dir != mysql_charsets_dir)
@@ -8994,9 +9011,7 @@ void refresh_status(THD *thd)
/* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters);
-#ifdef COMMUNITY_SERVER
flush_status_time= time((time_t*) 0);
-#endif
pthread_mutex_unlock(&LOCK_status);
/*
diff --git a/sql/mysqld_suffix.h b/sql/mysqld_suffix.h
index 654d7cf88c1..c7ab212f2a2 100644
--- a/sql/mysqld_suffix.h
+++ b/sql/mysqld_suffix.h
@@ -1,3 +1,6 @@
+#ifndef MYSQLD_SUFFIX_INCLUDED
+#define MYSQLD_SUFFIX_INCLUDED
+
/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -27,3 +30,4 @@
#else
#define MYSQL_SERVER_SUFFIX_STR MYSQL_SERVER_SUFFIX_DEF
#endif
+#endif /* MYSQLD_SUFFIX_INCLUDED */
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 7ff26c50afc..5cf3597c638 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -91,12 +91,11 @@ void sql_print_error(const char *format,...);
*/
extern uint test_flags;
extern ulong bytes_sent, bytes_received, net_big_packet_count;
-extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
#ifndef MYSQL_INSTANCE_MANAGER
#ifdef HAVE_QUERY_CACHE
#define USE_QUERY_CACHE
-extern void query_cache_init_query(NET *net);
-extern void query_cache_insert(NET *net, const char *packet, ulong length);
+extern void query_cache_insert(const char *packet, ulong length,
+ unsigned pkt_nr);
#endif // HAVE_QUERY_CACHE
#define update_statistics(A) A
#endif /* MYSQL_INSTANCE_MANGER */
@@ -125,18 +124,14 @@ my_bool my_net_init(NET *net, Vio* vio)
MYF(MY_WME))))
DBUG_RETURN(1);
net->buff_end=net->buff+net->max_packet;
- net->error=0; net->return_errno=0; net->return_status=0;
+ net->error=0; net->return_status=0;
net->pkt_nr=net->compress_pkt_nr=0;
net->write_pos=net->read_pos = net->buff;
net->last_error[0]=0;
net->compress=0; net->reading_or_writing=0;
net->where_b = net->remain_in_buf=0;
net->last_errno=0;
-#ifdef USE_QUERY_CACHE
- query_cache_init_query(net);
-#else
- net->query_cache_query= 0;
-#endif
+ net->unused= 0;
if (vio != 0) /* If real connection */
{
@@ -586,7 +581,7 @@ net_real_write(NET *net,const uchar *packet, size_t len)
DBUG_ENTER("net_real_write");
#if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE)
- query_cache_insert(net, (char*) packet, len);
+ query_cache_insert((char*) packet, len, net->pkt_nr);
#endif
if (net->error == 2)
diff --git a/sql/nt_servc.h b/sql/nt_servc.h
index 2f0d07df543..5bee42dedf0 100644
--- a/sql/nt_servc.h
+++ b/sql/nt_servc.h
@@ -1,3 +1,6 @@
+#ifndef NT_SERVC_INCLUDED
+#define NT_SERVC_INCLUDED
+
/**
@file
@@ -98,3 +101,5 @@ class NTService
};
/* ------------------------- the end -------------------------------------- */
+
+#endif /* NT_SERVC_INCLUDED */
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 94204962345..ac5b1f575de 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -438,8 +438,19 @@ public:
return 0;
}
- /* returns a number of keypart values appended to the key buffer */
- int store_min_key(KEY_PART *key, uchar **range_key, uint *range_key_flag)
+ /*
+ Returns a number of keypart values appended to the key buffer
+ for min key and max key. This function is used by both Range
+ Analysis and Partition pruning. For partition pruning we have
+ to ensure that we don't store also subpartition fields. Thus
+ we have to stop at the last partition part and not step into
+ the subpartition fields. For Range Analysis we set last_part
+ to MAX_KEY which we should never reach.
+ */
+ int store_min_key(KEY_PART *key,
+ uchar **range_key,
+ uint *range_key_flag,
+ uint last_part)
{
SEL_ARG *key_tree= first();
uint res= key_tree->store_min(key[key_tree->part].store_length,
@@ -447,15 +458,21 @@ public:
*range_key_flag|= key_tree->min_flag;
if (key_tree->next_key_part &&
key_tree->next_key_part->type == SEL_ARG::KEY_RANGE &&
+ key_tree->part != last_part &&
key_tree->next_key_part->part == key_tree->part+1 &&
!(*range_key_flag & (NO_MIN_RANGE | NEAR_MIN)))
- res+= key_tree->next_key_part->store_min_key(key, range_key,
- range_key_flag);
+ res+= key_tree->next_key_part->store_min_key(key,
+ range_key,
+ range_key_flag,
+ last_part);
return res;
}
/* returns a number of keypart values appended to the key buffer */
- int store_max_key(KEY_PART *key, uchar **range_key, uint *range_key_flag)
+ int store_max_key(KEY_PART *key,
+ uchar **range_key,
+ uint *range_key_flag,
+ uint last_part)
{
SEL_ARG *key_tree= last();
uint res=key_tree->store_max(key[key_tree->part].store_length,
@@ -463,10 +480,13 @@ public:
(*range_key_flag)|= key_tree->max_flag;
if (key_tree->next_key_part &&
key_tree->next_key_part->type == SEL_ARG::KEY_RANGE &&
+ key_tree->part != last_part &&
key_tree->next_key_part->part == key_tree->part+1 &&
!(*range_key_flag & (NO_MAX_RANGE | NEAR_MAX)))
- res+= key_tree->next_key_part->store_max_key(key, range_key,
- range_key_flag);
+ res+= key_tree->next_key_part->store_max_key(key,
+ range_key,
+ range_key_flag,
+ last_part);
return res;
}
@@ -634,6 +654,14 @@ public:
using_real_indexes==TRUE
*/
uint real_keynr[MAX_KEY];
+
+ /*
+ Used to store 'current key tuples', in both range analysis and
+ partitioning (list) analysis
+ */
+ uchar min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
+ max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+
/* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */
uint alloced_sel_args;
};
@@ -645,8 +673,6 @@ public:
longlong baseflag;
uint max_key_part, range_count;
- uchar min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
- max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
bool quick; // Don't calulate possible keys
uint fields_bitmap_size;
@@ -708,7 +734,8 @@ static
TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
double read_time);
static
-TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree);
+TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree,
+ double read_time);
static double get_index_only_read_time(const PARAM* param, ha_rows records,
int keynr);
@@ -2050,7 +2077,7 @@ public:
class TRP_GROUP_MIN_MAX : public TABLE_READ_PLAN
{
private:
- bool have_min, have_max;
+ bool have_min, have_max, have_agg_distinct;
KEY_PART_INFO *min_max_arg_part;
uint group_prefix_len;
uint used_key_parts;
@@ -2062,11 +2089,13 @@ private:
SEL_TREE *range_tree; /* Represents all range predicates in the query. */
SEL_ARG *index_tree; /* The SEL_ARG sub-tree corresponding to index_info. */
uint param_idx; /* Index of used key in param->key. */
- /* Number of records selected by the ranges in index_tree. */
+ bool is_index_scan; /* Use index_next() instead of random read */
public:
+ /* Number of records selected by the ranges in index_tree. */
ha_rows quick_prefix_records;
public:
- TRP_GROUP_MIN_MAX(bool have_min_arg, bool have_max_arg,
+ TRP_GROUP_MIN_MAX(bool have_min_arg, bool have_max_arg,
+ bool have_agg_distinct_arg,
KEY_PART_INFO *min_max_arg_part_arg,
uint group_prefix_len_arg, uint used_key_parts_arg,
uint group_key_parts_arg, KEY *index_info_arg,
@@ -2075,11 +2104,12 @@ public:
SEL_TREE *tree_arg, SEL_ARG *index_tree_arg,
uint param_idx_arg, ha_rows quick_prefix_records_arg)
: have_min(have_min_arg), have_max(have_max_arg),
+ have_agg_distinct(have_agg_distinct_arg),
min_max_arg_part(min_max_arg_part_arg),
group_prefix_len(group_prefix_len_arg), used_key_parts(used_key_parts_arg),
group_key_parts(group_key_parts_arg), index_info(index_info_arg),
index(index_arg), key_infix_len(key_infix_len_arg), range_tree(tree_arg),
- index_tree(index_tree_arg), param_idx(param_idx_arg),
+ index_tree(index_tree_arg), param_idx(param_idx_arg), is_index_scan(FALSE),
quick_prefix_records(quick_prefix_records_arg)
{
if (key_infix_len)
@@ -2089,6 +2119,7 @@ public:
QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows,
MEM_ROOT *parent_alloc);
+ void use_index_scan() { is_index_scan= TRUE; }
};
@@ -2350,7 +2381,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
Try to construct a QUICK_GROUP_MIN_MAX_SELECT.
Notice that it can be constructed no matter if there is a range tree.
*/
- group_trp= get_best_group_min_max(&param, tree);
+ group_trp= get_best_group_min_max(&param, tree, best_read_time);
if (group_trp)
{
param.table->quick_condition_rows= min(group_trp->records,
@@ -2600,6 +2631,8 @@ typedef struct st_part_prune_param
/* Same as above for subpartitioning */
my_bool *is_subpart_keypart;
+ my_bool ignore_part_fields; /* Ignore rest of partioning fields */
+
/***************************************************************
Following fields form find_used_partitions() recursion context:
**************************************************************/
@@ -2613,8 +2646,13 @@ typedef struct st_part_prune_param
/* Iterator to be used to obtain the "current" set of used partitions */
PARTITION_ITERATOR part_iter;
- /* Initialized bitmap of no_subparts size */
+ /* Initialized bitmap of num_subparts size */
MY_BITMAP subparts_bitmap;
+
+ uchar *cur_min_key;
+ uchar *cur_max_key;
+
+ uint cur_min_flag, cur_max_flag;
} PART_PRUNE_PARAM;
static bool create_partition_index_description(PART_PRUNE_PARAM *prune_par);
@@ -2732,6 +2770,11 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
prune_param.arg_stack_end= prune_param.arg_stack;
prune_param.cur_part_fields= 0;
prune_param.cur_subpart_fields= 0;
+
+ prune_param.cur_min_key= prune_param.range_param.min_key;
+ prune_param.cur_max_key= prune_param.range_param.max_key;
+ prune_param.cur_min_flag= prune_param.cur_max_flag= 0;
+
init_all_partitions_iterator(part_info, &prune_param.part_iter);
if (!tree->keys[0] || (-1 == (res= find_used_partitions(&prune_param,
tree->keys[0]))))
@@ -2869,8 +2912,8 @@ static void mark_full_partition_used_no_parts(partition_info* part_info,
static void mark_full_partition_used_with_parts(partition_info *part_info,
uint32 part_id)
{
- uint32 start= part_id * part_info->no_subparts;
- uint32 end= start + part_info->no_subparts;
+ uint32 start= part_id * part_info->num_subparts;
+ uint32 end= start + part_info->num_subparts;
DBUG_ENTER("mark_full_partition_used_with_parts");
for (; start != end; start++)
@@ -2968,6 +3011,11 @@ int find_used_partitions_imerge(PART_PRUNE_PARAM *ppar, SEL_IMERGE *imerge)
ppar->arg_stack_end= ppar->arg_stack;
ppar->cur_part_fields= 0;
ppar->cur_subpart_fields= 0;
+
+ ppar->cur_min_key= ppar->range_param.min_key;
+ ppar->cur_max_key= ppar->range_param.max_key;
+ ppar->cur_min_flag= ppar->cur_max_flag= 0;
+
init_all_partitions_iterator(ppar->part_info, &ppar->part_iter);
SEL_ARG *key_tree= (*ptree)->keys[0];
if (!key_tree || (-1 == (res |= find_used_partitions(ppar, key_tree))))
@@ -3091,9 +3139,14 @@ static
int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
{
int res, left_res=0, right_res=0;
- int partno= (int)key_tree->part;
- bool pushed= FALSE;
+ int key_tree_part= (int)key_tree->part;
bool set_full_part_if_bad_ret= FALSE;
+ bool ignore_part_fields= ppar->ignore_part_fields;
+ bool did_set_ignore_part_fields= FALSE;
+ RANGE_OPT_PARAM *range_par= &(ppar->range_param);
+
+ if (check_stack_overrun(range_par->thd, 3*STACK_MIN_SIZE, NULL))
+ return -1;
if (key_tree->left != &null_element)
{
@@ -3101,56 +3154,177 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
return -1;
}
+ /* Push SEL_ARG's to stack to enable looking backwards as well */
+ ppar->cur_part_fields+= ppar->is_part_keypart[key_tree_part];
+ ppar->cur_subpart_fields+= ppar->is_subpart_keypart[key_tree_part];
+ *(ppar->arg_stack_end++)= key_tree;
+
if (key_tree->type == SEL_ARG::KEY_RANGE)
{
- if (partno == 0 && (NULL != ppar->part_info->get_part_iter_for_interval))
+ if (ppar->part_info->get_part_iter_for_interval &&
+ key_tree->part <= ppar->last_part_partno)
{
- /*
- Partitioning is done by RANGE|INTERVAL(monotonic_expr(fieldX)), and
- we got "const1 CMP fieldX CMP const2" interval <-- psergey-todo: change
+ if (ignore_part_fields)
+ {
+ /*
+ We come here when a condition on the first partitioning
+ fields led to evaluating the partitioning condition
+ (due to finding a condition of the type a < const or
+ b > const). Thus we must ignore the rest of the
+ partitioning fields but we still want to analyse the
+ subpartitioning fields.
+ */
+ if (key_tree->next_key_part)
+ res= find_used_partitions(ppar, key_tree->next_key_part);
+ else
+ res= -1;
+ goto pop_and_go_right;
+ }
+ /* Collect left and right bound, their lengths and flags */
+ uchar *min_key= ppar->cur_min_key;
+ uchar *max_key= ppar->cur_max_key;
+ uchar *tmp_min_key= min_key;
+ uchar *tmp_max_key= max_key;
+ key_tree->store_min(ppar->key[key_tree->part].store_length,
+ &tmp_min_key, ppar->cur_min_flag);
+ key_tree->store_max(ppar->key[key_tree->part].store_length,
+ &tmp_max_key, ppar->cur_max_flag);
+ uint flag;
+ if (key_tree->next_key_part &&
+ key_tree->next_key_part->part == key_tree->part+1 &&
+ key_tree->next_key_part->part <= ppar->last_part_partno &&
+ key_tree->next_key_part->type == SEL_ARG::KEY_RANGE)
+ {
+ /*
+ There are more key parts for partition pruning to handle
+ This mainly happens when the condition is an equality
+ condition.
+ */
+ if ((tmp_min_key - min_key) == (tmp_max_key - max_key) &&
+ (memcmp(min_key, max_key, (uint)(tmp_max_key - max_key)) == 0) &&
+ !key_tree->min_flag && !key_tree->max_flag)
+ {
+ /* Set 'parameters' */
+ ppar->cur_min_key= tmp_min_key;
+ ppar->cur_max_key= tmp_max_key;
+ uint save_min_flag= ppar->cur_min_flag;
+ uint save_max_flag= ppar->cur_max_flag;
+
+ ppar->cur_min_flag|= key_tree->min_flag;
+ ppar->cur_max_flag|= key_tree->max_flag;
+
+ res= find_used_partitions(ppar, key_tree->next_key_part);
+
+ /* Restore 'parameters' back */
+ ppar->cur_min_key= min_key;
+ ppar->cur_max_key= max_key;
+
+ ppar->cur_min_flag= save_min_flag;
+ ppar->cur_max_flag= save_max_flag;
+ goto pop_and_go_right;
+ }
+ /* We have arrived at the last field in the partition pruning */
+ uint tmp_min_flag= key_tree->min_flag,
+ tmp_max_flag= key_tree->max_flag;
+ if (!tmp_min_flag)
+ key_tree->next_key_part->store_min_key(ppar->key,
+ &tmp_min_key,
+ &tmp_min_flag,
+ ppar->last_part_partno);
+ if (!tmp_max_flag)
+ key_tree->next_key_part->store_max_key(ppar->key,
+ &tmp_max_key,
+ &tmp_max_flag,
+ ppar->last_part_partno);
+ flag= tmp_min_flag | tmp_max_flag;
+ }
+ else
+ flag= key_tree->min_flag | key_tree->max_flag;
+
+ if (tmp_min_key != range_par->min_key)
+ flag&= ~NO_MIN_RANGE;
+ else
+ flag|= NO_MIN_RANGE;
+ if (tmp_max_key != range_par->max_key)
+ flag&= ~NO_MAX_RANGE;
+ else
+ flag|= NO_MAX_RANGE;
+
+ /*
+ We need to call the interval mapper if we have a condition which
+ makes sense to prune on. In the example of COLUMNS on a and
+ b it makes sense if we have a condition on a, or conditions on
+ both a and b. If we only have conditions on b it might make sense
+ but this is a harder case we will solve later. For the harder case
+ this clause then turns into use of all partitions and thus we
+ simply set res= -1 as if the mapper had returned that.
+ TODO: What to do here is defined in WL#4065.
*/
- DBUG_EXECUTE("info", dbug_print_segment_range(key_tree,
- ppar->range_param.
- key_parts););
- res= ppar->part_info->
- get_part_iter_for_interval(ppar->part_info,
- FALSE,
- key_tree->min_value,
- key_tree->max_value,
- key_tree->min_flag | key_tree->max_flag,
- &ppar->part_iter);
- if (!res)
- goto go_right; /* res==0 --> no satisfying partitions */
+ if (ppar->arg_stack[0]->part == 0)
+ {
+ uint32 i;
+ uint32 store_length_array[MAX_KEY];
+ uint32 num_keys= ppar->part_fields;
+
+ for (i= 0; i < num_keys; i++)
+ store_length_array[i]= ppar->key[i].store_length;
+ res= ppar->part_info->
+ get_part_iter_for_interval(ppar->part_info,
+ FALSE,
+ store_length_array,
+ range_par->min_key,
+ range_par->max_key,
+ tmp_min_key - range_par->min_key,
+ tmp_max_key - range_par->max_key,
+ flag,
+ &ppar->part_iter);
+ if (!res)
+ goto pop_and_go_right; /* res==0 --> no satisfying partitions */
+ }
+ else
+ res= -1;
+
if (res == -1)
{
- //get a full range iterator
+ /* get a full range iterator */
init_all_partitions_iterator(ppar->part_info, &ppar->part_iter);
}
/*
Save our intent to mark full partition as used if we will not be able
to obtain further limits on subpartitions
*/
+ if (key_tree_part < ppar->last_part_partno)
+ {
+ /*
+ We need to ignore the rest of the partitioning fields in all
+ evaluations after this
+ */
+ did_set_ignore_part_fields= TRUE;
+ ppar->ignore_part_fields= TRUE;
+ }
set_full_part_if_bad_ret= TRUE;
goto process_next_key_part;
}
- if (partno == ppar->last_subpart_partno &&
+ if (key_tree_part == ppar->last_subpart_partno &&
(NULL != ppar->part_info->get_subpart_iter_for_interval))
{
PARTITION_ITERATOR subpart_iter;
DBUG_EXECUTE("info", dbug_print_segment_range(key_tree,
- ppar->range_param.
- key_parts););
+ range_par->key_parts););
res= ppar->part_info->
get_subpart_iter_for_interval(ppar->part_info,
TRUE,
+ NULL, /* Currently not used here */
key_tree->min_value,
key_tree->max_value,
- key_tree->min_flag | key_tree->max_flag,
+ 0, 0, /* Those are ignored here */
+ key_tree->min_flag |
+ key_tree->max_flag,
&subpart_iter);
DBUG_ASSERT(res); /* We can't get "no satisfying subpartitions" */
if (res == -1)
- return -1; /* all subpartitions satisfy */
+ goto pop_and_go_right; /* all subpartitions satisfy */
uint32 subpart_id;
bitmap_clear_all(&ppar->subparts_bitmap);
@@ -3163,23 +3337,19 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
while ((part_id= ppar->part_iter.get_next(&ppar->part_iter)) !=
NOT_A_PARTITION_ID)
{
- for (uint i= 0; i < ppar->part_info->no_subparts; i++)
+ for (uint i= 0; i < ppar->part_info->num_subparts; i++)
if (bitmap_is_set(&ppar->subparts_bitmap, i))
bitmap_set_bit(&ppar->part_info->used_partitions,
- part_id * ppar->part_info->no_subparts + i);
+ part_id * ppar->part_info->num_subparts + i);
}
- goto go_right;
+ goto pop_and_go_right;
}
if (key_tree->is_singlepoint())
{
- pushed= TRUE;
- ppar->cur_part_fields+= ppar->is_part_keypart[partno];
- ppar->cur_subpart_fields+= ppar->is_subpart_keypart[partno];
- *(ppar->arg_stack_end++) = key_tree;
-
- if (partno == ppar->last_part_partno &&
- ppar->cur_part_fields == ppar->part_fields)
+ if (key_tree_part == ppar->last_part_partno &&
+ ppar->cur_part_fields == ppar->part_fields &&
+ ppar->part_info->get_part_iter_for_interval == NULL)
{
/*
Ok, we've got "fieldN<=>constN"-type SEL_ARGs for all partitioning
@@ -3208,7 +3378,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
goto process_next_key_part;
}
- if (partno == ppar->last_subpart_partno &&
+ if (key_tree_part == ppar->last_subpart_partno &&
ppar->cur_subpart_fields == ppar->subpart_fields)
{
/*
@@ -3232,7 +3402,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
NOT_A_PARTITION_ID)
{
bitmap_set_bit(&part_info->used_partitions,
- part_id * part_info->no_subparts + subpart_id);
+ part_id * part_info->num_subparts + subpart_id);
}
res= 1; /* Some partitions were marked as used */
goto pop_and_go_right;
@@ -3245,8 +3415,11 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
we're processing subpartititoning's key parts, this means we'll not be
able to infer any suitable condition, so bail out.
*/
- if (partno >= ppar->last_part_partno)
- return -1;
+ if (key_tree_part >= ppar->last_part_partno)
+ {
+ res= -1;
+ goto pop_and_go_right;
+ }
}
}
@@ -3255,7 +3428,17 @@ process_next_key_part:
res= find_used_partitions(ppar, key_tree->next_key_part);
else
res= -1;
-
+
+ if (did_set_ignore_part_fields)
+ {
+ /*
+ We have returned from processing all key trees linked to our next
+ key part. We are ready to be moving down (using right pointers) and
+ this tree is a new evaluation requiring its own decision on whether
+ to ignore partitioning fields.
+ */
+ ppar->ignore_part_fields= FALSE;
+ }
if (set_full_part_if_bad_ret)
{
if (res == -1)
@@ -3278,18 +3461,14 @@ process_next_key_part:
init_all_partitions_iterator(ppar->part_info, &ppar->part_iter);
}
- if (pushed)
- {
pop_and_go_right:
- /* Pop this key part info off the "stack" */
- ppar->arg_stack_end--;
- ppar->cur_part_fields-= ppar->is_part_keypart[partno];
- ppar->cur_subpart_fields-= ppar->is_subpart_keypart[partno];
- }
+ /* Pop this key part info off the "stack" */
+ ppar->arg_stack_end--;
+ ppar->cur_part_fields-= ppar->is_part_keypart[key_tree_part];
+ ppar->cur_subpart_fields-= ppar->is_subpart_keypart[key_tree_part];
if (res == -1)
return -1;
-go_right:
if (key_tree->right != &null_element)
{
if (-1 == (right_res= find_used_partitions(ppar,key_tree->right)))
@@ -3371,13 +3550,14 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
uint used_part_fields, used_subpart_fields;
used_part_fields= fields_ok_for_partition_index(part_info->part_field_array) ?
- part_info->no_part_fields : 0;
+ part_info->num_part_fields : 0;
used_subpart_fields=
fields_ok_for_partition_index(part_info->subpart_field_array)?
- part_info->no_subpart_fields : 0;
+ part_info->num_subpart_fields : 0;
uint total_parts= used_part_fields + used_subpart_fields;
+ ppar->ignore_part_fields= FALSE;
ppar->part_fields= used_part_fields;
ppar->last_part_partno= (int)used_part_fields - 1;
@@ -3412,10 +3592,10 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
if (ppar->subpart_fields)
{
my_bitmap_map *buf;
- uint32 bufsize= bitmap_buffer_size(ppar->part_info->no_subparts);
+ uint32 bufsize= bitmap_buffer_size(ppar->part_info->num_subparts);
if (!(buf= (my_bitmap_map*) alloc_root(alloc, bufsize)))
return TRUE;
- bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->no_subparts,
+ bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->num_subparts,
FALSE);
}
range_par->key_parts= key_part;
@@ -3426,12 +3606,8 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
{
key_part->key= 0;
key_part->part= part;
- key_part->store_length= key_part->length= (uint16) (*field)->key_length();
- if ((*field)->real_maybe_null())
- key_part->store_length+= HA_KEY_NULL_LENGTH;
- if ((*field)->type() == MYSQL_TYPE_BLOB ||
- (*field)->real_type() == MYSQL_TYPE_VARCHAR)
- key_part->store_length+= HA_KEY_BLOB_LENGTH;
+ key_part->length= (uint16)(*field)->key_length();
+ key_part->store_length= (uint16)get_partition_field_store_length(*field);
DBUG_PRINT("info", ("part %u length %u store_length %u", part,
key_part->length, key_part->store_length));
@@ -5707,7 +5883,8 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
value->result_type() == STRING_RESULT &&
key_part->image_type == Field::itRAW &&
((Field_str*)field)->charset() != conf_func->compare_collation() &&
- !(conf_func->compare_collation()->state & MY_CS_BINSORT))
+ !(conf_func->compare_collation()->state & MY_CS_BINSORT &&
+ (type == Item_func::EQUAL_FUNC || type == Item_func::EQ_FUNC)))
goto end;
if (key_part->image_type == Field::itMBR)
@@ -7608,12 +7785,16 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
tmp_max_flag=key_tree->max_flag;
if (!tmp_min_flag)
tmp_min_keypart+=
- key_tree->next_key_part->store_min_key(param->key[idx], &tmp_min_key,
- &tmp_min_flag);
+ key_tree->next_key_part->store_min_key(param->key[idx],
+ &tmp_min_key,
+ &tmp_min_flag,
+ MAX_KEY);
if (!tmp_max_flag)
tmp_max_keypart+=
- key_tree->next_key_part->store_max_key(param->key[idx], &tmp_max_key,
- &tmp_max_flag);
+ key_tree->next_key_part->store_max_key(param->key[idx],
+ &tmp_max_key,
+ &tmp_max_flag,
+ MAX_KEY);
min_key_length= (uint) (tmp_min_key - param->min_key);
max_key_length= (uint) (tmp_max_key - param->max_key);
}
@@ -7883,11 +8064,15 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
{
uint tmp_min_flag=key_tree->min_flag,tmp_max_flag=key_tree->max_flag;
if (!tmp_min_flag)
- min_part+= key_tree->next_key_part->store_min_key(key, &tmp_min_key,
- &tmp_min_flag);
+ min_part+= key_tree->next_key_part->store_min_key(key,
+ &tmp_min_key,
+ &tmp_min_flag,
+ MAX_KEY);
if (!tmp_max_flag)
- max_part+= key_tree->next_key_part->store_max_key(key, &tmp_max_key,
- &tmp_max_flag);
+ max_part+= key_tree->next_key_part->store_max_key(key,
+ &tmp_max_key,
+ &tmp_max_flag,
+ MAX_KEY);
flag=tmp_min_flag | tmp_max_flag;
}
}
@@ -9180,15 +9365,10 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
double *read_cost, ha_rows *records);
-/*
+/**
Test if this access method is applicable to a GROUP query with MIN/MAX
functions, and if so, construct a new TRP object.
- SYNOPSIS
- get_best_group_min_max()
- param Parameter from test_quick_select
- sel_tree Range tree generated by get_mm_tree
-
DESCRIPTION
Test whether a query can be computed via a QUICK_GROUP_MIN_MAX_SELECT.
Queries computable via a QUICK_GROUP_MIN_MAX_SELECT must satisfy the
@@ -9299,17 +9479,16 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
- Lift the limitation in condition (B3), that is, make this access method
applicable to ROLLUP queries.
- RETURN
- If mem_root != NULL
- - valid TRP_GROUP_MIN_MAX object if this QUICK class can be used for
- the query
- - NULL o/w.
- If mem_root == NULL
- - NULL
+ @param param Parameter from test_quick_select
+ @param sel_tree Range tree generated by get_mm_tree
+ @param read_time Best read time so far (=table/index scan time)
+ @return table read plan
+ @retval NULL Loose index scan not applicable or mem_root == NULL
+ @retval !NULL Loose index scan table read plan
*/
static TRP_GROUP_MIN_MAX *
-get_best_group_min_max(PARAM *param, SEL_TREE *tree)
+get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time)
{
THD *thd= param->thd;
JOIN *join= thd->lex->current_select->join;
@@ -9330,25 +9509,33 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
ORDER *tmp_group;
Item *item;
Item_field *item_field;
+ bool is_agg_distinct;
+ List<Item_field> agg_distinct_flds;
+
DBUG_ENTER("get_best_group_min_max");
/* Perform few 'cheap' tests whether this access method is applicable. */
if (!join)
DBUG_RETURN(NULL); /* This is not a select statement. */
if ((join->tables != 1) || /* The query must reference one table. */
- ((!join->group_list) && /* Neither GROUP BY nor a DISTINCT query. */
- (!join->select_distinct)) ||
(join->select_lex->olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */
DBUG_RETURN(NULL);
if (table->s->keys == 0) /* There are no indexes to use. */
DBUG_RETURN(NULL);
- /* Analyze the query in more detail. */
- List_iterator<Item> select_items_it(join->fields_list);
-
/* Check (SA1,SA4) and store the only MIN/MAX argument - the C attribute.*/
if (join->make_sum_func_list(join->all_fields, join->fields_list, 1))
DBUG_RETURN(NULL);
+
+ List_iterator<Item> select_items_it(join->fields_list);
+ is_agg_distinct = is_indexed_agg_distinct(join, &agg_distinct_flds);
+
+ if ((!join->group_list) && /* Neither GROUP BY nor a DISTINCT query. */
+ (!join->select_distinct) &&
+ !is_agg_distinct)
+ DBUG_RETURN(NULL);
+ /* Analyze the query in more detail. */
+
if (join->sum_funcs[0])
{
Item_sum *min_max_item;
@@ -9359,6 +9546,10 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
have_min= TRUE;
else if (min_max_item->sum_func() == Item_sum::MAX_FUNC)
have_max= TRUE;
+ else if (min_max_item->sum_func() == Item_sum::COUNT_DISTINCT_FUNC ||
+ min_max_item->sum_func() == Item_sum::SUM_DISTINCT_FUNC ||
+ min_max_item->sum_func() == Item_sum::AVG_DISTINCT_FUNC)
+ continue;
else
DBUG_RETURN(NULL);
@@ -9375,13 +9566,12 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
DBUG_RETURN(NULL);
}
}
-
/* Check (SA5). */
if (join->select_distinct)
{
while ((item= select_items_it++))
{
- if (item->type() != Item::FIELD_ITEM)
+ if (item->real_item()->type() != Item::FIELD_ITEM)
DBUG_RETURN(NULL);
}
}
@@ -9389,7 +9579,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
/* Check (GA4) - that there are no expressions among the group attributes. */
for (tmp_group= join->group_list; tmp_group; tmp_group= tmp_group->next)
{
- if ((*tmp_group->item)->type() != Item::FIELD_ITEM)
+ if ((*tmp_group->item)->real_item()->type() != Item::FIELD_ITEM)
DBUG_RETURN(NULL);
}
@@ -9408,6 +9598,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
uint best_param_idx= 0;
const uint pk= param->table->s->primary_key;
+ uint max_key_part;
SEL_ARG *cur_index_tree= NULL;
ha_rows cur_quick_prefix_records= 0;
uint cur_param_idx=MAX_KEY;
@@ -9461,6 +9652,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
}
}
+ max_key_part= 0;
+ used_key_parts_map.clear_all();
/*
Check (GA1) for GROUP BY queries.
*/
@@ -9484,6 +9677,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
{
cur_group_prefix_len+= cur_part->store_length;
++cur_group_key_parts;
+ max_key_part= cur_part - cur_index_info->key_part + 1;
+ used_key_parts_map.set_bit(max_key_part);
}
else
goto next_index;
@@ -9497,14 +9692,26 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
Later group_fields_array of ORDER objects is used to convert the query
to a GROUP query.
*/
- else if (join->select_distinct)
+ if ((!join->group_list && join->select_distinct) ||
+ is_agg_distinct)
{
- select_items_it.rewind();
- used_key_parts_map.clear_all();
- uint max_key_part= 0;
- while ((item= select_items_it++))
+ if (!is_agg_distinct)
{
- item_field= (Item_field*) item; /* (SA5) already checked above. */
+ select_items_it.rewind();
+ }
+
+ List_iterator<Item_field> agg_distinct_flds_it (agg_distinct_flds);
+ while (NULL != (item = (is_agg_distinct ?
+ (Item *) agg_distinct_flds_it++ : select_items_it++)))
+ {
+ /* (SA5) already checked above. */
+ item_field= (Item_field*) item->real_item();
+ DBUG_ASSERT(item->real_item()->type() == Item::FIELD_ITEM);
+
+ /* not doing loose index scan for derived tables */
+ if (!item_field->field)
+ goto next_index;
+
/* Find the order of the key part in the index. */
key_part_nr= get_field_keypart(cur_index_info, item_field->field);
/*
@@ -9513,7 +9720,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
*/
if (used_key_parts_map.is_set(key_part_nr))
continue;
- if (key_part_nr < 1 || key_part_nr > join->fields_list.elements)
+ if (key_part_nr < 1 ||
+ (!is_agg_distinct && key_part_nr > join->fields_list.elements))
goto next_index;
cur_part= cur_index_info->key_part + key_part_nr - 1;
cur_group_prefix_len+= cur_part->store_length;
@@ -9533,10 +9741,6 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
if (all_parts != cur_parts)
goto next_index;
}
- else
- {
- DBUG_ASSERT(FALSE);
- }
/* Check (SA2). */
if (min_max_arg_item)
@@ -9690,7 +9894,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
/* The query passes all tests, so construct a new TRP object. */
read_plan= new (param->mem_root)
- TRP_GROUP_MIN_MAX(have_min, have_max, min_max_arg_part,
+ TRP_GROUP_MIN_MAX(have_min, have_max, is_agg_distinct,
+ min_max_arg_part,
group_prefix_len, used_key_parts,
group_key_parts, index_info, index,
key_infix_len,
@@ -9704,6 +9909,11 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
read_plan->read_cost= best_read_cost;
read_plan->records= best_records;
+ if (read_time < best_read_cost && is_agg_distinct)
+ {
+ read_plan->read_cost= 0;
+ read_plan->use_index_scan();
+ }
DBUG_PRINT("info",
("Returning group min/max plan: cost: %g, records: %lu",
@@ -10213,11 +10423,12 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *param, bool retrieve_full_rows,
quick= new QUICK_GROUP_MIN_MAX_SELECT(param->table,
param->thd->lex->current_select->join,
- have_min, have_max, min_max_arg_part,
+ have_min, have_max,
+ have_agg_distinct, min_max_arg_part,
group_prefix_len, group_key_parts,
used_key_parts, index_info, index,
read_cost, records, key_infix_len,
- key_infix, parent_alloc);
+ key_infix, parent_alloc, is_index_scan);
if (!quick)
DBUG_RETURN(NULL);
@@ -10297,6 +10508,9 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *param, bool retrieve_full_rows,
key_infix_len Length of the key infix appended to the group prefix
key_infix Infix of constants from equality predicates
parent_alloc Memory pool for this and quick_prefix_select data
+ is_index_scan get the next different key not by jumping on it via
+ index read, but by scanning until the end of the
+ rows with equal key value.
RETURN
None
@@ -10304,20 +10518,22 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *param, bool retrieve_full_rows,
QUICK_GROUP_MIN_MAX_SELECT::
QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg,
- bool have_max_arg,
+ bool have_max_arg, bool have_agg_distinct_arg,
KEY_PART_INFO *min_max_arg_part_arg,
uint group_prefix_len_arg, uint group_key_parts_arg,
uint used_key_parts_arg, KEY *index_info_arg,
uint use_index, double read_cost_arg,
ha_rows records_arg, uint key_infix_len_arg,
- uchar *key_infix_arg, MEM_ROOT *parent_alloc)
+ uchar *key_infix_arg, MEM_ROOT *parent_alloc,
+ bool is_index_scan_arg)
:join(join_arg), index_info(index_info_arg),
group_prefix_len(group_prefix_len_arg),
group_key_parts(group_key_parts_arg), have_min(have_min_arg),
- have_max(have_max_arg), seen_first_key(FALSE),
- min_max_arg_part(min_max_arg_part_arg), key_infix(key_infix_arg),
- key_infix_len(key_infix_len_arg), min_functions_it(NULL),
- max_functions_it(NULL)
+ have_max(have_max_arg), have_agg_distinct(have_agg_distinct_arg),
+ seen_first_key(FALSE), min_max_arg_part(min_max_arg_part_arg),
+ key_infix(key_infix_arg), key_infix_len(key_infix_len_arg),
+ min_functions_it(NULL), max_functions_it(NULL),
+ is_index_scan(is_index_scan_arg)
{
head= table;
file= head->file;
@@ -10880,6 +11096,56 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max()
}
+/**
+ Find the next different key value by skiping all the rows with the same key
+ value.
+
+ Implements a specialized loose index access method for queries
+ containing aggregate functions with distinct of the form:
+ SELECT [SUM|COUNT|AVG](DISTINCT a,...) FROM t
+ This method comes to replace the index scan + Unique class
+ (distinct selection) for loose index scan that visits all the rows of a
+ covering index instead of jumping in the begining of each group.
+ TODO: Placeholder function. To be replaced by a handler API call
+
+ @param is_index_scan hint to use index scan instead of random index read
+ to find the next different value.
+ @param file table handler
+ @param key_part group key to compare
+ @param record row data
+ @param group_prefix current key prefix data
+ @param group_prefix_len length of the current key prefix data
+ @param group_key_parts number of the current key prefix columns
+ @return status
+ @retval 0 success
+ @retval !0 failure
+*/
+
+static int index_next_different (bool is_index_scan, handler *file,
+ KEY_PART_INFO *key_part, uchar * record,
+ const uchar * group_prefix,
+ uint group_prefix_len,
+ uint group_key_parts)
+{
+ if (is_index_scan)
+ {
+ int result= 0;
+
+ while (!key_cmp (key_part, group_prefix, group_prefix_len))
+ {
+ result= file->index_next(record);
+ if (result)
+ return(result);
+ }
+ return result;
+ }
+ else
+ return file->index_read_map(record, group_prefix,
+ make_prev_keypart_map(group_key_parts),
+ HA_READ_AFTER_KEY);
+}
+
+
/*
Determine the prefix of the next group.
@@ -10926,9 +11192,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix()
else
{
/* Load the first key in this group into record. */
- result= file->index_read_map(record, group_prefix,
- make_prev_keypart_map(group_key_parts),
- HA_READ_AFTER_KEY);
+ result= index_next_different (is_index_scan, file, index_info->key_part,
+ record, group_prefix, group_prefix_len,
+ group_key_parts);
if (result)
DBUG_RETURN(result);
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 8d2ba1bb0a6..393ffcb2115 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -616,6 +616,7 @@ private:
uchar *last_prefix; /* Prefix of the last group for detecting EOF. */
bool have_min; /* Specify whether we are computing */
bool have_max; /* a MIN, a MAX, or both. */
+ bool have_agg_distinct;/* aggregate_function(DISTINCT ...). */
bool seen_first_key; /* Denotes whether the first key was retrieved.*/
KEY_PART_INFO *min_max_arg_part; /* The keypart of the only argument field */
/* of all MIN/MAX functions. */
@@ -629,6 +630,11 @@ private:
List<Item_sum> *max_functions;
List_iterator<Item_sum> *min_functions_it;
List_iterator<Item_sum> *max_functions_it;
+ /*
+ Use index scan to get the next different key instead of jumping into it
+ through index read
+ */
+ bool is_index_scan;
public:
/*
The following two members are public to allow easy access from
@@ -646,12 +652,13 @@ private:
void update_max_result();
public:
QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join, bool have_min,
- bool have_max, KEY_PART_INFO *min_max_arg_part,
+ bool have_max, bool have_agg_distinct,
+ KEY_PART_INFO *min_max_arg_part,
uint group_prefix_len, uint group_key_parts,
uint used_key_parts, KEY *index_info, uint
use_index, double read_cost, ha_rows records, uint
key_infix_len, uchar *key_infix, MEM_ROOT
- *parent_alloc);
+ *parent_alloc, bool is_index_scan);
~QUICK_GROUP_MIN_MAX_SELECT();
bool add_range(SEL_ARG *sel_range);
void update_key_stat();
@@ -667,6 +674,12 @@ public:
#ifndef DBUG_OFF
void dbug_dump(int indent, bool verbose);
#endif
+ bool is_agg_distinct() { return have_agg_distinct; }
+ virtual void append_loose_scan_type(String *str)
+ {
+ if (is_index_scan)
+ str->append(STRING_WITH_LEN(" (scanning)"));
+ }
};
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index e009cf1ca9f..13b10ac2e8f 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -356,10 +356,13 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result= 0;
break;
}
+ item_sum->set_aggregator(item_sum->has_with_distinct() ?
+ Aggregator::DISTINCT_AGGREGATOR :
+ Aggregator::SIMPLE_AGGREGATOR);
if (!count)
{
/* If count == 0, then we know that is_exact_count == TRUE. */
- ((Item_sum_min*) item_sum)->clear(); /* Set to NULL. */
+ ((Item_sum_min*) item_sum)->aggregator_clear(); /* Set to NULL. */
}
else
((Item_sum_min*) item_sum)->reset(); /* Set to the constant value. */
@@ -444,10 +447,13 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result= 0;
break;
}
+ item_sum->set_aggregator(item_sum->has_with_distinct() ?
+ Aggregator::DISTINCT_AGGREGATOR :
+ Aggregator::SIMPLE_AGGREGATOR);
if (!count)
{
/* If count != 1, then we know that is_exact_count == TRUE. */
- ((Item_sum_max*) item_sum)->clear(); /* Set to NULL. */
+ ((Item_sum_max*) item_sum)->aggregator_clear(); /* Set to NULL. */
}
else
((Item_sum_max*) item_sum)->reset(); /* Set to the constant value. */
diff --git a/sql/partition_element.h b/sql/partition_element.h
index 905bc38165b..73f85ac275f 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -1,4 +1,7 @@
-/* Copyright (C) 2006 MySQL AB
+#ifndef PARTITION_ELEMENT_INCLUDED
+#define PARTITION_ELEMENT_INCLUDED
+
+/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,10 +35,40 @@ enum partition_state {
PART_REORGED_DROPPED= 5,
PART_CHANGED= 6,
PART_IS_CHANGED= 7,
- PART_IS_ADDED= 8
+ PART_IS_ADDED= 8,
+ PART_ADMIN= 9
};
/*
+ This struct is used to keep track of column expressions as part
+ of the COLUMNS concept in conjunction with RANGE and LIST partitioning.
+ The value can be either of MINVALUE, MAXVALUE and an expression that
+ must be constant and evaluate to the same type as the column it
+ represents.
+
+ The data in this fixed in two steps. The parser will only fill in whether
+ it is a max_value or provide an expression. Filling in
+ column_value, part_info, partition_id, null_value is done by the
+ function fix_column_value_function. However the item tree needs
+ fixed also before writing it into the frm file (in add_column_list_values).
+ To distinguish between those two variants, fixed= 1 after the
+ fixing in add_column_list_values and fixed= 2 otherwise. This is
+ since the fixing in add_column_list_values isn't a complete fixing.
+*/
+
+typedef struct p_column_list_val
+{
+ void* column_value;
+ Item* item_expression;
+ partition_info *part_info;
+ uint partition_id;
+ bool max_value;
+ bool null_value;
+ char fixed;
+} part_column_list_val;
+
+
+/*
This struct is used to contain the value of an element
in the VALUES IN struct. It needs to keep knowledge of
whether it is a signed/unsigned value and whether it is
@@ -45,8 +78,10 @@ enum partition_state {
typedef struct p_elem_val
{
longlong value;
+ uint added_items;
bool null_value;
bool unsigned_flag;
+ part_column_list_val *col_val_array;
} part_elem_value;
struct st_ddl_log_memory_entry;
@@ -68,8 +103,9 @@ public:
enum partition_state part_state;
uint16 nodegroup_id;
bool has_null_value;
- bool signed_flag;/* Indicate whether this partition uses signed constants */
- bool max_value; /* Indicate whether this partition uses MAXVALUE */
+ /* signed_flag and max_value only relevant for subpartitions */
+ bool signed_flag;
+ bool max_value;
partition_element()
: part_max_rows(0), part_min_rows(0), range_value(0),
@@ -97,3 +133,5 @@ public:
}
~partition_element() {}
};
+
+#endif /* PARTITION_ELEMENT_INCLUDED */
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index ba9ea0e876e..56d79ac0d45 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (C) 2006-2008 MySQL AB, Sun Microsystems Inc. 2008-2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -75,7 +75,7 @@ partition_info *partition_info::get_clone()
SYNOPSIS
create_default_partition_names()
part_no Partition number for subparts
- no_parts Number of partitions
+ num_parts Number of partitions
start_no Starting partition number
subpart Is it subpartitions
@@ -91,10 +91,10 @@ partition_info *partition_info::get_clone()
#define MAX_PART_NAME_SIZE 8
char *partition_info::create_default_partition_names(uint part_no,
- uint no_parts_arg,
+ uint num_parts_arg,
uint start_no)
{
- char *ptr= (char*) sql_calloc(no_parts_arg*MAX_PART_NAME_SIZE);
+ char *ptr= (char*) sql_calloc(num_parts_arg*MAX_PART_NAME_SIZE);
char *move_ptr= ptr;
uint i= 0;
DBUG_ENTER("create_default_partition_names");
@@ -105,11 +105,11 @@ char *partition_info::create_default_partition_names(uint part_no,
{
my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
move_ptr+=MAX_PART_NAME_SIZE;
- } while (++i < no_parts_arg);
+ } while (++i < num_parts_arg);
}
else
{
- mem_alloc_error(no_parts_arg*MAX_PART_NAME_SIZE);
+ mem_alloc_error(num_parts_arg*MAX_PART_NAME_SIZE);
}
DBUG_RETURN(ptr);
}
@@ -189,19 +189,19 @@ bool partition_info::set_up_default_partitions(handler *file,
goto end;
}
- if ((no_parts == 0) &&
- ((no_parts= file->get_default_no_partitions(info)) == 0))
+ if ((num_parts == 0) &&
+ ((num_parts= file->get_default_no_partitions(info)) == 0))
{
my_error(ER_PARTITION_NOT_DEFINED_ERROR, MYF(0), "partitions");
goto end;
}
- if (unlikely(no_parts > MAX_PARTITIONS))
+ if (unlikely(num_parts > MAX_PARTITIONS))
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
goto end;
}
- if (unlikely((!(default_name= create_default_partition_names(0, no_parts,
+ if (unlikely((!(default_name= create_default_partition_names(0, num_parts,
start_no)))))
goto end;
i= 0;
@@ -220,7 +220,7 @@ bool partition_info::set_up_default_partitions(handler *file,
mem_alloc_error(sizeof(partition_element));
goto end;
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
result= FALSE;
end:
DBUG_RETURN(result);
@@ -259,9 +259,9 @@ bool partition_info::set_up_default_subpartitions(handler *file,
List_iterator<partition_element> part_it(partitions);
DBUG_ENTER("partition_info::set_up_default_subpartitions");
- if (no_subparts == 0)
- no_subparts= file->get_default_no_partitions(info);
- if (unlikely((no_parts * no_subparts) > MAX_PARTITIONS))
+ if (num_subparts == 0)
+ num_subparts= file->get_default_no_partitions(info);
+ if (unlikely((num_parts * num_subparts) > MAX_PARTITIONS))
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
goto end;
@@ -288,8 +288,8 @@ bool partition_info::set_up_default_subpartitions(handler *file,
mem_alloc_error(sizeof(partition_element));
goto end;
}
- } while (++j < no_subparts);
- } while (++i < no_parts);
+ } while (++j < num_subparts);
+ } while (++i < num_parts);
result= FALSE;
end:
DBUG_RETURN(result);
@@ -334,6 +334,49 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file,
/*
+ Support routine for check_partition_info
+
+ SYNOPSIS
+ has_unique_fields
+ no parameters
+
+ RETURN VALUE
+ Erroneus field name Error, there are two fields with same name
+ NULL Ok, no field defined twice
+
+ DESCRIPTION
+ Check that the user haven't defined the same field twice in
+ key or column list partitioning.
+*/
+char* partition_info::has_unique_fields()
+{
+ char *field_name_outer, *field_name_inner;
+ List_iterator<char> it_outer(part_field_list);
+ uint num_fields= part_field_list.elements;
+ uint i,j;
+ DBUG_ENTER("partition_info::has_unique_fields");
+
+ for (i= 0; i < num_fields; i++)
+ {
+ field_name_outer= it_outer++;
+ List_iterator<char> it_inner(part_field_list);
+ for (j= 0; j < num_fields; j++)
+ {
+ field_name_inner= it_inner++;
+ if (i >= j)
+ continue;
+ if (!(my_strcasecmp(system_charset_info,
+ field_name_outer,
+ field_name_inner)))
+ {
+ DBUG_RETURN(field_name_outer);
+ }
+ }
+ }
+ DBUG_RETURN(NULL);
+}
+
+/*
A support function to check if a partition element's name is unique
SYNOPSIS
@@ -518,12 +561,12 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
{
handlerton *old_engine_type= engine_type;
bool first= TRUE;
- uint no_parts= partitions.elements;
+ uint num_parts= partitions.elements;
DBUG_ENTER("partition_info::check_engine_mix");
DBUG_PRINT("info", ("in: engine_type = %s, table_engine_set = %u",
ha_resolve_storage_engine_name(engine_type),
table_engine_set));
- if (no_parts)
+ if (num_parts)
{
List_iterator<partition_element> part_it(partitions);
uint i= 0;
@@ -536,7 +579,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
if (is_sub_partitioned() &&
part_elem->subpartitions.elements)
{
- uint no_subparts= part_elem->subpartitions.elements;
+ uint num_subparts= part_elem->subpartitions.elements;
uint j= 0;
List_iterator<partition_element> sub_it(part_elem->subpartitions);
do
@@ -548,7 +591,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
if (check_engine_condition(sub_elem, table_engine_set,
&engine_type, &first))
goto error;
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
/* ensure that the partition also has correct engine */
if (check_engine_condition(part_elem, table_engine_set,
&engine_type, &first))
@@ -557,7 +600,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
else if (check_engine_condition(part_elem, table_engine_set,
&engine_type, &first))
goto error;
- } while (++i < no_parts);
+ } while (++i < num_parts);
}
DBUG_PRINT("info", ("engine_type = %s",
ha_resolve_storage_engine_name(engine_type)));
@@ -589,6 +632,7 @@ error:
SYNOPSIS
check_range_constants()
+ thd Thread object
RETURN VALUE
TRUE An error occurred during creation of range constants
@@ -601,76 +645,112 @@ error:
called for RANGE PARTITIONed tables.
*/
-bool partition_info::check_range_constants()
+bool partition_info::check_range_constants(THD *thd)
{
partition_element* part_def;
- longlong current_largest;
- longlong part_range_value;
bool first= TRUE;
uint i;
List_iterator<partition_element> it(partitions);
- bool result= TRUE;
- bool signed_flag= !part_expr->unsigned_flag;
+ int result= TRUE;
DBUG_ENTER("partition_info::check_range_constants");
- DBUG_PRINT("enter", ("INT_RESULT with %d parts", no_parts));
-
- LINT_INIT(current_largest);
+ DBUG_PRINT("enter", ("RANGE with %d parts, column_list = %u", num_parts,
+ column_list));
- part_result_type= INT_RESULT;
- range_int_array= (longlong*)sql_alloc(no_parts * sizeof(longlong));
- if (unlikely(range_int_array == NULL))
+ if (column_list)
{
- mem_alloc_error(no_parts * sizeof(longlong));
- goto end;
- }
- i= 0;
- do
- {
- part_def= it++;
- if ((i != (no_parts - 1)) || !defined_max_value)
+ part_column_list_val *loc_range_col_array;
+ part_column_list_val *current_largest_col_val;
+ uint num_column_values= part_field_list.elements;
+ uint size_entries= sizeof(part_column_list_val) * num_column_values;
+ range_col_array= (part_column_list_val*)sql_calloc(num_parts *
+ size_entries);
+ LINT_INIT(current_largest_col_val);
+ if (unlikely(range_col_array == NULL))
{
- part_range_value= part_def->range_value;
- if (!signed_flag)
- part_range_value-= 0x8000000000000000ULL;
+ mem_alloc_error(num_parts * size_entries);
+ goto end;
}
- else
- part_range_value= LONGLONG_MAX;
- if (first)
+ loc_range_col_array= range_col_array;
+ i= 0;
+ do
{
- current_largest= part_range_value;
- range_int_array[0]= part_range_value;
+ part_def= it++;
+ {
+ List_iterator<part_elem_value> list_val_it(part_def->list_val_list);
+ part_elem_value *range_val= list_val_it++;
+ part_column_list_val *col_val= range_val->col_val_array;
+
+ if (fix_column_value_functions(thd, range_val, i))
+ goto end;
+ memcpy(loc_range_col_array, (const void*)col_val, size_entries);
+ loc_range_col_array+= num_column_values;
+ if (!first)
+ {
+ if (compare_column_values((const void*)current_largest_col_val,
+ (const void*)col_val) >= 0)
+ goto range_not_increasing_error;
+ }
+ current_largest_col_val= col_val;
+ }
first= FALSE;
+ } while (++i < num_parts);
+ }
+ else
+ {
+ longlong current_largest;
+ longlong part_range_value;
+ bool signed_flag= !part_expr->unsigned_flag;
+
+ LINT_INIT(current_largest);
+
+ part_result_type= INT_RESULT;
+ range_int_array= (longlong*)sql_alloc(num_parts * sizeof(longlong));
+ if (unlikely(range_int_array == NULL))
+ {
+ mem_alloc_error(num_parts * sizeof(longlong));
+ goto end;
}
- else
+ i= 0;
+ do
{
- if (likely(current_largest < part_range_value))
+ part_def= it++;
+ if ((i != (num_parts - 1)) || !defined_max_value)
{
- current_largest= part_range_value;
- range_int_array[i]= part_range_value;
- }
- else if (defined_max_value &&
- current_largest == part_range_value &&
- part_range_value == LONGLONG_MAX &&
- i == (no_parts - 1))
- {
- range_int_array[i]= part_range_value;
+ part_range_value= part_def->range_value;
+ if (!signed_flag)
+ part_range_value-= 0x8000000000000000ULL;
}
else
+ part_range_value= LONGLONG_MAX;
+
+ if (!first)
{
- my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
- goto end;
+ if (unlikely(current_largest > part_range_value) ||
+ (unlikely(current_largest == part_range_value) &&
+ (part_range_value < LONGLONG_MAX ||
+ i != (num_parts - 1) ||
+ !defined_max_value)))
+ goto range_not_increasing_error;
}
- }
- } while (++i < no_parts);
+ range_int_array[i]= part_range_value;
+ current_largest= part_range_value;
+ first= FALSE;
+ } while (++i < num_parts);
+ }
result= FALSE;
end:
DBUG_RETURN(result);
+
+range_not_increasing_error:
+ my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
+ goto end;
}
/*
Support routines for check_list_constants used by qsort to sort the
- constant list expressions. One routine for unsigned and one for signed.
+ constant list expressions. One routine for integers and one for
+ column lists.
SYNOPSIS
list_part_cmp()
@@ -695,6 +775,54 @@ int partition_info::list_part_cmp(const void* a, const void* b)
return 0;
}
+ /*
+ Compare two lists of column values in RANGE/LIST partitioning
+ SYNOPSIS
+ compare_column_values()
+ first First column list argument
+ second Second column list argument
+ RETURN VALUES
+ 0 Equal
+ -1 First argument is smaller
+ +1 First argument is larger
+*/
+
+int partition_info::compare_column_values(const void *first_arg,
+ const void *second_arg)
+{
+ const part_column_list_val *first= (part_column_list_val*)first_arg;
+ const part_column_list_val *second= (part_column_list_val*)second_arg;
+ partition_info *part_info= first->part_info;
+ Field **field;
+
+ for (field= part_info->part_field_array; *field;
+ field++, first++, second++)
+ {
+ if (first->max_value || second->max_value)
+ {
+ if (first->max_value && second->max_value)
+ return 0;
+ if (second->max_value)
+ return -1;
+ else
+ return +1;
+ }
+ if (first->null_value || second->null_value)
+ {
+ if (first->null_value && second->null_value)
+ continue;
+ if (second->null_value)
+ return +1;
+ else
+ return -1;
+ }
+ int res= (*field)->cmp((const uchar*)first->column_value,
+ (const uchar*)second->column_value);
+ if (res)
+ return res;
+ }
+ return 0;
+}
/*
This routine allocates an array for all list constants to achieve a fast
@@ -704,6 +832,7 @@ int partition_info::list_part_cmp(const void* a, const void* b)
SYNOPSIS
check_list_constants()
+ thd Thread object
RETURN VALUE
TRUE An error occurred during creation of list constants
@@ -716,20 +845,23 @@ int partition_info::list_part_cmp(const void* a, const void* b)
called for LIST PARTITIONed tables.
*/
-bool partition_info::check_list_constants()
+bool partition_info::check_list_constants(THD *thd)
{
- uint i;
+ uint i, size_entries, num_column_values;
uint list_index= 0;
part_elem_value *list_value;
bool result= TRUE;
- longlong curr_value, prev_value, type_add, calc_value;
+ longlong type_add, calc_value;
+ void *curr_value, *prev_value;
partition_element* part_def;
bool found_null= FALSE;
+ int (*compare_func)(const void *, const void*);
+ void *ptr;
List_iterator<partition_element> list_func_it(partitions);
DBUG_ENTER("partition_info::check_list_constants");
part_result_type= INT_RESULT;
- no_list_values= 0;
+ num_list_values= 0;
/*
We begin by calculating the number of list values that have been
defined in the first step.
@@ -762,51 +894,86 @@ bool partition_info::check_list_constants()
}
List_iterator<part_elem_value> list_val_it1(part_def->list_val_list);
while (list_val_it1++)
- no_list_values++;
- } while (++i < no_parts);
+ num_list_values++;
+ } while (++i < num_parts);
list_func_it.rewind();
- list_array= (LIST_PART_ENTRY*)sql_alloc((no_list_values+1) *
- sizeof(LIST_PART_ENTRY));
- if (unlikely(list_array == NULL))
+ num_column_values= part_field_list.elements;
+ size_entries= column_list ?
+ (num_column_values * sizeof(part_column_list_val)) :
+ sizeof(LIST_PART_ENTRY);
+ ptr= sql_calloc((num_list_values+1) * size_entries);
+ if (unlikely(ptr == NULL))
{
- mem_alloc_error(no_list_values * sizeof(LIST_PART_ENTRY));
+ mem_alloc_error(num_list_values * size_entries);
goto end;
}
-
- i= 0;
- /*
- Fix to be able to reuse signed sort functions also for unsigned
- partition functions.
- */
- type_add= (longlong)(part_expr->unsigned_flag ?
+ if (column_list)
+ {
+ part_column_list_val *loc_list_col_array;
+ loc_list_col_array= (part_column_list_val*)ptr;
+ list_col_array= (part_column_list_val*)ptr;
+ compare_func= compare_column_values;
+ i= 0;
+ do
+ {
+ part_def= list_func_it++;
+ List_iterator<part_elem_value> list_val_it2(part_def->list_val_list);
+ while ((list_value= list_val_it2++))
+ {
+ part_column_list_val *col_val= list_value->col_val_array;
+ if (unlikely(fix_column_value_functions(thd, list_value, i)))
+ {
+ DBUG_RETURN(TRUE);
+ }
+ memcpy(loc_list_col_array, (const void*)col_val, size_entries);
+ loc_list_col_array+= num_column_values;
+ }
+ } while (++i < num_parts);
+ }
+ else
+ {
+ compare_func= list_part_cmp;
+ list_array= (LIST_PART_ENTRY*)ptr;
+ i= 0;
+ /*
+ Fix to be able to reuse signed sort functions also for unsigned
+ partition functions.
+ */
+ type_add= (longlong)(part_expr->unsigned_flag ?
0x8000000000000000ULL :
0ULL);
- do
- {
- part_def= list_func_it++;
- List_iterator<part_elem_value> list_val_it2(part_def->list_val_list);
- while ((list_value= list_val_it2++))
+ do
{
- calc_value= list_value->value - type_add;
- list_array[list_index].list_value= calc_value;
- list_array[list_index++].partition_id= i;
- }
- } while (++i < no_parts);
-
- if (fixed && no_list_values)
+ part_def= list_func_it++;
+ List_iterator<part_elem_value> list_val_it2(part_def->list_val_list);
+ while ((list_value= list_val_it2++))
+ {
+ calc_value= list_value->value - type_add;
+ list_array[list_index].list_value= calc_value;
+ list_array[list_index++].partition_id= i;
+ }
+ } while (++i < num_parts);
+ }
+ DBUG_ASSERT(fixed);
+ if (num_list_values)
{
bool first= TRUE;
- my_qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY),
- &list_part_cmp);
-
+ /*
+ list_array and list_col_array are unions, so this works for both
+ variants of LIST partitioning.
+ */
+ my_qsort((void*)list_array, num_list_values, size_entries,
+ compare_func);
+
i= 0;
LINT_INIT(prev_value);
do
{
- DBUG_ASSERT(i < no_list_values);
- curr_value= list_array[i].list_value;
- if (likely(first || prev_value != curr_value))
+ DBUG_ASSERT(i < num_list_values);
+ curr_value= column_list ? (void*)&list_col_array[num_column_values * i] :
+ (void*)&list_array[i];
+ if (likely(first || compare_func(curr_value, prev_value)))
{
prev_value= curr_value;
first= FALSE;
@@ -816,7 +983,7 @@ bool partition_info::check_list_constants()
my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
goto end;
}
- } while (++i < no_list_values);
+ } while (++i < num_list_values);
}
result= FALSE;
end:
@@ -829,10 +996,11 @@ end:
SYNOPSIS
check_partition_info()
+ thd Thread object
+ eng_type Return value for used engine in partitions
file A reference to a handler of the table
info Create info
- engine_type Return value for used engine in partitions
- check_partition_function Should we check the partition function
+ add_or_reorg_part Is it ALTER TABLE ADD/REORGANIZE command
RETURN VALUE
TRUE Error, something went wrong
@@ -848,7 +1016,7 @@ end:
bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
handler *file, HA_CREATE_INFO *info,
- bool check_partition_function)
+ bool add_or_reorg_part)
{
handlerton *table_engine= default_engine_type;
uint i, tot_partitions;
@@ -859,11 +1027,11 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
DBUG_PRINT("info", ("default table_engine = %s",
ha_resolve_storage_engine_name(table_engine)));
- if (check_partition_function)
+ if (!add_or_reorg_part)
{
int err= 0;
- if (part_type != HASH_PARTITION || !list_of_part_fields)
+ if (!list_of_part_fields)
{
DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0,
@@ -877,9 +1045,12 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
}
+ if (thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
+ fix_parser_data(thd))
+ goto end;
}
if (unlikely(!is_sub_partitioned() &&
- !(use_default_subpartitions && use_default_no_subpartitions)))
+ !(use_default_subpartitions && use_default_num_subpartitions)))
{
my_error(ER_SUBPARTITION_ERROR, MYF(0));
goto end;
@@ -937,6 +1108,12 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
}
}
+ if (part_field_list.elements > 0 &&
+ (same_name= has_unique_fields()))
+ {
+ my_error(ER_SAME_NAME_PARTITION_FIELD, MYF(0), same_name);
+ goto end;
+ }
if ((same_name= has_unique_names()))
{
my_error(ER_SAME_NAME_PARTITION, MYF(0), same_name);
@@ -945,8 +1122,8 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
i= 0;
{
List_iterator<partition_element> part_it(partitions);
- uint no_parts_not_set= 0;
- uint prev_no_subparts_not_set= no_subparts + 1;
+ uint num_parts_not_set= 0;
+ uint prev_num_subparts_not_set= num_subparts + 1;
do
{
partition_element *part_elem= part_it++;
@@ -968,7 +1145,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
{
if (part_elem->engine_type == NULL)
{
- no_parts_not_set++;
+ num_parts_not_set++;
part_elem->engine_type= default_engine_type;
}
if (check_table_name(part_elem->partition_name,
@@ -983,7 +1160,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
else
{
uint j= 0;
- uint no_subparts_not_set= 0;
+ uint num_subparts_not_set= 0;
List_iterator<partition_element> sub_it(part_elem->subpartitions);
partition_element *sub_elem;
do
@@ -1002,44 +1179,45 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
else
{
sub_elem->engine_type= default_engine_type;
- no_subparts_not_set++;
+ num_subparts_not_set++;
}
}
DBUG_PRINT("info", ("part = %d sub = %d engine = %s", i, j,
ha_resolve_storage_engine_name(sub_elem->engine_type)));
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
- if (prev_no_subparts_not_set == (no_subparts + 1) &&
- (no_subparts_not_set == 0 || no_subparts_not_set == no_subparts))
- prev_no_subparts_not_set= no_subparts_not_set;
+ if (prev_num_subparts_not_set == (num_subparts + 1) &&
+ (num_subparts_not_set == 0 ||
+ num_subparts_not_set == num_subparts))
+ prev_num_subparts_not_set= num_subparts_not_set;
if (!table_engine_set &&
- prev_no_subparts_not_set != no_subparts_not_set)
+ prev_num_subparts_not_set != num_subparts_not_set)
{
- DBUG_PRINT("info", ("no_subparts_not_set = %u no_subparts = %u",
- no_subparts_not_set, no_subparts));
+ DBUG_PRINT("info", ("num_subparts_not_set = %u num_subparts = %u",
+ num_subparts_not_set, num_subparts));
my_error(ER_MIX_HANDLER_ERROR, MYF(0));
goto end;
}
if (part_elem->engine_type == NULL)
{
- if (no_subparts_not_set == 0)
+ if (num_subparts_not_set == 0)
part_elem->engine_type= sub_elem->engine_type;
else
{
- no_parts_not_set++;
+ num_parts_not_set++;
part_elem->engine_type= default_engine_type;
}
}
}
- } while (++i < no_parts);
+ } while (++i < num_parts);
if (!table_engine_set &&
- no_parts_not_set != 0 &&
- no_parts_not_set != no_parts)
+ num_parts_not_set != 0 &&
+ num_parts_not_set != num_parts)
{
- DBUG_PRINT("info", ("no_parts_not_set = %u no_parts = %u",
- no_parts_not_set, no_subparts));
+ DBUG_PRINT("info", ("num_parts_not_set = %u num_parts = %u",
+ num_parts_not_set, num_subparts));
my_error(ER_MIX_HANDLER_ERROR, MYF(0));
goto end;
}
@@ -1062,10 +1240,12 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
list constants.
*/
- if (fixed)
+ if (add_or_reorg_part)
{
- if (unlikely((part_type == RANGE_PARTITION && check_range_constants()) ||
- (part_type == LIST_PARTITION && check_list_constants())))
+ if (unlikely((part_type == RANGE_PARTITION &&
+ check_range_constants(thd)) ||
+ (part_type == LIST_PARTITION &&
+ check_list_constants(thd))))
goto end;
}
result= FALSE;
@@ -1096,20 +1276,101 @@ void partition_info::print_no_partition_found(TABLE *table)
if (check_single_table_access(current_thd,
SELECT_ACL, &table_list, TRUE))
+ {
my_message(ER_NO_PARTITION_FOR_GIVEN_VALUE,
ER(ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT), MYF(0));
+ }
else
{
- my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
- if (part_expr->null_value)
- buf_ptr= (char*)"NULL";
+ if (column_list)
+ buf_ptr= (char*)"from column_list";
else
- longlong2str(err_value, buf,
- part_expr->unsigned_flag ? 10 : -10);
+ {
+ my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
+ if (part_expr->null_value)
+ buf_ptr= (char*)"NULL";
+ else
+ longlong2str(err_value, buf,
+ part_expr->unsigned_flag ? 10 : -10);
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ }
my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr);
- dbug_tmp_restore_column_map(table->read_set, old_map);
}
}
+
+
+/*
+ Set fields related to partition expression
+ SYNOPSIS
+ set_part_expr()
+ start_token Start of partition function string
+ item_ptr Pointer to item tree
+ end_token End of partition function string
+ is_subpart Subpartition indicator
+ RETURN VALUES
+ TRUE Memory allocation error
+ FALSE Success
+*/
+
+bool partition_info::set_part_expr(char *start_token, Item *item_ptr,
+ char *end_token, bool is_subpart)
+{
+ uint expr_len= end_token - start_token;
+ char *func_string= (char*) sql_memdup(start_token, expr_len);
+
+ if (!func_string)
+ {
+ mem_alloc_error(expr_len);
+ return TRUE;
+ }
+ if (is_subpart)
+ {
+ list_of_subpart_fields= FALSE;
+ subpart_expr= item_ptr;
+ subpart_func_string= func_string;
+ subpart_func_len= expr_len;
+ }
+ else
+ {
+ list_of_part_fields= FALSE;
+ part_expr= item_ptr;
+ part_func_string= func_string;
+ part_func_len= expr_len;
+ }
+ return FALSE;
+}
+
+
+/*
+ Check that partition fields and subpartition fields are not too long
+
+ SYNOPSIS
+ check_partition_field_length()
+
+ RETURN VALUES
+ TRUE Total length was too big
+ FALSE Length is ok
+*/
+
+bool partition_info::check_partition_field_length()
+{
+ uint store_length= 0;
+ uint i;
+ DBUG_ENTER("partition_info::check_partition_field_length");
+
+ for (i= 0; i < num_part_fields; i++)
+ store_length+= get_partition_field_store_length(part_field_array[i]);
+ if (store_length > MAX_KEY_LENGTH)
+ DBUG_RETURN(TRUE);
+ store_length= 0;
+ for (i= 0; i < num_subpart_fields; i++)
+ store_length+= get_partition_field_store_length(subpart_field_array[i]);
+ if (store_length > MAX_KEY_LENGTH)
+ DBUG_RETURN(TRUE);
+ DBUG_RETURN(FALSE);
+}
+
+
/*
Set up buffers and arrays for fields requiring preparation
SYNOPSIS
@@ -1221,46 +1482,6 @@ bool partition_info::set_up_charset_field_preps()
}
subpart_charset_field_array[i]= NULL;
}
- if (tot_fields)
- {
- uint k;
- size= tot_fields*sizeof(char**);
- if (!(char_ptrs= (uchar**)sql_calloc(size)))
- goto error;
- full_part_field_buffers= char_ptrs;
- if (!(char_ptrs= (uchar**)sql_calloc(size)))
- goto error;
- restore_full_part_field_ptrs= char_ptrs;
- size= (tot_fields + 1) * sizeof(char**);
- if (!(char_ptrs= (uchar**)sql_calloc(size)))
- goto error;
- full_part_charset_field_array= (Field**)char_ptrs;
- for (i= 0; i < tot_part_fields; i++)
- {
- full_part_charset_field_array[i]= part_charset_field_array[i];
- full_part_field_buffers[i]= part_field_buffers[i];
- }
- k= tot_part_fields;
- for (i= 0; i < tot_subpart_fields; i++)
- {
- uint j;
- bool found= FALSE;
- field= subpart_charset_field_array[i];
-
- for (j= 0; j < tot_part_fields; j++)
- {
- if (field == part_charset_field_array[i])
- found= TRUE;
- }
- if (!found)
- {
- full_part_charset_field_array[k]= subpart_charset_field_array[i];
- full_part_field_buffers[k]= subpart_field_buffers[i];
- k++;
- }
- }
- full_part_charset_field_array[k]= NULL;
- }
DBUG_RETURN(FALSE);
error:
mem_alloc_error(size);
@@ -1321,5 +1542,636 @@ id_err:
return 1;
}
+/*
+ Create a new column value in current list with maxvalue
+ Called from parser
+
+ SYNOPSIS
+ add_max_value()
+ RETURN
+ TRUE Error
+ FALSE Success
+*/
+
+int partition_info::add_max_value()
+{
+ DBUG_ENTER("partition_info::add_max_value");
+
+ part_column_list_val *col_val;
+ if (!(col_val= add_column_value()))
+ {
+ DBUG_RETURN(TRUE);
+ }
+ col_val->max_value= TRUE;
+ DBUG_RETURN(FALSE);
+}
+
+/*
+ Create a new column value in current list
+ Called from parser
+
+ SYNOPSIS
+ add_column_value()
+ RETURN
+ >0 A part_column_list_val object which have been
+ inserted into its list
+ 0 Memory allocation failure
+*/
+
+part_column_list_val *partition_info::add_column_value()
+{
+ uint max_val= num_columns ? num_columns : MAX_REF_PARTS;
+ DBUG_ENTER("add_column_value");
+ DBUG_PRINT("enter", ("num_columns = %u, curr_list_object %u, max_val = %u",
+ num_columns, curr_list_object, max_val));
+ if (curr_list_object < max_val)
+ {
+ curr_list_val->added_items++;
+ DBUG_RETURN(&curr_list_val->col_val_array[curr_list_object++]);
+ }
+ if (!num_columns && part_type == LIST_PARTITION)
+ {
+ /*
+ We're trying to add more than MAX_REF_PARTS, this can happen
+ in ALTER TABLE using List partitions where the first partition
+ uses VALUES IN (1,2,3...,17) where the number of fields in
+ the list is more than MAX_REF_PARTS, in this case we know
+ that the number of columns must be 1 and we thus reorganize
+ into the structure used for 1 column. After this we call
+ ourselves recursively which should always succeed.
+ */
+ if (!reorganize_into_single_field_col_val())
+ {
+ DBUG_RETURN(add_column_value());
+ }
+ DBUG_RETURN(NULL);
+ }
+ if (column_list)
+ {
+ my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0));
+ }
+ else
+ {
+ if (part_type == RANGE_PARTITION)
+ my_error(ER_TOO_MANY_VALUES_ERROR, MYF(0), "RANGE");
+ else
+ my_error(ER_TOO_MANY_VALUES_ERROR, MYF(0), "LIST");
+ }
+ DBUG_RETURN(NULL);
+}
+
+
+/*
+ Initialise part_elem_value object at setting of a new object
+ (Helper functions to functions called by parser)
+
+ SYNOPSIS
+ init_col_val
+ col_val Column value object to be initialised
+ item Item object representing column value
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+void partition_info::init_col_val(part_column_list_val *col_val, Item *item)
+{
+ DBUG_ENTER("partition_info::init_col_val");
+
+ col_val->item_expression= item;
+ col_val->null_value= item->null_value;
+ if (item->result_type() == INT_RESULT)
+ {
+ /*
+ This could be both column_list partitioning and function
+ partitioning, but it doesn't hurt to set the function
+ partitioning flags about unsignedness.
+ */
+ curr_list_val->value= item->val_int();
+ curr_list_val->unsigned_flag= TRUE;
+ if (!item->unsigned_flag &&
+ curr_list_val->value < 0)
+ curr_list_val->unsigned_flag= FALSE;
+ if (!curr_list_val->unsigned_flag)
+ curr_part_elem->signed_flag= TRUE;
+ }
+ col_val->part_info= NULL;
+ DBUG_VOID_RETURN;
+}
+/*
+ Add a column value in VALUES LESS THAN or VALUES IN
+ (Called from parser)
+
+ SYNOPSIS
+ add_column_list_value()
+ lex Parser's lex object
+ thd Thread object
+ item Item object representing column value
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+bool partition_info::add_column_list_value(THD *thd, Item *item)
+{
+ part_column_list_val *col_val;
+ Name_resolution_context *context= &thd->lex->current_select->context;
+ TABLE_LIST *save_list= context->table_list;
+ const char *save_where= thd->where;
+ DBUG_ENTER("partition_info::add_column_list_value");
+
+ if (part_type == LIST_PARTITION &&
+ num_columns == 1U)
+ {
+ if (init_column_part())
+ {
+ DBUG_RETURN(TRUE);
+ }
+ }
+
+ context->table_list= 0;
+ if (column_list)
+ thd->where= "field list";
+ else
+ thd->where= "partition function";
+
+ if (item->walk(&Item::check_partition_func_processor, 0,
+ NULL))
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ if (item->fix_fields(thd, (Item**)0) ||
+ ((context->table_list= save_list), FALSE) ||
+ (!item->const_item()))
+ {
+ context->table_list= save_list;
+ thd->where= save_where;
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ thd->where= save_where;
+
+ if (!(col_val= add_column_value()))
+ {
+ DBUG_RETURN(TRUE);
+ }
+ init_col_val(col_val, item);
+ DBUG_RETURN(FALSE);
+}
+
+/*
+ Initialise part_info object for receiving a set of column values
+ for a partition, called when parser reaches VALUES LESS THAN or
+ VALUES IN.
+
+ SYNOPSIS
+ init_column_part()
+ lex Parser's lex object
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+bool partition_info::init_column_part()
+{
+ partition_element *p_elem= curr_part_elem;
+ part_column_list_val *col_val_array;
+ part_elem_value *list_val;
+ uint loc_num_columns;
+ DBUG_ENTER("partition_info::init_column_part");
+
+ if (!(list_val=
+ (part_elem_value*)sql_calloc(sizeof(part_elem_value))) ||
+ p_elem->list_val_list.push_back(list_val))
+ {
+ mem_alloc_error(sizeof(part_elem_value));
+ DBUG_RETURN(TRUE);
+ }
+ if (num_columns)
+ loc_num_columns= num_columns;
+ else
+ loc_num_columns= MAX_REF_PARTS;
+ if (!(col_val_array=
+ (part_column_list_val*)sql_calloc(loc_num_columns *
+ sizeof(part_column_list_val))))
+ {
+ mem_alloc_error(loc_num_columns * sizeof(part_elem_value));
+ DBUG_RETURN(TRUE);
+ }
+ list_val->col_val_array= col_val_array;
+ list_val->added_items= 0;
+ curr_list_val= list_val;
+ curr_list_object= 0;
+ DBUG_RETURN(FALSE);
+}
+
+/*
+ In the case of ALTER TABLE ADD/REORGANIZE PARTITION for LIST
+ partitions we can specify list values as:
+ VALUES IN (v1, v2,,,, v17) if we're using the first partitioning
+ variant with a function or a column list partitioned table with
+ one partition field. In this case the parser knows not the
+ number of columns start with and allocates MAX_REF_PARTS in the
+ array. If we try to allocate something beyond MAX_REF_PARTS we
+ will call this function to reorganize into a structure with
+ num_columns = 1. Also when the parser knows that we used LIST
+ partitioning and we used a VALUES IN like above where number of
+ values was smaller than MAX_REF_PARTS or equal, then we will
+ reorganize after discovering this in the parser.
+
+ SYNOPSIS
+ reorganize_into_single_field_col_val()
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+int partition_info::reorganize_into_single_field_col_val()
+{
+ part_column_list_val *col_val, *new_col_val;
+ part_elem_value *val= curr_list_val;
+ uint loc_num_columns= num_columns;
+ uint i;
+ DBUG_ENTER("partition_info::reorganize_into_single_field_col_val");
+
+ num_columns= 1;
+ val->added_items= 1U;
+ col_val= &val->col_val_array[0];
+ init_col_val(col_val, col_val->item_expression);
+ for (i= 1; i < loc_num_columns; i++)
+ {
+ col_val= &val->col_val_array[i];
+ DBUG_ASSERT(part_type == LIST_PARTITION);
+ if (init_column_part())
+ {
+ DBUG_RETURN(TRUE);
+ }
+ if (!(new_col_val= add_column_value()))
+ {
+ DBUG_RETURN(TRUE);
+ }
+ memcpy(new_col_val, col_val, sizeof(*col_val));
+ init_col_val(new_col_val, col_val->item_expression);
+ }
+ curr_list_val= val;
+ DBUG_RETURN(FALSE);
+}
+
+/*
+ This function handles the case of function-based partitioning.
+ It fixes some data structures created in the parser and puts
+ them in the format required by the rest of the partitioning
+ code.
+
+ SYNOPSIS
+ fix_func_partition()
+ thd Thread object
+ col_val Array of one value
+ part_elem The partition instance
+ part_id Id of partition instance
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+int partition_info::fix_func_partition(THD *thd,
+ part_elem_value *val,
+ partition_element *part_elem,
+ uint part_id)
+{
+ part_column_list_val *col_val= val->col_val_array;
+ DBUG_ENTER("partition_info::fix_func_partition");
+
+ if (col_val->fixed)
+ {
+ DBUG_RETURN(FALSE);
+ }
+ if (val->added_items != 1)
+ {
+ my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ if (col_val->max_value)
+ {
+ /* The parser ensures we're not LIST partitioned here */
+ DBUG_ASSERT(part_type == RANGE_PARTITION);
+ if (defined_max_value)
+ {
+ my_error(ER_PARTITION_MAXVALUE_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ if (part_id == (num_parts - 1))
+ {
+ defined_max_value= TRUE;
+ part_elem->max_value= TRUE;
+ part_elem->range_value= LONGLONG_MAX;
+ }
+ else
+ {
+ my_error(ER_PARTITION_MAXVALUE_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ }
+ else
+ {
+ Item *item_expr= col_val->item_expression;
+ if ((val->null_value= item_expr->null_value))
+ {
+ if (part_elem->has_null_value)
+ {
+ my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ part_elem->has_null_value= TRUE;
+ }
+ else if (item_expr->result_type() != INT_RESULT)
+ {
+ my_error(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ if (part_type == RANGE_PARTITION)
+ {
+ if (part_elem->has_null_value)
+ {
+ my_error(ER_NULL_IN_VALUES_LESS_THAN, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ part_elem->range_value= val->value;
+ }
+ }
+ col_val->fixed= 2;
+ DBUG_RETURN(FALSE);
+}
+
+/*
+ Get column item with a proper character set according to the field
+
+ SYNOPSIS
+ get_column_item()
+ item Item object to start with
+ field Field for which the item will be compared to
+
+ RETURN VALUES
+ NULL Error
+ item Returned item
+*/
+
+Item* partition_info::get_column_item(Item *item, Field *field)
+{
+ if (field->result_type() == STRING_RESULT &&
+ item->collation.collation != field->charset())
+ {
+ if (!(item= convert_charset_partition_constant(item,
+ field->charset())))
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ return NULL;
+ }
+ }
+ return item;
+}
+
+
+/*
+ Evaluate VALUES functions for column list values
+ SYNOPSIS
+ fix_column_value_functions()
+ thd Thread object
+ col_val List of column values
+ part_id Partition id we are fixing
+
+ RETURN VALUES
+ TRUE Error
+ FALSE Success
+ DESCRIPTION
+ Fix column VALUES and store in memory array adapted to the data type
+*/
+
+bool partition_info::fix_column_value_functions(THD *thd,
+ part_elem_value *val,
+ uint part_id)
+{
+ uint num_columns= part_field_list.elements;
+ bool result= FALSE;
+ uint i;
+ part_column_list_val *col_val= val->col_val_array;
+ DBUG_ENTER("partition_info::fix_column_value_functions");
+
+ if (col_val->fixed > 1)
+ {
+ DBUG_RETURN(FALSE);
+ }
+ for (i= 0; i < num_columns; col_val++, i++)
+ {
+ Item *column_item= col_val->item_expression;
+ Field *field= part_field_array[i];
+ col_val->part_info= this;
+ col_val->partition_id= part_id;
+ if (col_val->max_value)
+ col_val->column_value= NULL;
+ else
+ {
+ col_val->column_value= NULL;
+ if (!col_val->null_value)
+ {
+ uchar *val_ptr;
+ uint len= field->pack_length();
+ ulong save_sql_mode;
+ bool save_got_warning;
+
+ if (!(column_item= get_column_item(column_item,
+ field)))
+ {
+ result= TRUE;
+ goto end;
+ }
+ save_sql_mode= thd->variables.sql_mode;
+ thd->variables.sql_mode= 0;
+ save_got_warning= thd->got_warning;
+ thd->got_warning= 0;
+ if (column_item->save_in_field(field, TRUE) ||
+ thd->got_warning)
+ {
+ my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
+ result= TRUE;
+ goto end;
+ }
+ thd->got_warning= save_got_warning;
+ thd->variables.sql_mode= save_sql_mode;
+ if (!(val_ptr= (uchar*) sql_calloc(len)))
+ {
+ mem_alloc_error(len);
+ result= TRUE;
+ goto end;
+ }
+ col_val->column_value= val_ptr;
+ memcpy(val_ptr, field->ptr, len);
+ }
+ }
+ col_val->fixed= 2;
+ }
+end:
+ DBUG_RETURN(result);
+}
+
+/*
+ The parser generates generic data structures, we need to set them up
+ as the rest of the code expects to find them. This is in reality part
+ of the syntax check of the parser code.
+
+ It is necessary to call this function in the case of a CREATE TABLE
+ statement, in this case we do it early in the check_partition_info
+ function.
+
+ It is necessary to call this function for ALTER TABLE where we
+ assign a completely new partition structure, in this case we do it
+ in prep_alter_part_table after discovering that the partition
+ structure is entirely redefined.
+
+ It's necessary to call this method also for ALTER TABLE ADD/REORGANIZE
+ of partitions, in this we call it in prep_alter_part_table after
+ making some initial checks but before going deep to check the partition
+ info, we also assign the column_list variable before calling this function
+ here.
+
+ Finally we also call it immediately after returning from parsing the
+ partitioning text found in the frm file.
+
+ This function mainly fixes the VALUES parts, these are handled differently
+ whether or not we use column list partitioning. Since the parser doesn't
+ know which we are using we need to set-up the old data structures after
+ the parser is complete when we know if what type of partitioning the
+ base table is using.
+
+ For column lists we will handle this in the fix_column_value_function.
+ For column lists it is sufficient to verify that the number of columns
+ and number of elements are in synch with each other. So only partitioning
+ using functions need to be set-up to their data structures.
+
+ SYNOPSIS
+ fix_parser_data()
+ thd Thread object
+
+ RETURN VALUES
+ TRUE Failure
+ FALSE Success
+*/
+
+int partition_info::fix_parser_data(THD *thd)
+{
+ List_iterator<partition_element> it(partitions);
+ partition_element *part_elem;
+ uint num_elements;
+ uint i= 0, j, k;
+ DBUG_ENTER("partition_info::fix_parser_data");
+
+ if (!(part_type == RANGE_PARTITION ||
+ part_type == LIST_PARTITION))
+ {
+ /* Nothing to do for HASH/KEY partitioning */
+ DBUG_RETURN(FALSE);
+ }
+ do
+ {
+ part_elem= it++;
+ List_iterator<part_elem_value> list_val_it(part_elem->list_val_list);
+ j= 0;
+ num_elements= part_elem->list_val_list.elements;
+ DBUG_ASSERT(part_type == RANGE_PARTITION ?
+ num_elements == 1U : TRUE);
+ do
+ {
+ part_elem_value *val= list_val_it++;
+ if (column_list)
+ {
+ if (val->added_items != num_columns)
+ {
+ my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ for (k= 0; k < num_columns; k++)
+ {
+ part_column_list_val *col_val= &val->col_val_array[k];
+ if (col_val->null_value && part_type == RANGE_PARTITION)
+ {
+ my_error(ER_NULL_IN_VALUES_LESS_THAN, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ }
+ }
+ else
+ {
+ if (fix_func_partition(thd, val, part_elem, i))
+ {
+ DBUG_RETURN(TRUE);
+ }
+ if (val->null_value)
+ {
+ /*
+ Null values aren't required in the value part, they are kept per
+ partition instance, only LIST partitions have NULL values.
+ */
+ list_val_it.remove();
+ }
+ }
+ } while (++j < num_elements);
+ } while (++i < num_parts);
+ DBUG_RETURN(FALSE);
+}
+
+void partition_info::print_debug(const char *str, uint *value)
+{
+ DBUG_ENTER("print_debug");
+ if (value)
+ DBUG_PRINT("info", ("parser: %s, val = %u", str, *value));
+ else
+ DBUG_PRINT("info", ("parser: %s", str));
+ DBUG_VOID_RETURN;
+}
+#else /* WITH_PARTITION_STORAGE_ENGINE */
+ /*
+ For builds without partitioning we need to define these functions
+ since we they are called from the parser. The parser cannot
+ remove code parts using ifdef, but the code parts cannot be called
+ so we simply need to add empty functions to make the linker happy.
+ */
+part_column_list_val *partition_info::add_column_value()
+{
+ return NULL;
+}
+
+bool partition_info::set_part_expr(char *start_token, Item *item_ptr,
+ char *end_token, bool is_subpart)
+{
+ (void)start_token;
+ (void)item_ptr;
+ (void)end_token;
+ (void)is_subpart;
+ return FALSE;
+}
+
+int partition_info::reorganize_into_single_field_col_val()
+{
+ return 0;
+}
+
+bool partition_info::init_column_part()
+{
+ return FALSE;
+}
+
+bool partition_info::add_column_list_value(THD *thd, Item *item)
+{
+ return FALSE;
+}
+int partition_info::add_max_value()
+{
+ return 0;
+}
+
+void partition_info::print_debug(const char *str, uint *value)
+{
+}
#endif /* WITH_PARTITION_STORAGE_ENGINE */
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 9f438e8260b..0ac8dec4945 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -1,4 +1,7 @@
-/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+#ifndef PARTITION_INFO_INCLUDED
+#define PARTITION_INFO_INCLUDED
+
+/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,10 +67,9 @@ public:
/*
When we have various string fields we might need some preparation
before and clean-up after calling the get_part_id_func's. We need
- one such method for get_partition_id and one for
- get_part_partition_id and one for get_subpartition_id.
+ one such method for get_part_partition_id and one for
+ get_subpartition_id.
*/
- get_part_id_func get_partition_id_charset;
get_part_id_func get_part_partition_id_charset;
get_subpart_id_func get_subpartition_id_charset;
@@ -81,7 +83,6 @@ public:
without duplicates, NULL-terminated.
*/
Field **full_part_field_array;
- Field **full_part_charset_field_array;
/*
Set of all fields used in partition and subpartition expression.
Required for testing of partition fields in write_set when
@@ -97,10 +98,8 @@ public:
*/
uchar **part_field_buffers;
uchar **subpart_field_buffers;
- uchar **full_part_field_buffers;
uchar **restore_part_field_ptrs;
uchar **restore_subpart_field_ptrs;
- uchar **restore_full_part_field_ptrs;
Item *part_expr;
Item *subpart_expr;
@@ -124,6 +123,8 @@ public:
union {
longlong *range_int_array;
LIST_PART_ENTRY *list_array;
+ part_column_list_val *range_col_array;
+ part_column_list_val *list_col_array;
};
/********************************************
@@ -154,6 +155,10 @@ public:
partition_element *curr_part_elem;
partition_element *current_partition;
+ part_elem_value *curr_list_val;
+ uint curr_list_object;
+ uint num_columns;
+
/*
These key_map's are used for Partitioning to enable quick decisions
on whether we can derive more information about which partition to
@@ -172,17 +177,17 @@ public:
uint part_func_len;
uint subpart_func_len;
- uint no_parts;
- uint no_subparts;
+ uint num_parts;
+ uint num_subparts;
uint count_curr_subparts;
uint part_error_code;
- uint no_list_values;
+ uint num_list_values;
- uint no_part_fields;
- uint no_subpart_fields;
- uint no_full_part_fields;
+ uint num_part_fields;
+ uint num_subpart_fields;
+ uint num_full_part_fields;
uint has_null_part_id;
/*
@@ -193,9 +198,9 @@ public:
uint16 linear_hash_mask;
bool use_default_partitions;
- bool use_default_no_partitions;
+ bool use_default_num_partitions;
bool use_default_subpartitions;
- bool use_default_no_subpartitions;
+ bool use_default_num_subpartitions;
bool default_partitions_setup;
bool defined_max_value;
bool list_of_part_fields;
@@ -205,7 +210,7 @@ public:
bool is_auto_partitioned;
bool from_openfrm;
bool has_null_value;
-
+ bool column_list;
partition_info()
: get_partition_id(NULL), get_part_partition_id(NULL),
@@ -214,11 +219,8 @@ public:
part_charset_field_array(NULL),
subpart_charset_field_array(NULL),
full_part_field_array(NULL),
- full_part_charset_field_array(NULL),
part_field_buffers(NULL), subpart_field_buffers(NULL),
- full_part_field_buffers(NULL),
restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL),
- restore_full_part_field_ptrs(NULL),
part_expr(NULL), subpart_expr(NULL), item_free_list(NULL),
first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL),
list_array(NULL), err_value(0),
@@ -226,22 +228,23 @@ public:
part_func_string(NULL), subpart_func_string(NULL),
part_state(NULL),
curr_part_elem(NULL), current_partition(NULL),
+ curr_list_object(0), num_columns(0),
default_engine_type(NULL),
part_result_type(INT_RESULT),
part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION),
part_info_len(0), part_state_len(0),
part_func_len(0), subpart_func_len(0),
- no_parts(0), no_subparts(0),
+ num_parts(0), num_subparts(0),
count_curr_subparts(0), part_error_code(0),
- no_list_values(0), no_part_fields(0), no_subpart_fields(0),
- no_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0),
- use_default_partitions(TRUE), use_default_no_partitions(TRUE),
- use_default_subpartitions(TRUE), use_default_no_subpartitions(TRUE),
+ num_list_values(0), num_part_fields(0), num_subpart_fields(0),
+ num_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0),
+ use_default_partitions(TRUE), use_default_num_partitions(TRUE),
+ use_default_subpartitions(TRUE), use_default_num_subpartitions(TRUE),
default_partitions_setup(FALSE), defined_max_value(FALSE),
list_of_part_fields(FALSE), list_of_subpart_fields(FALSE),
linear_hash_ind(FALSE), fixed(FALSE),
is_auto_partitioned(FALSE), from_openfrm(FALSE),
- has_null_value(FALSE)
+ has_null_value(FALSE), column_list(FALSE)
{
all_fields_in_PF.clear_all();
all_fields_in_PPF.clear_all();
@@ -264,27 +267,47 @@ public:
/* Returns the total number of partitions on the leaf level */
uint get_tot_partitions()
{
- return no_parts * (is_sub_partitioned() ? no_subparts : 1);
+ return num_parts * (is_sub_partitioned() ? num_subparts : 1);
}
bool set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info,
uint start_no);
+ char *has_unique_fields();
char *has_unique_names();
bool check_engine_mix(handlerton *engine_type, bool default_engine);
- bool check_range_constants();
- bool check_list_constants();
+ bool check_range_constants(THD *thd);
+ bool check_list_constants(THD *thd);
bool check_partition_info(THD *thd, handlerton **eng_type,
handler *file, HA_CREATE_INFO *info,
bool check_partition_function);
void print_no_partition_found(TABLE *table);
+ void print_debug(const char *str, uint*);
+ Item* get_column_item(Item *item, Field *field);
+ int fix_func_partition(THD *thd,
+ part_elem_value *val,
+ partition_element *part_elem,
+ uint part_id);
+ bool fix_column_value_functions(THD *thd,
+ part_elem_value *val,
+ uint part_id);
+ int fix_parser_data(THD *thd);
+ int add_max_value();
+ void init_col_val(part_column_list_val *col_val, Item *item);
+ int reorganize_into_single_field_col_val();
+ part_column_list_val *add_column_value();
+ bool set_part_expr(char *start_token, Item *item_ptr,
+ char *end_token, bool is_subpart);
+ static int compare_column_values(const void *a, const void *b);
bool set_up_charset_field_preps();
+ bool check_partition_field_length();
+ bool init_column_part();
+ bool add_column_list_value(THD *thd, Item *item);
private:
static int list_part_cmp(const void* a, const void* b);
- static int list_part_cmp_unsigned(const void* a, const void* b);
bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
uint start_no);
bool set_up_default_subpartitions(handler *file, HA_CREATE_INFO *info);
- char *create_default_partition_names(uint part_no, uint no_parts,
+ char *create_default_partition_names(uint part_no, uint num_parts,
uint start_no);
char *create_subpartition_name(uint subpart_no, const char *part_name);
bool has_unique_name(partition_element *element);
@@ -310,7 +333,9 @@ void init_all_partitions_iterator(partition_info *part_info,
PARTITION_ITERATOR *part_iter)
{
part_iter->part_nums.start= part_iter->part_nums.cur= 0;
- part_iter->part_nums.end= part_info->no_parts;
+ part_iter->part_nums.end= part_info->num_parts;
part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
part_iter->get_next= get_next_partition_id_range;
}
+
+#endif /* PARTITION_INFO_INCLUDED */
diff --git a/sql/procedure.h b/sql/procedure.h
index ceb586766b1..25b30ac593d 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -1,3 +1,6 @@
+#ifndef PROCEDURE_INCLUDED
+#define PROCEDURE_INCLUDED
+
/* Copyright (C) 2000-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -23,7 +26,7 @@
#define PROC_NO_SORT 1 /**< Bits in flags */
#define PROC_GROUP 2 /**< proc must have group */
-/* Procedure items used by procedures to store values for send_fields */
+/* Procedure items used by procedures to store values for send_result_set_metadata */
class Item_proc :public Item
{
@@ -149,3 +152,5 @@ public:
Procedure *setup_procedure(THD *thd,ORDER *proc_param,select_result *result,
List<Item> &field_list,int *error);
+
+#endif /* PROCEDURE_INCLUDED */
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 4f69a0fdb52..5990f0f001a 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -29,12 +29,13 @@
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
/* Declared non-static only because of the embedded library. */
-bool net_send_error_packet(THD *thd, uint sql_errno, const char *err);
-bool net_send_ok(THD *, uint, uint, ha_rows, ulonglong, const char *);
-bool net_send_eof(THD *thd, uint server_status, uint total_warn_count);
+bool net_send_error_packet(THD *, uint, const char *, const char *);
+/* Declared non-static only because of the embedded library. */
+bool net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *);
+/* Declared non-static only because of the embedded library. */
+bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
#ifndef EMBEDDED_LIBRARY
-static bool write_eof_packet(THD *thd, NET *net,
- uint server_status, uint total_warn_count);
+static bool write_eof_packet(THD *, NET *, uint, uint);
#endif
#ifndef EMBEDDED_LIBRARY
@@ -58,6 +59,64 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
}
+
+
+/*
+ net_store_data() - extended version with character set conversion.
+
+ It is optimized for short strings whose length after
+ conversion is garanteed to be less than 251, which accupies
+ exactly one byte to store length. It allows not to use
+ the "convert" member as a temporary buffer, conversion
+ is done directly to the "packet" member.
+ The limit 251 is good enough to optimize send_result_set_metadata()
+ because column, table, database names fit into this limit.
+*/
+
+#ifndef EMBEDDED_LIBRARY
+bool Protocol::net_store_data(const uchar *from, size_t length,
+ CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
+{
+ uint dummy_errors;
+ /* Calculate maxumum possible result length */
+ uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
+ if (conv_length > 250)
+ {
+ /*
+ For strings with conv_length greater than 250 bytes
+ we don't know how many bytes we will need to store length: one or two,
+ because we don't know result length until conversion is done.
+ For example, when converting from utf8 (mbmaxlen=3) to latin1,
+ conv_length=300 means that the result length can vary between 100 to 300.
+ length=100 needs one byte, length=300 needs to bytes.
+
+ Thus conversion directly to "packet" is not worthy.
+ Let's use "convert" as a temporary buffer.
+ */
+ return (convert->copy((const char*) from, length, from_cs,
+ to_cs, &dummy_errors) ||
+ net_store_data((const uchar*) convert->ptr(), convert->length()));
+ }
+
+ ulong packet_length= packet->length();
+ ulong new_length= packet_length + conv_length + 1;
+
+ if (new_length > packet->alloced_length() && packet->realloc(new_length))
+ return 1;
+
+ char *length_pos= (char*) packet->ptr() + packet_length;
+ char *to= length_pos + 1;
+
+ to+= copy_and_convert(to, conv_length, to_cs,
+ (const char*) from, length, from_cs, &dummy_errors);
+
+ net_store_length((uchar*) length_pos, to - length_pos - 1);
+ packet->length((uint) (to - packet->ptr()));
+ return 0;
+}
+#endif
+
+
/**
Send a error string to client.
@@ -80,29 +139,33 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
@retval TRUE An error occurred and the message wasn't sent properly
*/
-bool net_send_error(THD *thd, uint sql_errno, const char *err)
+bool net_send_error(THD *thd, uint sql_errno, const char *err,
+ const char* sqlstate)
{
+ bool error;
DBUG_ENTER("net_send_error");
DBUG_ASSERT(!thd->spcont);
DBUG_ASSERT(sql_errno);
- DBUG_ASSERT(err && err[0]);
+ DBUG_ASSERT(err);
DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, err));
- bool error;
+
+ if (sqlstate == NULL)
+ sqlstate= mysql_errno_to_sqlstate(sql_errno);
/*
It's one case when we can push an error even though there
is an OK or EOF already.
*/
- thd->main_da.can_overwrite_status= TRUE;
+ thd->stmt_da->can_overwrite_status= TRUE;
/* Abort multi-result sets */
thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
- error= net_send_error_packet(thd, sql_errno, err);
+ error= net_send_error_packet(thd, sql_errno, err, sqlstate);
- thd->main_da.can_overwrite_status= FALSE;
+ thd->stmt_da->can_overwrite_status= FALSE;
DBUG_RETURN(error);
}
@@ -124,7 +187,7 @@ bool net_send_error(THD *thd, uint sql_errno, const char *err)
@param thd Thread handler
@param server_status The server status
- @param total_warn_count Total number of warnings
+ @param statement_warn_count Total number of warnings
@param affected_rows Number of rows changed by statement
@param id Auto_increment id for first row (if used)
@param message Message to send to the client (Used by mysql_status)
@@ -138,8 +201,8 @@ bool net_send_error(THD *thd, uint sql_errno, const char *err)
#ifndef EMBEDDED_LIBRARY
bool
net_send_ok(THD *thd,
- uint server_status, uint total_warn_count,
- ha_rows affected_rows, ulonglong id, const char *message)
+ uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong id, const char *message)
{
NET *net= &thd->net;
uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
@@ -162,12 +225,12 @@ net_send_ok(THD *thd,
(ulong) affected_rows,
(ulong) id,
(uint) (server_status & 0xffff),
- (uint) total_warn_count));
+ (uint) statement_warn_count));
int2store(pos, server_status);
pos+=2;
/* We can only return up to 65535 warnings in two bytes */
- uint tmp= min(total_warn_count, 65535);
+ uint tmp= min(statement_warn_count, 65535);
int2store(pos, tmp);
pos+= 2;
}
@@ -176,7 +239,7 @@ net_send_ok(THD *thd,
int2store(pos, server_status);
pos+=2;
}
- thd->main_da.can_overwrite_status= TRUE;
+ thd->stmt_da->can_overwrite_status= TRUE;
if (message && message[0])
pos= net_store_data(pos, (uchar*) message, strlen(message));
@@ -184,7 +247,7 @@ net_send_ok(THD *thd,
if (!error)
error= net_flush(net);
- thd->main_da.can_overwrite_status= FALSE;
+ thd->stmt_da->can_overwrite_status= FALSE;
DBUG_PRINT("info", ("OK sent, so no more error sending allowed"));
DBUG_RETURN(error);
@@ -208,7 +271,7 @@ static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
@param thd Thread handler
@param server_status The server status
- @param total_warn_count Total number of warnings
+ @param statement_warn_count Total number of warnings
@return
@retval FALSE The message was successfully sent
@@ -216,7 +279,7 @@ static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
*/
bool
-net_send_eof(THD *thd, uint server_status, uint total_warn_count)
+net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{
NET *net= &thd->net;
bool error= FALSE;
@@ -224,11 +287,11 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
/* Set to TRUE if no active vio, to work well in case of --init-file */
if (net->vio != 0)
{
- thd->main_da.can_overwrite_status= TRUE;
- error= write_eof_packet(thd, net, server_status, total_warn_count);
+ thd->stmt_da->can_overwrite_status= TRUE;
+ error= write_eof_packet(thd, net, server_status, statement_warn_count);
if (!error)
error= net_flush(net);
- thd->main_da.can_overwrite_status= FALSE;
+ thd->stmt_da->can_overwrite_status= FALSE;
DBUG_PRINT("info", ("EOF sent, so no more error sending allowed"));
}
DBUG_RETURN(error);
@@ -242,7 +305,7 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
@param thd The thread handler
@param net The network handler
@param server_status The server status
- @param total_warn_count The number of warnings
+ @param statement_warn_count The number of warnings
@return
@@ -252,7 +315,7 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
static bool write_eof_packet(THD *thd, NET *net,
uint server_status,
- uint total_warn_count)
+ uint statement_warn_count)
{
bool error;
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
@@ -262,7 +325,7 @@ static bool write_eof_packet(THD *thd, NET *net,
Don't send warn count during SP execution, as the warn_list
is cleared between substatements, and mysqltest gets confused
*/
- uint tmp= min(total_warn_count, 65535);
+ uint tmp= min(statement_warn_count, 65535);
buff[0]= 254;
int2store(buff+1, tmp);
/*
@@ -309,13 +372,18 @@ bool send_old_password_request(THD *thd)
@retval TRUE An error occurred and the messages wasn't sent properly
*/
-bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
+bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
+ const char* sqlstate)
+
{
NET *net= &thd->net;
uint length;
/*
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
*/
+ uint error;
+ uchar converted_err[MYSQL_ERRMSG_SIZE];
+ uint32 converted_err_len;
uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
DBUG_ENTER("send_error_packet");
@@ -330,27 +398,24 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
DBUG_RETURN(FALSE);
}
- if (net->return_errno)
- { // new client code; Add errno before message
- int2store(buff,sql_errno);
- pos= buff+2;
- if (thd->client_capabilities & CLIENT_PROTOCOL_41)
- {
- /* The first # is to make the protocol backward compatible */
- buff[2]= '#';
- pos= (uchar*) strmov((char*) buff+3, mysql_errno_to_sqlstate(sql_errno));
- }
- length= (uint) (strmake((char*) pos, err, MYSQL_ERRMSG_SIZE-1) -
- (char*) buff);
- err= (char*) buff;
- }
- else
+ int2store(buff,sql_errno);
+ pos= buff+2;
+ if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{
- length=(uint) strlen(err);
- set_if_smaller(length,MYSQL_ERRMSG_SIZE-1);
+ /* The first # is to make the protocol backward compatible */
+ buff[2]= '#';
+ pos= (uchar*) strmov((char*) buff+3, sqlstate);
}
+ converted_err_len= convert_error_message((char*)converted_err,
+ sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err),
+ system_charset_info, &error);
+ length= (uint) (strmake((char*) pos, (char*)converted_err, MYSQL_ERRMSG_SIZE) -
+ (char*) buff);
+ err= (char*) buff;
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
- length));
+ length));
}
#endif /* EMBEDDED_LIBRARY */
@@ -414,6 +479,12 @@ static uchar *net_store_length_fast(uchar *packet, uint length)
packet is "buffered" in the diagnostics area and sent to the client
in the end of statement.
+ @note This method defines a template, but delegates actual
+ sending of data to virtual Protocol::send_{ok,eof,error}. This
+ allows for implementation of protocols that "intercept" ok/eof/error
+ messages, and store them in memory, etc, instead of sending to
+ the client.
+
@pre The diagnostics area is assigned or disabled. It can not be empty
-- we assume that every SQL statement or COM_* command
generates OK, ERROR, or EOF status.
@@ -428,47 +499,94 @@ static uchar *net_store_length_fast(uchar *packet, uint length)
Diagnostics_area::is_sent is set for debugging purposes only.
*/
-void net_end_statement(THD *thd)
+void Protocol::end_statement()
{
- DBUG_ASSERT(! thd->main_da.is_sent);
+ DBUG_ENTER("Protocol::end_statement");
+ DBUG_ASSERT(! thd->stmt_da->is_sent);
+ bool error= FALSE;
/* Can not be true, but do not take chances in production. */
- if (thd->main_da.is_sent)
- return;
+ if (thd->stmt_da->is_sent)
+ DBUG_VOID_RETURN;
- bool error= FALSE;
-
- switch (thd->main_da.status()) {
+ switch (thd->stmt_da->status()) {
case Diagnostics_area::DA_ERROR:
/* The query failed, send error to log and abort bootstrap. */
- error= net_send_error(thd,
- thd->main_da.sql_errno(),
- thd->main_da.message());
+ error= send_error(thd->stmt_da->sql_errno(),
+ thd->stmt_da->message(),
+ thd->stmt_da->get_sqlstate());
break;
case Diagnostics_area::DA_EOF:
- error= net_send_eof(thd,
- thd->main_da.server_status(),
- thd->main_da.total_warn_count());
+ error= send_eof(thd->stmt_da->server_status(),
+ thd->stmt_da->statement_warn_count());
break;
case Diagnostics_area::DA_OK:
- error= net_send_ok(thd,
- thd->main_da.server_status(),
- thd->main_da.total_warn_count(),
- thd->main_da.affected_rows(),
- thd->main_da.last_insert_id(),
- thd->main_da.message());
+ error= send_ok(thd->stmt_da->server_status(),
+ thd->stmt_da->statement_warn_count(),
+ thd->stmt_da->affected_rows(),
+ thd->stmt_da->last_insert_id(),
+ thd->stmt_da->message());
break;
case Diagnostics_area::DA_DISABLED:
break;
case Diagnostics_area::DA_EMPTY:
default:
DBUG_ASSERT(0);
- error= net_send_ok(thd, thd->server_status, thd->total_warn_count,
- 0, 0, NULL);
+ error= send_ok(thd->server_status, 0, 0, 0, NULL);
break;
}
if (!error)
- thd->main_da.is_sent= TRUE;
+ thd->stmt_da->is_sent= TRUE;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ A default implementation of "OK" packet response to the client.
+
+ Currently this implementation is re-used by both network-oriented
+ protocols -- the binary and text one. They do not differ
+ in their OK packet format, which allows for a significant simplification
+ on client side.
+*/
+
+bool Protocol::send_ok(uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong last_insert_id,
+ const char *message)
+{
+ DBUG_ENTER("Protocol::send_ok");
+
+ DBUG_RETURN(net_send_ok(thd, server_status, statement_warn_count,
+ affected_rows, last_insert_id, message));
+}
+
+
+/**
+ A default implementation of "EOF" packet response to the client.
+
+ Binary and text protocol do not differ in their EOF packet format.
+*/
+
+bool Protocol::send_eof(uint server_status, uint statement_warn_count)
+{
+ DBUG_ENTER("Protocol::send_eof");
+
+ DBUG_RETURN(net_send_eof(thd, server_status, statement_warn_count));
+}
+
+
+/**
+ A default implementation of "ERROR" packet response to the client.
+
+ Binary and text protocol do not differ in ERROR packet format.
+*/
+
+bool Protocol::send_error(uint sql_errno, const char *err_msg,
+ const char *sql_state)
+{
+ DBUG_ENTER("Protocol::send_error");
+
+ DBUG_RETURN(net_send_error_packet(thd, sql_errno, err_msg, sql_state));
}
@@ -525,9 +643,10 @@ void Protocol::init(THD *thd_arg)
for the error.
*/
-void Protocol::end_partial_result_set(THD *thd)
+void Protocol::end_partial_result_set(THD *thd_arg)
{
- net_send_eof(thd, thd->server_status, 0 /* no warnings, we're inside SP */);
+ net_send_eof(thd_arg, thd_arg->server_status,
+ 0 /* no warnings, we're inside SP */);
}
@@ -560,16 +679,16 @@ bool Protocol::flush()
1 Error (Note that in this case the error is not sent to the
client)
*/
-bool Protocol::send_fields(List<Item> *list, uint flags)
+bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
Item *item;
- uchar buff[80];
+ uchar buff[MAX_FIELD_WIDTH];
String tmp((char*) buff,sizeof(buff),&my_charset_bin);
Protocol_text prot(thd);
String *local_packet= prot.storage_packet();
CHARSET_INFO *thd_charset= thd->variables.character_set_results;
- DBUG_ENTER("send_fields");
+ DBUG_ENTER("send_result_set_metadata");
if (flags & SEND_NUM_ROWS)
{ // Packet with number of elements
@@ -711,9 +830,10 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
to show that there is no cursor.
Send no warning information, as it will be sent at statement end.
*/
- write_eof_packet(thd, &thd->net, thd->server_status, thd->total_warn_count);
+ write_eof_packet(thd, &thd->net, thd->server_status,
+ thd->warning_info->statement_warn_count());
}
- DBUG_RETURN(prepare_for_send(list));
+ DBUG_RETURN(prepare_for_send(list->elements));
err:
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES),
@@ -732,6 +852,47 @@ bool Protocol::write()
/**
+ Send one result set row.
+
+ @param row_items a collection of column values for that row
+
+ @return Error status.
+ @retval TRUE Error.
+ @retval FALSE Success.
+*/
+
+bool Protocol::send_result_set_row(List<Item> *row_items)
+{
+ char buffer[MAX_FIELD_WIDTH];
+ String str_buffer(buffer, sizeof (buffer), &my_charset_bin);
+ List_iterator_fast<Item> it(*row_items);
+
+ DBUG_ENTER("Protocol::send_result_set_row");
+
+ for (Item *item= it++; item; item= it++)
+ {
+ if (item->send(this, &str_buffer))
+ {
+ // If we're out of memory, reclaim some, to help us recover.
+ this->free();
+ DBUG_RETURN(TRUE);
+ }
+ /* Item::send() may generate an error. If so, abort the loop. */
+ if (thd->is_error())
+ DBUG_RETURN(TRUE);
+
+ /*
+ Reset str_buffer to its original state, as it may have been altered in
+ Item::send().
+ */
+ str_buffer.set(buffer, sizeof(buffer), &my_charset_bin);
+ }
+
+ DBUG_RETURN(FALSE);
+}
+
+
+/**
Send \\0 end terminated string.
@param from NullS or \\0 terminated string
@@ -777,7 +938,6 @@ bool Protocol::store(I_List<i_string>* str_list)
return store((char*) tmp.ptr(), len, tmp.charset());
}
-
/****************************************************************************
Functions to handle the simple (default) protocol where everything is
This protocol is the one that is used by default between the MySQL server
@@ -820,10 +980,10 @@ bool Protocol::store_string_aux(const char *from, size_t length,
fromcs != &my_charset_bin &&
tocs != &my_charset_bin)
{
- uint dummy_errors;
- return (convert->copy(from, length, fromcs, tocs, &dummy_errors) ||
- net_store_data((uchar*) convert->ptr(), convert->length()));
+ /* Store with conversion */
+ return net_store_data((uchar*) from, length, fromcs, tocs);
}
+ /* Store without conversion */
return net_store_data((uchar*) from, length);
}
@@ -1056,6 +1216,53 @@ bool Protocol_text::store_time(MYSQL_TIME *tm)
return net_store_data((uchar*) buff, length);
}
+/**
+ Assign OUT-parameters to user variables.
+
+ @param sp_params List of PS/SP parameters (both input and output).
+
+ @return Error status.
+ @retval FALSE Success.
+ @retval TRUE Error.
+*/
+
+bool Protocol_text::send_out_parameters(List<Item_param> *sp_params)
+{
+ DBUG_ASSERT(sp_params->elements ==
+ thd->lex->prepared_stmt_params.elements);
+
+ List_iterator_fast<Item_param> item_param_it(*sp_params);
+ List_iterator_fast<LEX_STRING> user_var_name_it(thd->lex->prepared_stmt_params);
+
+ while (true)
+ {
+ Item_param *item_param= item_param_it++;
+ LEX_STRING *user_var_name= user_var_name_it++;
+
+ if (!item_param || !user_var_name)
+ break;
+
+ if (!item_param->get_out_param_info())
+ continue; // It's an IN-parameter.
+
+ Item_func_set_user_var *suv=
+ new Item_func_set_user_var(*user_var_name, item_param);
+ /*
+ Item_func_set_user_var is not fixed after construction, call
+ fix_fields().
+ */
+ if (suv->fix_fields(thd, NULL))
+ return TRUE;
+
+ if (suv->check(FALSE))
+ return TRUE;
+
+ if (suv->update())
+ return TRUE;
+ }
+
+ return FALSE;
+}
/****************************************************************************
Functions to handle the binary protocol used with prepared statements
@@ -1076,14 +1283,13 @@ bool Protocol_text::store_time(MYSQL_TIME *tm)
[..]..[[length]data] data
****************************************************************************/
-bool Protocol_binary::prepare_for_send(List<Item> *item_list)
+bool Protocol_binary::prepare_for_send(uint num_columns)
{
- Protocol::prepare_for_send(item_list);
+ Protocol::prepare_for_send(num_columns);
bit_fields= (field_count+9)/8;
- if (packet->alloc(bit_fields+1))
- return 1;
+ return packet->alloc(bit_fields+1);
+
/* prepare_for_resend will be called after this one */
- return 0;
}
@@ -1271,3 +1477,80 @@ bool Protocol_binary::store_time(MYSQL_TIME *tm)
buff[0]=(char) length; // Length is stored first
return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC);
}
+
+/**
+ Send a result set with OUT-parameter values by means of PS-protocol.
+
+ @param sp_params List of PS/SP parameters (both input and output).
+
+ @return Error status.
+ @retval FALSE Success.
+ @retval TRUE Error.
+*/
+
+bool Protocol_binary::send_out_parameters(List<Item_param> *sp_params)
+{
+ if (!(thd->client_capabilities & CLIENT_PS_MULTI_RESULTS))
+ {
+ /* The client does not support OUT-parameters. */
+ return FALSE;
+ }
+
+ List<Item> out_param_lst;
+
+ {
+ List_iterator_fast<Item_param> item_param_it(*sp_params);
+
+ while (true)
+ {
+ Item_param *item_param= item_param_it++;
+
+ if (!item_param)
+ break;
+
+ if (!item_param->get_out_param_info())
+ continue; // It's an IN-parameter.
+
+ if (out_param_lst.push_back(item_param))
+ return TRUE;
+ }
+ }
+
+ if (!out_param_lst.elements)
+ return FALSE;
+
+ /*
+ We have to set SERVER_PS_OUT_PARAMS in THD::server_status, because it
+ is used in send_result_set_metadata().
+ */
+
+ thd->server_status|= SERVER_PS_OUT_PARAMS | SERVER_MORE_RESULTS_EXISTS;
+
+ /* Send meta-data. */
+ if (send_result_set_metadata(&out_param_lst, SEND_NUM_ROWS | SEND_EOF))
+ return TRUE;
+
+ /* Send data. */
+
+ prepare_for_resend();
+
+ if (send_result_set_row(&out_param_lst))
+ return TRUE;
+
+ if (write())
+ return TRUE;
+
+ /* Restore THD::server_status. */
+ thd->server_status&= ~SERVER_PS_OUT_PARAMS;
+
+ /*
+ Reset SERVER_MORE_RESULTS_EXISTS bit, because this is the last packet
+ for sure.
+ */
+ thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
+
+ /* Send EOF-packet. */
+ net_send_eof(thd, thd->server_status, 0);
+
+ return FALSE;
+}
diff --git a/sql/protocol.h b/sql/protocol.h
index 251ba6fbc33..142f7919d6f 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -1,3 +1,6 @@
+#ifndef PROTOCOL_INCLUDED
+#define PROTOCOL_INCLUDED
+
/* Copyright (C) 2002-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -17,9 +20,11 @@
#pragma interface /* gcc class implementation */
#endif
+#include "sql_error.h"
class i_string;
class THD;
+class Item_param;
typedef struct st_mysql_field MYSQL_FIELD;
typedef struct st_mysql_rows MYSQL_ROWS;
@@ -42,8 +47,20 @@ protected:
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
#endif
+ bool net_store_data(const uchar *from, size_t length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
bool store_string_aux(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+
+ virtual bool send_ok(uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong last_insert_id,
+ const char *message);
+
+ virtual bool send_eof(uint server_status, uint statement_warn_count);
+
+ virtual bool send_error(uint sql_errno, const char *err_msg,
+ const char *sql_state);
+
public:
Protocol() {}
Protocol(THD *thd_arg) { init(thd_arg); }
@@ -51,7 +68,8 @@ public:
void init(THD* thd_arg);
enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 };
- virtual bool send_fields(List<Item> *list, uint flags);
+ virtual bool send_result_set_metadata(List<Item> *list, uint flags);
+ bool send_result_set_row(List<Item> *row_items);
bool store(I_List<i_string> *str_list);
bool store(const char *from, CHARSET_INFO *cs);
@@ -69,9 +87,9 @@ public:
inline bool store(String *str)
{ return store((char*) str->ptr(), str->length(), str->charset()); }
- virtual bool prepare_for_send(List<Item> *item_list)
+ virtual bool prepare_for_send(uint num_columns)
{
- field_count=item_list->elements;
+ field_count= num_columns;
return 0;
}
virtual bool flush();
@@ -93,6 +111,8 @@ public:
virtual bool store_date(MYSQL_TIME *time)=0;
virtual bool store_time(MYSQL_TIME *time)=0;
virtual bool store(Field *field)=0;
+
+ virtual bool send_out_parameters(List<Item_param> *sp_params)=0;
#ifdef EMBEDDED_LIBRARY
int begin_dataset();
virtual void remove_last_row() {}
@@ -101,13 +121,15 @@ public:
#endif
enum enum_protocol_type
{
- PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1
/*
- before adding here or change the values, consider that it is cast to a
- bit in sql_cache.cc.
+ Before adding a new type, please make sure
+ there is enough storage for it in Query_cache_query_flags.
*/
+ PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1, PROTOCOL_LOCAL= 2
};
virtual enum enum_protocol_type type()= 0;
+
+ void end_statement();
};
@@ -134,6 +156,8 @@ public:
virtual bool store(float nr, uint32 decimals, String *buffer);
virtual bool store(double from, uint32 decimals, String *buffer);
virtual bool store(Field *field);
+
+ virtual bool send_out_parameters(List<Item_param> *sp_params);
#ifdef EMBEDDED_LIBRARY
void remove_last_row();
#endif
@@ -148,7 +172,7 @@ private:
public:
Protocol_binary() {}
Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {}
- virtual bool prepare_for_send(List<Item> *item_list);
+ virtual bool prepare_for_send(uint num_columns);
virtual void prepare_for_resend();
#ifdef EMBEDDED_LIBRARY
virtual bool write();
@@ -169,14 +193,18 @@ public:
virtual bool store(float nr, uint32 decimals, String *buffer);
virtual bool store(double from, uint32 decimals, String *buffer);
virtual bool store(Field *field);
+
+ virtual bool send_out_parameters(List<Item_param> *sp_params);
+
virtual enum enum_protocol_type type() { return PROTOCOL_BINARY; };
};
void send_warning(THD *thd, uint sql_errno, const char *err=0);
-bool net_send_error(THD *thd, uint sql_errno=0, const char *err=0);
-void net_end_statement(THD *thd);
+bool net_send_error(THD *thd, uint sql_errno, const char *err,
+ const char* sqlstate);
bool send_old_password_request(THD *thd);
uchar *net_store_data(uchar *to,const uchar *from, size_t length);
uchar *net_store_data(uchar *to,int32 from);
uchar *net_store_data(uchar *to,longlong from);
+#endif /* PROTOCOL_INCLUDED */
diff --git a/sql/records.cc b/sql/records.cc
index b6faf0227f9..8fd63d104a4 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -13,6 +13,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifdef USE_PRAGMA_INTERFACE
+#pragma implementation /* gcc class implementation */
+#endif
/**
@file
@@ -21,8 +24,10 @@
Functions for easy reading of records, possible through a cache
*/
+#include "records.h"
#include "mysql_priv.h"
+
static int rr_quick(READ_RECORD *info);
int rr_sequential(READ_RECORD *info);
static int rr_from_tempfile(READ_RECORD *info);
diff --git a/sql/records.h b/sql/records.h
new file mode 100644
index 00000000000..ae81a31ee1a
--- /dev/null
+++ b/sql/records.h
@@ -0,0 +1,79 @@
+#ifndef SQL_RECORDS_H
+#define SQL_RECORDS_H
+/* Copyright (C) 2008 Sun/MySQL
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface /* gcc class implementation */
+#endif
+#include <my_global.h> /* for uint typedefs */
+
+struct st_join_table;
+class handler;
+struct TABLE;
+class THD;
+class SQL_SELECT;
+
+/**
+ A context for reading through a single table using a chosen access method:
+ index read, scan, etc, use of cache, etc.
+
+ Use by:
+ READ_RECORD read_record;
+ init_read_record(&read_record, ...);
+ while (read_record.read_record())
+ {
+ ...
+ }
+ end_read_record();
+*/
+
+struct READ_RECORD
+{
+ typedef int (*Read_func)(READ_RECORD*);
+ typedef void (*Unlock_row_func)(st_join_table *);
+ typedef int (*Setup_func)(struct st_join_table*);
+
+ TABLE *table; /* Head-form */
+ handler *file;
+ TABLE **forms; /* head and ref forms */
+ Unlock_row_func unlock_row;
+ Read_func read_record;
+ THD *thd;
+ SQL_SELECT *select;
+ uint cache_records;
+ uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
+ uint index;
+ uchar *ref_pos; /* pointer to form->refpos */
+ uchar *record;
+ uchar *rec_buf; /* to read field values after filesort */
+ uchar *cache,*cache_pos,*cache_end,*read_positions;
+ struct st_io_cache *io_cache;
+ bool print_error, ignore_not_found_rows;
+
+public:
+ READ_RECORD() {}
+};
+
+void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
+ SQL_SELECT *select, int use_record_cache,
+ bool print_errors, bool disable_rr_cache);
+void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+ bool print_error, uint idx);
+void end_read_record(READ_RECORD *info);
+
+void rr_unlock_row(st_join_table *tab);
+
+#endif /* SQL_RECORDS_H */
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index c6a05e93bf4..7a941b1d99b 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -146,10 +146,10 @@ void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
pthread_mutex_lock(&LOCK_slave_list);
SLAVE_INFO* old_si;
- if ((old_si = (SLAVE_INFO*)hash_search(&slave_list,
- (uchar*)&thd->server_id, 4)) &&
+ if ((old_si = (SLAVE_INFO*)my_hash_search(&slave_list,
+ (uchar*)&thd->server_id, 4)) &&
(!only_mine || old_si->thd == thd))
- hash_delete(&slave_list, (uchar*)old_si);
+ my_hash_delete(&slave_list, (uchar*)old_si);
if (need_mutex)
pthread_mutex_unlock(&LOCK_slave_list);
@@ -221,17 +221,18 @@ extern "C" void slave_info_free(void *s)
void init_slave_list()
{
- hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0,
- (hash_get_key) slave_list_key, (hash_free_key) slave_info_free, 0);
+ my_hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0,
+ (my_hash_get_key) slave_list_key,
+ (my_hash_free_key) slave_info_free, 0);
pthread_mutex_init(&LOCK_slave_list, MY_MUTEX_INIT_FAST);
}
void end_slave_list()
{
/* No protection by a mutex needed as we are only called at shutdown */
- if (hash_inited(&slave_list))
+ if (my_hash_inited(&slave_list))
{
- hash_free(&slave_list);
+ my_hash_free(&slave_list);
pthread_mutex_destroy(&LOCK_slave_list);
}
}
@@ -470,7 +471,7 @@ bool show_new_master(THD* thd)
field_list.push_back(new Item_empty_string("Log_name", 20));
field_list.push_back(new Item_return_int("Log_pos", 10,
MYSQL_TYPE_LONGLONG));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
protocol->prepare_for_resend();
@@ -547,8 +548,8 @@ HOSTS";
uint32 log_server_id;
SLAVE_INFO* si, *old_si;
log_server_id = atoi(row[0]);
- if ((old_si= (SLAVE_INFO*)hash_search(&slave_list,
- (uchar*)&log_server_id,4)))
+ if ((old_si= (SLAVE_INFO*)my_hash_search(&slave_list,
+ (uchar*)&log_server_id,4)))
si = old_si;
else
{
@@ -681,7 +682,7 @@ bool show_slave_hosts(THD* thd)
field_list.push_back(new Item_return_int("Master_id", 10,
MYSQL_TYPE_LONG));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -689,7 +690,7 @@ bool show_slave_hosts(THD* thd)
for (uint i = 0; i < slave_list.records; ++i)
{
- SLAVE_INFO* si = (SLAVE_INFO*) hash_element(&slave_list, i);
+ SLAVE_INFO* si = (SLAVE_INFO*) my_hash_element(&slave_list, i);
protocol->prepare_for_resend();
protocol->store((uint32) si->server_id);
protocol->store(si->host, &my_charset_bin);
@@ -920,7 +921,7 @@ bool load_master_data(THD* thd)
goto err;
}
/* Clear the result of mysql_create_db(). */
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
if (mysql_select_db(&mysql, db) ||
mysql_real_query(&mysql, STRING_WITH_LEN("SHOW TABLES")) ||
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 6ff78067aca..bce2c727050 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -1,3 +1,6 @@
+#ifndef REPL_FAILSAFE_INCLUDED
+#define REPL_FAILSAFE_INCLUDED
+
/* Copyright (C) 2001-2005 MySQL AB & Sasha
This program is free software; you can redistribute it and/or modify
@@ -49,3 +52,4 @@ int register_slave(THD* thd, uchar* packet, uint packet_length);
void unregister_slave(THD* thd, bool only_mine, bool need_mutex);
#endif /* HAVE_REPLICATION */
+#endif /* REPL_FAILSAFE_INCLUDED */
diff --git a/sql/replication.h b/sql/replication.h
new file mode 100644
index 00000000000..eea77ef9f8e
--- /dev/null
+++ b/sql/replication.h
@@ -0,0 +1,550 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef REPLICATION_H
+#define REPLICATION_H
+
+typedef struct st_mysql MYSQL;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ Transaction observer flags.
+*/
+enum Trans_flags {
+ /** Transaction is a real transaction */
+ TRANS_IS_REAL_TRANS = 1
+};
+
+/**
+ Transaction observer parameter
+*/
+typedef struct Trans_param {
+ uint32 server_id;
+ uint32 flags;
+
+ /*
+ The latest binary log file name and position written by current
+ transaction, if binary log is disabled or no log event has been
+ written into binary log file by current transaction (events
+ written into transaction log cache are not counted), these two
+ member will be zero.
+ */
+ const char *log_file;
+ my_off_t log_pos;
+} Trans_param;
+
+/**
+ Observes and extends transaction execution
+*/
+typedef struct Trans_observer {
+ uint32 len;
+
+ /**
+ This callback is called after transaction commit
+
+ This callback is called right after commit to storage engines for
+ transactional tables.
+
+ For non-transactional tables, this is called at the end of the
+ statement, before sending statement status, if the statement
+ succeeded.
+
+ @note The return value is currently ignored by the server.
+
+ @param param The parameter for transaction observers
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_commit)(Trans_param *param);
+
+ /**
+ This callback is called after transaction rollback
+
+ This callback is called right after rollback to storage engines
+ for transactional tables.
+
+ For non-transactional tables, this is called at the end of the
+ statement, before sending statement status, if the statement
+ failed.
+
+ @note The return value is currently ignored by the server.
+
+ @param param The parameter for transaction observers
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_rollback)(Trans_param *param);
+} Trans_observer;
+
+/**
+ Binlog storage flags
+*/
+enum Binlog_storage_flags {
+ /** Binary log was sync:ed */
+ BINLOG_STORAGE_IS_SYNCED = 1
+};
+
+/**
+ Binlog storage observer parameters
+ */
+typedef struct Binlog_storage_param {
+ uint32 server_id;
+} Binlog_storage_param;
+
+/**
+ Observe binlog logging storage
+*/
+typedef struct Binlog_storage_observer {
+ uint32 len;
+
+ /**
+ This callback is called after binlog has been flushed
+
+ This callback is called after cached events have been flushed to
+ binary log file. Whether the binary log file is synchronized to
+ disk is indicated by the bit BINLOG_STORAGE_IS_SYNCED in @a flags.
+
+ @param param Observer common parameter
+ @param log_file Binlog file name been updated
+ @param log_pos Binlog position after update
+ @param flags flags for binlog storage
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_flush)(Binlog_storage_param *param,
+ const char *log_file, my_off_t log_pos,
+ uint32 flags);
+} Binlog_storage_observer;
+
+/**
+ Replication binlog transmitter (binlog dump) observer parameter.
+*/
+typedef struct Binlog_transmit_param {
+ uint32 server_id;
+ uint32 flags;
+} Binlog_transmit_param;
+
+/**
+ Observe and extends the binlog dumping thread.
+*/
+typedef struct Binlog_transmit_observer {
+ uint32 len;
+
+ /**
+ This callback is called when binlog dumping starts
+
+
+ @param param Observer common parameter
+ @param log_file Binlog file name to transmit from
+ @param log_pos Binlog position to transmit from
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*transmit_start)(Binlog_transmit_param *param,
+ const char *log_file, my_off_t log_pos);
+
+ /**
+ This callback is called when binlog dumping stops
+
+ @param param Observer common parameter
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*transmit_stop)(Binlog_transmit_param *param);
+
+ /**
+ This callback is called to reserve bytes in packet header for event transmission
+
+ This callback is called when resetting transmit packet header to
+ reserve bytes for this observer in packet header.
+
+ The @a header buffer is allocated by the server code, and @a size
+ is the size of the header buffer. Each observer can only reserve
+ a maximum size of @a size in the header.
+
+ @param param Observer common parameter
+ @param header Pointer of the header buffer
+ @param size Size of the header buffer
+ @param len Header length reserved by this observer
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*reserve_header)(Binlog_transmit_param *param,
+ unsigned char *header,
+ unsigned long size,
+ unsigned long *len);
+
+ /**
+ This callback is called before sending an event packet to slave
+
+ @param param Observer common parameter
+ @param packet Binlog event packet to send
+ @param len Length of the event packet
+ @param log_file Binlog file name of the event packet to send
+ @param log_pos Binlog position of the event packet to send
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*before_send_event)(Binlog_transmit_param *param,
+ unsigned char *packet, unsigned long len,
+ const char *log_file, my_off_t log_pos );
+
+ /**
+ This callback is called after sending an event packet to slave
+
+ @param param Observer common parameter
+ @param event_buf Binlog event packet buffer sent
+ @param len length of the event packet buffer
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_send_event)(Binlog_transmit_param *param,
+ const char *event_buf, unsigned long len);
+
+ /**
+ This callback is called after resetting master status
+
+ This is called when executing the command RESET MASTER, and is
+ used to reset status variables added by observers.
+
+ @param param Observer common parameter
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_reset_master)(Binlog_transmit_param *param);
+} Binlog_transmit_observer;
+
+/**
+ Binlog relay IO flags
+*/
+enum Binlog_relay_IO_flags {
+ /** Binary relay log was sync:ed */
+ BINLOG_RELAY_IS_SYNCED = 1
+};
+
+
+/**
+ Replication binlog relay IO observer parameter
+*/
+typedef struct Binlog_relay_IO_param {
+ uint32 server_id;
+
+ /* Master host, user and port */
+ char *host;
+ char *user;
+ unsigned int port;
+
+ char *master_log_name;
+ my_off_t master_log_pos;
+
+ MYSQL *mysql; /* the connection to master */
+} Binlog_relay_IO_param;
+
+/**
+ Observes and extends the service of slave IO thread.
+*/
+typedef struct Binlog_relay_IO_observer {
+ uint32 len;
+
+ /**
+ This callback is called when slave IO thread starts
+
+ @param param Observer common parameter
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*thread_start)(Binlog_relay_IO_param *param);
+
+ /**
+ This callback is called when slave IO thread stops
+
+ @param param Observer common parameter
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*thread_stop)(Binlog_relay_IO_param *param);
+
+ /**
+ This callback is called before slave requesting binlog transmission from master
+
+ This is called before slave issuing BINLOG_DUMP command to master
+ to request binlog.
+
+ @param param Observer common parameter
+ @param flags binlog dump flags
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*before_request_transmit)(Binlog_relay_IO_param *param, uint32 flags);
+
+ /**
+ This callback is called after read an event packet from master
+
+ @param param Observer common parameter
+ @param packet The event packet read from master
+ @param len Length of the event packet read from master
+ @param event_buf The event packet return after process
+ @param event_len The length of event packet return after process
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_read_event)(Binlog_relay_IO_param *param,
+ const char *packet, unsigned long len,
+ const char **event_buf, unsigned long *event_len);
+
+ /**
+ This callback is called after written an event packet to relay log
+
+ @param param Observer common parameter
+ @param event_buf Event packet written to relay log
+ @param event_len Length of the event packet written to relay log
+ @param flags flags for relay log
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_queue_event)(Binlog_relay_IO_param *param,
+ const char *event_buf, unsigned long event_len,
+ uint32 flags);
+
+ /**
+ This callback is called after reset slave relay log IO status
+
+ @param param Observer common parameter
+
+ @retval 0 Sucess
+ @retval 1 Failure
+ */
+ int (*after_reset_slave)(Binlog_relay_IO_param *param);
+} Binlog_relay_IO_observer;
+
+
+/**
+ Register a transaction observer
+
+ @param observer The transaction observer to register
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer already exists
+*/
+int register_trans_observer(Trans_observer *observer, void *p);
+
+/**
+ Unregister a transaction observer
+
+ @param observer The transaction observer to unregister
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer not exists
+*/
+int unregister_trans_observer(Trans_observer *observer, void *p);
+
+/**
+ Register a binlog storage observer
+
+ @param observer The binlog storage observer to register
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer already exists
+*/
+int register_binlog_storage_observer(Binlog_storage_observer *observer, void *p);
+
+/**
+ Unregister a binlog storage observer
+
+ @param observer The binlog storage observer to unregister
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer not exists
+*/
+int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p);
+
+/**
+ Register a binlog transmit observer
+
+ @param observer The binlog transmit observer to register
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer already exists
+*/
+int register_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p);
+
+/**
+ Unregister a binlog transmit observer
+
+ @param observer The binlog transmit observer to unregister
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer not exists
+*/
+int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p);
+
+/**
+ Register a binlog relay IO (slave IO thread) observer
+
+ @param observer The binlog relay IO observer to register
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer already exists
+*/
+int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p);
+
+/**
+ Unregister a binlog relay IO (slave IO thread) observer
+
+ @param observer The binlog relay IO observer to unregister
+ @param p pointer to the internal plugin structure
+
+ @retval 0 Sucess
+ @retval 1 Observer not exists
+*/
+int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p);
+
+/**
+ Connect to master
+
+ This function can only used in the slave I/O thread context, and
+ will use the same master information to do the connection.
+
+ @code
+ MYSQL *mysql = mysql_init(NULL);
+ if (rpl_connect_master(mysql))
+ {
+ // do stuff with the connection
+ }
+ mysql_close(mysql); // close the connection
+ @endcode
+
+ @param mysql address of MYSQL structure to use, pass NULL will
+ create a new one
+
+ @return address of MYSQL structure on success, NULL on failure
+*/
+MYSQL *rpl_connect_master(MYSQL *mysql);
+
+/**
+ Set thread entering a condition
+
+ This function should be called before putting a thread to wait for
+ a condition. @a mutex should be held before calling this
+ function. After being waken up, @f thd_exit_cond should be called.
+
+ @param thd The thread entering the condition, NULL means current thread
+ @param cond The condition the thread is going to wait for
+ @param mutex The mutex associated with the condition, this must be
+ held before call this function
+ @param msg The new process message for the thread
+*/
+const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
+ pthread_mutex_t *mutex, const char *msg);
+
+/**
+ Set thread leaving a condition
+
+ This function should be called after a thread being waken up for a
+ condition.
+
+ @param thd The thread entering the condition, NULL means current thread
+ @param old_msg The process message, ususally this should be the old process
+ message before calling @f thd_enter_cond
+*/
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg);
+
+/**
+ Get the value of user variable as an integer.
+
+ This function will return the value of variable @a name as an
+ integer. If the original value of the variable is not an integer,
+ the value will be converted into an integer.
+
+ @param name user variable name
+ @param value pointer to return the value
+ @param null_value if not NULL, the function will set it to true if
+ the value of variable is null, set to false if not
+
+ @retval 0 Success
+ @retval 1 Variable not found
+*/
+int get_user_var_int(const char *name,
+ long long int *value, int *null_value);
+
+/**
+ Get the value of user variable as a double precision float number.
+
+ This function will return the value of variable @a name as real
+ number. If the original value of the variable is not a real number,
+ the value will be converted into a real number.
+
+ @param name user variable name
+ @param value pointer to return the value
+ @param null_value if not NULL, the function will set it to true if
+ the value of variable is null, set to false if not
+
+ @retval 0 Success
+ @retval 1 Variable not found
+*/
+int get_user_var_real(const char *name,
+ double *value, int *null_value);
+
+/**
+ Get the value of user variable as a string.
+
+ This function will return the value of variable @a name as
+ string. If the original value of the variable is not a string,
+ the value will be converted into a string.
+
+ @param name user variable name
+ @param value pointer to the value buffer
+ @param len length of the value buffer
+ @param precision precision of the value if it is a float number
+ @param null_value if not NULL, the function will set it to true if
+ the value of variable is null, set to false if not
+
+ @retval 0 Success
+ @retval 1 Variable not found
+*/
+int get_user_var_str(const char *name,
+ char *value, unsigned long len,
+ unsigned int precision, int *null_value);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* REPLICATION_H */
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index 68272c58bb1..392d8baf50e 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -32,9 +32,9 @@ Rpl_filter::Rpl_filter() :
Rpl_filter::~Rpl_filter()
{
if (do_table_inited)
- hash_free(&do_table);
+ my_hash_free(&do_table);
if (ignore_table_inited)
- hash_free(&ignore_table);
+ my_hash_free(&ignore_table);
if (wild_do_table_inited)
free_string_array(&wild_do_table);
if (wild_ignore_table_inited)
@@ -103,12 +103,12 @@ Rpl_filter::tables_ok(const char* db, TABLE_LIST* tables)
len= (uint) (strmov(end, tables->table_name) - hash_key);
if (do_table_inited) // if there are any do's
{
- if (hash_search(&do_table, (uchar*) hash_key, len))
+ if (my_hash_search(&do_table, (uchar*) hash_key, len))
DBUG_RETURN(1);
}
if (ignore_table_inited) // if there are any ignores
{
- if (hash_search(&ignore_table, (uchar*) hash_key, len))
+ if (my_hash_search(&ignore_table, (uchar*) hash_key, len))
DBUG_RETURN(0);
}
if (wild_do_table_inited &&
@@ -387,7 +387,7 @@ void free_table_ent(void* a)
void
Rpl_filter::init_table_rule_hash(HASH* h, bool* h_inited)
{
- hash_init(h, system_charset_info,TABLE_RULE_HASH_SIZE,0,0,
+ my_hash_init(h, system_charset_info,TABLE_RULE_HASH_SIZE,0,0,
get_table_key, free_table_ent, 0);
*h_inited = 1;
}
@@ -458,7 +458,7 @@ Rpl_filter::table_rule_ent_hash_to_str(String* s, HASH* h, bool inited)
{
for (uint i= 0; i < h->records; i++)
{
- TABLE_RULE_ENT* e= (TABLE_RULE_ENT*) hash_element(h, i);
+ TABLE_RULE_ENT* e= (TABLE_RULE_ENT*) my_hash_element(h, i);
if (s->length())
s->append(',');
s->append(e->db,e->key_len);
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
new file mode 100644
index 00000000000..ebd6e4e0c0b
--- /dev/null
+++ b/sql/rpl_handler.cc
@@ -0,0 +1,518 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "mysql_priv.h"
+
+#include "rpl_mi.h"
+#include "sql_repl.h"
+#include "log_event.h"
+#include "rpl_filter.h"
+#include <my_dir.h>
+#include "rpl_handler.h"
+
+Trans_delegate *transaction_delegate;
+Binlog_storage_delegate *binlog_storage_delegate;
+#ifdef HAVE_REPLICATION
+Binlog_transmit_delegate *binlog_transmit_delegate;
+Binlog_relay_IO_delegate *binlog_relay_io_delegate;
+#endif /* HAVE_REPLICATION */
+
+/*
+ structure to save transaction log filename and position
+*/
+typedef struct Trans_binlog_info {
+ my_off_t log_pos;
+ char log_file[FN_REFLEN];
+} Trans_binlog_info;
+
+static pthread_key(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO);
+
+int get_user_var_int(const char *name,
+ long long int *value, int *null_value)
+{
+ my_bool null_val;
+ user_var_entry *entry=
+ (user_var_entry*) my_hash_search(&current_thd->user_vars,
+ (uchar*) name, strlen(name));
+ if (!entry)
+ return 1;
+ *value= entry->val_int(&null_val);
+ if (null_value)
+ *null_value= null_val;
+ return 0;
+}
+
+int get_user_var_real(const char *name,
+ double *value, int *null_value)
+{
+ my_bool null_val;
+ user_var_entry *entry=
+ (user_var_entry*) my_hash_search(&current_thd->user_vars,
+ (uchar*) name, strlen(name));
+ if (!entry)
+ return 1;
+ *value= entry->val_real(&null_val);
+ if (null_value)
+ *null_value= null_val;
+ return 0;
+}
+
+int get_user_var_str(const char *name, char *value,
+ size_t len, unsigned int precision, int *null_value)
+{
+ String str;
+ my_bool null_val;
+ user_var_entry *entry=
+ (user_var_entry*) my_hash_search(&current_thd->user_vars,
+ (uchar*) name, strlen(name));
+ if (!entry)
+ return 1;
+ entry->val_str(&null_val, &str, precision);
+ strncpy(value, str.c_ptr(), len);
+ if (null_value)
+ *null_value= null_val;
+ return 0;
+}
+
+int delegates_init()
+{
+ static unsigned long trans_mem[sizeof(Trans_delegate) / sizeof(unsigned long) + 1];
+ static unsigned long storage_mem[sizeof(Binlog_storage_delegate) / sizeof(unsigned long) + 1];
+#ifdef HAVE_REPLICATION
+ static unsigned long transmit_mem[sizeof(Binlog_transmit_delegate) / sizeof(unsigned long) + 1];
+ static unsigned long relay_io_mem[sizeof(Binlog_relay_IO_delegate)/ sizeof(unsigned long) + 1];
+#endif
+
+ if (!(transaction_delegate= new (trans_mem) Trans_delegate)
+ || (!transaction_delegate->is_inited())
+ || !(binlog_storage_delegate= new (storage_mem) Binlog_storage_delegate)
+ || (!binlog_storage_delegate->is_inited())
+#ifdef HAVE_REPLICATION
+ || !(binlog_transmit_delegate= new (transmit_mem) Binlog_transmit_delegate)
+ || (!binlog_transmit_delegate->is_inited())
+ || !(binlog_relay_io_delegate= new (relay_io_mem) Binlog_relay_IO_delegate)
+ || (!binlog_relay_io_delegate->is_inited())
+#endif /* HAVE_REPLICATION */
+ )
+ return 1;
+
+ if (pthread_key_create(&RPL_TRANS_BINLOG_INFO, NULL))
+ return 1;
+ return 0;
+}
+
+void delegates_destroy()
+{
+ if (transaction_delegate)
+ transaction_delegate->~Trans_delegate();
+ if (binlog_storage_delegate)
+ binlog_storage_delegate->~Binlog_storage_delegate();
+#ifdef HAVE_REPLICATION
+ if (binlog_transmit_delegate)
+ binlog_transmit_delegate->~Binlog_transmit_delegate();
+ if (binlog_relay_io_delegate)
+ binlog_relay_io_delegate->~Binlog_relay_IO_delegate();
+#endif /* HAVE_REPLICATION */
+}
+
+/*
+ This macro is used by almost all the Delegate methods to iterate
+ over all the observers running given callback function of the
+ delegate .
+
+ Add observer plugins to the thd->lex list, after each statement, all
+ plugins add to thd->lex will be automatically unlocked.
+ */
+#define FOREACH_OBSERVER(r, f, thd, args) \
+ param.server_id= thd->server_id; \
+ /*
+ Use a struct to make sure that they are allocated adjacent, check
+ delete_dynamic().
+ */ \
+ struct { \
+ DYNAMIC_ARRAY plugins; \
+ /* preallocate 8 slots */ \
+ plugin_ref plugins_buffer[8]; \
+ } s; \
+ DYNAMIC_ARRAY *plugins= &s.plugins; \
+ plugin_ref *plugins_buffer= s.plugins_buffer; \
+ my_init_dynamic_array2(plugins, sizeof(plugin_ref), \
+ plugins_buffer, 8, 8); \
+ read_lock(); \
+ Observer_info_iterator iter= observer_info_iter(); \
+ Observer_info *info= iter++; \
+ for (; info; info= iter++) \
+ { \
+ plugin_ref plugin= \
+ my_plugin_lock(0, &info->plugin); \
+ if (!plugin) \
+ { \
+ /* plugin is not intialized or deleted, this is not an error */ \
+ r= 0; \
+ break; \
+ } \
+ insert_dynamic(plugins, (uchar *)&plugin); \
+ if (((Observer *)info->observer)->f \
+ && ((Observer *)info->observer)->f args) \
+ { \
+ r= 1; \
+ sql_print_error("Run function '" #f "' in plugin '%s' failed", \
+ info->plugin_int->name.str); \
+ break; \
+ } \
+ } \
+ unlock(); \
+ /*
+ Unlock plugins should be done after we released the Delegate lock
+ to avoid possible deadlock when this is the last user of the
+ plugin, and when we unlock the plugin, it will try to
+ deinitialize the plugin, which will try to lock the Delegate in
+ order to remove the observers.
+ */ \
+ plugin_unlock_list(0, (plugin_ref*)plugins->buffer, \
+ plugins->elements); \
+ delete_dynamic(plugins)
+
+
+int Trans_delegate::after_commit(THD *thd, bool all)
+{
+ Trans_param param;
+ bool is_real_trans= (all || thd->transaction.all.ha_list == 0);
+ if (is_real_trans)
+ param.flags |= TRANS_IS_REAL_TRANS;
+
+ Trans_binlog_info *log_info=
+ my_pthread_getspecific_ptr(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO);
+
+ param.log_file= log_info ? log_info->log_file : 0;
+ param.log_pos= log_info ? log_info->log_pos : 0;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_commit, thd, (&param));
+
+ /*
+ This is the end of a real transaction or autocommit statement, we
+ can free the memory allocated for binlog file and position.
+ */
+ if (is_real_trans && log_info)
+ {
+ my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, NULL);
+ my_free(log_info, MYF(0));
+ }
+ return ret;
+}
+
+int Trans_delegate::after_rollback(THD *thd, bool all)
+{
+ Trans_param param;
+ bool is_real_trans= (all || thd->transaction.all.ha_list == 0);
+ if (is_real_trans)
+ param.flags |= TRANS_IS_REAL_TRANS;
+
+ Trans_binlog_info *log_info=
+ my_pthread_getspecific_ptr(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO);
+
+ param.log_file= log_info ? log_info->log_file : 0;
+ param.log_pos= log_info ? log_info->log_pos : 0;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_commit, thd, (&param));
+
+ /*
+ This is the end of a real transaction or autocommit statement, we
+ can free the memory allocated for binlog file and position.
+ */
+ if (is_real_trans && log_info)
+ {
+ my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, NULL);
+ my_free(log_info, MYF(0));
+ }
+ return ret;
+}
+
+int Binlog_storage_delegate::after_flush(THD *thd,
+ const char *log_file,
+ my_off_t log_pos,
+ bool synced)
+{
+ Binlog_storage_param param;
+ uint32 flags=0;
+ if (synced)
+ flags |= BINLOG_STORAGE_IS_SYNCED;
+
+ Trans_binlog_info *log_info=
+ my_pthread_getspecific_ptr(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO);
+
+ if (!log_info)
+ {
+ if(!(log_info=
+ (Trans_binlog_info *)my_malloc(sizeof(Trans_binlog_info), MYF(0))))
+ return 1;
+ my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, log_info);
+ }
+
+ strcpy(log_info->log_file, log_file+dirname_length(log_file));
+ log_info->log_pos = log_pos;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_flush, thd,
+ (&param, log_info->log_file, log_info->log_pos, flags));
+ return ret;
+}
+
+#ifdef HAVE_REPLICATION
+int Binlog_transmit_delegate::transmit_start(THD *thd, ushort flags,
+ const char *log_file,
+ my_off_t log_pos)
+{
+ Binlog_transmit_param param;
+ param.flags= flags;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, transmit_start, thd, (&param, log_file, log_pos));
+ return ret;
+}
+
+int Binlog_transmit_delegate::transmit_stop(THD *thd, ushort flags)
+{
+ Binlog_transmit_param param;
+ param.flags= flags;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, transmit_stop, thd, (&param));
+ return ret;
+}
+
+int Binlog_transmit_delegate::reserve_header(THD *thd, ushort flags,
+ String *packet)
+{
+ /* NOTE2ME: Maximum extra header size for each observer, I hope 32
+ bytes should be enough for each Observer to reserve their extra
+ header. If later found this is not enough, we can increase this
+ /HEZX
+ */
+#define RESERVE_HEADER_SIZE 32
+ unsigned char header[RESERVE_HEADER_SIZE];
+ ulong hlen;
+ Binlog_transmit_param param;
+ param.flags= flags;
+ param.server_id= thd->server_id;
+
+ int ret= 0;
+ read_lock();
+ Observer_info_iterator iter= observer_info_iter();
+ Observer_info *info= iter++;
+ for (; info; info= iter++)
+ {
+ plugin_ref plugin=
+ my_plugin_lock(thd, &info->plugin);
+ if (!plugin)
+ {
+ ret= 1;
+ break;
+ }
+ hlen= 0;
+ if (((Observer *)info->observer)->reserve_header
+ && ((Observer *)info->observer)->reserve_header(&param,
+ header,
+ RESERVE_HEADER_SIZE,
+ &hlen))
+ {
+ ret= 1;
+ plugin_unlock(thd, plugin);
+ break;
+ }
+ plugin_unlock(thd, plugin);
+ if (hlen == 0)
+ continue;
+ if (hlen > RESERVE_HEADER_SIZE || packet->append((char *)header, hlen))
+ {
+ ret= 1;
+ break;
+ }
+ }
+ unlock();
+ return ret;
+}
+
+int Binlog_transmit_delegate::before_send_event(THD *thd, ushort flags,
+ String *packet,
+ const char *log_file,
+ my_off_t log_pos)
+{
+ Binlog_transmit_param param;
+ param.flags= flags;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, before_send_event, thd,
+ (&param, (uchar *)packet->c_ptr(),
+ packet->length(),
+ log_file+dirname_length(log_file), log_pos));
+ return ret;
+}
+
+int Binlog_transmit_delegate::after_send_event(THD *thd, ushort flags,
+ String *packet)
+{
+ Binlog_transmit_param param;
+ param.flags= flags;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_send_event, thd,
+ (&param, packet->c_ptr(), packet->length()));
+ return ret;
+}
+
+int Binlog_transmit_delegate::after_reset_master(THD *thd, ushort flags)
+
+{
+ Binlog_transmit_param param;
+ param.flags= flags;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_reset_master, thd, (&param));
+ return ret;
+}
+
+void Binlog_relay_IO_delegate::init_param(Binlog_relay_IO_param *param,
+ Master_info *mi)
+{
+ param->mysql= mi->mysql;
+ param->user= mi->user;
+ param->host= mi->host;
+ param->port= mi->port;
+ param->master_log_name= mi->master_log_name;
+ param->master_log_pos= mi->master_log_pos;
+}
+
+int Binlog_relay_IO_delegate::thread_start(THD *thd, Master_info *mi)
+{
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, thread_start, thd, (&param));
+ return ret;
+}
+
+
+int Binlog_relay_IO_delegate::thread_stop(THD *thd, Master_info *mi)
+{
+
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, thread_stop, thd, (&param));
+ return ret;
+}
+
+int Binlog_relay_IO_delegate::before_request_transmit(THD *thd,
+ Master_info *mi,
+ ushort flags)
+{
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, before_request_transmit, thd, (&param, (uint32)flags));
+ return ret;
+}
+
+int Binlog_relay_IO_delegate::after_read_event(THD *thd, Master_info *mi,
+ const char *packet, ulong len,
+ const char **event_buf,
+ ulong *event_len)
+{
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_read_event, thd,
+ (&param, packet, len, event_buf, event_len));
+ return ret;
+}
+
+int Binlog_relay_IO_delegate::after_queue_event(THD *thd, Master_info *mi,
+ const char *event_buf,
+ ulong event_len,
+ bool synced)
+{
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ uint32 flags=0;
+ if (synced)
+ flags |= BINLOG_STORAGE_IS_SYNCED;
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_queue_event, thd,
+ (&param, event_buf, event_len, flags));
+ return ret;
+}
+
+int Binlog_relay_IO_delegate::after_reset_slave(THD *thd, Master_info *mi)
+
+{
+ Binlog_relay_IO_param param;
+ init_param(&param, mi);
+
+ int ret= 0;
+ FOREACH_OBSERVER(ret, after_reset_slave, thd, (&param));
+ return ret;
+}
+#endif /* HAVE_REPLICATION */
+
+int register_trans_observer(Trans_observer *observer, void *p)
+{
+ return transaction_delegate->add_observer(observer, (st_plugin_int *)p);
+}
+
+int unregister_trans_observer(Trans_observer *observer, void *p)
+{
+ return transaction_delegate->remove_observer(observer, (st_plugin_int *)p);
+}
+
+int register_binlog_storage_observer(Binlog_storage_observer *observer, void *p)
+{
+ return binlog_storage_delegate->add_observer(observer, (st_plugin_int *)p);
+}
+
+int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p)
+{
+ return binlog_storage_delegate->remove_observer(observer, (st_plugin_int *)p);
+}
+
+#ifdef HAVE_REPLICATION
+int register_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
+{
+ return binlog_transmit_delegate->add_observer(observer, (st_plugin_int *)p);
+}
+
+int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
+{
+ return binlog_transmit_delegate->remove_observer(observer, (st_plugin_int *)p);
+}
+
+int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
+{
+ return binlog_relay_io_delegate->add_observer(observer, (st_plugin_int *)p);
+}
+
+int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
+{
+ return binlog_relay_io_delegate->remove_observer(observer, (st_plugin_int *)p);
+}
+#endif /* HAVE_REPLICATION */
diff --git a/sql/rpl_handler.h b/sql/rpl_handler.h
new file mode 100644
index 00000000000..4fb7b4e035b
--- /dev/null
+++ b/sql/rpl_handler.h
@@ -0,0 +1,213 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef RPL_HANDLER_H
+#define RPL_HANDLER_H
+
+#include "mysql_priv.h"
+#include "rpl_mi.h"
+#include "rpl_rli.h"
+#include "sql_plugin.h"
+#include "replication.h"
+
+class Observer_info {
+public:
+ void *observer;
+ st_plugin_int *plugin_int;
+ plugin_ref plugin;
+
+ Observer_info(void *ob, st_plugin_int *p)
+ :observer(ob), plugin_int(p)
+ {
+ plugin= plugin_int_to_ref(plugin_int);
+ }
+};
+
+class Delegate {
+public:
+ typedef List<Observer_info> Observer_info_list;
+ typedef List_iterator<Observer_info> Observer_info_iterator;
+
+ int add_observer(void *observer, st_plugin_int *plugin)
+ {
+ int ret= FALSE;
+ if (!inited)
+ return TRUE;
+ write_lock();
+ Observer_info_iterator iter(observer_info_list);
+ Observer_info *info= iter++;
+ while (info && info->observer != observer)
+ info= iter++;
+ if (!info)
+ {
+ info= new Observer_info(observer, plugin);
+ if (!info || observer_info_list.push_back(info, &memroot))
+ ret= TRUE;
+ }
+ else
+ ret= TRUE;
+ unlock();
+ return ret;
+ }
+
+ int remove_observer(void *observer, st_plugin_int *plugin)
+ {
+ int ret= FALSE;
+ if (!inited)
+ return TRUE;
+ write_lock();
+ Observer_info_iterator iter(observer_info_list);
+ Observer_info *info= iter++;
+ while (info && info->observer != observer)
+ info= iter++;
+ if (info)
+ iter.remove();
+ else
+ ret= TRUE;
+ unlock();
+ return ret;
+ }
+
+ inline Observer_info_iterator observer_info_iter()
+ {
+ return Observer_info_iterator(observer_info_list);
+ }
+
+ inline bool is_empty()
+ {
+ return observer_info_list.is_empty();
+ }
+
+ inline int read_lock()
+ {
+ if (!inited)
+ return TRUE;
+ return rw_rdlock(&lock);
+ }
+
+ inline int write_lock()
+ {
+ if (!inited)
+ return TRUE;
+ return rw_wrlock(&lock);
+ }
+
+ inline int unlock()
+ {
+ if (!inited)
+ return TRUE;
+ return rw_unlock(&lock);
+ }
+
+ inline bool is_inited()
+ {
+ return inited;
+ }
+
+ Delegate()
+ {
+ inited= FALSE;
+ if (my_rwlock_init(&lock, NULL))
+ return;
+ init_sql_alloc(&memroot, 1024, 0);
+ inited= TRUE;
+ }
+ ~Delegate()
+ {
+ inited= FALSE;
+ rwlock_destroy(&lock);
+ free_root(&memroot, MYF(0));
+ }
+
+private:
+ Observer_info_list observer_info_list;
+ rw_lock_t lock;
+ MEM_ROOT memroot;
+ bool inited;
+};
+
+class Trans_delegate
+ :public Delegate {
+public:
+ typedef Trans_observer Observer;
+ int before_commit(THD *thd, bool all);
+ int before_rollback(THD *thd, bool all);
+ int after_commit(THD *thd, bool all);
+ int after_rollback(THD *thd, bool all);
+};
+
+class Binlog_storage_delegate
+ :public Delegate {
+public:
+ typedef Binlog_storage_observer Observer;
+ int after_flush(THD *thd, const char *log_file,
+ my_off_t log_pos, bool synced);
+};
+
+#ifdef HAVE_REPLICATION
+class Binlog_transmit_delegate
+ :public Delegate {
+public:
+ typedef Binlog_transmit_observer Observer;
+ int transmit_start(THD *thd, ushort flags,
+ const char *log_file, my_off_t log_pos);
+ int transmit_stop(THD *thd, ushort flags);
+ int reserve_header(THD *thd, ushort flags, String *packet);
+ int before_send_event(THD *thd, ushort flags,
+ String *packet, const
+ char *log_file, my_off_t log_pos );
+ int after_send_event(THD *thd, ushort flags,
+ String *packet);
+ int after_reset_master(THD *thd, ushort flags);
+};
+
+class Binlog_relay_IO_delegate
+ :public Delegate {
+public:
+ typedef Binlog_relay_IO_observer Observer;
+ int thread_start(THD *thd, Master_info *mi);
+ int thread_stop(THD *thd, Master_info *mi);
+ int before_request_transmit(THD *thd, Master_info *mi, ushort flags);
+ int after_read_event(THD *thd, Master_info *mi,
+ const char *packet, ulong len,
+ const char **event_buf, ulong *event_len);
+ int after_queue_event(THD *thd, Master_info *mi,
+ const char *event_buf, ulong event_len,
+ bool synced);
+ int after_reset_slave(THD *thd, Master_info *mi);
+private:
+ void init_param(Binlog_relay_IO_param *param, Master_info *mi);
+};
+#endif /* HAVE_REPLICATION */
+
+int delegates_init();
+void delegates_destroy();
+
+extern Trans_delegate *transaction_delegate;
+extern Binlog_storage_delegate *binlog_storage_delegate;
+#ifdef HAVE_REPLICATION
+extern Binlog_transmit_delegate *binlog_transmit_delegate;
+extern Binlog_relay_IO_delegate *binlog_relay_io_delegate;
+#endif /* HAVE_REPLICATION */
+
+/*
+ if there is no observers in the delegate, we can return 0
+ immediately.
+*/
+#define RUN_HOOK(group, hook, args) \
+ (group ##_delegate->is_empty() ? \
+ 0 : group ##_delegate->hook args)
+
+#endif /* RPL_HANDLER_H */
diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h
index 4ece092c5b8..a0c71fee099 100644
--- a/sql/rpl_injector.h
+++ b/sql/rpl_injector.h
@@ -25,9 +25,8 @@
/* Forward declarations */
class handler;
class MYSQL_BIN_LOG;
-struct st_table;
+struct TABLE;
-typedef st_table TABLE;
/*
Injector to inject rows into the MySQL server.
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 5e46837e948..e83e0ad0ba9 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -26,17 +26,21 @@
int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
const char *default_val);
+int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
+int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);
-Master_info::Master_info()
+Master_info::Master_info(bool is_slave_recovery)
:Slave_reporting_capability("I/O"),
ssl(0), ssl_verify_server_cert(0), fd(-1), io_thd(0), inited(0),
- abort_slave(0),slave_running(0),
- slave_run_id(0)
+ rli(is_slave_recovery), abort_slave(0), slave_running(0),
+ slave_run_id(0), sync_counter(0),
+ heartbeat_period(0), received_heartbeats(0), master_id(0)
{
host[0] = 0; user[0] = 0; password[0] = 0;
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
ssl_cipher[0]= 0; ssl_key[0]= 0;
+ my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16);
bzero((char*) &file, sizeof(file));
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
@@ -47,6 +51,7 @@ Master_info::Master_info()
Master_info::~Master_info()
{
+ delete_dynamic(&ignore_server_ids);
pthread_mutex_destroy(&run_lock);
pthread_mutex_destroy(&data_lock);
pthread_cond_destroy(&data_cond);
@@ -54,6 +59,43 @@ Master_info::~Master_info()
pthread_cond_destroy(&stop_cond);
}
+/**
+ A comparison function to be supplied as argument to @c sort_dynamic()
+ and @c bsearch()
+
+ @return -1 if first argument is less, 0 if it equal to, 1 if it is greater
+ than the second
+*/
+int change_master_server_id_cmp(ulong *id1, ulong *id2)
+{
+ return *id1 < *id2? -1 : (*id1 > *id2? 1 : 0);
+}
+
+
+/**
+ Reports if the s_id server has been configured to ignore events
+ it generates with
+
+ CHANGE MASTER IGNORE_SERVER_IDS= ( list of server ids )
+
+ Method is called from the io thread event receiver filtering.
+
+ @param s_id the master server identifier
+
+ @retval TRUE if s_id is in the list of ignored master servers,
+ @retval FALSE otherwise.
+ */
+bool Master_info::shall_ignore_server_id(ulong s_id)
+{
+ if (likely(ignore_server_ids.elements == 1))
+ return (* (ulong*) dynamic_array_ptr(&ignore_server_ids, 0)) == s_id;
+ else
+ return bsearch((const ulong *) &s_id,
+ ignore_server_ids.buffer,
+ ignore_server_ids.elements, sizeof(ulong),
+ (int (*) (const void*, const void*)) change_master_server_id_cmp)
+ != NULL;
+}
void init_master_info_with_options(Master_info* mi)
{
@@ -84,6 +126,17 @@ void init_master_info_with_options(Master_info* mi)
strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1);
/* Intentionally init ssl_verify_server_cert to 0, no option available */
mi->ssl_verify_server_cert= 0;
+ /*
+ always request heartbeat unless master_heartbeat_period is set
+ explicitly zero. Here is the default value for heartbeat period
+ if CHANGE MASTER did not specify it. (no data loss in conversion
+ as hb period has a max)
+ */
+ mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
+ (slave_net_timeout/2.0));
+ DBUG_ASSERT(mi->heartbeat_period > (float) 0.001
+ || mi->heartbeat_period == 0);
+
DBUG_VOID_RETURN;
}
@@ -93,9 +146,12 @@ enum {
/* 5.1.16 added value of master_ssl_verify_server_cert */
LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT= 15,
-
+ /* 6.0 added value of master_heartbeat_period */
+ LINE_FOR_MASTER_HEARTBEAT_PERIOD= 16,
+ /* 6.0 added value of master_ignore_server_id */
+ LINE_FOR_REPLICATE_IGNORE_SERVER_IDS= 17,
/* Number of lines currently used when saving master info file */
- LINES_IN_MASTER_INFO= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT
+ LINES_IN_MASTER_INFO= LINE_FOR_REPLICATE_IGNORE_SERVER_IDS
};
int init_master_info(Master_info* mi, const char* master_info_fname,
@@ -197,6 +253,7 @@ file '%s')", fname);
mi->fd = fd;
int port, connect_retry, master_log_pos, lines;
int ssl= 0, ssl_verify_server_cert= 0;
+ float master_heartbeat_period= 0.0;
char *first_non_digit;
/*
@@ -281,7 +338,23 @@ file '%s')", fname);
if (lines >= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT &&
init_intvar_from_file(&ssl_verify_server_cert, &mi->file, 0))
goto errwithmsg;
-
+ /*
+ Starting from 6.0 master_heartbeat_period might be
+ in the file
+ */
+ if (lines >= LINE_FOR_MASTER_HEARTBEAT_PERIOD &&
+ init_floatvar_from_file(&master_heartbeat_period, &mi->file, 0.0))
+ goto errwithmsg;
+ /*
+ Starting from 6.0 list of server_id of ignorable servers might be
+ in the file
+ */
+ if (lines >= LINE_FOR_REPLICATE_IGNORE_SERVER_IDS &&
+ init_dynarray_intvar_from_file(&mi->ignore_server_ids, &mi->file))
+ {
+ sql_print_error("Failed to initialize master info ignore_server_ids");
+ goto errwithmsg;
+ }
}
#ifndef HAVE_OPENSSL
@@ -300,6 +373,7 @@ file '%s')", fname);
mi->connect_retry= (uint) connect_retry;
mi->ssl= (my_bool) ssl;
mi->ssl_verify_server_cert= ssl_verify_server_cert;
+ mi->heartbeat_period= master_heartbeat_period;
}
DBUG_PRINT("master_info",("log_file_name: %s position: %ld",
mi->master_log_name,
@@ -310,6 +384,7 @@ file '%s')", fname);
goto err;
mi->inited = 1;
+ mi->rli.is_relay_log_recovery= FALSE;
// now change cache READ -> WRITE - must do this before flush_master_info
reinit_io_cache(&mi->file, WRITE_CACHE, 0L, 0, 1);
if ((error=test(flush_master_info(mi, 1))))
@@ -342,6 +417,7 @@ int flush_master_info(Master_info* mi, bool flush_relay_log_cache)
{
IO_CACHE* file = &mi->file;
char lbuf[22];
+ int err= 0;
DBUG_ENTER("flush_master_info");
DBUG_PRINT("enter",("master_pos: %ld", (long) mi->master_log_pos));
@@ -358,9 +434,35 @@ int flush_master_info(Master_info* mi, bool flush_relay_log_cache)
When we come to this place in code, relay log may or not be initialized;
the caller is responsible for setting 'flush_relay_log_cache' accordingly.
*/
- if (flush_relay_log_cache &&
- flush_io_cache(mi->rli.relay_log.get_log_file()))
- DBUG_RETURN(2);
+ if (flush_relay_log_cache)
+ {
+ IO_CACHE *log_file= mi->rli.relay_log.get_log_file();
+ if (flush_io_cache(log_file))
+ DBUG_RETURN(2);
+ }
+
+ /*
+ produce a line listing the total number and all the ignored server_id:s
+ */
+ char* ignore_server_ids_buf;
+ {
+ ignore_server_ids_buf=
+ (char *) my_malloc((sizeof(::server_id) * 3 + 1) *
+ (1 + mi->ignore_server_ids.elements), MYF(MY_WME));
+ if (!ignore_server_ids_buf)
+ DBUG_RETURN(1);
+ for (ulong i= 0, cur_len= my_sprintf(ignore_server_ids_buf,
+ (ignore_server_ids_buf, "%u",
+ mi->ignore_server_ids.elements));
+ i < mi->ignore_server_ids.elements; i++)
+ {
+ ulong s_id;
+ get_dynamic(&mi->ignore_server_ids, (uchar*) &s_id, i);
+ cur_len +=my_sprintf(ignore_server_ids_buf + cur_len,
+ (ignore_server_ids_buf + cur_len,
+ " %lu", s_id));
+ }
+ }
/*
We flushed the relay log BEFORE the master.info file, because if we crash
@@ -378,17 +480,27 @@ int flush_master_info(Master_info* mi, bool flush_relay_log_cache)
contents of file). But because of number of lines in the first line
of file we don't care about this garbage.
*/
-
+ char heartbeat_buf[sizeof(mi->heartbeat_period) * 4]; // buffer to suffice always
+ my_sprintf(heartbeat_buf, (heartbeat_buf, "%.3f", mi->heartbeat_period));
my_b_seek(file, 0L);
my_b_printf(file,
- "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n%d\n",
+ "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n%d\n%s\n%s\n",
LINES_IN_MASTER_INFO,
mi->master_log_name, llstr(mi->master_log_pos, lbuf),
mi->host, mi->user,
mi->password, mi->port, mi->connect_retry,
(int)(mi->ssl), mi->ssl_ca, mi->ssl_capath, mi->ssl_cert,
- mi->ssl_cipher, mi->ssl_key, mi->ssl_verify_server_cert);
- DBUG_RETURN(-flush_io_cache(file));
+ mi->ssl_cipher, mi->ssl_key, mi->ssl_verify_server_cert,
+ heartbeat_buf, ignore_server_ids_buf);
+ my_free(ignore_server_ids_buf, MYF(0));
+ err= flush_io_cache(file);
+ if (sync_masterinfo_period && !err &&
+ ++(mi->sync_counter) >= sync_masterinfo_period)
+ {
+ err= my_sync(mi->fd, MYF(MY_WME));
+ mi->sync_counter= 0;
+ }
+ DBUG_RETURN(-err);
}
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 93fb0a98198..f822a6bc1b1 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -20,6 +20,7 @@
#include "rpl_rli.h"
#include "rpl_reporting.h"
+#include "my_sys.h"
/*****************************************************************************
@@ -58,8 +59,9 @@
class Master_info : public Slave_reporting_capability
{
public:
- Master_info();
+ Master_info(bool is_slave_recovery);
~Master_info();
+ bool shall_ignore_server_id(ulong s_id);
/* the variables below are needed because we can change masters on the fly */
char master_log_name[FN_REFLEN];
@@ -100,6 +102,16 @@ class Master_info : public Slave_reporting_capability
*/
long clock_diff_with_master;
+ /*
+ Keeps track of the number of events before fsyncing.
+ The option --sync-master-info determines how many
+ events should happen before fsyncing.
+ */
+ uint sync_counter;
+ float heartbeat_period; // interface with CHANGE MASTER or master.info
+ ulonglong received_heartbeats; // counter of received heartbeat events
+ DYNAMIC_ARRAY ignore_server_ids;
+ ulong master_id;
};
void init_master_info_with_options(Master_info* mi);
@@ -109,6 +121,7 @@ int init_master_info(Master_info* mi, const char* master_info_fname,
int thread_mask);
void end_master_info(Master_info* mi);
int flush_master_info(Master_info* mi, bool flush_relay_log_cache);
+int change_master_server_id_cmp(ulong *id1, ulong *id2);
#endif /* HAVE_REPLICATION */
#endif /* RPL_MI_H */
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index a26717d7acf..a1403d2ff71 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -28,12 +28,13 @@ int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
const char *default_val);
-
-Relay_log_info::Relay_log_info()
+Relay_log_info::Relay_log_info(bool is_slave_recovery)
:Slave_reporting_capability("SQL"),
no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
- info_fd(-1), cur_log_fd(-1), save_temporary_tables(0),
- cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
+ info_fd(-1), cur_log_fd(-1), relay_log(&sync_relaylog_period),
+ sync_counter(0), is_relay_log_recovery(is_slave_recovery),
+ save_temporary_tables(0), cur_log_old_open_count(0), group_relay_log_pos(0),
+ event_relay_log_pos(0),
#if HAVE_purify
is_fake(FALSE),
#endif
@@ -207,7 +208,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
{
sql_print_error("Failed to create a new relay log info file (\
file '%s', errno %d)", fname, my_errno);
- msg= current_thd->main_da.message();
+ msg= current_thd->stmt_da->message();
goto err;
}
if (init_io_cache(&rli->info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L,0,
@@ -215,7 +216,7 @@ file '%s', errno %d)", fname, my_errno);
{
sql_print_error("Failed to create a cache on relay log info file '%s'",
fname);
- msg= current_thd->main_da.message();
+ msg= current_thd->stmt_da->message();
goto err;
}
@@ -282,6 +283,9 @@ Failed to open the existing relay log info file '%s' (errno %d)",
rli->group_relay_log_pos= rli->event_relay_log_pos= relay_log_pos;
rli->group_master_log_pos= master_log_pos;
+ if (rli->is_relay_log_recovery && init_recovery(rli->mi, &msg))
+ goto err;
+
if (init_relay_log_pos(rli,
rli->group_relay_log_name,
rli->group_relay_log_pos,
@@ -313,7 +317,10 @@ Failed to open the existing relay log info file '%s' (errno %d)",
*/
reinit_io_cache(&rli->info_file, WRITE_CACHE,0L,0,1);
if ((error= flush_relay_log_info(rli)))
- sql_print_error("Failed to flush relay log info file");
+ {
+ msg= "Failed to flush relay log info file";
+ goto err;
+ }
if (count_relay_log_space(rli))
{
msg="Error counting relay log space";
@@ -1212,7 +1219,6 @@ void Relay_log_info::cleanup_context(THD *thd, bool error)
*/
thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
- last_event_start_time= 0;
DBUG_VOID_RETURN;
}
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 171778d9675..fd36d18adae 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -96,6 +96,19 @@ public:
LOG_INFO linfo;
IO_CACHE cache_buf,*cur_log;
+ /*
+ Keeps track of the number of transactions that commits
+ before fsyncing. The option --sync-relay-log-info determines
+ how many transactions should commit before fsyncing.
+ */
+ uint sync_counter;
+
+ /*
+ Identifies when the recovery process is going on.
+ See sql/slave.cc:init_recovery for further details.
+ */
+ bool is_relay_log_recovery;
+
/* The following variables are safe to read any time */
/* IO_CACHE of the info file - set only during init or end */
@@ -267,7 +280,7 @@ public:
char slave_patternload_file[FN_REFLEN];
size_t slave_patternload_file_size;
- Relay_log_info();
+ Relay_log_info(bool is_slave_recovery);
~Relay_log_info();
/*
@@ -336,12 +349,10 @@ public:
void clear_tables_to_lock();
/*
- Used by row-based replication to detect that it should not stop at
- this event, but give it a chance to send more events. The time
- where the last event inside a group started is stored here. If the
- variable is zero, we are not in a group (but may be in a
- transaction).
- */
+ Used to defer stopping the SQL thread to give it a chance
+ to finish up the current group of events.
+ The timestamp is set and reset in @c sql_slave_killed().
+ */
time_t last_event_start_time;
/**
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index 6ef9a8623fe..b04a3120a86 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -34,10 +34,10 @@ table_mapping::table_mapping()
No "free_element" function for entries passed here, as the entries are
allocated in a MEM_ROOT (freed as a whole in the destructor), they cannot
be freed one by one.
- Note that below we don't test if hash_init() succeeded. This constructor
- is called at startup only.
+ Note that below we don't test if my_hash_init() succeeded. This
+ constructor is called at startup only.
*/
- (void) hash_init(&m_table_ids,&my_charset_bin,TABLE_ID_HASH_SIZE,
+ (void) my_hash_init(&m_table_ids,&my_charset_bin,TABLE_ID_HASH_SIZE,
offsetof(entry,table_id),sizeof(ulong),
0,0,0);
/* We don't preallocate any block, this is consistent with m_free=0 above */
@@ -49,7 +49,7 @@ table_mapping::~table_mapping()
#ifdef MYSQL_CLIENT
clear_tables();
#endif
- hash_free(&m_table_ids);
+ my_hash_free(&m_table_ids);
free_root(&m_mem_root, MYF(0));
}
@@ -115,7 +115,7 @@ int table_mapping::set_table(ulong table_id, TABLE* table)
#ifdef MYSQL_CLIENT
free_table_map_log_event(e->table);
#endif
- hash_delete(&m_table_ids,(uchar *)e);
+ my_hash_delete(&m_table_ids,(uchar *)e);
}
e->table_id= table_id;
e->table= table;
@@ -138,7 +138,7 @@ int table_mapping::remove_table(ulong table_id)
entry *e= find_entry(table_id);
if (e)
{
- hash_delete(&m_table_ids,(uchar *)e);
+ my_hash_delete(&m_table_ids,(uchar *)e);
/* we add this entry to the chain of free (free for use) entries */
e->next= m_free;
m_free= e;
@@ -156,7 +156,7 @@ void table_mapping::clear_tables()
DBUG_ENTER("table_mapping::clear_tables()");
for (uint i= 0; i < m_table_ids.records; i++)
{
- entry *e= (entry *)hash_element(&m_table_ids, i);
+ entry *e= (entry *)my_hash_element(&m_table_ids, i);
#ifdef MYSQL_CLIENT
free_table_map_log_event(e->table);
#endif
diff --git a/sql/rpl_tblmap.h b/sql/rpl_tblmap.h
index 3b5b10be580..a6ec8bcbc9b 100644
--- a/sql/rpl_tblmap.h
+++ b/sql/rpl_tblmap.h
@@ -18,8 +18,7 @@
/* Forward declarations */
#ifndef MYSQL_CLIENT
-struct st_table;
-typedef st_table TABLE;
+struct TABLE;
#else
class Table_map_log_event;
typedef Table_map_log_event TABLE;
@@ -91,9 +90,9 @@ private:
entry *find_entry(ulong table_id)
{
- return (entry *)hash_search(&m_table_ids,
- (uchar*)&table_id,
- sizeof(table_id));
+ return (entry *) my_hash_search(&m_table_ids,
+ (uchar*)&table_id,
+ sizeof(table_id));
}
int expand();
diff --git a/sql/scheduler.h b/sql/scheduler.h
index 46bbd300cbb..e7916031a27 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -1,3 +1,6 @@
+#ifndef SCHEDULER_INCLUDED
+#define SCHEDULER_INCLUDED
+
/* Copyright (C) 2007 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -58,3 +61,5 @@ enum pool_command_op
class thd_scheduler
{};
+
+#endif /* SCHEDULER_INCLUDED */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index b80bdde9670..36597658077 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -125,8 +125,10 @@ static void fix_net_read_timeout(THD *thd, enum_var_type type);
static void fix_net_write_timeout(THD *thd, enum_var_type type);
static void fix_net_retry_count(THD *thd, enum_var_type type);
static void fix_max_join_size(THD *thd, enum_var_type type);
+#ifdef HAVE_QUERY_CACHE
static void fix_query_cache_size(THD *thd, enum_var_type type);
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type);
+#endif
static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type);
static void fix_max_binlog_size(THD *thd, enum_var_type type);
static void fix_max_relay_log_size(THD *thd, enum_var_type type);
@@ -302,9 +304,6 @@ static sys_var_key_cache_long sys_key_cache_division_limit(&vars, "key_cache_div
static sys_var_key_cache_long sys_key_cache_age_threshold(&vars, "key_cache_age_threshold",
offsetof(KEY_CACHE,
param_age_threshold));
-static sys_var_const sys_language(&vars, "language",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) language);
static sys_var_const sys_large_files_support(&vars, "large_files_support",
OPT_GLOBAL, SHOW_BOOL,
(uchar*) &opt_large_files);
@@ -314,6 +313,9 @@ static sys_var_const sys_large_page_size(&vars, "large_page_size",
static sys_var_const sys_large_pages(&vars, "large_pages",
OPT_GLOBAL, SHOW_MY_BOOL,
(uchar*) &opt_large_pages);
+static sys_var_const sys_language(&vars, "lc_messages_dir",
+ OPT_GLOBAL, SHOW_CHAR,
+ (uchar*) lc_messages_dir);
static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
&opt_local_infile);
#ifdef HAVE_MLOCKALL
@@ -434,7 +436,7 @@ static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_met
&myisam_stats_method_typelib,
NULL);
-#ifdef __NT__
+#ifdef _WIN32
/* purecov: begin inspected */
static sys_var_const sys_named_pipe(&vars, "named_pipe",
OPT_GLOBAL, SHOW_MY_BOOL,
@@ -493,9 +495,6 @@ static sys_var_thd_ulong sys_div_precincrement(&vars, "div_precision_increment",
&SV::div_precincrement);
static sys_var_long_ptr sys_rpl_recovery_rank(&vars, "rpl_recovery_rank",
&rpl_recovery_rank);
-static sys_var_long_ptr sys_query_cache_size(&vars, "query_cache_size",
- &query_cache_size,
- fix_query_cache_size);
static sys_var_thd_ulong sys_range_alloc_block_size(&vars, "range_alloc_block_size",
&SV::range_alloc_block_size);
@@ -557,14 +556,20 @@ sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
NULL);
#ifdef HAVE_QUERY_CACHE
+static sys_var_long_ptr sys_query_cache_size(&vars, "query_cache_size",
+ &query_cache_size,
+ fix_query_cache_size);
static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit",
- &query_cache.query_cache_limit);
-static sys_var_long_ptr sys_query_cache_min_res_unit(&vars, "query_cache_min_res_unit",
- &query_cache_min_res_unit,
- fix_query_cache_min_res_unit);
+ &query_cache.query_cache_limit);
+static sys_var_long_ptr
+ sys_query_cache_min_res_unit(&vars, "query_cache_min_res_unit",
+ &query_cache_min_res_unit,
+ fix_query_cache_min_res_unit);
+static int check_query_cache_type(THD *thd, set_var *var);
static sys_var_thd_enum sys_query_cache_type(&vars, "query_cache_type",
&SV::query_cache_type,
- &query_cache_type_typelib);
+ &query_cache_type_typelib, NULL,
+ check_query_cache_type);
static sys_var_thd_bool
sys_query_cache_wlock_invalidate(&vars, "query_cache_wlock_invalidate",
&SV::query_cache_wlock_invalidate);
@@ -768,7 +773,7 @@ static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
OPTION_RELAXED_UNIQUE_CHECKS,
1,
sys_var::SESSION_VARIABLE_IN_BINLOG);
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL,
set_option_bit,
ulonglong(OPTION_PROFILING));
@@ -792,6 +797,9 @@ sys_last_insert_id(&vars, "last_insert_id",
static sys_var_last_insert_id
sys_identity(&vars, "identity", sys_var::SESSION_VARIABLE_IN_BINLOG);
+static sys_var_thd_lc_messages
+sys_lc_messages(&vars, "lc_messages", sys_var::NOT_IN_BINLOG);
+
static sys_var_thd_lc_time_names
sys_lc_time_names(&vars, "lc_time_names", sys_var::SESSION_VARIABLE_IN_BINLOG);
@@ -870,9 +878,9 @@ static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRIN
static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl);
static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl);
static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN);
+static sys_var_have_variable sys_have_profiling(&vars, "have_profiling", &have_profiling);
static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache",
&have_query_cache);
-static sys_var_have_variable sys_have_community_features(&vars, "have_community_features", &have_community_features);
static sys_var_have_variable sys_have_rtree_keys(&vars, "have_rtree_keys", &have_rtree_keys);
static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink);
/* Global read-only variable describing server license */
@@ -913,8 +921,10 @@ bool sys_var_str::check(THD *thd, set_var *var)
return 0;
if ((res=(*check_func)(thd, var)) < 0)
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
- name, var->value->str_value.ptr());
+ {
+ ErrConvString err(&var->value->str_value);
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
+ }
return res;
}
@@ -1126,10 +1136,9 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)),
{}
#endif /* HAVE_REPLICATION */
-
+#ifdef HAVE_QUERY_CACHE
static void fix_query_cache_size(THD *thd, enum_var_type type)
{
-#ifdef HAVE_QUERY_CACHE
ulong new_cache_size= query_cache.resize(query_cache_size);
/*
@@ -1143,11 +1152,35 @@ static void fix_query_cache_size(THD *thd, enum_var_type type)
query_cache_size, new_cache_size);
query_cache_size= new_cache_size;
-#endif
}
-#ifdef HAVE_QUERY_CACHE
+/**
+ Trigger before query_cache_type variable is updated.
+ @param thd Thread handler
+ @param var Pointer to the new variable status
+
+ @return Status code
+ @retval 1 Failure
+ @retval 0 Success
+*/
+
+static int check_query_cache_type(THD *thd, set_var *var)
+{
+ /*
+ Don't allow changes of the query_cache_type if the query cache
+ is disabled.
+ */
+ if (query_cache.is_disabled())
+ {
+ my_error(ER_QUERY_CACHE_DISABLED,MYF(0));
+ return 1;
+ }
+
+ return 0;
+}
+
+
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type)
{
query_cache_min_res_unit=
@@ -1541,6 +1574,23 @@ static bool get_unsigned(THD *thd, set_var *var, ulonglong user_max,
}
+bool sys_var_uint_ptr::check(THD *thd, set_var *var)
+{
+ var->save_result.ulong_value= (ulong) var->value->val_uint();
+ return 0;
+}
+
+bool sys_var_uint_ptr::update(THD *thd, set_var *var)
+{
+ *value= (uint) var->save_result.ulong_value;
+ return 0;
+}
+
+void sys_var_uint_ptr::set_default(THD *thd, enum_var_type type)
+{
+ *value= (uint) option_limits->def_value;
+}
+
sys_var_long_ptr::
sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_arg,
sys_after_update_func after_update_arg)
@@ -1802,9 +1852,15 @@ bool sys_var::check_enum(THD *thd, set_var *var, const TYPELIB *enum_names)
if (!(res=var->value->val_str(&str)) ||
((long) (var->save_result.ulong_value=
(ulong) find_type(enum_names, res->ptr(),
- res->length(),1)-1)) < 0)
+ res->length(), FALSE) - 1)) < 0)
{
- value= res ? res->c_ptr() : "NULL";
+ if (res)
+ {
+ ErrConvString err(res);
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
+ return 1;
+ }
+ value= "NULL";
goto err;
}
}
@@ -1857,8 +1913,9 @@ bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
&not_used));
if (error_len)
{
- strmake(buff, error, min(sizeof(buff) - 1, error_len));
- goto err;
+ ErrConvString err(error, error_len, res->charset());
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
+ return 1;
}
}
else
@@ -2006,7 +2063,8 @@ bool sys_var_thd_date_time_format::check(THD *thd, set_var *var)
if (!(format= date_time_format_make(date_time_type,
res->ptr(), res->length())))
{
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, res->c_ptr());
+ ErrConvString err(res);
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
return 1;
}
@@ -2110,7 +2168,8 @@ bool sys_var_collation::check(THD *thd, set_var *var)
}
if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))))
{
- my_error(ER_UNKNOWN_COLLATION, MYF(0), res->c_ptr());
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
return 1;
}
}
@@ -2150,7 +2209,8 @@ bool sys_var_character_set::check(THD *thd, set_var *var)
else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) &&
!(tmp=get_old_charset_by_name(res->c_ptr())))
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
return 1;
}
}
@@ -2541,9 +2601,20 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
{
MYSQL_QUERY_LOG *file_log;
char buff[FN_REFLEN];
- char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
+ char *res= 0, *old_value= 0;
bool result= 0;
- uint str_length= (var ? var->value->str_value.length() : 0);
+ uint str_length= 0;
+
+ if (var)
+ {
+ String str(buff, sizeof(buff), system_charset_info), *newval;
+
+ newval= var->value->val_str(&str);
+ old_value= newval->c_ptr_safe();
+ str_length= strlen(old_value);
+ }
+
+
switch (log_type) {
case QUERY_LOG_SLOW:
@@ -2912,7 +2983,7 @@ bool sys_var_thd_ulong_session_readonly::check(THD *thd, set_var *var)
}
-bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var)
+static MY_LOCALE *check_locale(THD *thd, const char *name, set_var *var)
{
MY_LOCALE *locale_match;
@@ -2922,29 +2993,38 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var)
{
char buf[20];
int10_to_str((int) var->value->val_int(), buf, -10);
- my_printf_error(ER_UNKNOWN_ERROR, "Unknown locale: '%s'", MYF(0), buf);
- return 1;
+ my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE), MYF(0), buf);
+ return 0;
}
}
else // STRING_RESULT
{
char buff[6];
- String str(buff, sizeof(buff), &my_charset_latin1), *res;
+ String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
- return 1;
+ return 0;
}
const char *locale_str= res->c_ptr();
if (!(locale_match= my_locale_by_name(locale_str)))
{
- my_printf_error(ER_UNKNOWN_ERROR,
- "Unknown locale: '%s'", MYF(0), locale_str);
- return 1;
+ my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE),
+ MYF(0), locale_str);
+ return 0;
}
}
- var->save_result.locale_value= locale_match;
+ return var->save_result.locale_value= locale_match;
+}
+
+
+bool sys_var_thd_lc::check(THD *thd, set_var *var)
+{
+ MY_LOCALE *locale_match;
+
+ if (!(locale_match= check_locale(thd, name, var)))
+ return 1;
return 0;
}
@@ -2976,6 +3056,56 @@ void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
thd->variables.lc_time_names= global_system_variables.lc_time_names;
}
+
+bool sys_var_thd_lc_messages::update(THD *thd, set_var *var)
+{
+ MY_LOCALE *locale= var->save_result.locale_value;
+
+ if (!locale->errmsgs->errmsgs)
+ {
+ pthread_mutex_lock(&LOCK_error_messages);
+ if (!locale->errmsgs->errmsgs &&
+ read_texts(ERRMSG_FILE, locale->errmsgs->language,
+ &locale->errmsgs->errmsgs,
+ ER_ERROR_LAST - ER_ERROR_FIRST + 1))
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_UNKNOWN_ERROR,
+ "Can't process error message file for locale '%s'",
+ locale->name);
+ pthread_mutex_unlock(&LOCK_error_messages);
+ return 0;
+ }
+ pthread_mutex_unlock(&LOCK_error_messages);
+ }
+
+ if (var->type == OPT_GLOBAL)
+ global_system_variables.lc_messages= locale;
+ else
+ thd->variables.lc_messages= locale;
+
+ return 0;
+}
+
+
+uchar *sys_var_thd_lc_messages::value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
+{
+ return type == OPT_GLOBAL ?
+ (uchar *) global_system_variables.lc_messages->name :
+ (uchar *) thd->variables.lc_messages->name;
+}
+
+
+void sys_var_thd_lc_messages::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ global_system_variables.lc_messages= my_default_lc_messages;
+ else
+ thd->variables.lc_messages= global_system_variables.lc_messages;
+}
+
+
/*
Handling of microseoncds given as seconds.part_seconds
@@ -3061,6 +3191,15 @@ static bool set_option_autocommit(THD *thd, set_var *var)
ulonglong org_options= thd->options;
+ /*
+ If we are setting AUTOCOMMIT=1 and it was not already 1, then we
+ need to commit any outstanding transactions.
+ */
+ if (var->save_result.ulong_value != 0 &&
+ (thd->options & OPTION_NOT_AUTOCOMMIT) &&
+ ha_commit(thd))
+ return 1;
+
if (var->save_result.ulong_value != 0)
thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
else
@@ -3074,8 +3213,6 @@ static bool set_option_autocommit(THD *thd, set_var *var)
thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
- if (ha_commit(thd))
- return 1;
}
else
{
@@ -3139,17 +3276,13 @@ static int check_pseudo_thread_id(THD *thd, set_var *var)
static uchar *get_warning_count(THD *thd)
{
- thd->sys_var_tmp.long_value=
- (thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
- thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
- thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
+ thd->sys_var_tmp.long_value= thd->warning_info->warn_count();
return (uchar*) &thd->sys_var_tmp.long_value;
}
static uchar *get_error_count(THD *thd)
{
- thd->sys_var_tmp.long_value=
- thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
+ thd->sys_var_tmp.long_value= thd->warning_info->error_count();
return (uchar*) &thd->sys_var_tmp.long_value;
}
@@ -3259,7 +3392,7 @@ int mysql_add_sys_var_chain(sys_var *first, struct my_option *long_options)
error:
for (; first != var; first= first->next)
- hash_delete(&system_variable_hash, (uchar*) first);
+ my_hash_delete(&system_variable_hash, (uchar*) first);
return 1;
}
@@ -3283,7 +3416,7 @@ int mysql_del_sys_var_chain(sys_var *first)
/* A write lock should be held on LOCK_system_variables_hash */
for (sys_var *var= first; var; var= var->next)
- result|= hash_delete(&system_variable_hash, (uchar*) var);
+ result|= my_hash_delete(&system_variable_hash, (uchar*) var);
return result;
}
@@ -3320,7 +3453,7 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted)
for (i= 0; i < count; i++)
{
- sys_var *var= (sys_var*) hash_element(&system_variable_hash, i);
+ sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i);
show->name= var->name;
show->value= (char*) var;
show->type= SHOW_SYS;
@@ -3357,8 +3490,8 @@ int set_var_init()
for (sys_var *var=vars.first; var; var= var->next, count++) ;
- if (hash_init(&system_variable_hash, system_charset_info, count, 0,
- 0, (hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
+ if (my_hash_init(&system_variable_hash, system_charset_info, count, 0,
+ 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
goto error;
vars.last->next= NULL;
@@ -3383,7 +3516,7 @@ error:
void set_var_free()
{
- hash_free(&system_variable_hash);
+ my_hash_free(&system_variable_hash);
}
@@ -3409,7 +3542,7 @@ sys_var *intern_find_sys_var(const char *str, uint length, bool no_error)
This function is only called from the sql_plugin.cc.
A lock on LOCK_system_variable_hash should be held
*/
- var= (sys_var*) hash_search(&system_variable_hash,
+ var= (sys_var*) my_hash_search(&system_variable_hash,
(uchar*) str, length ? length : strlen(str));
if (!(var || no_error))
my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
@@ -3496,6 +3629,16 @@ bool not_all_support_one_shot(List<set_var_base> *var_list)
Functions to handle SET mysql_internal_variable=const_expr
*****************************************************************************/
+/**
+ Verify that the supplied value is correct.
+
+ @param thd Thread handler
+
+ @return status code
+ @retval -1 Failure
+ @retval 0 Success
+*/
+
int set_var::check(THD *thd)
{
if (var->is_readonly())
@@ -3923,7 +4066,8 @@ ulong fix_sql_mode(ulong sql_mode)
if (sql_mode & MODE_TRADITIONAL)
sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES |
MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER);
+ MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER |
+ MODE_NO_ENGINE_SUBSTITUTION);
return sql_mode;
}
@@ -4001,8 +4145,9 @@ bool sys_var_thd_optimizer_switch::check(THD *thd, set_var *var)
&error, &error_len, &not_used);
if (error_len)
{
- strmake(buff, error, min(sizeof(buff) - 1, error_len));
- goto err;
+ ErrConvString err(error, error_len, res->charset());
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
+ return TRUE;
}
return FALSE;
err:
diff --git a/sql/set_var.h b/sql/set_var.h
index fa747107870..c08097521d2 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -1,3 +1,6 @@
+#ifndef SET_VAR_INCLUDED
+#define SET_VAR_INCLUDED
+
/* Copyright (C) 2002-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -172,6 +175,27 @@ public:
{ return (uchar*) value; }
};
+/**
+ Unsigned int system variable class
+ */
+class sys_var_uint_ptr :public sys_var
+{
+public:
+ sys_var_uint_ptr(sys_var_chain *chain, const char *name_arg,
+ uint *value_ptr_arg,
+ sys_after_update_func after_update_arg= NULL)
+ :sys_var(name_arg, after_update_arg),
+ value(value_ptr_arg)
+ { chain_sys_var(chain); }
+ bool check(THD *thd, set_var *var);
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE show_type() { return SHOW_INT; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (uchar*) value; }
+private:
+ uint *value;
+};
/*
A global ulong variable that is protected by LOCK_global_system_variables
@@ -519,10 +543,16 @@ public:
{ chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
- int ret= 0;
- if (check_func)
- ret= (*check_func)(thd, var);
- return ret ? ret : check_enum(thd, var, enum_names);
+ /*
+ check_enum fails if the character representation supplied was wrong
+ or that the integer value was wrong or missing.
+ */
+ if (check_enum(thd, var, enum_names))
+ return TRUE;
+ else if ((check_func && (*check_func)(thd, var)))
+ return TRUE;
+ else
+ return FALSE;
}
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
@@ -1216,11 +1246,12 @@ public:
};
-class sys_var_thd_lc_time_names :public sys_var_thd
+
+class sys_var_thd_lc: public sys_var_thd
{
public:
- sys_var_thd_lc_time_names(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
+ sys_var_thd_lc(sys_var_chain *chain, const char *name_arg,
+ Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
: sys_var_thd(name_arg, NULL, binlog_status_arg)
{
#if MYSQL_VERSION_ID < 50000
@@ -1235,11 +1266,35 @@ public:
return ((type != STRING_RESULT) && (type != INT_RESULT));
}
bool check_default(enum_var_type type) { return 0; }
+};
+
+
+class sys_var_thd_lc_time_names :public sys_var_thd_lc
+{
+public:
+ sys_var_thd_lc_time_names(sys_var_chain *chain_arg, const char *name_arg,
+ Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
+ : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg)
+ {}
bool update(THD *thd, set_var *var);
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- virtual void set_default(THD *thd, enum_var_type type);
+ void set_default(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_thd_lc_messages :public sys_var_thd_lc
+{
+public:
+ sys_var_thd_lc_messages(sys_var_chain *chain_arg, const char *name_arg,
+ Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
+ : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg)
+ {}
+ bool update(THD *thd, set_var *var);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ void set_default(THD *thd, enum_var_type type);
};
+
#ifdef HAVE_EVENT_SCHEDULER
class sys_var_event_scheduler :public sys_var_long_ptr
{
@@ -1322,8 +1377,8 @@ public:
{
Item_field *item= (Item_field*) value_arg;
if (!(value=new Item_string(item->field_name,
- (uint) strlen(item->field_name),
- item->collation.collation)))
+ (uint) strlen(item->field_name),
+ system_charset_info)))
value=value_arg; /* Give error message later */
}
else
@@ -1465,3 +1520,5 @@ void free_key_cache(const char *name, KEY_CACHE *key_cache);
bool process_key_caches(process_key_cache_t func);
void delete_elements(I_List<NAMED_LIST> *list,
void (*free_element)(const char*, uchar*));
+
+#endif /* SET_VAR_INCLUDED */
diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am
index 68b393e619f..06b349d5de2 100644
--- a/sql/share/Makefile.am
+++ b/sql/share/Makefile.am
@@ -15,7 +15,7 @@
## Process this file with automake to create Makefile.in
-EXTRA_DIST= errmsg.txt
+EXTRA_DIST= errmsg-utf8.txt
dist-hook:
for dir in charsets @AVAILABLE_LANGUAGES@; do \
@@ -31,7 +31,7 @@ all-local: english/errmsg.sys
# Use the english errmsg.sys as a flag that all errmsg.sys needs to be
# created. Normally these are created by extra/Makefile
-english/errmsg.sys: errmsg.txt
+english/errmsg.sys: errmsg-utf8.txt
rm -f $(top_builddir)/include/mysqld_error.h
(cd $(top_builddir)/extra && $(MAKE))
@@ -43,8 +43,8 @@ install-data-local:
$(DESTDIR)$(pkgdatadir)/$$lang/errmsg.sys; \
done
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/charsets
- $(INSTALL_DATA) $(srcdir)/errmsg.txt \
- $(DESTDIR)$(pkgdatadir)/errmsg.txt; \
+ $(INSTALL_DATA) $(srcdir)/errmsg-utf8.txt \
+ $(DESTDIR)$(pkgdatadir)/errmsg-utf8.txt; \
$(INSTALL_DATA) $(srcdir)/charsets/README $(DESTDIR)$(pkgdatadir)/charsets/README
$(INSTALL_DATA) $(srcdir)/charsets/*.xml $(DESTDIR)$(pkgdatadir)/charsets
diff --git a/sql/share/errmsg-cnv.sh b/sql/share/errmsg-cnv.sh
new file mode 100644
index 00000000000..ac6243c9a37
--- /dev/null
+++ b/sql/share/errmsg-cnv.sh
@@ -0,0 +1,61 @@
+#
+# This shell script converts errmsg.txt
+# from a mixed-charset format
+# to utf8 format
+# and writes the result to errmgs-utf8.txt
+#
+
+
+cat errmsg.txt | while IFS= ; read -r a
+do
+cs=""
+
+var="${a#"${a%%[![:space:]]*}"}"
+
+case $var in
+cze*|hun*|pol*|rum*|slo*)
+ cs=latin2
+ ;;
+dan*|nla*|eng*|fre*|ger*|ita*|nor*|por*|spa*|swe*)
+ cs=latin1
+ ;;
+est*)
+ cs=latin7
+ ;;
+greek*)
+ cs=windows-1253
+ ;;
+jpn*)
+ cs=euc-jp
+ ;;
+jps*)
+ cs=shift-jis
+ ;;
+kor*)
+ cs=euc-kr
+ ;;
+serbian*)
+ cs=windows-1250
+ ;;
+rus*)
+ cs=koi8-r
+ ;;
+ukr*)
+ cs=koi8-u
+ ;;
+*)
+ echo $a
+esac
+
+if [ "x$cs" != "x" ]
+then
+ b=`echo $a | iconv -f $cs -t utf-8` ; rc=$?
+ if [ "$rc" == "0" ]
+ then
+ echo "$b"
+ else
+ echo "# This message failed to convert from $cs, skipped"
+ fi
+fi
+done > errmsg-utf8.txt
+
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
new file mode 100644
index 00000000000..4260efdeb56
--- /dev/null
+++ b/sql/share/errmsg-utf8.txt
@@ -0,0 +1,6262 @@
+languages czech=cze latin2, danish=dan latin1, dutch=nla latin1, english=eng latin1, estonian=est latin7, french=fre latin1, german=ger latin1, greek=greek greek, hungarian=hun latin2, italian=ita latin1, japanese=jpn ujis, japanese-sjis=jps sjis, korean=kor euckr, norwegian-ny=norwegian-ny latin1, norwegian=nor latin1, polish=pol latin2, portuguese=por latin1, romanian=rum latin2, russian=rus koi8r, serbian=serbian cp1250, slovak=slo latin2, spanish=spa latin1, swedish=swe latin1, ukrainian=ukr koi8u;
+
+default-language eng
+
+start-error-number 1000
+
+ER_HASHCHK
+ eng "hashchk"
+ER_NISAMCHK
+ eng "isamchk"
+ER_NO
+ cze "NE"
+ dan "NEJ"
+ nla "NEE"
+ eng "NO"
+ est "EI"
+ fre "NON"
+ ger "Nein"
+ greek "ΟΧΙ"
+ hun "NEM"
+ kor "아니오"
+ nor "NEI"
+ norwegian-ny "NEI"
+ pol "NIE"
+ por "NÃO"
+ rum "NU"
+ rus "ÐЕТ"
+ serbian "NE"
+ slo "NIE"
+ ukr "ÐІ"
+ER_YES
+ cze "ANO"
+ dan "JA"
+ nla "JA"
+ eng "YES"
+ est "JAH"
+ fre "OUI"
+ ger "Ja"
+ greek "ÎΑΙ"
+ hun "IGEN"
+ ita "SI"
+ kor "예"
+ nor "JA"
+ norwegian-ny "JA"
+ pol "TAK"
+ por "SIM"
+ rum "DA"
+ rus "ДÐ"
+ serbian "DA"
+ slo "Ãno"
+ spa "SI"
+ ukr "ТÐК"
+ER_CANT_CREATE_FILE
+ cze "Nemohu vytvo-Břit soubor '%-.200s' (chybový kód: %d)"
+ dan "Kan ikke oprette filen '%-.200s' (Fejlkode: %d)"
+ nla "Kan file '%-.200s' niet aanmaken (Errcode: %d)"
+ eng "Can't create file '%-.200s' (errno: %d)"
+ est "Ei suuda luua faili '%-.200s' (veakood: %d)"
+ fre "Ne peut créer le fichier '%-.200s' (Errcode: %d)"
+ ger "Kann Datei '%-.200s' nicht erzeugen (Fehler: %d)"
+ greek "ΑδÏνατη η δημιουÏγία του αÏχείου '%-.200s' (κωδικός λάθους: %d)"
+ hun "A '%-.200s' file nem hozhato letre (hibakod: %d)"
+ ita "Impossibile creare il file '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ファイルãŒä½œã‚Œã¾ã›ã‚“ (errno: %d)"
+ kor "í™”ì¼ '%-.200s'를 만들지 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke opprette fila '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje opprette fila '%-.200s' (Feilkode: %d)"
+ pol "Nie można stworzyć pliku '%-.200s' (Kod błędu: %d)"
+ por "Não pode criar o arquivo '%-.200s' (erro no. %d)"
+ rum "Nu pot sa creez fisierul '%-.200s' (Eroare: %d)"
+ rus "Ðевозможно Ñоздать файл '%-.200s' (ошибка: %d)"
+ serbian "Ne mogu da kreiram file '%-.200s' (errno: %d)"
+ slo "Nemôžem vytvoriť súbor '%-.200s' (chybový kód: %d)"
+ spa "No puedo crear archivo '%-.200s' (Error: %d)"
+ swe "Kan inte skapa filen '%-.200s' (Felkod: %d)"
+ ukr "Ðе можу Ñтворити файл '%-.200s' (помилка: %d)"
+ER_CANT_CREATE_TABLE
+ cze "Nemohu vytvo-Břit tabulku '%-.200s' (chybový kód: %d)"
+ dan "Kan ikke oprette tabellen '%-.200s' (Fejlkode: %d)"
+ nla "Kan tabel '%-.200s' niet aanmaken (Errcode: %d)"
+ eng "Can't create table '%-.200s' (errno: %d)"
+ jps "'%-.200s' テーブルãŒä½œã‚Œã¾ã›ã‚“.(errno: %d)",
+ est "Ei suuda luua tabelit '%-.200s' (veakood: %d)"
+ fre "Ne peut créer la table '%-.200s' (Errcode: %d)"
+ ger "Kann Tabelle '%-.200s' nicht erzeugen (Fehler: %d)"
+ greek "ΑδÏνατη η δημιουÏγία του πίνακα '%-.200s' (κωδικός λάθους: %d)"
+ hun "A '%-.200s' tabla nem hozhato letre (hibakod: %d)"
+ ita "Impossibile creare la tabella '%-.200s' (errno: %d)"
+ jpn "'%-.200s' テーブルãŒä½œã‚Œã¾ã›ã‚“.(errno: %d)"
+ kor "í…Œì´ë¸” '%-.200s'를 만들지 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke opprette tabellen '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje opprette tabellen '%-.200s' (Feilkode: %d)"
+ pol "Nie można stworzyć tabeli '%-.200s' (Kod błędu: %d)"
+ por "Não pode criar a tabela '%-.200s' (erro no. %d)"
+ rum "Nu pot sa creez tabla '%-.200s' (Eroare: %d)"
+ rus "Ðевозможно Ñоздать таблицу '%-.200s' (ошибка: %d)"
+ serbian "Ne mogu da kreiram tabelu '%-.200s' (errno: %d)"
+ slo "Nemôžem vytvoriť tabuľku '%-.200s' (chybový kód: %d)"
+ spa "No puedo crear tabla '%-.200s' (Error: %d)"
+ swe "Kan inte skapa tabellen '%-.200s' (Felkod: %d)"
+ ukr "Ðе можу Ñтворити таблицю '%-.200s' (помилка: %d)"
+ER_CANT_CREATE_DB
+ cze "Nemohu vytvo-Břit databázi '%-.192s' (chybový kód: %d)"
+ dan "Kan ikke oprette databasen '%-.192s' (Fejlkode: %d)"
+ nla "Kan database '%-.192s' niet aanmaken (Errcode: %d)"
+ eng "Can't create database '%-.192s' (errno: %d)"
+ jps "'%-.192s' データベースãŒä½œã‚Œã¾ã›ã‚“ (errno: %d)",
+ est "Ei suuda luua andmebaasi '%-.192s' (veakood: %d)"
+ fre "Ne peut créer la base '%-.192s' (Erreur %d)"
+ ger "Kann Datenbank '%-.192s' nicht erzeugen (Fehler: %d)"
+ greek "ΑδÏνατη η δημιουÏγία της βάσης δεδομένων '%-.192s' (κωδικός λάθους: %d)"
+ hun "Az '%-.192s' adatbazis nem hozhato letre (hibakod: %d)"
+ ita "Impossibile creare il database '%-.192s' (errno: %d)"
+ jpn "'%-.192s' データベースãŒä½œã‚Œã¾ã›ã‚“ (errno: %d)"
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ '%-.192s'를 만들지 못했습니다.. (ì—러번호: %d)"
+ nor "Kan ikke opprette databasen '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje opprette databasen '%-.192s' (Feilkode: %d)"
+ pol "Nie można stworzyć bazy danych '%-.192s' (Kod błędu: %d)"
+ por "Não pode criar o banco de dados '%-.192s' (erro no. %d)"
+ rum "Nu pot sa creez baza de date '%-.192s' (Eroare: %d)"
+ rus "Ðевозможно Ñоздать базу данных '%-.192s' (ошибка: %d)"
+ serbian "Ne mogu da kreiram bazu '%-.192s' (errno: %d)"
+ slo "Nemôžem vytvoriť databázu '%-.192s' (chybový kód: %d)"
+ spa "No puedo crear base de datos '%-.192s' (Error: %d)"
+ swe "Kan inte skapa databasen '%-.192s' (Felkod: %d)"
+ ukr "Ðе можу Ñтворити базу данних '%-.192s' (помилка: %d)"
+ER_DB_CREATE_EXISTS
+ cze "Nemohu vytvo-Břit databázi '%-.192s'; databáze již existuje"
+ dan "Kan ikke oprette databasen '%-.192s'; databasen eksisterer"
+ nla "Kan database '%-.192s' niet aanmaken; database bestaat reeds"
+ eng "Can't create database '%-.192s'; database exists"
+ jps "'%-.192s' データベースãŒä½œã‚Œã¾ã›ã‚“.æ—¢ã«ãã®ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒå­˜åœ¨ã—ã¾ã™",
+ est "Ei suuda luua andmebaasi '%-.192s': andmebaas juba eksisteerib"
+ fre "Ne peut créer la base '%-.192s'; elle existe déjà"
+ ger "Kann Datenbank '%-.192s' nicht erzeugen. Datenbank existiert bereits"
+ greek "ΑδÏνατη η δημιουÏγία της βάσης δεδομένων '%-.192s'; Η βάση δεδομένων υπάÏχει ήδη"
+ hun "Az '%-.192s' adatbazis nem hozhato letre Az adatbazis mar letezik"
+ ita "Impossibile creare il database '%-.192s'; il database esiste"
+ jpn "'%-.192s' データベースãŒä½œã‚Œã¾ã›ã‚“.æ—¢ã«ãã®ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒå­˜åœ¨ã—ã¾ã™"
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ '%-.192s'를 만들지 못했습니다.. ë°ì´íƒ€ë² ì´ìŠ¤ê°€ 존재함"
+ nor "Kan ikke opprette databasen '%-.192s'; databasen eksisterer"
+ norwegian-ny "Kan ikkje opprette databasen '%-.192s'; databasen eksisterer"
+ pol "Nie można stworzyć bazy danych '%-.192s'; baza danych już istnieje"
+ por "Não pode criar o banco de dados '%-.192s'; este banco de dados já existe"
+ rum "Nu pot sa creez baza de date '%-.192s'; baza de date exista deja"
+ rus "Ðевозможно Ñоздать базу данных '%-.192s'. База данных уже ÑущеÑтвует"
+ serbian "Ne mogu da kreiram bazu '%-.192s'; baza već postoji."
+ slo "Nemôžem vytvoriť databázu '%-.192s'; databáza existuje"
+ spa "No puedo crear base de datos '%-.192s'; la base de datos ya existe"
+ swe "Databasen '%-.192s' existerar redan"
+ ukr "Ðе можу Ñтворити базу данних '%-.192s'. База данних Ñ–Ñнує"
+ER_DB_DROP_EXISTS
+ cze "Nemohu zru-Bšit databázi '%-.192s', databáze neexistuje"
+ dan "Kan ikke slette (droppe) '%-.192s'; databasen eksisterer ikke"
+ nla "Kan database '%-.192s' niet verwijderen; database bestaat niet"
+ eng "Can't drop database '%-.192s'; database doesn't exist"
+ jps "'%-.192s' データベースを破棄ã§ãã¾ã›ã‚“. ãã®ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒãªã„ã®ã§ã™.",
+ est "Ei suuda kustutada andmebaasi '%-.192s': andmebaasi ei eksisteeri"
+ fre "Ne peut effacer la base '%-.192s'; elle n'existe pas"
+ ger "Kann Datenbank '%-.192s' nicht löschen; Datenbank nicht vorhanden"
+ greek "ΑδÏνατη η διαγÏαφή της βάσης δεδομένων '%-.192s'. Η βάση δεδομένων δεν υπάÏχει"
+ hun "A(z) '%-.192s' adatbazis nem szuntetheto meg. Az adatbazis nem letezik"
+ ita "Impossibile cancellare '%-.192s'; il database non esiste"
+ jpn "'%-.192s' データベースを破棄ã§ãã¾ã›ã‚“. ãã®ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒãªã„ã®ã§ã™."
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ '%-.192s'를 제거하지 못했습니다. ë°ì´íƒ€ë² ì´ìŠ¤ê°€ 존재하지 ì•ŠìŒ "
+ nor "Kan ikke fjerne (drop) '%-.192s'; databasen eksisterer ikke"
+ norwegian-ny "Kan ikkje fjerne (drop) '%-.192s'; databasen eksisterer ikkje"
+ pol "Nie można usun?ć bazy danych '%-.192s'; baza danych nie istnieje"
+ por "Não pode eliminar o banco de dados '%-.192s'; este banco de dados não existe"
+ rum "Nu pot sa drop baza de date '%-.192s'; baza da date este inexistenta"
+ rus "Ðевозможно удалить базу данных '%-.192s'. Такой базы данных нет"
+ serbian "Ne mogu da izbrišem bazu '%-.192s'; baza ne postoji."
+ slo "Nemôžem zmazať databázu '%-.192s'; databáza neexistuje"
+ spa "No puedo eliminar base de datos '%-.192s'; la base de datos no existe"
+ swe "Kan inte radera databasen '%-.192s'; databasen finns inte"
+ ukr "Ðе можу видалити базу данних '%-.192s'. База данних не Ñ–Ñнує"
+ER_DB_DROP_DELETE
+ cze "Chyba p-Bři rušení databáze (nemohu vymazat '%-.192s', chyba %d)"
+ dan "Fejl ved sletning (drop) af databasen (kan ikke slette '%-.192s', Fejlkode %d)"
+ nla "Fout bij verwijderen database (kan '%-.192s' niet verwijderen, Errcode: %d)"
+ eng "Error dropping database (can't delete '%-.192s', errno: %d)"
+ jps "データベース破棄エラー ('%-.192s' を削除ã§ãã¾ã›ã‚“, errno: %d)",
+ est "Viga andmebaasi kustutamisel (ei suuda kustutada faili '%-.192s', veakood: %d)"
+ fre "Ne peut effacer la base '%-.192s' (erreur %d)"
+ ger "Fehler beim Löschen der Datenbank ('%-.192s' kann nicht gelöscht werden, Fehler: %d)"
+ greek "ΠαÏουσιάστηκε Ï€Ïόβλημα κατά τη διαγÏαφή της βάσης δεδομένων (αδÏνατη η διαγÏαφή '%-.192s', κωδικός λάθους: %d)"
+ hun "Adatbazis megszuntetesi hiba ('%-.192s' nem torolheto, hibakod: %d)"
+ ita "Errore durante la cancellazione del database (impossibile cancellare '%-.192s', errno: %d)"
+ jpn "データベース破棄エラー ('%-.192s' を削除ã§ãã¾ã›ã‚“, errno: %d)"
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ 제거 ì—러('%-.192s'를 삭제할 수 ì—†ì니다, ì—러번호: %d)"
+ nor "Feil ved fjerning (drop) av databasen (kan ikke slette '%-.192s', feil %d)"
+ norwegian-ny "Feil ved fjerning (drop) av databasen (kan ikkje slette '%-.192s', feil %d)"
+ pol "Bł?d podczas usuwania bazy danych (nie można usun?ć '%-.192s', bł?d %d)"
+ por "Erro ao eliminar banco de dados (não pode eliminar '%-.192s' - erro no. %d)"
+ rum "Eroare dropuind baza de date (nu pot sa sterg '%-.192s', Eroare: %d)"
+ rus "Ошибка при удалении базы данных (невозможно удалить '%-.192s', ошибка: %d)"
+ serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem '%-.192s', errno: %d)"
+ slo "Chyba pri mazaní databázy (nemôžem zmazať '%-.192s', chybový kód: %d)"
+ spa "Error eliminando la base de datos(no puedo borrar '%-.192s', error %d)"
+ swe "Fel vid radering av databasen (Kan inte radera '%-.192s'. Felkod: %d)"
+ ukr "Ðе можу видалити базу данних (Ðе можу видалити '%-.192s', помилка: %d)"
+ER_DB_DROP_RMDIR
+ cze "Chyba p-Bři rušení databáze (nemohu vymazat adresář '%-.192s', chyba %d)"
+ dan "Fejl ved sletting af database (kan ikke slette folderen '%-.192s', Fejlkode %d)"
+ nla "Fout bij verwijderen database (kan rmdir '%-.192s' niet uitvoeren, Errcode: %d)"
+ eng "Error dropping database (can't rmdir '%-.192s', errno: %d)"
+ jps "データベース破棄エラー ('%-.192s' ã‚’ rmdir ã§ãã¾ã›ã‚“, errno: %d)",
+ est "Viga andmebaasi kustutamisel (ei suuda kustutada kataloogi '%-.192s', veakood: %d)"
+ fre "Erreur en effaçant la base (rmdir '%-.192s', erreur %d)"
+ ger "Fehler beim Löschen der Datenbank (Verzeichnis '%-.192s' kann nicht gelöscht werden, Fehler: %d)"
+ greek "ΠαÏουσιάστηκε Ï€Ïόβλημα κατά τη διαγÏαφή της βάσης δεδομένων (αδÏνατη η διαγÏαφή του φακέλλου '%-.192s', κωδικός λάθους: %d)"
+ hun "Adatbazis megszuntetesi hiba ('%-.192s' nem szuntetheto meg, hibakod: %d)"
+ ita "Errore durante la cancellazione del database (impossibile rmdir '%-.192s', errno: %d)"
+ jpn "データベース破棄エラー ('%-.192s' ã‚’ rmdir ã§ãã¾ã›ã‚“, errno: %d)"
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ 제거 ì—러(rmdir '%-.192s'를 í•  수 ì—†ì니다, ì—러번호: %d)"
+ nor "Feil ved sletting av database (kan ikke slette katalogen '%-.192s', feil %d)"
+ norwegian-ny "Feil ved sletting av database (kan ikkje slette katalogen '%-.192s', feil %d)"
+ pol "Bł?d podczas usuwania bazy danych (nie można wykonać rmdir '%-.192s', bł?d %d)"
+ por "Erro ao eliminar banco de dados (não pode remover diretório '%-.192s' - erro no. %d)"
+ rum "Eroare dropuind baza de date (nu pot sa rmdir '%-.192s', Eroare: %d)"
+ rus "Ðевозможно удалить базу данных (невозможно удалить каталог '%-.192s', ошибка: %d)"
+ serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem direktorijum '%-.192s', errno: %d)"
+ slo "Chyba pri mazaní databázy (nemôžem vymazať adresár '%-.192s', chybový kód: %d)"
+ spa "Error eliminando la base de datos (No puedo borrar directorio '%-.192s', error %d)"
+ swe "Fel vid radering av databasen (Kan inte radera biblioteket '%-.192s'. Felkod: %d)"
+ ukr "Ðе можу видалити базу данних (Ðе можу видалити теку '%-.192s', помилка: %d)"
+ER_CANT_DELETE_FILE
+ cze "Chyba p-Bři výmazu '%-.192s' (chybový kód: %d)"
+ dan "Fejl ved sletning af '%-.192s' (Fejlkode: %d)"
+ nla "Fout bij het verwijderen van '%-.192s' (Errcode: %d)"
+ eng "Error on delete of '%-.192s' (errno: %d)"
+ jps "'%-.192s' ã®å‰Šé™¤ãŒã‚¨ãƒ©ãƒ¼ (errno: %d)",
+ est "Viga '%-.192s' kustutamisel (veakood: %d)"
+ fre "Erreur en effaçant '%-.192s' (Errcode: %d)"
+ ger "Fehler beim Löschen von '%-.192s' (Fehler: %d)"
+ greek "ΠαÏουσιάστηκε Ï€Ïόβλημα κατά τη διαγÏαφή '%-.192s' (κωδικός λάθους: %d)"
+ hun "Torlesi hiba: '%-.192s' (hibakod: %d)"
+ ita "Errore durante la cancellazione di '%-.192s' (errno: %d)"
+ jpn "'%-.192s' ã®å‰Šé™¤ãŒã‚¨ãƒ©ãƒ¼ (errno: %d)"
+ kor "'%-.192s' ì‚­ì œ 중 ì—러 (ì—러번호: %d)"
+ nor "Feil ved sletting av '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Feil ved sletting av '%-.192s' (Feilkode: %d)"
+ pol "Bł?d podczas usuwania '%-.192s' (Kod błędu: %d)"
+ por "Erro na remoção de '%-.192s' (erro no. %d)"
+ rum "Eroare incercind sa delete '%-.192s' (Eroare: %d)"
+ rus "Ошибка при удалении '%-.192s' (ошибка: %d)"
+ serbian "Greška pri brisanju '%-.192s' (errno: %d)"
+ slo "Chyba pri mazaní '%-.192s' (chybový kód: %d)"
+ spa "Error en el borrado de '%-.192s' (Error: %d)"
+ swe "Kan inte radera filen '%-.192s' (Felkod: %d)"
+ ukr "Ðе можу видалити '%-.192s' (помилка: %d)"
+ER_CANT_FIND_SYSTEM_REC
+ cze "Nemohu -BÄíst záznam v systémové tabulce"
+ dan "Kan ikke læse posten i systemfolderen"
+ nla "Kan record niet lezen in de systeem tabel"
+ eng "Can't read record in system table"
+ jps "system table ã®ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’読む事ãŒã§ãã¾ã›ã‚“ã§ã—ãŸ",
+ est "Ei suuda lugeda kirjet süsteemsest tabelist"
+ fre "Ne peut lire un enregistrement de la table 'system'"
+ ger "Datensatz in der Systemtabelle nicht lesbar"
+ greek "ΑδÏνατη η ανάγνωση εγγÏαφής από πίνακα του συστήματος"
+ hun "Nem olvashato rekord a rendszertablaban"
+ ita "Impossibile leggere il record dalla tabella di sistema"
+ jpn "system table ã®ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’読む事ãŒã§ãã¾ã›ã‚“ã§ã—ãŸ"
+ kor "system í…Œì´ë¸”ì—ì„œ 레코드를 ì½ì„ 수 없습니다."
+ nor "Kan ikke lese posten i systemkatalogen"
+ norwegian-ny "Kan ikkje lese posten i systemkatalogen"
+ pol "Nie można odczytać rekordu z tabeli systemowej"
+ por "Não pode ler um registro numa tabela do sistema"
+ rum "Nu pot sa citesc cimpurile in tabla de system (system table)"
+ rus "Ðевозможно прочитать запиÑÑŒ в ÑиÑтемной таблице"
+ serbian "Ne mogu da proÄitam slog iz sistemske tabele"
+ slo "Nemôžem ÄítaÅ¥ záznam v systémovej tabuľke"
+ spa "No puedo leer el registro en la tabla del sistema"
+ swe "Hittar inte posten i systemregistret"
+ ukr "Ðе можу зчитати Ð·Ð°Ð¿Ð¸Ñ Ð· ÑиÑтемної таблиці"
+ER_CANT_GET_STAT
+ cze "Nemohu z-Bískat stav '%-.200s' (chybový kód: %d)"
+ dan "Kan ikke læse status af '%-.200s' (Fejlkode: %d)"
+ nla "Kan de status niet krijgen van '%-.200s' (Errcode: %d)"
+ eng "Can't get status of '%-.200s' (errno: %d)"
+ jps "'%-.200s' ã®ã‚¹ãƒ†ã‚¤ã‚¿ã‚¹ãŒå¾—られã¾ã›ã‚“. (errno: %d)",
+ est "Ei suuda lugeda '%-.200s' olekut (veakood: %d)"
+ fre "Ne peut obtenir le status de '%-.200s' (Errcode: %d)"
+ ger "Kann Status von '%-.200s' nicht ermitteln (Fehler: %d)"
+ greek "ΑδÏνατη η λήψη πληÏοφοÏιών για την κατάσταση του '%-.200s' (κωδικός λάθους: %d)"
+ hun "A(z) '%-.200s' statusza nem allapithato meg (hibakod: %d)"
+ ita "Impossibile leggere lo stato di '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ã®ã‚¹ãƒ†ã‚¤ã‚¿ã‚¹ãŒå¾—られã¾ã›ã‚“. (errno: %d)"
+ kor "'%-.200s'ì˜ ìƒíƒœë¥¼ 얻지 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke lese statusen til '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje lese statusen til '%-.200s' (Feilkode: %d)"
+ pol "Nie można otrzymać statusu '%-.200s' (Kod błędu: %d)"
+ por "Não pode obter o status de '%-.200s' (erro no. %d)"
+ rum "Nu pot sa obtin statusul lui '%-.200s' (Eroare: %d)"
+ rus "Ðевозможно получить ÑтатуÑную информацию о '%-.200s' (ошибка: %d)"
+ serbian "Ne mogu da dobijem stanje file-a '%-.200s' (errno: %d)"
+ slo "Nemôžem zistiť stav '%-.200s' (chybový kód: %d)"
+ spa "No puedo obtener el estado de '%-.200s' (Error: %d)"
+ swe "Kan inte läsa filinformationen (stat) från '%-.200s' (Felkod: %d)"
+ ukr "Ðе можу отримати ÑÑ‚Ð°Ñ‚ÑƒÑ '%-.200s' (помилка: %d)"
+ER_CANT_GET_WD
+ cze "Chyba p-Bři zjišťování pracovní adresář (chybový kód: %d)"
+ dan "Kan ikke læse aktive folder (Fejlkode: %d)"
+ nla "Kan de werkdirectory niet krijgen (Errcode: %d)"
+ eng "Can't get working directory (errno: %d)"
+ jps "working directory を得る事ãŒã§ãã¾ã›ã‚“ã§ã—㟠(errno: %d)",
+ est "Ei suuda identifitseerida jooksvat kataloogi (veakood: %d)"
+ fre "Ne peut obtenir le répertoire de travail (Errcode: %d)"
+ ger "Kann Arbeitsverzeichnis nicht ermitteln (Fehler: %d)"
+ greek "Ο φάκελλος εÏγασίας δεν βÏέθηκε (κωδικός λάθους: %d)"
+ hun "A munkakonyvtar nem allapithato meg (hibakod: %d)"
+ ita "Impossibile leggere la directory di lavoro (errno: %d)"
+ jpn "working directory を得る事ãŒã§ãã¾ã›ã‚“ã§ã—㟠(errno: %d)"
+ kor "수행 디렉토리를 찾지 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke lese aktiv katalog(Feilkode: %d)"
+ norwegian-ny "Kan ikkje lese aktiv katalog(Feilkode: %d)"
+ pol "Nie można rozpoznać aktualnego katalogu (Kod błędu: %d)"
+ por "Não pode obter o diretório corrente (erro no. %d)"
+ rum "Nu pot sa obtin directorul current (working directory) (Eroare: %d)"
+ rus "Ðевозможно определить рабочий каталог (ошибка: %d)"
+ serbian "Ne mogu da dobijem trenutni direktorijum (errno: %d)"
+ slo "Nemôžem zistiť pracovný adresár (chybový kód: %d)"
+ spa "No puedo acceder al directorio (Error: %d)"
+ swe "Kan inte inte läsa aktivt bibliotek. (Felkod: %d)"
+ ukr "Ðе можу визначити робочу теку (помилка: %d)"
+ER_CANT_LOCK
+ cze "Nemohu uzamknout soubor (chybov-Bý kód: %d)"
+ dan "Kan ikke låse fil (Fejlkode: %d)"
+ nla "Kan de file niet blokeren (Errcode: %d)"
+ eng "Can't lock file (errno: %d)"
+ jps "ファイルをロックã§ãã¾ã›ã‚“ (errno: %d)",
+ est "Ei suuda lukustada faili (veakood: %d)"
+ fre "Ne peut verrouiller le fichier (Errcode: %d)"
+ ger "Datei kann nicht gesperrt werden (Fehler: %d)"
+ greek "Το αÏχείο δεν μποÏεί να κλειδωθεί (κωδικός λάθους: %d)"
+ hun "A file nem zarolhato. (hibakod: %d)"
+ ita "Impossibile il locking il file (errno: %d)"
+ jpn "ファイルをロックã§ãã¾ã›ã‚“ (errno: %d)"
+ kor "í™”ì¼ì„ 잠그지(lock) 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke låse fila (Feilkode: %d)"
+ norwegian-ny "Kan ikkje låse fila (Feilkode: %d)"
+ pol "Nie można zablokować pliku (Kod błędu: %d)"
+ por "Não pode travar o arquivo (erro no. %d)"
+ rum "Nu pot sa lock fisierul (Eroare: %d)"
+ rus "Ðевозможно поÑтавить блокировку на файле (ошибка: %d)"
+ serbian "Ne mogu da zakljuÄam file (errno: %d)"
+ slo "Nemôžem zamknúť súbor (chybový kód: %d)"
+ spa "No puedo bloquear archivo: (Error: %d)"
+ swe "Kan inte låsa filen. (Felkod: %d)"
+ ukr "Ðе можу заблокувати файл (помилка: %d)"
+ER_CANT_OPEN_FILE
+ cze "Nemohu otev-Břít soubor '%-.200s' (chybový kód: %d)"
+ dan "Kan ikke åbne fil: '%-.200s' (Fejlkode: %d)"
+ nla "Kan de file '%-.200s' niet openen (Errcode: %d)"
+ eng "Can't open file: '%-.200s' (errno: %d)"
+ jps "'%-.200s' ファイルを開ã事ãŒã§ãã¾ã›ã‚“ (errno: %d)",
+ est "Ei suuda avada faili '%-.200s' (veakood: %d)"
+ fre "Ne peut ouvrir le fichier: '%-.200s' (Errcode: %d)"
+ ger "Kann Datei '%-.200s' nicht öffnen (Fehler: %d)"
+ greek "Δεν είναι δυνατό να ανοιχτεί το αÏχείο: '%-.200s' (κωδικός λάθους: %d)"
+ hun "A '%-.200s' file nem nyithato meg (hibakod: %d)"
+ ita "Impossibile aprire il file: '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ファイルを開ã事ãŒã§ãã¾ã›ã‚“ (errno: %d)"
+ kor "í™”ì¼ì„ 열지 못했습니다.: '%-.200s' (ì—러번호: %d)"
+ nor "Kan ikke åpne fila: '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje åpne fila: '%-.200s' (Feilkode: %d)"
+ pol "Nie można otworzyć pliku: '%-.200s' (Kod błędu: %d)"
+ por "Não pode abrir o arquivo '%-.200s' (erro no. %d)"
+ rum "Nu pot sa deschid fisierul: '%-.200s' (Eroare: %d)"
+ rus "Ðевозможно открыть файл: '%-.200s' (ошибка: %d)"
+ serbian "Ne mogu da otvorim file: '%-.200s' (errno: %d)"
+ slo "Nemôžem otvoriť súbor: '%-.200s' (chybový kód: %d)"
+ spa "No puedo abrir archivo: '%-.200s' (Error: %d)"
+ swe "Kan inte använda '%-.200s' (Felkod: %d)"
+ ukr "Ðе можу відкрити файл: '%-.200s' (помилка: %d)"
+ER_FILE_NOT_FOUND
+ cze "Nemohu naj-Bít soubor '%-.200s' (chybový kód: %d)"
+ dan "Kan ikke finde fila: '%-.200s' (Fejlkode: %d)"
+ nla "Kan de file: '%-.200s' niet vinden (Errcode: %d)"
+ eng "Can't find file: '%-.200s' (errno: %d)"
+ jps "'%-.200s' ファイルを見付ã‘る事ãŒã§ãã¾ã›ã‚“.(errno: %d)",
+ est "Ei suuda leida faili '%-.200s' (veakood: %d)"
+ fre "Ne peut trouver le fichier: '%-.200s' (Errcode: %d)"
+ ger "Kann Datei '%-.200s' nicht finden (Fehler: %d)"
+ greek "Δεν βÏέθηκε το αÏχείο: '%-.200s' (κωδικός λάθους: %d)"
+ hun "A(z) '%-.200s' file nem talalhato (hibakod: %d)"
+ ita "Impossibile trovare il file: '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ファイルを見付ã‘る事ãŒã§ãã¾ã›ã‚“.(errno: %d)"
+ kor "í™”ì¼ì„ 찾지 못했습니다.: '%-.200s' (ì—러번호: %d)"
+ nor "Kan ikke finne fila: '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje finne fila: '%-.200s' (Feilkode: %d)"
+ pol "Nie można znaleĽć pliku: '%-.200s' (Kod błędu: %d)"
+ por "Não pode encontrar o arquivo '%-.200s' (erro no. %d)"
+ rum "Nu pot sa gasesc fisierul: '%-.200s' (Eroare: %d)"
+ rus "Ðевозможно найти файл: '%-.200s' (ошибка: %d)"
+ serbian "Ne mogu da pronađem file: '%-.200s' (errno: %d)"
+ slo "Nemôžem nájsť súbor: '%-.200s' (chybový kód: %d)"
+ spa "No puedo encontrar archivo: '%-.200s' (Error: %d)"
+ swe "Hittar inte filen '%-.200s' (Felkod: %d)"
+ ukr "Ðе можу знайти файл: '%-.200s' (помилка: %d)"
+ER_CANT_READ_DIR
+ cze "Nemohu -BÄíst adresář '%-.192s' (chybový kód: %d)"
+ dan "Kan ikke læse folder '%-.192s' (Fejlkode: %d)"
+ nla "Kan de directory niet lezen van '%-.192s' (Errcode: %d)"
+ eng "Can't read dir of '%-.192s' (errno: %d)"
+ jps "'%-.192s' ディレクトリãŒèª­ã‚ã¾ã›ã‚“.(errno: %d)",
+ est "Ei suuda lugeda kataloogi '%-.192s' (veakood: %d)"
+ fre "Ne peut lire le répertoire de '%-.192s' (Errcode: %d)"
+ ger "Verzeichnis von '%-.192s' nicht lesbar (Fehler: %d)"
+ greek "Δεν είναι δυνατό να διαβαστεί ο φάκελλος του '%-.192s' (κωδικός λάθους: %d)"
+ hun "A(z) '%-.192s' konyvtar nem olvashato. (hibakod: %d)"
+ ita "Impossibile leggere la directory di '%-.192s' (errno: %d)"
+ jpn "'%-.192s' ディレクトリãŒèª­ã‚ã¾ã›ã‚“.(errno: %d)"
+ kor "'%-.192s'디렉토리를 ì½ì§€ 못했습니다. (ì—러번호: %d)"
+ nor "Kan ikke lese katalogen '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje lese katalogen '%-.192s' (Feilkode: %d)"
+ pol "Nie można odczytać katalogu '%-.192s' (Kod błędu: %d)"
+ por "Não pode ler o diretório de '%-.192s' (erro no. %d)"
+ rum "Nu pot sa citesc directorul '%-.192s' (Eroare: %d)"
+ rus "Ðевозможно прочитать каталог '%-.192s' (ошибка: %d)"
+ serbian "Ne mogu da proÄitam direktorijum '%-.192s' (errno: %d)"
+ slo "Nemôžem ÄítaÅ¥ adresár '%-.192s' (chybový kód: %d)"
+ spa "No puedo leer el directorio de '%-.192s' (Error: %d)"
+ swe "Kan inte läsa från bibliotek '%-.192s' (Felkod: %d)"
+ ukr "Ðе можу прочитати теку '%-.192s' (помилка: %d)"
+ER_CANT_SET_WD
+ cze "Nemohu zm-Běnit adresář na '%-.192s' (chybový kód: %d)"
+ dan "Kan ikke skifte folder til '%-.192s' (Fejlkode: %d)"
+ nla "Kan de directory niet veranderen naar '%-.192s' (Errcode: %d)"
+ eng "Can't change dir to '%-.192s' (errno: %d)"
+ jps "'%-.192s' ディレクトリ㫠chdir ã§ãã¾ã›ã‚“.(errno: %d)",
+ est "Ei suuda siseneda kataloogi '%-.192s' (veakood: %d)"
+ fre "Ne peut changer le répertoire pour '%-.192s' (Errcode: %d)"
+ ger "Kann nicht in das Verzeichnis '%-.192s' wechseln (Fehler: %d)"
+ greek "ΑδÏνατη η αλλαγή του Ï„Ïέχοντος καταλόγου σε '%-.192s' (κωδικός λάθους: %d)"
+ hun "Konyvtarvaltas nem lehetseges a(z) '%-.192s'-ba. (hibakod: %d)"
+ ita "Impossibile cambiare la directory in '%-.192s' (errno: %d)"
+ jpn "'%-.192s' ディレクトリ㫠chdir ã§ãã¾ã›ã‚“.(errno: %d)"
+ kor "'%-.192s'디렉토리로 ì´ë™í•  수 없었습니다. (ì—러번호: %d)"
+ nor "Kan ikke skifte katalog til '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Kan ikkje skifte katalog til '%-.192s' (Feilkode: %d)"
+ pol "Nie można zmienić katalogu na '%-.192s' (Kod błędu: %d)"
+ por "Não pode mudar para o diretório '%-.192s' (erro no. %d)"
+ rum "Nu pot sa schimb directorul '%-.192s' (Eroare: %d)"
+ rus "Ðевозможно перейти в каталог '%-.192s' (ошибка: %d)"
+ serbian "Ne mogu da promenim direktorijum na '%-.192s' (errno: %d)"
+ slo "Nemôžem vojsť do adresára '%-.192s' (chybový kód: %d)"
+ spa "No puedo cambiar al directorio de '%-.192s' (Error: %d)"
+ swe "Kan inte byta till '%-.192s' (Felkod: %d)"
+ ukr "Ðе можу перейти у теку '%-.192s' (помилка: %d)"
+ER_CHECKREAD
+ cze "Z-Báznam byl zmÄ›nÄ›n od posledního Ätení v tabulce '%-.192s'"
+ dan "Posten er ændret siden sidste læsning '%-.192s'"
+ nla "Record is veranderd sinds de laatste lees activiteit in de tabel '%-.192s'"
+ eng "Record has changed since last read in table '%-.192s'"
+ est "Kirje tabelis '%-.192s' on muutunud viimasest lugemisest saadik"
+ fre "Enregistrement modifié depuis sa dernière lecture dans la table '%-.192s'"
+ ger "Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.192s' geändert"
+ greek "Η εγγÏαφή έχει αλλάξει από την τελευταία φοÏά που ανασÏÏθηκε από τον πίνακα '%-.192s'"
+ hun "A(z) '%-.192s' tablaban talalhato rekord megvaltozott az utolso olvasas ota"
+ ita "Il record e` cambiato dall'ultima lettura della tabella '%-.192s'"
+ kor "í…Œì´ë¸” '%-.192s'ì—ì„œ 마지막으로 ì½ì€ 후 Recordê°€ 변경ë˜ì—ˆìŠµë‹ˆë‹¤."
+ nor "Posten har blitt endret siden den ble lest '%-.192s'"
+ norwegian-ny "Posten har vorte endra sidan den sist vart lesen '%-.192s'"
+ pol "Rekord został zmieniony od ostaniego odczytania z tabeli '%-.192s'"
+ por "Registro alterado desde a última leitura da tabela '%-.192s'"
+ rum "Cimpul a fost schimbat de la ultima citire a tabelei '%-.192s'"
+ rus "ЗапиÑÑŒ изменилаÑÑŒ Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñ‚Ð° поÑледней выборки в таблице '%-.192s'"
+ serbian "Slog je promenjen od zadnjeg Äitanja tabele '%-.192s'"
+ slo "Záznam bol zmenený od posledného Äítania v tabuľke '%-.192s'"
+ spa "El registro ha cambiado desde la ultima lectura de la tabla '%-.192s'"
+ swe "Posten har förändrats sedan den lästes i register '%-.192s'"
+ ukr "Ð—Ð°Ð¿Ð¸Ñ Ð±ÑƒÐ»Ð¾ змінено з чаÑу оÑтаннього Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð· таблиці '%-.192s'"
+ER_DISK_FULL
+ cze "Disk je pln-Bý (%s), Äekám na uvolnÄ›ní nÄ›jakého místa ..."
+ dan "Ikke mere diskplads (%s). Venter på at få frigjort plads..."
+ nla "Schijf vol (%s). Aan het wachten totdat er ruimte vrij wordt gemaakt..."
+ eng "Disk full (%s); waiting for someone to free some space..."
+ jps "Disk full (%s). 誰ã‹ãŒä½•ã‹ã‚’減らã™ã¾ã§ã¾ã£ã¦ãã ã•ã„...",
+ est "Ketas täis (%s). Ootame kuni tekib vaba ruumi..."
+ fre "Disque plein (%s). J'attend que quelqu'un libère de l'espace..."
+ ger "Festplatte voll (%s). Warte, bis jemand Platz schafft ..."
+ greek "Δεν υπάÏχει χώÏος στο δίσκο (%s). ΠαÏακαλώ, πεÏιμένετε να ελευθεÏωθεί χώÏος..."
+ hun "A lemez megtelt (%s)."
+ ita "Disco pieno (%s). In attesa che qualcuno liberi un po' di spazio..."
+ jpn "Disk full (%s). 誰ã‹ãŒä½•ã‹ã‚’減らã™ã¾ã§ã¾ã£ã¦ãã ã•ã„..."
+ kor "Disk full (%s). 다른 ì‚¬ëžŒì´ ì§€ìš¸ë•Œê¹Œì§€ 기다립니다..."
+ nor "Ikke mer diskplass (%s). Venter på å få frigjort plass..."
+ norwegian-ny "Ikkje meir diskplass (%s). Ventar på å få frigjort plass..."
+ pol "Dysk pełny (%s). Oczekiwanie na zwolnienie miejsca..."
+ por "Disco cheio (%s). Aguardando alguém liberar algum espaço..."
+ rum "Hard-disk-ul este plin (%s). Astept sa se elibereze ceva spatiu..."
+ rus "ДиÑк заполнен. (%s). Ожидаем, пока кто-то не уберет поÑле ÑÐµÐ±Ñ Ð¼ÑƒÑор..."
+ serbian "Disk je pun (%s). Čekam nekoga da dođe i oslobodi nešto mesta..."
+ slo "Disk je plný (%s), Äakám na uvoľnenie miesta..."
+ spa "Disco lleno (%s). Esperando para que se libere algo de espacio..."
+ swe "Disken är full (%s). Väntar tills det finns ledigt utrymme..."
+ ukr "ДиÑк заповнений (%s). Вичикую, доки звільнитьÑÑ Ñ‚Ñ€Ð¾Ñ…Ð¸ міÑцÑ..."
+ER_DUP_KEY 23000
+ cze "Nemohu zapsat, zdvojen-Bý klÃ­Ä v tabulce '%-.192s'"
+ dan "Kan ikke skrive, flere ens nøgler i tabellen '%-.192s'"
+ nla "Kan niet schrijven, dubbele zoeksleutel in tabel '%-.192s'"
+ eng "Can't write; duplicate key in table '%-.192s'"
+ jps "table '%-.192s' ã« key ãŒé‡è¤‡ã—ã¦ã„ã¦æ›¸ãã“ã‚ã¾ã›ã‚“",
+ est "Ei saa kirjutada, korduv võti tabelis '%-.192s'"
+ fre "Ecriture impossible, doublon dans une clé de la table '%-.192s'"
+ ger "Kann nicht speichern, Grund: doppelter Schlüssel in Tabelle '%-.192s'"
+ greek "Δεν είναι δυνατή η καταχώÏηση, η τιμή υπάÏχει ήδη στον πίνακα '%-.192s'"
+ hun "Irasi hiba, duplikalt kulcs a '%-.192s' tablaban."
+ ita "Scrittura impossibile: chiave duplicata nella tabella '%-.192s'"
+ jpn "table '%-.192s' ã« key ãŒé‡è¤‡ã—ã¦ã„ã¦æ›¸ãã“ã‚ã¾ã›ã‚“"
+ kor "기ë¡í•  수 ì—†ì니다., í…Œì´ë¸” '%-.192s'ì—ì„œ 중복 키"
+ nor "Kan ikke skrive, flere like nøkler i tabellen '%-.192s'"
+ norwegian-ny "Kan ikkje skrive, flere like nyklar i tabellen '%-.192s'"
+ pol "Nie można zapisać, powtórzone klucze w tabeli '%-.192s'"
+ por "Não pode gravar. Chave duplicada na tabela '%-.192s'"
+ rum "Nu pot sa scriu (can't write), cheie duplicata in tabela '%-.192s'"
+ rus "Ðевозможно произвеÑти запиÑÑŒ, дублирующийÑÑ ÐºÐ»ÑŽÑ‡ в таблице '%-.192s'"
+ serbian "Ne mogu da piÅ¡em poÅ¡to postoji duplirani kljuÄ u tabeli '%-.192s'"
+ slo "Nemôžem zapísaÅ¥, duplikát kľúÄa v tabuľke '%-.192s'"
+ spa "No puedo escribir, clave duplicada en la tabla '%-.192s'"
+ swe "Kan inte skriva, dubbel söknyckel i register '%-.192s'"
+ ukr "Ðе можу запиÑати, дублюючийÑÑ ÐºÐ»ÑŽÑ‡ в таблиці '%-.192s'"
+ER_ERROR_ON_CLOSE
+ cze "Chyba p-Bři zavírání '%-.192s' (chybový kód: %d)"
+ dan "Fejl ved lukning af '%-.192s' (Fejlkode: %d)"
+ nla "Fout bij het sluiten van '%-.192s' (Errcode: %d)"
+ eng "Error on close of '%-.192s' (errno: %d)"
+ est "Viga faili '%-.192s' sulgemisel (veakood: %d)"
+ fre "Erreur a la fermeture de '%-.192s' (Errcode: %d)"
+ ger "Fehler beim Schließen von '%-.192s' (Fehler: %d)"
+ greek "ΠαÏουσιάστηκε Ï€Ïόβλημα κλείνοντας το '%-.192s' (κωδικός λάθους: %d)"
+ hun "Hiba a(z) '%-.192s' zarasakor. (hibakod: %d)"
+ ita "Errore durante la chiusura di '%-.192s' (errno: %d)"
+ kor "'%-.192s'닫는 중 ì—러 (ì—러번호: %d)"
+ nor "Feil ved lukking av '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Feil ved lukking av '%-.192s' (Feilkode: %d)"
+ pol "Bł?d podczas zamykania '%-.192s' (Kod błędu: %d)"
+ por "Erro ao fechar '%-.192s' (erro no. %d)"
+ rum "Eroare inchizind '%-.192s' (errno: %d)"
+ rus "Ошибка при закрытии '%-.192s' (ошибка: %d)"
+ serbian "Greška pri zatvaranju '%-.192s' (errno: %d)"
+ slo "Chyba pri zatváraní '%-.192s' (chybový kód: %d)"
+ spa "Error en el cierre de '%-.192s' (Error: %d)"
+ swe "Fick fel vid stängning av '%-.192s' (Felkod: %d)"
+ ukr "Ðе можу закрити '%-.192s' (помилка: %d)"
+ER_ERROR_ON_READ
+ cze "Chyba p-BÅ™i Ätení souboru '%-.200s' (chybový kód: %d)"
+ dan "Fejl ved læsning af '%-.200s' (Fejlkode: %d)"
+ nla "Fout bij het lezen van file '%-.200s' (Errcode: %d)"
+ eng "Error reading file '%-.200s' (errno: %d)"
+ jps "'%-.200s' ファイルã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (errno: %d)",
+ est "Viga faili '%-.200s' lugemisel (veakood: %d)"
+ fre "Erreur en lecture du fichier '%-.200s' (Errcode: %d)"
+ ger "Fehler beim Lesen der Datei '%-.200s' (Fehler: %d)"
+ greek "ΠÏόβλημα κατά την ανάγνωση του αÏχείου '%-.200s' (κωδικός λάθους: %d)"
+ hun "Hiba a '%-.200s'file olvasasakor. (hibakod: %d)"
+ ita "Errore durante la lettura del file '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ファイルã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (errno: %d)"
+ kor "'%-.200s'í™”ì¼ ì½ê¸° ì—러 (ì—러번호: %d)"
+ nor "Feil ved lesing av '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Feil ved lesing av '%-.200s' (Feilkode: %d)"
+ pol "Bł?d podczas odczytu pliku '%-.200s' (Kod błędu: %d)"
+ por "Erro ao ler arquivo '%-.200s' (erro no. %d)"
+ rum "Eroare citind fisierul '%-.200s' (errno: %d)"
+ rus "Ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° '%-.200s' (ошибка: %d)"
+ serbian "GreÅ¡ka pri Äitanju file-a '%-.200s' (errno: %d)"
+ slo "Chyba pri Äítaní súboru '%-.200s' (chybový kód: %d)"
+ spa "Error leyendo el fichero '%-.200s' (Error: %d)"
+ swe "Fick fel vid läsning av '%-.200s' (Felkod %d)"
+ ukr "Ðе можу прочитати файл '%-.200s' (помилка: %d)"
+ER_ERROR_ON_RENAME
+ cze "Chyba p-Bři přejmenování '%-.210s' na '%-.210s' (chybový kód: %d)"
+ dan "Fejl ved omdøbning af '%-.210s' til '%-.210s' (Fejlkode: %d)"
+ nla "Fout bij het hernoemen van '%-.210s' naar '%-.210s' (Errcode: %d)"
+ eng "Error on rename of '%-.210s' to '%-.210s' (errno: %d)"
+ jps "'%-.210s' ã‚’ '%-.210s' ã« rename ã§ãã¾ã›ã‚“ (errno: %d)",
+ est "Viga faili '%-.210s' ümbernimetamisel '%-.210s'-ks (veakood: %d)"
+ fre "Erreur en renommant '%-.210s' en '%-.210s' (Errcode: %d)"
+ ger "Fehler beim Umbenennen von '%-.210s' in '%-.210s' (Fehler: %d)"
+ greek "ΠÏόβλημα κατά την μετονομασία του αÏχείου '%-.210s' to '%-.210s' (κωδικός λάθους: %d)"
+ hun "Hiba a '%-.210s' file atnevezesekor '%-.210s'. (hibakod: %d)"
+ ita "Errore durante la rinominazione da '%-.210s' a '%-.210s' (errno: %d)"
+ jpn "'%-.210s' ã‚’ '%-.210s' ã« rename ã§ãã¾ã›ã‚“ (errno: %d)"
+ kor "'%-.210s'를 '%-.210s'ë¡œ ì´ë¦„ 변경중 ì—러 (ì—러번호: %d)"
+ nor "Feil ved omdøping av '%-.210s' til '%-.210s' (Feilkode: %d)"
+ norwegian-ny "Feil ved omdøyping av '%-.210s' til '%-.210s' (Feilkode: %d)"
+ pol "Bł?d podczas zmieniania nazwy '%-.210s' na '%-.210s' (Kod błędu: %d)"
+ por "Erro ao renomear '%-.210s' para '%-.210s' (erro no. %d)"
+ rum "Eroare incercind sa renumesc '%-.210s' in '%-.210s' (errno: %d)"
+ rus "Ошибка при переименовании '%-.210s' в '%-.210s' (ошибка: %d)"
+ serbian "Greška pri promeni imena '%-.210s' na '%-.210s' (errno: %d)"
+ slo "Chyba pri premenovávaní '%-.210s' na '%-.210s' (chybový kód: %d)"
+ spa "Error en el renombrado de '%-.210s' a '%-.210s' (Error: %d)"
+ swe "Kan inte byta namn från '%-.210s' till '%-.210s' (Felkod: %d)"
+ ukr "Ðе можу перейменувати '%-.210s' у '%-.210s' (помилка: %d)"
+ER_ERROR_ON_WRITE
+ cze "Chyba p-Bři zápisu do souboru '%-.200s' (chybový kód: %d)"
+ dan "Fejl ved skriving av filen '%-.200s' (Fejlkode: %d)"
+ nla "Fout bij het wegschrijven van file '%-.200s' (Errcode: %d)"
+ eng "Error writing file '%-.200s' (errno: %d)"
+ jps "'%-.200s' ファイルを書ã事ãŒã§ãã¾ã›ã‚“ (errno: %d)",
+ est "Viga faili '%-.200s' kirjutamisel (veakood: %d)"
+ fre "Erreur d'écriture du fichier '%-.200s' (Errcode: %d)"
+ ger "Fehler beim Speichern der Datei '%-.200s' (Fehler: %d)"
+ greek "ΠÏόβλημα κατά την αποθήκευση του αÏχείου '%-.200s' (κωδικός λάθους: %d)"
+ hun "Hiba a '%-.200s' file irasakor. (hibakod: %d)"
+ ita "Errore durante la scrittura del file '%-.200s' (errno: %d)"
+ jpn "'%-.200s' ファイルを書ã事ãŒã§ãã¾ã›ã‚“ (errno: %d)"
+ kor "'%-.200s'í™”ì¼ ê¸°ë¡ ì¤‘ ì—러 (ì—러번호: %d)"
+ nor "Feil ved skriving av fila '%-.200s' (Feilkode: %d)"
+ norwegian-ny "Feil ved skriving av fila '%-.200s' (Feilkode: %d)"
+ pol "Bł?d podczas zapisywania pliku '%-.200s' (Kod błędu: %d)"
+ por "Erro ao gravar arquivo '%-.200s' (erro no. %d)"
+ rum "Eroare scriind fisierul '%-.200s' (errno: %d)"
+ rus "Ошибка запиÑи в файл '%-.200s' (ошибка: %d)"
+ serbian "Greška pri upisu '%-.200s' (errno: %d)"
+ slo "Chyba pri zápise do súboru '%-.200s' (chybový kód: %d)"
+ spa "Error escribiendo el archivo '%-.200s' (Error: %d)"
+ swe "Fick fel vid skrivning till '%-.200s' (Felkod %d)"
+ ukr "Ðе можу запиÑати файл '%-.200s' (помилка: %d)"
+ER_FILE_USED
+ cze "'%-.192s' je zam-BÄen proti zmÄ›nám"
+ dan "'%-.192s' er låst mod opdateringer"
+ nla "'%-.192s' is geblokeerd tegen veranderingen"
+ eng "'%-.192s' is locked against change"
+ jps "'%-.192s' ã¯ãƒ­ãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™",
+ est "'%-.192s' on lukustatud muudatuste vastu"
+ fre "'%-.192s' est verrouillé contre les modifications"
+ ger "'%-.192s' ist für Änderungen gesperrt"
+ greek "'%-.192s' δεν επιτÏέπονται αλλαγές"
+ hun "'%-.192s' a valtoztatas ellen zarolva"
+ ita "'%-.192s' e` soggetto a lock contro i cambiamenti"
+ jpn "'%-.192s' ã¯ãƒ­ãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™"
+ kor "'%-.192s'ê°€ 변경할 수 ì—†ë„ë¡ ìž ê²¨ìžˆì니다."
+ nor "'%-.192s' er låst mot oppdateringer"
+ norwegian-ny "'%-.192s' er låst mot oppdateringar"
+ pol "'%-.192s' jest zablokowany na wypadek zmian"
+ por "'%-.192s' está com travamento contra alterações"
+ rum "'%-.192s' este blocat pentry schimbari (loccked against change)"
+ rus "'%-.192s' заблокирован Ð´Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹"
+ serbian "'%-.192s' je zakljuÄan za upis"
+ slo "'%-.192s' je zamknutý proti zmenám"
+ spa "'%-.192s' esta bloqueado contra cambios"
+ swe "'%-.192s' är låst mot användning"
+ ukr "'%-.192s' заблокований на внеÑÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ð½"
+ER_FILSORT_ABORT
+ cze "T-Břídění přerušeno"
+ dan "Sortering afbrudt"
+ nla "Sorteren afgebroken"
+ eng "Sort aborted"
+ jps "Sort 中断",
+ est "Sorteerimine katkestatud"
+ fre "Tri alphabétique abandonné"
+ ger "Sortiervorgang abgebrochen"
+ greek "Η διαδικασία ταξινόμισης ακυÏώθηκε"
+ hun "Sikertelen rendezes"
+ ita "Operazione di ordinamento abbandonata"
+ jpn "Sort 中断"
+ kor "소트가 중단ë˜ì—ˆìŠµë‹ˆë‹¤."
+ nor "Sortering avbrutt"
+ norwegian-ny "Sortering avbrote"
+ pol "Sortowanie przerwane"
+ por "Ordenação abortada"
+ rum "Sortare intrerupta"
+ rus "Сортировка прервана"
+ serbian "Sortiranje je prekinuto"
+ slo "Triedenie prerušené"
+ spa "Ordeancion cancelada"
+ swe "Sorteringen avbruten"
+ ukr "Ð¡Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÐµÑ€Ð²Ð°Ð½Ð¾"
+ER_FORM_NOT_FOUND
+ cze "Pohled '%-.192s' pro '%-.192s' neexistuje"
+ dan "View '%-.192s' eksisterer ikke for '%-.192s'"
+ nla "View '%-.192s' bestaat niet voor '%-.192s'"
+ eng "View '%-.192s' doesn't exist for '%-.192s'"
+ jps "View '%-.192s' ㌠'%-.192s' ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "Vaade '%-.192s' ei eksisteeri '%-.192s' jaoks"
+ fre "La vue (View) '%-.192s' n'existe pas pour '%-.192s'"
+ ger "View '%-.192s' existiert für '%-.192s' nicht"
+ greek "Το View '%-.192s' δεν υπάÏχει για '%-.192s'"
+ hun "A(z) '%-.192s' nezet nem letezik a(z) '%-.192s'-hoz"
+ ita "La view '%-.192s' non esiste per '%-.192s'"
+ jpn "View '%-.192s' ㌠'%-.192s' ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "ë·° '%-.192s'ê°€ '%-.192s'ì—서는 존재하지 ì•Šì니다."
+ nor "View '%-.192s' eksisterer ikke for '%-.192s'"
+ norwegian-ny "View '%-.192s' eksisterar ikkje for '%-.192s'"
+ pol "Widok '%-.192s' nie istnieje dla '%-.192s'"
+ por "Visão '%-.192s' não existe para '%-.192s'"
+ rum "View '%-.192s' nu exista pentru '%-.192s'"
+ rus "ПредÑтавление '%-.192s' не ÑущеÑтвует Ð´Ð»Ñ '%-.192s'"
+ serbian "View '%-.192s' ne postoji za '%-.192s'"
+ slo "Pohľad '%-.192s' neexistuje pre '%-.192s'"
+ spa "La vista '%-.192s' no existe para '%-.192s'"
+ swe "Formulär '%-.192s' finns inte i '%-.192s'"
+ ukr "ВиглÑд '%-.192s' не Ñ–Ñнує Ð´Ð»Ñ '%-.192s'"
+ER_GET_ERRNO
+ cze "Obsluha tabulky vr-Bátila chybu %d"
+ dan "Modtog fejl %d fra tabel håndteringen"
+ nla "Fout %d van tabel handler"
+ eng "Got error %d from storage engine"
+ est "Tabeli handler tagastas vea %d"
+ fre "Reçu l'erreur %d du handler de la table"
+ ger "Fehler %d (Speicher-Engine)"
+ greek "Ελήφθη μήνυμα λάθους %d από τον χειÏιστή πίνακα (table handler)"
+ hun "%d hibajelzes a tablakezelotol"
+ ita "Rilevato l'errore %d dal gestore delle tabelle"
+ jpn "Got error %d from table handler"
+ kor "í…Œì´ë¸” handlerì—ì„œ %d ì—러가 ë°œìƒ í•˜ì˜€ìŠµë‹ˆë‹¤."
+ nor "Mottok feil %d fra tabell håndterer"
+ norwegian-ny "Mottok feil %d fra tabell handterar"
+ pol "Otrzymano bł?d %d z obsługi tabeli"
+ por "Obteve erro %d no manipulador de tabelas"
+ rum "Eroarea %d obtinuta din handlerul tabelei"
+ rus "Получена ошибка %d от обработчика таблиц"
+ serbian "Handler tabela je vratio grešku %d"
+ slo "Obsluha tabuľky vrátila chybu %d"
+ spa "Error %d desde el manejador de la tabla"
+ swe "Fick felkod %d från databashanteraren"
+ ukr "Отримано помилку %d від деÑкриптора таблиці"
+ER_ILLEGAL_HA
+ cze "Obsluha tabulky '%-.192s' nem-Bá tento parametr"
+ dan "Denne mulighed eksisterer ikke for tabeltypen '%-.192s'"
+ nla "Tabel handler voor '%-.192s' heeft deze optie niet"
+ eng "Table storage engine for '%-.192s' doesn't have this option"
+ est "Tabeli '%-.192s' handler ei toeta antud operatsiooni"
+ fre "Le handler de la table '%-.192s' n'a pas cette option"
+ ger "Diese Option gibt es nicht (Speicher-Engine für '%-.192s')"
+ greek "Ο χειÏιστής πίνακα (table handler) για '%-.192s' δεν διαθέτει αυτή την επιλογή"
+ hun "A(z) '%-.192s' tablakezelonek nincs ilyen opcioja"
+ ita "Il gestore delle tabelle per '%-.192s' non ha questa opzione"
+ jpn "Table handler for '%-.192s' doesn't have this option"
+ kor "'%-.192s'ì˜ í…Œì´ë¸” handler는 ì´ëŸ¬í•œ ì˜µì…˜ì„ ì œê³µí•˜ì§€ ì•Šì니다."
+ nor "Tabell håndtereren for '%-.192s' har ikke denne muligheten"
+ norwegian-ny "Tabell håndteraren for '%-.192s' har ikkje denne moglegheita"
+ pol "Obsługa tabeli '%-.192s' nie posiada tej opcji"
+ por "Manipulador de tabela para '%-.192s' não tem esta opção"
+ rum "Handlerul tabelei pentru '%-.192s' nu are aceasta optiune"
+ rus "Обработчик таблицы '%-.192s' не поддерживает Ñту возможноÑÑ‚ÑŒ"
+ serbian "Handler tabela za '%-.192s' nema ovu opciju"
+ slo "Obsluha tabuľky '%-.192s' nemá tento parameter"
+ spa "El manejador de la tabla de '%-.192s' no tiene esta opcion"
+ swe "Tabellhanteraren for tabell '%-.192s' stödjer ej detta"
+ ukr "ДеÑкриптор таблиці '%-.192s' не має цієї влаÑтивоÑÑ‚Ñ–"
+ER_KEY_NOT_FOUND
+ cze "Nemohu naj-Bít záznam v '%-.192s'"
+ dan "Kan ikke finde posten i '%-.192s'"
+ nla "Kan record niet vinden in '%-.192s'"
+ eng "Can't find record in '%-.192s'"
+ jps "'%-.192s'ã®ãªã‹ã«ãƒ¬ã‚³ãƒ¼ãƒ‰ãŒè¦‹ä»˜ã‹ã‚Šã¾ã›ã‚“",
+ est "Ei suuda leida kirjet '%-.192s'-s"
+ fre "Ne peut trouver l'enregistrement dans '%-.192s'"
+ ger "Kann Datensatz in '%-.192s' nicht finden"
+ greek "ΑδÏνατη η ανεÏÏεση εγγÏαφής στο '%-.192s'"
+ hun "Nem talalhato a rekord '%-.192s'-ben"
+ ita "Impossibile trovare il record in '%-.192s'"
+ jpn "'%-.192s'ã®ãªã‹ã«ãƒ¬ã‚³ãƒ¼ãƒ‰ãŒè¦‹ä»˜ã‹ã‚Šã¾ã›ã‚“"
+ kor "'%-.192s'ì—ì„œ 레코드를 ì°¾ì„ ìˆ˜ ì—†ì니다."
+ nor "Kan ikke finne posten i '%-.192s'"
+ norwegian-ny "Kan ikkje finne posten i '%-.192s'"
+ pol "Nie można znaleĽć rekordu w '%-.192s'"
+ por "Não pode encontrar registro em '%-.192s'"
+ rum "Nu pot sa gasesc recordul in '%-.192s'"
+ rus "Ðевозможно найти запиÑÑŒ в '%-.192s'"
+ serbian "Ne mogu da pronađem slog u '%-.192s'"
+ slo "Nemôžem nájsť záznam v '%-.192s'"
+ spa "No puedo encontrar el registro en '%-.192s'"
+ swe "Hittar inte posten '%-.192s'"
+ ukr "Ðе можу запиÑати у '%-.192s'"
+ER_NOT_FORM_FILE
+ cze "Nespr-Bávná informace v souboru '%-.200s'"
+ dan "Forkert indhold i: '%-.200s'"
+ nla "Verkeerde info in file: '%-.200s'"
+ eng "Incorrect information in file: '%-.200s'"
+ jps "ファイル '%-.200s' ã® info ãŒé–“é•ã£ã¦ã„るよã†ã§ã™",
+ est "Vigane informatsioon failis '%-.200s'"
+ fre "Information erronnée dans le fichier: '%-.200s'"
+ ger "Falsche Information in Datei '%-.200s'"
+ greek "Λάθος πληÏοφοÏίες στο αÏχείο: '%-.200s'"
+ hun "Ervenytelen info a file-ban: '%-.200s'"
+ ita "Informazione errata nel file: '%-.200s'"
+ jpn "ファイル '%-.200s' ã® info ãŒé–“é•ã£ã¦ã„るよã†ã§ã™"
+ kor "í™”ì¼ì˜ 부정확한 ì •ë³´: '%-.200s'"
+ nor "Feil informasjon i filen: '%-.200s'"
+ norwegian-ny "Feil informasjon i fila: '%-.200s'"
+ pol "Niewła?ciwa informacja w pliku: '%-.200s'"
+ por "Informação incorreta no arquivo '%-.200s'"
+ rum "Informatie incorecta in fisierul: '%-.200s'"
+ rus "ÐÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð² файле '%-.200s'"
+ serbian "Pogrešna informacija u file-u: '%-.200s'"
+ slo "Nesprávna informácia v súbore: '%-.200s'"
+ spa "Informacion erronea en el archivo: '%-.200s'"
+ swe "Felaktig fil: '%-.200s'"
+ ukr "Хибна Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ñƒ файлі: '%-.200s'"
+ER_NOT_KEYFILE
+ cze "Nespr-Bávný klÃ­Ä pro tabulku '%-.200s'; pokuste se ho opravit"
+ dan "Fejl i indeksfilen til tabellen '%-.200s'; prøv at reparere den"
+ nla "Verkeerde zoeksleutel file voor tabel: '%-.200s'; probeer het te repareren"
+ eng "Incorrect key file for table '%-.200s'; try to repair it"
+ jps "'%-.200s' テーブル㮠key file ãŒé–“é•ã£ã¦ã„るよã†ã§ã™. 修復をã—ã¦ãã ã•ã„",
+ est "Tabeli '%-.200s' võtmefail on vigane; proovi seda parandada"
+ fre "Index corrompu dans la table: '%-.200s'; essayez de le réparer"
+ ger "Fehlerhafte Index-Datei für Tabelle '%-.200s'; versuche zu reparieren"
+ greek "Λάθος αÏχείο ταξινόμισης (key file) για τον πίνακα: '%-.200s'; ΠαÏακαλώ, διοÏθώστε το!"
+ hun "Ervenytelen kulcsfile a tablahoz: '%-.200s'; probalja kijavitani!"
+ ita "File chiave errato per la tabella : '%-.200s'; prova a riparalo"
+ jpn "'%-.200s' テーブル㮠key file ãŒé–“é•ã£ã¦ã„るよã†ã§ã™. 修復をã—ã¦ãã ã•ã„"
+ kor "'%-.200s' í…Œì´ë¸”ì˜ ë¶€ì •í™•í•œ 키 존재. 수정하시오!"
+ nor "Tabellen '%-.200s' har feil i nøkkelfilen; forsøk å reparer den"
+ norwegian-ny "Tabellen '%-.200s' har feil i nykkelfila; prøv å reparere den"
+ pol "Niewła?ciwy plik kluczy dla tabeli: '%-.200s'; spróbuj go naprawić"
+ por "Arquivo de índice incorreto para tabela '%-.200s'; tente repará-lo"
+ rum "Cheia fisierului incorecta pentru tabela: '%-.200s'; incearca s-o repari"
+ rus "Ðекорректный индекÑный файл Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹: '%-.200s'. Попробуйте воÑÑтановить его"
+ serbian "Pogrešan key file za tabelu: '%-.200s'; probajte da ga ispravite"
+ slo "Nesprávny kÄ¾ÃºÄ pre tabuľku '%-.200s'; pokúste sa ho opraviÅ¥"
+ spa "Clave de archivo erronea para la tabla: '%-.200s'; intente repararlo"
+ swe "Fatalt fel vid hantering av register '%-.200s'; kör en reparation"
+ ukr "Хибний файл ключей Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ–: '%-.200s'; Спробуйте його відновити"
+ER_OLD_KEYFILE
+ cze "Star-Bý klíÄový soubor pro '%-.192s'; opravte ho."
+ dan "Gammel indeksfil for tabellen '%-.192s'; reparer den"
+ nla "Oude zoeksleutel file voor tabel '%-.192s'; repareer het!"
+ eng "Old key file for table '%-.192s'; repair it!"
+ jps "'%-.192s' テーブルã¯å¤ã„å½¢å¼ã® key file ã®ã‚ˆã†ã§ã™; 修復をã—ã¦ãã ã•ã„",
+ est "Tabeli '%-.192s' võtmefail on aegunud; paranda see!"
+ fre "Vieux fichier d'index pour la table '%-.192s'; réparez le!"
+ ger "Alte Index-Datei für Tabelle '%-.192s'. Bitte reparieren"
+ greek "Παλαιό αÏχείο ταξινόμισης (key file) για τον πίνακα '%-.192s'; ΠαÏακαλώ, διοÏθώστε το!"
+ hun "Regi kulcsfile a '%-.192s'tablahoz; probalja kijavitani!"
+ ita "File chiave vecchio per la tabella '%-.192s'; riparalo!"
+ jpn "'%-.192s' テーブルã¯å¤ã„å½¢å¼ã® key file ã®ã‚ˆã†ã§ã™; 修復をã—ã¦ãã ã•ã„"
+ kor "'%-.192s' í…Œì´ë¸”ì˜ ì´ì „ë²„ì ¼ì˜ í‚¤ 존재. 수정하시오!"
+ nor "Gammel nøkkelfil for tabellen '%-.192s'; reparer den!"
+ norwegian-ny "Gammel nykkelfil for tabellen '%-.192s'; reparer den!"
+ pol "Plik kluczy dla tabeli '%-.192s' jest starego typu; napraw go!"
+ por "Arquivo de índice desatualizado para tabela '%-.192s'; repare-o!"
+ rum "Cheia fisierului e veche pentru tabela '%-.192s'; repar-o!"
+ rus "Старый индекÑный файл Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹ '%-.192s'; отремонтируйте его!"
+ serbian "Zastareo key file za tabelu '%-.192s'; ispravite ga"
+ slo "Starý kľúÄový súbor pre '%-.192s'; opravte ho!"
+ spa "Clave de archivo antigua para la tabla '%-.192s'; reparelo!"
+ swe "Gammal nyckelfil '%-.192s'; reparera registret"
+ ukr "Старий файл ключей Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– '%-.192s'; Відновіть його!"
+ER_OPEN_AS_READONLY
+ cze "'%-.192s' je jen pro -BÄtení"
+ dan "'%-.192s' er skrivebeskyttet"
+ nla "'%-.192s' is alleen leesbaar"
+ eng "Table '%-.192s' is read only"
+ jps "'%-.192s' ã¯èª­ã¿è¾¼ã¿å°‚用ã§ã™",
+ est "Tabel '%-.192s' on ainult lugemiseks"
+ fre "'%-.192s' est en lecture seulement"
+ ger "Tabelle '%-.192s' ist nur lesbar"
+ greek "'%-.192s' επιτÏέπεται μόνο η ανάγνωση"
+ hun "'%-.192s' irasvedett"
+ ita "'%-.192s' e` di sola lettura"
+ jpn "'%-.192s' ã¯èª­ã¿è¾¼ã¿å°‚用ã§ã™"
+ kor "í…Œì´ë¸” '%-.192s'는 ì½ê¸°ì „ìš© 입니다."
+ nor "'%-.192s' er skrivebeskyttet"
+ norwegian-ny "'%-.192s' er skrivetryggja"
+ pol "'%-.192s' jest tylko do odczytu"
+ por "Tabela '%-.192s' é somente para leitura"
+ rum "Tabela '%-.192s' e read-only"
+ rus "Таблица '%-.192s' предназначена только Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ"
+ serbian "Tabelu '%-.192s' je dozvoljeno samo Äitati"
+ slo "'%-.192s' is ÄítaÅ¥ only"
+ spa "'%-.192s' es de solo lectura"
+ swe "'%-.192s' är skyddad mot förändring"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ"
+ER_OUTOFMEMORY HY001 S1001
+ cze "M-Bálo paměti. Přestartujte daemona a zkuste znovu (je potřeba %d bytů)"
+ dan "Ikke mere hukommelse. Genstart serveren og prøv igen (mangler %d bytes)"
+ nla "Geen geheugen meer. Herstart server en probeer opnieuw (%d bytes nodig)"
+ eng "Out of memory; restart server and try again (needed %d bytes)"
+ jps "Out of memory. デーモンをリスタートã—ã¦ã¿ã¦ãã ã•ã„ (%d bytes å¿…è¦)",
+ est "Mälu sai otsa. Proovi MySQL uuesti käivitada (puudu jäi %d baiti)"
+ fre "Manque de mémoire. Redémarrez le démon et ré-essayez (%d octets nécessaires)"
+ ger "Kein Speicher vorhanden (%d Bytes benötigt). Bitte Server neu starten"
+ greek "Δεν υπάÏχει διαθέσιμη μνήμη. ΠÏοσπαθήστε πάλι, επανεκινώντας τη διαδικασία (demon) (χÏειάζονται %d bytes)"
+ hun "Nincs eleg memoria. Inditsa ujra a demont, es probalja ismet. (%d byte szukseges.)"
+ ita "Memoria esaurita. Fai ripartire il demone e riprova (richiesti %d bytes)"
+ jpn "Out of memory. デーモンをリスタートã—ã¦ã¿ã¦ãã ã•ã„ (%d bytes å¿…è¦)"
+ kor "Out of memory. ë°ëª¬ì„ 재 실행 후 다시 시작하시오 (needed %d bytes)"
+ nor "Ikke mer minne. Star på nytt tjenesten og prøv igjen (trengte %d byter)"
+ norwegian-ny "Ikkje meir minne. Start på nytt tenesten og prøv igjen (trengte %d bytar)"
+ pol "Zbyt mało pamięci. Uruchom ponownie demona i spróbuj ponownie (potrzeba %d bajtów)"
+ por "Sem memória. Reinicie o programa e tente novamente (necessita de %d bytes)"
+ rum "Out of memory. Porneste daemon-ul din nou si incearca inca o data (e nevoie de %d bytes)"
+ rus "ÐедоÑтаточно памÑти. ПерезапуÑтите Ñервер и попробуйте еще раз (нужно %d байт)"
+ serbian "Nema memorije. Restartujte MySQL server i probajte ponovo (potrebno je %d byte-ova)"
+ slo "Málo pamäti. Reštartujte daemona a skúste znova (je potrebných %d bytov)"
+ spa "Memoria insuficiente. Reinicie el demonio e intentelo otra vez (necesita %d bytes)"
+ swe "Oväntat slut på minnet, starta om programmet och försök på nytt (Behövde %d bytes)"
+ ukr "Брак пам'ÑÑ‚Ñ–. РеÑтартуйте Ñервер та Ñпробуйте знову (потрібно %d байтів)"
+ER_OUT_OF_SORTMEMORY HY001 S1001
+ cze "M-Bálo paměti pro třídění. Zvyšte velikost třídícího bufferu"
+ dan "Ikke mere sorteringshukommelse. Øg sorteringshukommelse (sort buffer size) for serveren"
+ nla "Geen geheugen om te sorteren. Verhoog de server sort buffer size"
+ eng "Out of sort memory; increase server sort buffer size"
+ jps "Out of sort memory. sort buffer size ãŒè¶³ã‚Šãªã„よã†ã§ã™.",
+ est "Mälu sai sorteerimisel otsa. Suurenda MySQL-i sorteerimispuhvrit"
+ fre "Manque de mémoire pour le tri. Augmentez-la."
+ ger "Kein Speicher zum Sortieren vorhanden. sort_buffer_size sollte im Server erhöht werden"
+ greek "Δεν υπάÏχει διαθέσιμη μνήμη για ταξινόμιση. Αυξήστε το sort buffer size για τη διαδικασία (demon)"
+ hun "Nincs eleg memoria a rendezeshez. Novelje a rendezo demon puffermeretet"
+ ita "Memoria per gli ordinamenti esaurita. Incrementare il 'sort_buffer' al demone"
+ jpn "Out of sort memory. sort buffer size ãŒè¶³ã‚Šãªã„よã†ã§ã™."
+ kor "Out of sort memory. daemon sort bufferì˜ í¬ê¸°ë¥¼ ì¦ê°€ì‹œí‚¤ì„¸ìš”"
+ nor "Ikke mer sorteringsminne. Øk sorteringsminnet (sort buffer size) for tjenesten"
+ norwegian-ny "Ikkje meir sorteringsminne. Auk sorteringsminnet (sorteringsbffer storleik) for tenesten"
+ pol "Zbyt mało pamięci dla sortowania. Zwiększ wielko?ć bufora demona dla sortowania"
+ por "Sem memória para ordenação. Aumente tamanho do 'buffer' de ordenação"
+ rum "Out of memory pentru sortare. Largeste marimea buffer-ului pentru sortare in daemon (sort buffer size)"
+ rus "ÐедоÑтаточно памÑти Ð´Ð»Ñ Ñортировки. Увеличьте размер буфера Ñортировки на Ñервере"
+ serbian "Nema memorije za sortiranje. Povećajte veliÄinu sort buffer-a MySQL server-u"
+ slo "Málo pamäti pre triedenie, zvýšte veľkosť triediaceho bufferu"
+ spa "Memoria de ordenacion insuficiente. Incremente el tamano del buffer de ordenacion"
+ swe "Sorteringsbufferten räcker inte till. Kontrollera startparametrarna"
+ ukr "Брак пам'ÑÑ‚Ñ– Ð´Ð»Ñ ÑортуваннÑ. Треба збільшити розмір буфера ÑÐ¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñƒ Ñервера"
+ER_UNEXPECTED_EOF
+ cze "Neo-BÄekávaný konec souboru pÅ™i Ätení '%-.192s' (chybový kód: %d)"
+ dan "Uventet afslutning på fil (eof) ved læsning af filen '%-.192s' (Fejlkode: %d)"
+ nla "Onverwachte eof gevonden tijdens het lezen van file '%-.192s' (Errcode: %d)"
+ eng "Unexpected EOF found when reading file '%-.192s' (errno: %d)"
+ jps "'%-.192s' ファイルを読ã¿è¾¼ã¿ä¸­ã« EOF ãŒäºˆæœŸã›ã¬æ‰€ã§ç¾ã‚Œã¾ã—ãŸ. (errno: %d)",
+ est "Ootamatu faililõpumärgend faili '%-.192s' lugemisel (veakood: %d)"
+ fre "Fin de fichier inattendue en lisant '%-.192s' (Errcode: %d)"
+ ger "Unerwartetes Ende beim Lesen der Datei '%-.192s' (Fehler: %d)"
+ greek "Κατά τη διάÏκεια της ανάγνωσης, βÏέθηκε απÏοσδόκητα το τέλος του αÏχείου '%-.192s' (κωδικός λάθους: %d)"
+ hun "Varatlan filevege-jel a '%-.192s'olvasasakor. (hibakod: %d)"
+ ita "Fine del file inaspettata durante la lettura del file '%-.192s' (errno: %d)"
+ jpn "'%-.192s' ファイルを読ã¿è¾¼ã¿ä¸­ã« EOF ãŒäºˆæœŸã›ã¬æ‰€ã§ç¾ã‚Œã¾ã—ãŸ. (errno: %d)"
+ kor "'%-.192s' í™”ì¼ì„ ì½ëŠ” ë„중 ìž˜ëª»ëœ eofì„ ë°œê²¬ (ì—러번호: %d)"
+ nor "Uventet slutt på fil (eof) ved lesing av filen '%-.192s' (Feilkode: %d)"
+ norwegian-ny "Uventa slutt på fil (eof) ved lesing av fila '%-.192s' (Feilkode: %d)"
+ pol "Nieoczekiwany 'eof' napotkany podczas czytania z pliku '%-.192s' (Kod błędu: %d)"
+ por "Encontrado fim de arquivo inesperado ao ler arquivo '%-.192s' (erro no. %d)"
+ rum "Sfirsit de fisier neasteptat in citirea fisierului '%-.192s' (errno: %d)"
+ rus "Ðеожиданный конец файла '%-.192s' (ошибка: %d)"
+ serbian "NeoÄekivani kraj pri Äitanju file-a '%-.192s' (errno: %d)"
+ slo "NeoÄakávaný koniec súboru pri Äítaní '%-.192s' (chybový kód: %d)"
+ spa "Inesperado fin de ficheroU mientras leiamos el archivo '%-.192s' (Error: %d)"
+ swe "Oväntat filslut vid läsning från '%-.192s' (Felkod: %d)"
+ ukr "Хибний кінець файлу '%-.192s' (помилка: %d)"
+ER_CON_COUNT_ERROR 08004
+ cze "P-Bříliš mnoho spojení"
+ dan "For mange forbindelser (connections)"
+ nla "Te veel verbindingen"
+ eng "Too many connections"
+ jps "接続ãŒå¤šã™ãŽã¾ã™",
+ est "Liiga palju samaaegseid ühendusi"
+ fre "Trop de connexions"
+ ger "Zu viele Verbindungen"
+ greek "ΥπάÏχουν πολλές συνδέσεις..."
+ hun "Tul sok kapcsolat"
+ ita "Troppe connessioni"
+ jpn "接続ãŒå¤šã™ãŽã¾ã™"
+ kor "너무 ë§Žì€ ì—°ê²°... max_connectionì„ ì¦ê°€ 시키시오..."
+ nor "For mange tilkoblinger (connections)"
+ norwegian-ny "For mange tilkoplingar (connections)"
+ pol "Zbyt wiele poł?czeń"
+ por "Excesso de conexões"
+ rum "Prea multe conectiuni"
+ rus "Слишком много Ñоединений"
+ serbian "Previše konekcija"
+ slo "Príliš mnoho spojení"
+ spa "Demasiadas conexiones"
+ swe "För många anslutningar"
+ ukr "Забагато з'єднань"
+ER_OUT_OF_RESOURCES
+ cze "M-Bálo prostoru/paměti pro thread"
+ dan "Udgået for tråde/hukommelse"
+ nla "Geen thread geheugen meer; controleer of mysqld of andere processen al het beschikbare geheugen gebruikt. Zo niet, dan moet u wellicht 'ulimit' gebruiken om mysqld toe te laten meer geheugen te benutten, of u kunt extra swap ruimte toevoegen"
+ eng "Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space"
+ jps "Out of memory; mysqld ã‹ãã®ä»–ã®ãƒ—ロセスãŒãƒ¡ãƒ¢ãƒªãƒ¼ã‚’å…¨ã¦ä½¿ã£ã¦ã„ã‚‹ã‹ç¢ºèªã—ã¦ãã ã•ã„. メモリーを使ã„切ã£ã¦ã„ãªã„å ´åˆã€'ulimit' を設定ã—㦠mysqld ã®ãƒ¡ãƒ¢ãƒªãƒ¼ä½¿ç”¨é™ç•Œé‡ã‚’多ãã™ã‚‹ã‹ã€swap space を増やã—ã¦ã¿ã¦ãã ã•ã„",
+ est "Mälu sai otsa. Võimalik, et aitab swap-i lisamine või käsu 'ulimit' abil MySQL-le rohkema mälu kasutamise lubamine"
+ fre "Manque de 'threads'/mémoire"
+ ger "Kein Speicher mehr vorhanden. Prüfen Sie, ob mysqld oder ein anderer Prozess den gesamten Speicher verbraucht. Wenn nicht, sollten Sie mit 'ulimit' dafür sorgen, dass mysqld mehr Speicher benutzen darf, oder mehr Swap-Speicher einrichten"
+ greek "ΠÏόβλημα με τη διαθέσιμη μνήμη (Out of thread space/memory)"
+ hun "Elfogyott a thread-memoria"
+ ita "Fine dello spazio/memoria per i thread"
+ jpn "Out of memory; mysqld ã‹ãã®ä»–ã®ãƒ—ロセスãŒãƒ¡ãƒ¢ãƒªãƒ¼ã‚’å…¨ã¦ä½¿ã£ã¦ã„ã‚‹ã‹ç¢ºèªã—ã¦ãã ã•ã„. メモリーを使ã„切ã£ã¦ã„ãªã„å ´åˆã€'ulimit' を設定ã—㦠mysqld ã®ãƒ¡ãƒ¢ãƒªãƒ¼ä½¿ç”¨é™ç•Œé‡ã‚’多ãã™ã‚‹ã‹ã€swap space を増やã—ã¦ã¿ã¦ãã ã•ã„"
+# This message failed to convert from euc-kr, skipped
+ nor "Tomt for tråd plass/minne"
+ norwegian-ny "Tomt for tråd plass/minne"
+ pol "Zbyt mało miejsca/pamięci dla w?tku"
+ por "Sem memória. Verifique se o mysqld ou algum outro processo está usando toda memória disponível. Se não, você pode ter que usar 'ulimit' para permitir ao mysqld usar mais memória ou você pode adicionar mais área de 'swap'"
+ rum "Out of memory; Verifica daca mysqld sau vreun alt proces foloseste toate memoria disponbila. Altfel, trebuie sa folosesi 'ulimit' ca sa permiti lui memoria disponbila. Altfel, trebuie sa folosesi 'ulimit' ca sa permiti lui mysqld sa foloseasca mai multa memorie ori adauga mai mult spatiu pentru swap (swap space)"
+ rus "ÐедоÑтаточно памÑти; удоÑтоверьтеÑÑŒ, что mysqld или какой-либо другой процеÑÑ Ð½Ðµ занимает вÑÑŽ доÑтупную памÑÑ‚ÑŒ. ЕÑли нет, то вы можете иÑпользовать ulimit, чтобы выделить Ð´Ð»Ñ mysqld больше памÑти, или увеличить объем файла подкачки"
+ serbian "Nema memorije; Proverite da li MySQL server ili neki drugi proces koristi svu slobodnu memoriju. (UNIX: Ako ne, probajte da upotrebite 'ulimit' komandu da biste dozvolili daemon-u da koristi više memorije ili probajte da dodate više swap memorije)"
+ slo "Málo miesta-pamäti pre vlákno"
+ spa "Memoria/espacio de tranpaso insuficiente"
+ swe "Fick slut på minnet. Kontrollera om mysqld eller någon annan process använder allt tillgängligt minne. Om inte, försök använda 'ulimit' eller allokera mera swap"
+ ukr "Брак пам'ÑÑ‚Ñ–; Перевірте чи mysqld або ÑкіÑÑŒ інші процеÑи викориÑтовують уÑÑŽ доÑтупну пам'ÑÑ‚ÑŒ. Як ні, то ви можете ÑкориÑтатиÑÑ 'ulimit', аби дозволити mysqld викориÑтовувати більше пам'ÑÑ‚Ñ– або ви можете додати більше міÑÑ†Ñ Ð¿Ñ–Ð´ Ñвап"
+ER_BAD_HOST_ERROR 08S01
+ cze "Nemohu zjistit jm-Béno stroje pro Vaši adresu"
+ dan "Kan ikke få værtsnavn for din adresse"
+ nla "Kan de hostname niet krijgen van uw adres"
+ eng "Can't get hostname for your address"
+ jps "ãã® address ã® hostname ãŒå¼•ã‘ã¾ã›ã‚“.",
+ est "Ei suuda lahendada IP aadressi masina nimeks"
+ fre "Ne peut obtenir de hostname pour votre adresse"
+ ger "Kann Hostnamen für diese Adresse nicht erhalten"
+ greek "Δεν έγινε γνωστό το hostname για την address σας"
+ hun "A gepnev nem allapithato meg a cimbol"
+ ita "Impossibile risalire al nome dell'host dall'indirizzo (risoluzione inversa)"
+ jpn "ãã® address ã® hostname ãŒå¼•ã‘ã¾ã›ã‚“."
+ kor "ë‹¹ì‹ ì˜ ì»´í“¨í„°ì˜ í˜¸ìŠ¤íŠ¸ì´ë¦„ì„ ì–»ì„ ìˆ˜ ì—†ì니다."
+ nor "Kan ikke få tak i vertsnavn for din adresse"
+ norwegian-ny "Kan ikkje få tak i vertsnavn for di adresse"
+ pol "Nie można otrzymać nazwy hosta dla twojego adresu"
+ por "Não pode obter nome do 'host' para seu endereço"
+ rum "Nu pot sa obtin hostname-ul adresei tale"
+ rus "Ðевозможно получить Ð¸Ð¼Ñ Ñ…Ð¾Ñта Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ³Ð¾ адреÑа"
+ serbian "Ne mogu da dobijem ime host-a za vašu IP adresu"
+ slo "Nemôžem zistiť meno hostiteľa pre vašu adresu"
+ spa "No puedo obtener el nombre de maquina de tu direccion"
+ swe "Kan inte hitta 'hostname' för din adress"
+ ukr "Ðе можу визначити ім'Ñ Ñ…Ð¾Ñту Ð´Ð»Ñ Ð²Ð°ÑˆÐ¾Ñ— адреÑи"
+ER_HANDSHAKE_ERROR 08S01
+ cze "Chyba p-Bři ustavování spojení"
+ dan "Forkert håndtryk (handshake)"
+ nla "Verkeerde handshake"
+ eng "Bad handshake"
+ est "Väär handshake"
+ fre "Mauvais 'handshake'"
+ ger "Ungültiger Handshake"
+ greek "Η αναγνώÏιση (handshake) δεν έγινε σωστά"
+ hun "A kapcsolatfelvetel nem sikerult (Bad handshake)"
+ ita "Negoziazione impossibile"
+ nor "Feil håndtrykk (handshake)"
+ norwegian-ny "Feil handtrykk (handshake)"
+ pol "ZÅ‚y uchwyt(handshake)"
+ por "Negociação de acesso falhou"
+ rum "Prost inceput de conectie (bad handshake)"
+ rus "Ðекорректное приветÑтвие"
+ serbian "LoÅ¡ poÄetak komunikacije (handshake)"
+ slo "Chyba pri nadväzovaní spojenia"
+ spa "Protocolo erroneo"
+ swe "Fel vid initiering av kommunikationen med klienten"
+ ukr "Ðевірна уÑтановка зв'Ñзку"
+ER_DBACCESS_DENIED_ERROR 42000
+ cze "P-Břístup pro uživatele '%-.48s'@'%-.64s' k databázi '%-.192s' není povolen"
+ dan "Adgang nægtet bruger: '%-.48s'@'%-.64s' til databasen '%-.192s'"
+ nla "Toegang geweigerd voor gebruiker: '%-.48s'@'%-.64s' naar database '%-.192s'"
+ eng "Access denied for user '%-.48s'@'%-.64s' to database '%-.192s'"
+ jps "ユーザー '%-.48s'@'%-.64s' ã® '%-.192s' データベースã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã‚’æ‹’å¦ã—ã¾ã™",
+ est "Ligipääs keelatud kasutajale '%-.48s'@'%-.64s' andmebaasile '%-.192s'"
+ fre "Accès refusé pour l'utilisateur: '%-.48s'@'@%-.64s'. Base '%-.192s'"
+ ger "Benutzer '%-.48s'@'%-.64s' hat keine Zugriffsberechtigung für Datenbank '%-.192s'"
+ greek "Δεν επιτέÏεται η Ï€Ïόσβαση στο χÏήστη: '%-.48s'@'%-.64s' στη βάση δεδομένων '%-.192s'"
+ hun "A(z) '%-.48s'@'%-.64s' felhasznalo szamara tiltott eleres az '%-.192s' adabazishoz."
+ ita "Accesso non consentito per l'utente: '%-.48s'@'%-.64s' al database '%-.192s'"
+ jpn "ユーザー '%-.48s'@'%-.64s' ã® '%-.192s' データベースã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã‚’æ‹’å¦ã—ã¾ã™"
+ kor "'%-.48s'@'%-.64s' 사용ìžëŠ” '%-.192s' ë°ì´íƒ€ë² ì´ìŠ¤ì— ì ‘ê·¼ì´ ê±°ë¶€ ë˜ì—ˆìŠµë‹ˆë‹¤."
+ nor "Tilgang nektet for bruker: '%-.48s'@'%-.64s' til databasen '%-.192s' nektet"
+ norwegian-ny "Tilgang ikkje tillate for brukar: '%-.48s'@'%-.64s' til databasen '%-.192s' nekta"
+ por "Acesso negado para o usuário '%-.48s'@'%-.64s' ao banco de dados '%-.192s'"
+ rum "Acces interzis pentru utilizatorul: '%-.48s'@'%-.64s' la baza de date '%-.192s'"
+ rus "Ð”Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s'@'%-.64s' доÑтуп к базе данных '%-.192s' закрыт"
+ serbian "Pristup je zabranjen korisniku '%-.48s'@'%-.64s' za bazu '%-.192s'"
+ slo "Zakázaný prístup pre užívateľa: '%-.48s'@'%-.64s' k databázi '%-.192s'"
+ spa "Acceso negado para usuario: '%-.48s'@'%-.64s' para la base de datos '%-.192s'"
+ swe "Användare '%-.48s'@'%-.64s' är ej berättigad att använda databasen %-.192s"
+ ukr "ДоÑтуп заборонено Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувача: '%-.48s'@'%-.64s' до бази данних '%-.192s'"
+ER_ACCESS_DENIED_ERROR 28000
+ cze "P-Břístup pro uživatele '%-.48s'@'%-.64s' (s heslem %s)"
+ dan "Adgang nægtet bruger: '%-.48s'@'%-.64s' (Bruger adgangskode: %s)"
+ nla "Toegang geweigerd voor gebruiker: '%-.48s'@'%-.64s' (Wachtwoord gebruikt: %s)"
+ eng "Access denied for user '%-.48s'@'%-.64s' (using password: %s)"
+ jps "ユーザー '%-.48s'@'%-.64s' ã‚’æ‹’å¦ã—ã¾ã™.uUsing password: %s)",
+ est "Ligipääs keelatud kasutajale '%-.48s'@'%-.64s' (kasutab parooli: %s)"
+ fre "Accès refusé pour l'utilisateur: '%-.48s'@'@%-.64s' (mot de passe: %s)"
+ ger "Benutzer '%-.48s'@'%-.64s' hat keine Zugriffsberechtigung (verwendetes Passwort: %s)"
+ greek "Δεν επιτέÏεται η Ï€Ïόσβαση στο χÏήστη: '%-.48s'@'%-.64s' (χÏήση password: %s)"
+ hun "A(z) '%-.48s'@'%-.64s' felhasznalo szamara tiltott eleres. (Hasznalja a jelszot: %s)"
+ ita "Accesso non consentito per l'utente: '%-.48s'@'%-.64s' (Password: %s)"
+ jpn "ユーザー '%-.48s'@'%-.64s' ã‚’æ‹’å¦ã—ã¾ã™.uUsing password: %s)"
+ kor "'%-.48s'@'%-.64s' 사용ìžëŠ” ì ‘ê·¼ì´ ê±°ë¶€ ë˜ì—ˆìŠµë‹ˆë‹¤. (using password: %s)"
+ nor "Tilgang nektet for bruker: '%-.48s'@'%-.64s' (Bruker passord: %s)"
+ norwegian-ny "Tilgang ikke tillate for brukar: '%-.48s'@'%-.64s' (Brukar passord: %s)"
+ por "Acesso negado para o usuário '%-.48s'@'%-.64s' (senha usada: %s)"
+ rum "Acces interzis pentru utilizatorul: '%-.48s'@'%-.64s' (Folosind parola: %s)"
+ rus "ДоÑтуп закрыт Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s'@'%-.64s' (был иÑпользован пароль: %s)"
+ serbian "Pristup je zabranjen korisniku '%-.48s'@'%-.64s' (koristi lozinku: '%s')"
+ slo "Zakázaný prístup pre užívateľa: '%-.48s'@'%-.64s' (použitie hesla: %s)"
+ spa "Acceso negado para usuario: '%-.48s'@'%-.64s' (Usando clave: %s)"
+ swe "Användare '%-.48s'@'%-.64s' är ej berättigad att logga in (Använder lösen: %s)"
+ ukr "ДоÑтуп заборонено Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувача: '%-.48s'@'%-.64s' (ВикориÑтано пароль: %s)"
+ER_NO_DB_ERROR 3D000
+ cze "Nebyla vybr-Bána žádná databáze"
+ dan "Ingen database valgt"
+ nla "Geen database geselecteerd"
+ eng "No database selected"
+ jps "データベースãŒé¸æŠžã•ã‚Œã¦ã„ã¾ã›ã‚“.",
+ est "Andmebaasi ei ole valitud"
+ fre "Aucune base n'a été sélectionnée"
+ ger "Keine Datenbank ausgewählt"
+ greek "Δεν επιλέχθηκε βάση δεδομένων"
+ hun "Nincs kivalasztott adatbazis"
+ ita "Nessun database selezionato"
+ jpn "データベースãŒé¸æŠžã•ã‚Œã¦ã„ã¾ã›ã‚“."
+ kor "ì„ íƒëœ ë°ì´íƒ€ë² ì´ìŠ¤ê°€ 없습니다."
+ nor "Ingen database valgt"
+ norwegian-ny "Ingen database vald"
+ pol "Nie wybrano żadnej bazy danych"
+ por "Nenhum banco de dados foi selecionado"
+ rum "Nici o baza de data nu a fost selectata inca"
+ rus "База данных не выбрана"
+ serbian "Ni jedna baza nije selektovana"
+ slo "Nebola vybraná databáza"
+ spa "Base de datos no seleccionada"
+ swe "Ingen databas i användning"
+ ukr "Базу данних не вибрано"
+ER_UNKNOWN_COM_ERROR 08S01
+ cze "Nezn-Bámý příkaz"
+ dan "Ukendt kommando"
+ nla "Onbekend commando"
+ eng "Unknown command"
+ jps "ãã®ã‚³ãƒžãƒ³ãƒ‰ã¯ä½•ï¼Ÿ",
+ est "Tundmatu käsk"
+ fre "Commande inconnue"
+ ger "Unbekannter Befehl"
+ greek "Αγνωστη εντολή"
+ hun "Ervenytelen parancs"
+ ita "Comando sconosciuto"
+ jpn "ãã®ã‚³ãƒžãƒ³ãƒ‰ã¯ä½•ï¼Ÿ"
+ kor "명령어가 뭔지 모르겠어요..."
+ nor "Ukjent kommando"
+ norwegian-ny "Ukjent kommando"
+ pol "Nieznana komenda"
+ por "Comando desconhecido"
+ rum "Comanda invalida"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° коммуникационного протокола"
+ serbian "Nepoznata komanda"
+ slo "Neznámy príkaz"
+ spa "Comando desconocido"
+ swe "Okänt commando"
+ ukr "Ðевідома команда"
+ER_BAD_NULL_ERROR 23000
+ cze "Sloupec '%-.192s' nem-Bůže být null"
+ dan "Kolonne '%-.192s' kan ikke være NULL"
+ nla "Kolom '%-.192s' kan niet null zijn"
+ eng "Column '%-.192s' cannot be null"
+ jps "Column '%-.192s' 㯠null ã«ã¯ã§ããªã„ã®ã§ã™",
+ est "Tulp '%-.192s' ei saa omada nullväärtust"
+ fre "Le champ '%-.192s' ne peut être vide (null)"
+ ger "Feld '%-.192s' darf nicht NULL sein"
+ greek "Το πεδίο '%-.192s' δεν μποÏεί να είναι κενό (null)"
+ hun "A(z) '%-.192s' oszlop erteke nem lehet nulla"
+ ita "La colonna '%-.192s' non puo` essere nulla"
+ jpn "Column '%-.192s' 㯠null ã«ã¯ã§ããªã„ã®ã§ã™"
+ kor "칼럼 '%-.192s'는 ë„(Null)ì´ ë˜ë©´ 안ë©ë‹ˆë‹¤. "
+ nor "Kolonne '%-.192s' kan ikke vere null"
+ norwegian-ny "Kolonne '%-.192s' kan ikkje vere null"
+ pol "Kolumna '%-.192s' nie może być null"
+ por "Coluna '%-.192s' não pode ser vazia"
+ rum "Coloana '%-.192s' nu poate sa fie null"
+ rus "Столбец '%-.192s' не может принимать величину NULL"
+ serbian "Kolona '%-.192s' ne može biti NULL"
+ slo "Pole '%-.192s' nemôže byť null"
+ spa "La columna '%-.192s' no puede ser nula"
+ swe "Kolumn '%-.192s' får inte vara NULL"
+ ukr "Стовбець '%-.192s' не може бути нульовим"
+ER_BAD_DB_ERROR 42000
+ cze "Nezn-Bámá databáze '%-.192s'"
+ dan "Ukendt database '%-.192s'"
+ nla "Onbekende database '%-.192s'"
+ eng "Unknown database '%-.192s'"
+ jps "'%-.192s' ãªã‚“ã¦ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã¯çŸ¥ã‚Šã¾ã›ã‚“.",
+ est "Tundmatu andmebaas '%-.192s'"
+ fre "Base '%-.192s' inconnue"
+ ger "Unbekannte Datenbank '%-.192s'"
+ greek "Αγνωστη βάση δεδομένων '%-.192s'"
+ hun "Ervenytelen adatbazis: '%-.192s'"
+ ita "Database '%-.192s' sconosciuto"
+ jpn "'%-.192s' ãªã‚“ã¦ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã¯çŸ¥ã‚Šã¾ã›ã‚“."
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ '%-.192s'는 알수 ì—†ìŒ"
+ nor "Ukjent database '%-.192s'"
+ norwegian-ny "Ukjent database '%-.192s'"
+ pol "Nieznana baza danych '%-.192s'"
+ por "Banco de dados '%-.192s' desconhecido"
+ rum "Baza de data invalida '%-.192s'"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð±Ð°Ð·Ð° данных '%-.192s'"
+ serbian "Nepoznata baza '%-.192s'"
+ slo "Neznáma databáza '%-.192s'"
+ spa "Base de datos desconocida '%-.192s'"
+ swe "Okänd databas: '%-.192s'"
+ ukr "Ðевідома база данних '%-.192s'"
+ER_TABLE_EXISTS_ERROR 42S01
+ cze "Tabulka '%-.192s' ji-Bž existuje"
+ dan "Tabellen '%-.192s' findes allerede"
+ nla "Tabel '%-.192s' bestaat al"
+ eng "Table '%-.192s' already exists"
+ jps "Table '%-.192s' ã¯æ—¢ã«ã‚ã‚Šã¾ã™",
+ est "Tabel '%-.192s' juba eksisteerib"
+ fre "La table '%-.192s' existe déjà"
+ ger "Tabelle '%-.192s' bereits vorhanden"
+ greek "Ο πίνακας '%-.192s' υπάÏχει ήδη"
+ hun "A(z) '%-.192s' tabla mar letezik"
+ ita "La tabella '%-.192s' esiste gia`"
+ jpn "Table '%-.192s' ã¯æ—¢ã«ã‚ã‚Šã¾ã™"
+ kor "í…Œì´ë¸” '%-.192s'는 ì´ë¯¸ 존재함"
+ nor "Tabellen '%-.192s' eksisterer allerede"
+ norwegian-ny "Tabellen '%-.192s' eksisterar allereide"
+ pol "Tabela '%-.192s' już istnieje"
+ por "Tabela '%-.192s' já existe"
+ rum "Tabela '%-.192s' exista deja"
+ rus "Таблица '%-.192s' уже ÑущеÑтвует"
+ serbian "Tabela '%-.192s' već postoji"
+ slo "Tabuľka '%-.192s' už existuje"
+ spa "La tabla '%-.192s' ya existe"
+ swe "Tabellen '%-.192s' finns redan"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' вже Ñ–Ñнує"
+ER_BAD_TABLE_ERROR 42S02
+ cze "Nezn-Bámá tabulka '%-.100s'"
+ dan "Ukendt tabel '%-.100s'"
+ nla "Onbekende tabel '%-.100s'"
+ eng "Unknown table '%-.100s'"
+ jps "table '%-.100s' ã¯ã‚ã‚Šã¾ã›ã‚“.",
+ est "Tundmatu tabel '%-.100s'"
+ fre "Table '%-.100s' inconnue"
+ ger "Unbekannte Tabelle '%-.100s'"
+ greek "Αγνωστος πίνακας '%-.100s'"
+ hun "Ervenytelen tabla: '%-.100s'"
+ ita "Tabella '%-.100s' sconosciuta"
+ jpn "table '%-.100s' ã¯ã‚ã‚Šã¾ã›ã‚“."
+ kor "í…Œì´ë¸” '%-.100s'는 알수 ì—†ìŒ"
+ nor "Ukjent tabell '%-.100s'"
+ norwegian-ny "Ukjent tabell '%-.100s'"
+ pol "Nieznana tabela '%-.100s'"
+ por "Tabela '%-.100s' desconhecida"
+ rum "Tabela '%-.100s' este invalida"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ð° '%-.100s'"
+ serbian "Nepoznata tabela '%-.100s'"
+ slo "Neznáma tabuľka '%-.100s'"
+ spa "Tabla '%-.100s' desconocida"
+ swe "Okänd tabell '%-.100s'"
+ ukr "Ðевідома Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.100s'"
+ER_NON_UNIQ_ERROR 23000
+ cze "Sloupec '%-.192s' v %-.192s nen-Bí zcela jasný"
+ dan "Felt: '%-.192s' i tabel %-.192s er ikke entydigt"
+ nla "Kolom: '%-.192s' in %-.192s is niet eenduidig"
+ eng "Column '%-.192s' in %-.192s is ambiguous"
+ est "Väli '%-.192s' %-.192s-s ei ole ühene"
+ fre "Champ: '%-.192s' dans %-.192s est ambigu"
+ ger "Feld '%-.192s' in %-.192s ist nicht eindeutig"
+ greek "Το πεδίο: '%-.192s' σε %-.192s δεν έχει καθοÏιστεί"
+ hun "A(z) '%-.192s' oszlop %-.192s-ben ketertelmu"
+ ita "Colonna: '%-.192s' di %-.192s e` ambigua"
+ jpn "Column: '%-.192s' in %-.192s is ambiguous"
+ kor "칼럼: '%-.192s' in '%-.192s' ì´ ëª¨í˜¸í•¨"
+ nor "Felt: '%-.192s' i tabell %-.192s er ikke entydig"
+ norwegian-ny "Kolonne: '%-.192s' i tabell %-.192s er ikkje eintydig"
+ pol "Kolumna: '%-.192s' w %-.192s jest dwuznaczna"
+ por "Coluna '%-.192s' em '%-.192s' é ambígua"
+ rum "Coloana: '%-.192s' in %-.192s este ambigua"
+ rus "Столбец '%-.192s' в %-.192s задан неоднозначно"
+ serbian "Kolona '%-.192s' u %-.192s nije jedinstvena u kontekstu"
+ slo "Pole: '%-.192s' v %-.192s je nejasné"
+ spa "La columna: '%-.192s' en %-.192s es ambigua"
+ swe "Kolumn '%-.192s' i %-.192s är inte unik"
+ ukr "Стовбець '%-.192s' у %-.192s визначений неоднозначно"
+ER_SERVER_SHUTDOWN 08S01
+ cze "Prob-Bíhá ukonÄování práce serveru"
+ dan "Database nedlukning er i gang"
+ nla "Bezig met het stoppen van de server"
+ eng "Server shutdown in progress"
+ jps "Server を shutdown 中...",
+ est "Serveri seiskamine käib"
+ fre "Arrêt du serveur en cours"
+ ger "Der Server wird heruntergefahren"
+ greek "ΕναÏξη διαδικασίας αποσÏνδεσης του εξυπηÏετητή (server shutdown)"
+ hun "A szerver leallitasa folyamatban"
+ ita "Shutdown del server in corso"
+ jpn "Server を shutdown 中..."
+ kor "Server가 셧다운 중입니다."
+ nor "Database nedkobling er i gang"
+ norwegian-ny "Tenar nedkopling er i gang"
+ pol "Trwa kończenie działania serwera"
+ por "'Shutdown' do servidor em andamento"
+ rum "Terminarea serverului este in desfasurare"
+ rus "Сервер находитÑÑ Ð² процеÑÑе оÑтановки"
+ serbian "Gašenje servera je u toku"
+ slo "Prebieha ukonÄovanie práce servera"
+ spa "Desconexion de servidor en proceso"
+ swe "Servern går nu ned"
+ ukr "ЗавершуєтьÑÑ Ñ€Ð°Ð±Ð¾Ñ‚Ð° Ñервера"
+ER_BAD_FIELD_ERROR 42S22 S0022
+ cze "Nezn-Bámý sloupec '%-.192s' v %-.192s"
+ dan "Ukendt kolonne '%-.192s' i tabel %-.192s"
+ nla "Onbekende kolom '%-.192s' in %-.192s"
+ eng "Unknown column '%-.192s' in '%-.192s'"
+ jps "'%-.192s' column 㯠'%-.192s' ã«ã¯ã‚ã‚Šã¾ã›ã‚“.",
+ est "Tundmatu tulp '%-.192s' '%-.192s'-s"
+ fre "Champ '%-.192s' inconnu dans %-.192s"
+ ger "Unbekanntes Tabellenfeld '%-.192s' in %-.192s"
+ greek "Αγνωστο πεδίο '%-.192s' σε '%-.192s'"
+ hun "A(z) '%-.192s' oszlop ervenytelen '%-.192s'-ben"
+ ita "Colonna sconosciuta '%-.192s' in '%-.192s'"
+ jpn "'%-.192s' column 㯠'%-.192s' ã«ã¯ã‚ã‚Šã¾ã›ã‚“."
+ kor "Unknown 칼럼 '%-.192s' in '%-.192s'"
+ nor "Ukjent kolonne '%-.192s' i tabell %-.192s"
+ norwegian-ny "Ukjent felt '%-.192s' i tabell %-.192s"
+ pol "Nieznana kolumna '%-.192s' w %-.192s"
+ por "Coluna '%-.192s' desconhecida em '%-.192s'"
+ rum "Coloana invalida '%-.192s' in '%-.192s'"
+ rus "ÐеизвеÑтный Ñтолбец '%-.192s' в '%-.192s'"
+ serbian "Nepoznata kolona '%-.192s' u '%-.192s'"
+ slo "Neznáme pole '%-.192s' v '%-.192s'"
+ spa "La columna '%-.192s' en %-.192s es desconocida"
+ swe "Okänd kolumn '%-.192s' i %-.192s"
+ ukr "Ðевідомий Ñтовбець '%-.192s' у '%-.192s'"
+ER_WRONG_FIELD_WITH_GROUP 42000 S1009
+ cze "Pou-Bžité '%-.192s' nebylo v group by"
+ dan "Brugte '%-.192s' som ikke var i group by"
+ nla "Opdracht gebruikt '%-.192s' dat niet in de GROUP BY voorkomt"
+ eng "'%-.192s' isn't in GROUP BY"
+ jps "'%-.192s' isn't in GROUP BY",
+ est "'%-.192s' puudub GROUP BY klauslis"
+ fre "'%-.192s' n'est pas dans 'group by'"
+ ger "'%-.192s' ist nicht in GROUP BY vorhanden"
+ greek "ΧÏησιμοποιήθηκε '%-.192s' που δεν υπήÏχε στο group by"
+ hun "Used '%-.192s' with wasn't in group by"
+ ita "Usato '%-.192s' che non e` nel GROUP BY"
+ kor "'%-.192s'ì€ GROUP BYì†ì— ì—†ìŒ"
+ nor "Brukte '%-.192s' som ikke var i group by"
+ norwegian-ny "Brukte '%-.192s' som ikkje var i group by"
+ pol "Użyto '%-.192s' bez umieszczenia w group by"
+ por "'%-.192s' não está em 'GROUP BY'"
+ rum "'%-.192s' nu exista in clauza GROUP BY"
+ rus "'%-.192s' не приÑутÑтвует в GROUP BY"
+ serbian "Entitet '%-.192s' nije naveden u komandi 'GROUP BY'"
+ slo "Použité '%-.192s' nebolo v 'group by'"
+ spa "Usado '%-.192s' el cual no esta group by"
+ swe "'%-.192s' finns inte i GROUP BY"
+ ukr "'%-.192s' не є у GROUP BY"
+ER_WRONG_GROUP_FIELD 42000 S1009
+ cze "Nemohu pou-Bžít group na '%-.192s'"
+ dan "Kan ikke gruppere på '%-.192s'"
+ nla "Kan '%-.192s' niet groeperen"
+ eng "Can't group on '%-.192s'"
+ est "Ei saa grupeerida '%-.192s' järgi"
+ fre "Ne peut regrouper '%-.192s'"
+ ger "Gruppierung über '%-.192s' nicht möglich"
+ greek "ΑδÏνατη η ομαδοποίηση (group on) '%-.192s'"
+ hun "A group nem hasznalhato: '%-.192s'"
+ ita "Impossibile raggruppare per '%-.192s'"
+ kor "'%-.192s'를 그룹할 수 ì—†ìŒ"
+ nor "Kan ikke gruppere på '%-.192s'"
+ norwegian-ny "Kan ikkje gruppere på '%-.192s'"
+ pol "Nie można grupować po '%-.192s'"
+ por "Não pode agrupar em '%-.192s'"
+ rum "Nu pot sa grupez pe (group on) '%-.192s'"
+ rus "Ðевозможно произвеÑти группировку по '%-.192s'"
+ serbian "Ne mogu da grupišem po '%-.192s'"
+ slo "Nemôžem použiť 'group' na '%-.192s'"
+ spa "No puedo agrupar por '%-.192s'"
+ swe "Kan inte använda GROUP BY med '%-.192s'"
+ ukr "Ðе можу групувати по '%-.192s'"
+ER_WRONG_SUM_SELECT 42000 S1009
+ cze "P-Bříkaz obsahuje zároveň funkci sum a sloupce"
+ dan "Udtrykket har summer (sum) funktioner og kolonner i samme udtryk"
+ nla "Opdracht heeft totaliseer functies en kolommen in dezelfde opdracht"
+ eng "Statement has sum functions and columns in same statement"
+ est "Lauses on korraga nii tulbad kui summeerimisfunktsioonid"
+ fre "Vous demandez la fonction sum() et des champs dans la même commande"
+ ger "Die Verwendung von Summierungsfunktionen und Spalten im selben Befehl ist nicht erlaubt"
+ greek "Η διατÏπωση πεÏιέχει sum functions και columns στην ίδια διατÏπωση"
+ ita "Il comando ha una funzione SUM e una colonna non specificata nella GROUP BY"
+ kor "Statement ê°€ sumê¸°ëŠ¥ì„ ë™ìž‘중ì´ê³  ì¹¼ëŸ¼ë„ ë™ì¼í•œ statement입니다."
+ nor "Uttrykket har summer (sum) funksjoner og kolonner i samme uttrykk"
+ norwegian-ny "Uttrykket har summer (sum) funksjoner og kolonner i same uttrykk"
+ pol "Zapytanie ma funkcje sumuj?ce i kolumny w tym samym zapytaniu"
+ por "Cláusula contém funções de soma e colunas juntas"
+ rum "Comanda are functii suma si coloane in aceeasi comanda"
+ rus "Выражение Ñодержит групповые функции и Ñтолбцы, но не включает GROUP BY. Ркак вы умудрилиÑÑŒ получить Ñто Ñообщение об ошибке?"
+ serbian "Izraz ima 'SUM' agregatnu funkciju i kolone u isto vreme"
+ slo "Príkaz obsahuje zároveň funkciu 'sum' a poľa"
+ spa "El estamento tiene funciones de suma y columnas en el mismo estamento"
+ swe "Kommandot har både sum functions och enkla funktioner"
+ ukr "У виразі викориÑтано підÑумовуючі функції порÑд з іменами Ñтовбців"
+ER_WRONG_VALUE_COUNT 21S01
+ cze "Po-BÄet sloupců neodpovídá zadané hodnotÄ›"
+ dan "Kolonne tæller stemmer ikke med antallet af værdier"
+ nla "Het aantal kolommen komt niet overeen met het aantal opgegeven waardes"
+ eng "Column count doesn't match value count"
+ est "Tulpade arv erineb väärtuste arvust"
+ ger "Die Anzahl der Spalten entspricht nicht der Anzahl der Werte"
+ greek "Το Column count δεν ταιÏιάζει με το value count"
+ hun "Az oszlopban levo ertek nem egyezik meg a szamitott ertekkel"
+ ita "Il numero delle colonne non e` uguale al numero dei valori"
+ kor "ì¹¼ëŸ¼ì˜ ì¹´ìš´íŠ¸ê°€ ê°’ì˜ ì¹´ìš´íŠ¸ì™€ ì¼ì¹˜í•˜ì§€ 않습니다."
+ nor "Felt telling stemmer verdi telling"
+ norwegian-ny "Kolonne telling stemmer verdi telling"
+ pol "Liczba kolumn nie odpowiada liczbie warto?ci"
+ por "Contagem de colunas não confere com a contagem de valores"
+ rum "Numarul de coloane nu este acelasi cu numarul valoarei"
+ rus "КоличеÑтво Ñтолбцов не Ñовпадает Ñ ÐºÐ¾Ð»Ð¸Ñ‡ÐµÑтвом значений"
+ serbian "Broj kolona ne odgovara broju vrednosti"
+ slo "PoÄet polí nezodpovedá zadanej hodnote"
+ spa "La columna con count no tiene valores para contar"
+ swe "Antalet kolumner motsvarar inte antalet värden"
+ ukr "КількіÑÑ‚ÑŒ Ñтовбців не Ñпівпадає з кількіÑÑ‚ÑŽ значень"
+ER_TOO_LONG_IDENT 42000 S1009
+ cze "Jm-Béno identifikátoru '%-.100s' je příliš dlouhé"
+ dan "Navnet '%-.100s' er for langt"
+ nla "Naam voor herkenning '%-.100s' is te lang"
+ eng "Identifier name '%-.100s' is too long"
+ jps "Identifier name '%-.100s' ã¯é•·ã™ãŽã¾ã™",
+ est "Identifikaatori '%-.100s' nimi on liiga pikk"
+ fre "Le nom de l'identificateur '%-.100s' est trop long"
+ ger "Name des Bezeichners '%-.100s' ist zu lang"
+ greek "Το identifier name '%-.100s' είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿"
+ hun "A(z) '%-.100s' azonositonev tul hosszu."
+ ita "Il nome dell'identificatore '%-.100s' e` troppo lungo"
+ jpn "Identifier name '%-.100s' ã¯é•·ã™ãŽã¾ã™"
+ kor "Identifier '%-.100s'는 너무 길군요."
+ nor "Identifikator '%-.100s' er for lang"
+ norwegian-ny "Identifikator '%-.100s' er for lang"
+ pol "Nazwa identyfikatora '%-.100s' jest zbyt długa"
+ por "Nome identificador '%-.100s' é longo demais"
+ rum "Numele indentificatorului '%-.100s' este prea lung"
+ rus "Слишком длинный идентификатор '%-.100s'"
+ serbian "Ime '%-.100s' je predugaÄko"
+ slo "Meno identifikátora '%-.100s' je príliš dlhé"
+ spa "El nombre del identificador '%-.100s' es demasiado grande"
+ swe "Kolumnnamn '%-.100s' är för långt"
+ ukr "Ім'Ñ Ñ–Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ñ–ÐºÐ°Ñ‚Ð¾Ñ€Ð° '%-.100s' задовге"
+ER_DUP_FIELDNAME 42S21 S1009
+ cze "Zdvojen-Bé jméno sloupce '%-.192s'"
+ dan "Feltnavnet '%-.192s' findes allerede"
+ nla "Dubbele kolom naam '%-.192s'"
+ eng "Duplicate column name '%-.192s'"
+ jps "'%-.192s' ã¨ã„ㆠcolumn åã¯é‡è¤‡ã—ã¦ã¾ã™",
+ est "Kattuv tulba nimi '%-.192s'"
+ fre "Nom du champ '%-.192s' déjà utilisé"
+ ger "Doppelter Spaltenname: '%-.192s'"
+ greek "Επανάληψη column name '%-.192s'"
+ hun "Duplikalt oszlopazonosito: '%-.192s'"
+ ita "Nome colonna duplicato '%-.192s'"
+ jpn "'%-.192s' ã¨ã„ㆠcolumn åã¯é‡è¤‡ã—ã¦ã¾ã™"
+ kor "ì¤‘ë³µëœ ì¹¼ëŸ¼ ì´ë¦„: '%-.192s'"
+ nor "Feltnavnet '%-.192s' eksisterte fra før"
+ norwegian-ny "Feltnamnet '%-.192s' eksisterte frå før"
+ pol "Powtórzona nazwa kolumny '%-.192s'"
+ por "Nome da coluna '%-.192s' duplicado"
+ rum "Numele coloanei '%-.192s' e duplicat"
+ rus "ДублирующееÑÑ Ð¸Ð¼Ñ Ñтолбца '%-.192s'"
+ serbian "Duplirano ime kolone '%-.192s'"
+ slo "Opakované meno poľa '%-.192s'"
+ spa "Nombre de columna duplicado '%-.192s'"
+ swe "Kolumnnamn '%-.192s finns flera gånger"
+ ukr "Дублююче ім'Ñ ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%-.192s'"
+ER_DUP_KEYNAME 42000 S1009
+ cze "Zdvojen-Bé jméno klíÄe '%-.192s'"
+ dan "Indeksnavnet '%-.192s' findes allerede"
+ nla "Dubbele zoeksleutel naam '%-.192s'"
+ eng "Duplicate key name '%-.192s'"
+ jps "'%-.192s' ã¨ã„ㆠkey ã®åå‰ã¯é‡è¤‡ã—ã¦ã„ã¾ã™",
+ est "Kattuv võtme nimi '%-.192s'"
+ fre "Nom de clef '%-.192s' déjà utilisé"
+ ger "Doppelter Name für Schlüssel vorhanden: '%-.192s'"
+ greek "Επανάληψη key name '%-.192s'"
+ hun "Duplikalt kulcsazonosito: '%-.192s'"
+ ita "Nome chiave duplicato '%-.192s'"
+ jpn "'%-.192s' ã¨ã„ㆠkey ã®åå‰ã¯é‡è¤‡ã—ã¦ã„ã¾ã™"
+ kor "ì¤‘ë³µëœ í‚¤ ì´ë¦„ : '%-.192s'"
+ nor "Nøkkelnavnet '%-.192s' eksisterte fra før"
+ norwegian-ny "Nøkkelnamnet '%-.192s' eksisterte frå før"
+ pol "Powtórzony nazwa klucza '%-.192s'"
+ por "Nome da chave '%-.192s' duplicado"
+ rum "Numele cheiei '%-.192s' e duplicat"
+ rus "ДублирующееÑÑ Ð¸Ð¼Ñ ÐºÐ»ÑŽÑ‡Ð° '%-.192s'"
+ serbian "Duplirano ime kljuÄa '%-.192s'"
+ slo "Opakované meno kľúÄa '%-.192s'"
+ spa "Nombre de clave duplicado '%-.192s'"
+ swe "Nyckelnamn '%-.192s' finns flera gånger"
+ ukr "Дублююче ім'Ñ ÐºÐ»ÑŽÑ‡Ð° '%-.192s'"
+# When using this error code, please use ER(ER_DUP_ENTRY_WITH_KEY_NAME)
+# for the message string. See, for example, code in handler.cc.
+ER_DUP_ENTRY 23000 S1009
+ cze "Zdvojen-Bý klÃ­Ä '%-.192s' (Äíslo klíÄe %d)"
+ dan "Ens værdier '%-.192s' for indeks %d"
+ nla "Dubbele ingang '%-.192s' voor zoeksleutel %d"
+ eng "Duplicate entry '%-.192s' for key %d"
+ jps "'%-.192s' 㯠key %d ã«ãŠã„ã¦é‡è¤‡ã—ã¦ã„ã¾ã™",
+ est "Kattuv väärtus '%-.192s' võtmele %d"
+ fre "Duplicata du champ '%-.192s' pour la clef %d"
+ ger "Doppelter Eintrag '%-.192s' für Schlüssel %d"
+ greek "Διπλή εγγÏαφή '%-.192s' για το κλειδί %d"
+ hun "Duplikalt bejegyzes '%-.192s' a %d kulcs szerint."
+ ita "Valore duplicato '%-.192s' per la chiave %d"
+ jpn "'%-.192s' 㯠key %d ã«ãŠã„ã¦é‡è¤‡ã—ã¦ã„ã¾ã™"
+ kor "ì¤‘ë³µëœ ìž…ë ¥ ê°’ '%-.192s': key %d"
+ nor "Like verdier '%-.192s' for nøkkel %d"
+ norwegian-ny "Like verdiar '%-.192s' for nykkel %d"
+ pol "Powtórzone wyst?pienie '%-.192s' dla klucza %d"
+ por "Entrada '%-.192s' duplicada para a chave %d"
+ rum "Cimpul '%-.192s' e duplicat pentru cheia %d"
+ rus "ДублирующаÑÑÑ Ð·Ð°Ð¿Ð¸ÑÑŒ '%-.192s' по ключу %d"
+ serbian "Dupliran unos '%-.192s' za kljuÄ '%d'"
+ slo "Opakovaný kÄ¾ÃºÄ '%-.192s' (Äíslo kľúÄa %d)"
+ spa "Entrada duplicada '%-.192s' para la clave %d"
+ swe "Dubbel nyckel '%-.192s' för nyckel %d"
+ ukr "Дублюючий Ð·Ð°Ð¿Ð¸Ñ '%-.192s' Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð° %d"
+ER_WRONG_FIELD_SPEC 42000 S1009
+ cze "Chybn-Bá specifikace sloupce '%-.192s'"
+ dan "Forkert kolonnespecifikaton for felt '%-.192s'"
+ nla "Verkeerde kolom specificatie voor kolom '%-.192s'"
+ eng "Incorrect column specifier for column '%-.192s'"
+ est "Vigane tulba kirjeldus tulbale '%-.192s'"
+ fre "Mauvais paramètre de champ pour le champ '%-.192s'"
+ ger "Falsche Spezifikation für Feld '%-.192s'"
+ greek "Εσφαλμένο column specifier για το πεδίο '%-.192s'"
+ hun "Rossz oszlopazonosito: '%-.192s'"
+ ita "Specifica errata per la colonna '%-.192s'"
+ kor "칼럼 '%-.192s'ì˜ ë¶€ì •í™•í•œ 칼럼 ì •ì˜ìž"
+ nor "Feil kolonne spesifikator for felt '%-.192s'"
+ norwegian-ny "Feil kolonne spesifikator for kolonne '%-.192s'"
+ pol "Błędna specyfikacja kolumny dla kolumny '%-.192s'"
+ por "Especificador de coluna incorreto para a coluna '%-.192s'"
+ rum "Specificandul coloanei '%-.192s' este incorect"
+ rus "Ðекорректный определитель Ñтолбца Ð´Ð»Ñ Ñтолбца '%-.192s'"
+ serbian "Pogrešan naziv kolone za kolonu '%-.192s'"
+ slo "Chyba v špecifikácii poľa '%-.192s'"
+ spa "Especificador de columna erroneo para la columna '%-.192s'"
+ swe "Felaktigt kolumntyp för kolumn '%-.192s'"
+ ukr "Ðевірний Ñпецифікатор ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%-.192s'"
+ER_PARSE_ERROR 42000 s1009
+ cze "%s bl-Bízko '%-.80s' na řádku %d"
+ dan "%s nær '%-.80s' på linje %d"
+ nla "%s bij '%-.80s' in regel %d"
+ eng "%s near '%-.80s' at line %d"
+ jps "%s : '%-.80s' 付近 : %d 行目",
+ est "%s '%-.80s' ligidal real %d"
+ fre "%s près de '%-.80s' à la ligne %d"
+ ger "%s bei '%-.80s' in Zeile %d"
+ greek "%s πλησίον '%-.80s' στη γÏαμμή %d"
+ hun "A %s a '%-.80s'-hez kozeli a %d sorban"
+ ita "%s vicino a '%-.80s' linea %d"
+ jpn "%s : '%-.80s' 付近 : %d 行目"
+ kor "'%s' ì—러 ê°™ì니다. ('%-.80s' 명령어 ë¼ì¸ %d)"
+ nor "%s nær '%-.80s' på linje %d"
+ norwegian-ny "%s attmed '%-.80s' på line %d"
+ pol "%s obok '%-.80s' w linii %d"
+ por "%s próximo a '%-.80s' na linha %d"
+ rum "%s linga '%-.80s' pe linia %d"
+ rus "%s около '%-.80s' на Ñтроке %d"
+ serbian "'%s' u iskazu '%-.80s' na liniji %d"
+ slo "%s blízko '%-.80s' na riadku %d"
+ spa "%s cerca '%-.80s' en la linea %d"
+ swe "%s nära '%-.80s' på rad %d"
+ ukr "%s Ð±Ñ–Ð»Ñ '%-.80s' в Ñтроці %d"
+ER_EMPTY_QUERY 42000
+ cze "V-Býsledek dotazu je prázdný"
+ dan "Forespørgsel var tom"
+ nla "Query was leeg"
+ eng "Query was empty"
+ jps "Query ãŒç©ºã§ã™.",
+ est "Tühi päring"
+ fre "Query est vide"
+ ger "Leere Abfrage"
+ greek "Το εÏώτημα (query) που θέσατε ήταν κενό"
+ hun "Ures lekerdezes."
+ ita "La query e` vuota"
+ jpn "Query ãŒç©ºã§ã™."
+ kor "쿼리결과가 없습니다."
+ nor "Forespørsel var tom"
+ norwegian-ny "Førespurnad var tom"
+ pol "Zapytanie było puste"
+ por "Consulta (query) estava vazia"
+ rum "Query-ul a fost gol"
+ rus "Ð—Ð°Ð¿Ñ€Ð¾Ñ Ð¾ÐºÐ°Ð·Ð°Ð»ÑÑ Ð¿ÑƒÑтым"
+ serbian "Upit je bio prazan"
+ slo "Výsledok požiadavky bol prázdny"
+ spa "La query estaba vacia"
+ swe "Frågan var tom"
+ ukr "ПуÑтий запит"
+ER_NONUNIQ_TABLE 42000 S1009
+ cze "Nejednozna-BÄná tabulka/alias: '%-.192s'"
+ dan "Tabellen/aliaset: '%-.192s' er ikke unikt"
+ nla "Niet unieke waarde tabel/alias: '%-.192s'"
+ eng "Not unique table/alias: '%-.192s'"
+ jps "'%-.192s' ã¯ä¸€æ„ã® table/alias åã§ã¯ã‚ã‚Šã¾ã›ã‚“",
+ est "Ei ole unikaalne tabel/alias '%-.192s'"
+ fre "Table/alias: '%-.192s' non unique"
+ ger "Tabellenname/Alias '%-.192s' nicht eindeutig"
+ greek "ΑδÏνατη η ανεÏÏεση unique table/alias: '%-.192s'"
+ hun "Nem egyedi tabla/alias: '%-.192s'"
+ ita "Tabella/alias non unico: '%-.192s'"
+ jpn "'%-.192s' ã¯ä¸€æ„ã® table/alias åã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+ kor "Unique 하지 ì•Šì€ í…Œì´ë¸”/alias: '%-.192s'"
+ nor "Ikke unikt tabell/alias: '%-.192s'"
+ norwegian-ny "Ikkje unikt tabell/alias: '%-.192s'"
+ pol "Tabela/alias nie s? unikalne: '%-.192s'"
+ por "Tabela/alias '%-.192s' não única"
+ rum "Tabela/alias: '%-.192s' nu este unic"
+ rus "ПовторÑющаÑÑÑ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ð°/пÑевдоним '%-.192s'"
+ serbian "Tabela ili alias nisu bili jedinstveni: '%-.192s'"
+ slo "Nie jednoznaÄná tabuľka/alias: '%-.192s'"
+ spa "Tabla/alias: '%-.192s' es no unica"
+ swe "Icke unikt tabell/alias: '%-.192s'"
+ ukr "Ðеунікальна таблицÑ/пÑевдонім: '%-.192s'"
+ER_INVALID_DEFAULT 42000 S1009
+ cze "Chybn-Bá defaultní hodnota pro '%-.192s'"
+ dan "Ugyldig standardværdi for '%-.192s'"
+ nla "Foutieve standaard waarde voor '%-.192s'"
+ eng "Invalid default value for '%-.192s'"
+ est "Vigane vaikeväärtus '%-.192s' jaoks"
+ fre "Valeur par défaut invalide pour '%-.192s'"
+ ger "Fehlerhafter Vorgabewert (DEFAULT) für '%-.192s'"
+ greek "Εσφαλμένη Ï€ÏοκαθοÏισμένη τιμή (default value) για '%-.192s'"
+ hun "Ervenytelen ertek: '%-.192s'"
+ ita "Valore di default non valido per '%-.192s'"
+ kor "'%-.192s'ì˜ ìœ íš¨í•˜ì§€ 못한 ë””í´íŠ¸ ê°’ì„ ì‚¬ìš©í•˜ì…¨ìŠµë‹ˆë‹¤."
+ nor "Ugyldig standardverdi for '%-.192s'"
+ norwegian-ny "Ugyldig standardverdi for '%-.192s'"
+ pol "Niewła?ciwa warto?ć domy?lna dla '%-.192s'"
+ por "Valor padrão (default) inválido para '%-.192s'"
+ rum "Valoarea de default este invalida pentru '%-.192s'"
+ rus "Ðекорректное значение по умолчанию Ð´Ð»Ñ '%-.192s'"
+ serbian "Loša default vrednost za '%-.192s'"
+ slo "Chybná implicitná hodnota pre '%-.192s'"
+ spa "Valor por defecto invalido para '%-.192s'"
+ swe "Ogiltigt DEFAULT värde för '%-.192s'"
+ ukr "Ðевірне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾ замовчуванню Ð´Ð»Ñ '%-.192s'"
+ER_MULTIPLE_PRI_KEY 42000 S1009
+ cze "Definov-Báno více primárních klíÄů"
+ dan "Flere primærnøgler specificeret"
+ nla "Meerdere primaire zoeksleutels gedefinieerd"
+ eng "Multiple primary key defined"
+ jps "複数㮠primary key ãŒå®šç¾©ã•ã‚Œã¾ã—ãŸ",
+ est "Mitut primaarset võtit ei saa olla"
+ fre "Plusieurs clefs primaires définies"
+ ger "Mehrere Primärschlüssel (PRIMARY KEY) definiert"
+ greek "ΠεÏισσότεÏα από ένα primary key οÏίστηκαν"
+ hun "Tobbszoros elsodleges kulcs definialas."
+ ita "Definite piu` chiave primarie"
+ jpn "複数㮠primary key ãŒå®šç¾©ã•ã‚Œã¾ã—ãŸ"
+ kor "Multiple primary keyê°€ ì •ì˜ë˜ì–´ 있슴"
+ nor "Fleire primærnøkle spesifisert"
+ norwegian-ny "Fleire primærnyklar spesifisert"
+ pol "Zdefiniowano wiele kluczy podstawowych"
+ por "Definida mais de uma chave primária"
+ rum "Chei primare definite de mai multe ori"
+ rus "Указано неÑколько первичных ключей"
+ serbian "Definisani viÅ¡estruki primarni kljuÄevi"
+ slo "Zadefinovaných viac primárnych kľúÄov"
+ spa "Multiples claves primarias definidas"
+ swe "Flera PRIMARY KEY använda"
+ ukr "Первинного ключа визначено неодноразово"
+ER_TOO_MANY_KEYS 42000 S1009
+ cze "Zad-Báno příliÅ¡ mnoho klíÄů, je povoleno nejvíce %d klíÄů"
+ dan "For mange nøgler specificeret. Kun %d nøgler må bruges"
+ nla "Teveel zoeksleutels gedefinieerd. Maximaal zijn %d zoeksleutels toegestaan"
+ eng "Too many keys specified; max %d keys allowed"
+ jps "key ã®æŒ‡å®šãŒå¤šã™ãŽã¾ã™. key ã¯æœ€å¤§ %d ã¾ã§ã§ã™",
+ est "Liiga palju võtmeid. Maksimaalselt võib olla %d võtit"
+ fre "Trop de clefs sont définies. Maximum de %d clefs alloué"
+ ger "Zu viele Schlüssel definiert. Maximal %d Schlüssel erlaubt"
+ greek "ΠάÏα πολλά key οÏίσθηκαν. Το Ï€Î¿Î»Ï %d επιτÏέπονται"
+ hun "Tul sok kulcs. Maximum %d kulcs engedelyezett."
+ ita "Troppe chiavi. Sono ammesse max %d chiavi"
+ jpn "key ã®æŒ‡å®šãŒå¤šã™ãŽã¾ã™. key ã¯æœ€å¤§ %d ã¾ã§ã§ã™"
+ kor "너무 ë§Žì€ í‚¤ê°€ ì •ì˜ë˜ì–´ 있ì니다.. 최대 %dì˜ í‚¤ê°€ 가능함"
+ nor "For mange nøkler spesifisert. Maks %d nøkler tillatt"
+ norwegian-ny "For mange nykler spesifisert. Maks %d nyklar tillatt"
+ pol "Okre?lono zbyt wiele kluczy. Dostępnych jest maksymalnie %d kluczy"
+ por "Especificadas chaves demais. O máximo permitido são %d chaves"
+ rum "Prea multe chei. Numarul de chei maxim este %d"
+ rus "Указано Ñлишком много ключей. РазрешаетÑÑ ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ не более %d ключей"
+ serbian "Navedeno je previÅ¡e kljuÄeva. Maksimum %d kljuÄeva je dozvoljeno"
+ slo "Zadaných ríliÅ¡ veľa kľúÄov. Najviac %d kľúÄov je povolených"
+ spa "Demasiadas claves primarias declaradas. Un maximo de %d claves son permitidas"
+ swe "För många nycklar använda. Man får ha högst %d nycklar"
+ ukr "Забагато ключів зазначено. Дозволено не більше %d ключів"
+ER_TOO_MANY_KEY_PARTS 42000 S1009
+ cze "Zad-Báno příliÅ¡ mnoho Äást klíÄů, je povoleno nejvíce %d Äástí"
+ dan "For mange nøgledele specificeret. Kun %d dele må bruges"
+ nla "Teveel zoeksleutel onderdelen gespecificeerd. Maximaal %d onderdelen toegestaan"
+ eng "Too many key parts specified; max %d parts allowed"
+ est "Võti koosneb liiga paljudest osadest. Maksimaalselt võib olla %d osa"
+ fre "Trop de parties specifiées dans la clef. Maximum de %d parties"
+ ger "Zu viele Teilschlüssel definiert. Maximal %d Teilschlüssel erlaubt"
+ greek "ΠάÏα πολλά key parts οÏίσθηκαν. Το Ï€Î¿Î»Ï %d επιτÏέπονται"
+ hun "Tul sok kulcsdarabot definialt. Maximum %d resz engedelyezett"
+ ita "Troppe parti di chiave specificate. Sono ammesse max %d parti"
+ kor "너무 ë§Žì€ í‚¤ 부분(parts)ë“¤ì´ ì •ì˜ë˜ì–´ 있ì니다.. 최대 %d ë¶€ë¶„ì´ ê°€ëŠ¥í•¨"
+ nor "For mange nøkkeldeler spesifisert. Maks %d deler tillatt"
+ norwegian-ny "For mange nykkeldelar spesifisert. Maks %d delar tillatt"
+ pol "Okre?lono zbyt wiele czę?ci klucza. Dostępnych jest maksymalnie %d czę?ci"
+ por "Especificadas partes de chave demais. O máximo permitido são %d partes"
+ rum "Prea multe chei. Numarul de chei maxim este %d"
+ rus "Указано Ñлишком много чаÑтей ÑоÑтавного ключа. РазрешаетÑÑ ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ не более %d чаÑтей"
+ serbian "Navedeno je previÅ¡e delova kljuÄa. Maksimum %d delova je dozvoljeno"
+ slo "Zadaných ríliÅ¡ veľa Äastí kľúÄov. Je povolených najviac %d Äastí"
+ spa "Demasiadas partes de clave declaradas. Un maximo de %d partes son permitidas"
+ swe "För många nyckeldelar använda. Man får ha högst %d nyckeldelar"
+ ukr "Забагато чаÑтин ключа зазначено. Дозволено не більше %d чаÑтин"
+ER_TOO_LONG_KEY 42000 S1009
+ cze "Zadan-Bý klÃ­Ä byl příliÅ¡ dlouhý, nejvÄ›tší délka klíÄe je %d"
+ dan "Specificeret nøgle var for lang. Maksimal nøglelængde er %d"
+ nla "Gespecificeerde zoeksleutel was te lang. De maximale lengte is %d"
+ eng "Specified key was too long; max key length is %d bytes"
+ jps "key ãŒé•·ã™ãŽã¾ã™. key ã®é•·ã•ã¯æœ€å¤§ %d ã§ã™",
+ est "Võti on liiga pikk. Maksimaalne võtmepikkus on %d"
+ fre "La clé est trop longue. Longueur maximale: %d"
+ ger "Schlüssel ist zu lang. Die maximale Schlüssellänge beträgt %d"
+ greek "Το κλειδί που οÏίσθηκε είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿. Το μέγιστο μήκος είναι %d"
+ hun "A megadott kulcs tul hosszu. Maximalis kulcshosszusag: %d"
+ ita "La chiave specificata e` troppo lunga. La max lunghezza della chiave e` %d"
+ jpn "key ãŒé•·ã™ãŽã¾ã™. key ã®é•·ã•ã¯æœ€å¤§ %d ã§ã™"
+ kor "ì •ì˜ëœ 키가 너무 ê¹ë‹ˆë‹¤. 최대 í‚¤ì˜ ê¸¸ì´ëŠ” %d입니다."
+ nor "Spesifisert nøkkel var for lang. Maks nøkkellengde er is %d"
+ norwegian-ny "Spesifisert nykkel var for lang. Maks nykkellengde er %d"
+ pol "Zdefinowany klucz jest zbyt długi. Maksymaln? długo?ci? klucza jest %d"
+ por "Chave especificada longa demais. O comprimento de chave máximo permitido é %d"
+ rum "Cheia specificata este prea lunga. Marimea maxima a unei chei este de %d"
+ rus "Указан Ñлишком длинный ключ. МакÑÐ¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð´Ð»Ð¸Ð½Ð° ключа ÑоÑтавлÑет %d байт"
+ serbian "Navedeni kljuÄ je predug. Maksimalna dužina kljuÄa je %d"
+ slo "Zadaný kÄ¾ÃºÄ je príliÅ¡ dlhý, najväÄÅ¡ia dĺžka kľúÄa je %d"
+ spa "Declaracion de clave demasiado larga. La maxima longitud de clave es %d"
+ swe "För lång nyckel. Högsta tillåtna nyckellängd är %d"
+ ukr "Зазначений ключ задовгий. Ðайбільша довжина ключа %d байтів"
+ER_KEY_COLUMN_DOES_NOT_EXITS 42000 S1009
+ cze "Kl-BíÄový sloupec '%-.192s' v tabulce neexistuje"
+ dan "Nøglefeltet '%-.192s' eksisterer ikke i tabellen"
+ nla "Zoeksleutel kolom '%-.192s' bestaat niet in tabel"
+ eng "Key column '%-.192s' doesn't exist in table"
+ jps "Key column '%-.192s' ãŒãƒ†ãƒ¼ãƒ–ルã«ã‚ã‚Šã¾ã›ã‚“.",
+ est "Võtme tulp '%-.192s' puudub tabelis"
+ fre "La clé '%-.192s' n'existe pas dans la table"
+ ger "In der Tabelle gibt es kein Schlüsselfeld '%-.192s'"
+ greek "Το πεδίο κλειδί '%-.192s' δεν υπάÏχει στον πίνακα"
+ hun "A(z) '%-.192s'kulcsoszlop nem letezik a tablaban"
+ ita "La colonna chiave '%-.192s' non esiste nella tabella"
+ jpn "Key column '%-.192s' ãŒãƒ†ãƒ¼ãƒ–ルã«ã‚ã‚Šã¾ã›ã‚“."
+ kor "Key 칼럼 '%-.192s'는 í…Œì´ë¸”ì— ì¡´ìž¬í•˜ì§€ 않습니다."
+ nor "Nøkkel felt '%-.192s' eksiterer ikke i tabellen"
+ norwegian-ny "Nykkel kolonne '%-.192s' eksiterar ikkje i tabellen"
+ pol "Kolumna '%-.192s' zdefiniowana w kluczu nie istnieje w tabeli"
+ por "Coluna chave '%-.192s' não existe na tabela"
+ rum "Coloana cheie '%-.192s' nu exista in tabela"
+ rus "Ключевой Ñтолбец '%-.192s' в таблице не ÑущеÑтвует"
+ serbian "KljuÄna kolona '%-.192s' ne postoji u tabeli"
+ slo "KľúÄový stĺpec '%-.192s' v tabuľke neexistuje"
+ spa "La columna clave '%-.192s' no existe en la tabla"
+ swe "Nyckelkolumn '%-.192s' finns inte"
+ ukr "Ключовий Ñтовбець '%-.192s' не Ñ–Ñнує у таблиці"
+ER_BLOB_USED_AS_KEY 42000 S1009
+ cze "Blob sloupec '%-.192s' nem-Bůže být použit jako klíÄ"
+ dan "BLOB feltet '%-.192s' kan ikke bruges ved specifikation af indeks"
+ nla "BLOB kolom '%-.192s' kan niet gebruikt worden bij zoeksleutel specificatie"
+ eng "BLOB column '%-.192s' can't be used in key specification with the used table type"
+ est "BLOB-tüüpi tulpa '%-.192s' ei saa kasutada võtmena"
+ fre "Champ BLOB '%-.192s' ne peut être utilisé dans une clé"
+ ger "BLOB-Feld '%-.192s' kann beim verwendeten Tabellentyp nicht als Schlüssel verwendet werden"
+ greek "Πεδίο Ï„Ïπου Blob '%-.192s' δεν μποÏεί να χÏησιμοποιηθεί στον οÏισμό ενός ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï (key specification)"
+ hun "Blob objektum '%-.192s' nem hasznalhato kulcskent"
+ ita "La colonna BLOB '%-.192s' non puo` essere usata nella specifica della chiave"
+ kor "BLOB 칼럼 '%-.192s'는 키 ì •ì˜ì—ì„œ ì‚¬ìš©ë  ìˆ˜ 없습니다."
+ nor "Blob felt '%-.192s' kan ikke brukes ved spesifikasjon av nøkler"
+ norwegian-ny "Blob kolonne '%-.192s' kan ikkje brukast ved spesifikasjon av nyklar"
+ pol "Kolumna typu Blob '%-.192s' nie może być użyta w specyfikacji klucza"
+ por "Coluna BLOB '%-.192s' não pode ser utilizada na especificação de chave para o tipo de tabela usado"
+ rum "Coloana de tip BLOB '%-.192s' nu poate fi folosita in specificarea cheii cu tipul de tabla folosit"
+ rus "Столбец типа BLOB '%-.192s' не может быть иÑпользован как значение ключа в таблице такого типа"
+ serbian "BLOB kolona '%-.192s' ne može biti upotrebljena za navoÄ‘enje kljuÄa sa tipom tabele koji se trenutno koristi"
+ slo "Blob pole '%-.192s' nemôže byÅ¥ použité ako kľúÄ"
+ spa "La columna Blob '%-.192s' no puede ser usada en una declaracion de clave"
+ swe "En BLOB '%-.192s' kan inte vara nyckel med den använda tabelltypen"
+ ukr "BLOB Ñтовбець '%-.192s' не може бути викориÑтаний у визначенні ключа в цьому типі таблиці"
+ER_TOO_BIG_FIELDLENGTH 42000 S1009
+ cze "P-Bříliš velká délka sloupce '%-.192s' (nejvíce %lu). Použijte BLOB"
+ dan "For stor feltlængde for kolonne '%-.192s' (maks = %lu). Brug BLOB i stedet"
+ nla "Te grote kolomlengte voor '%-.192s' (max = %lu). Maak hiervoor gebruik van het type BLOB"
+ eng "Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead"
+ jps "column '%-.192s' ã¯,確ä¿ã™ã‚‹ column ã®å¤§ãã•ãŒå¤šã™ãŽã¾ã™. (最大 %lu ã¾ã§). BLOB ã‚’ã‹ã‚ã‚Šã«ä½¿ç”¨ã—ã¦ãã ã•ã„.",
+ est "Tulba '%-.192s' pikkus on liiga pikk (maksimaalne pikkus: %lu). Kasuta BLOB väljatüüpi"
+ fre "Champ '%-.192s' trop long (max = %lu). Utilisez un BLOB"
+ ger "Feldlänge für Feld '%-.192s' zu groß (maximal %lu). BLOB- oder TEXT-Spaltentyp verwenden!"
+ greek "Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿ μήκος για το πεδίο '%-.192s' (max = %lu). ΠαÏακαλώ χÏησιμοποιείστε τον Ï„Ïπο BLOB"
+ hun "A(z) '%-.192s' oszlop tul hosszu. (maximum = %lu). Hasznaljon BLOB tipust inkabb."
+ ita "La colonna '%-.192s' e` troppo grande (max=%lu). Utilizza un BLOB."
+ jpn "column '%-.192s' ã¯,確ä¿ã™ã‚‹ column ã®å¤§ãã•ãŒå¤šã™ãŽã¾ã™. (最大 %lu ã¾ã§). BLOB ã‚’ã‹ã‚ã‚Šã«ä½¿ç”¨ã—ã¦ãã ã•ã„."
+ kor "칼럼 '%-.192s'ì˜ ì¹¼ëŸ¼ 길ì´ê°€ 너무 ê¹ë‹ˆë‹¤ (최대 = %lu). ëŒ€ì‹ ì— BLOB를 사용하세요."
+ nor "For stor nøkkellengde for kolonne '%-.192s' (maks = %lu). Bruk BLOB istedenfor"
+ norwegian-ny "For stor nykkellengde for felt '%-.192s' (maks = %lu). Bruk BLOB istadenfor"
+ pol "Zbyt duża długo?ć kolumny '%-.192s' (maks. = %lu). W zamian użyj typu BLOB"
+ por "Comprimento da coluna '%-.192s' grande demais (max = %lu); use BLOB em seu lugar"
+ rum "Lungimea coloanei '%-.192s' este prea lunga (maximum = %lu). Foloseste BLOB mai bine"
+ rus "Слишком Ð±Ð¾Ð»ÑŒÑˆÐ°Ñ Ð´Ð»Ð¸Ð½Ð° Ñтолбца '%-.192s' (макÑимум = %lu). ИÑпользуйте тип BLOB или TEXT вмеÑто текущего"
+ serbian "Previše podataka za kolonu '%-.192s' (maksimum je %lu). Upotrebite BLOB polje"
+ slo "Príliš veľká dĺžka pre pole '%-.192s' (maximum = %lu). Použite BLOB"
+ spa "Longitud de columna demasiado grande para la columna '%-.192s' (maximo = %lu).Usar BLOB en su lugar"
+ swe "För stor kolumnlängd angiven för '%-.192s' (max= %lu). Använd en BLOB instället"
+ ukr "Задовга довжина ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%-.192s' (max = %lu). ВикориÑтайте тип BLOB"
+ER_WRONG_AUTO_KEY 42000 S1009
+ cze "M-Bůžete mít pouze jedno AUTO pole a to musí být definováno jako klíÄ"
+ dan "Der kan kun specificeres eet AUTO_INCREMENT-felt, og det skal være indekseret"
+ nla "Er kan slechts 1 autofield zijn en deze moet als zoeksleutel worden gedefinieerd."
+ eng "Incorrect table definition; there can be only one auto column and it must be defined as a key"
+ jps "テーブルã®å®šç¾©ãŒé•ã„ã¾ã™; there can be only one auto column and it must be defined as a key",
+ est "Vigane tabelikirjeldus; Tabelis tohib olla üks auto_increment tüüpi tulp ning see peab olema defineeritud võtmena"
+ fre "Un seul champ automatique est permis et il doit être indexé"
+ ger "Falsche Tabellendefinition. Es darf nur eine AUTO_INCREMENT-Spalte geben, und diese muss als Schlüssel definiert werden"
+ greek "ΜποÏεί να υπάÏχει μόνο ένα auto field και Ï€Ïέπει να έχει οÏισθεί σαν key"
+ hun "Csak egy auto mezo lehetseges, es azt kulcskent kell definialni."
+ ita "Puo` esserci solo un campo AUTO e deve essere definito come chiave"
+ jpn "テーブルã®å®šç¾©ãŒé•ã„ã¾ã™; there can be only one auto column and it must be defined as a key"
+ kor "부정확한 í…Œì´ë¸” ì •ì˜; í…Œì´ë¸”ì€ í•˜ë‚˜ì˜ auto ì¹¼ëŸ¼ì´ ì¡´ìž¬í•˜ê³  키로 ì •ì˜ë˜ì–´ì ¸ì•¼ 합니다."
+ nor "Bare ett auto felt kan være definert som nøkkel."
+ norwegian-ny "Bare eitt auto felt kan være definert som nøkkel."
+ pol "W tabeli może być tylko jedno pole auto i musi ono być zdefiniowane jako klucz"
+ por "Definição incorreta de tabela. Somente é permitido um único campo auto-incrementado e ele tem que ser definido como chave"
+ rum "Definitia tabelei este incorecta; Nu pot fi mai mult de o singura coloana de tip auto si aceasta trebuie definita ca cheie"
+ rus "Ðекорректное определение таблицы: может ÑущеÑтвовать только один автоинкрементный Ñтолбец, и он должен быть определен как ключ"
+ serbian "PogreÅ¡na definicija tabele; U tabeli može postojati samo jedna 'AUTO' kolona i ona mora biti istovremeno definisana kao kolona kljuÄa"
+ slo "Môžete maÅ¥ iba jedno AUTO pole a to musí byÅ¥ definované ako kľúÄ"
+ spa "Puede ser solamente un campo automatico y este debe ser definido como una clave"
+ swe "Det får finnas endast ett AUTO_INCREMENT-fält och detta måste vara en nyckel"
+ ukr "Ðевірне Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ–; Може бути лише один автоматичний Ñтовбець, що повинен бути визначений Ñк ключ"
+ER_READY
+ cze "%s: p-Břipraven na spojení\nVersion: '%s' socket: '%s' port: %d""
+ dan "%s: klar til tilslutninger\nVersion: '%s' socket: '%s' port: %d""
+ nla "%s: klaar voor verbindingen\nVersion: '%s' socket: '%s' port: %d""
+ eng "%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d"
+ jps "%s: 準備完了¥nVersion: '%s' socket: '%s' port: %d"",
+ est "%s: ootab ühendusi\nVersion: '%s' socket: '%s' port: %d""
+ fre "%s: Prêt pour des connexions\nVersion: '%s' socket: '%s' port: %d""
+ ger "%s: Bereit für Verbindungen.\nVersion: '%s' Socket: '%s' Port: %d"
+ greek "%s: σε αναμονή συνδέσεων\nVersion: '%s' socket: '%s' port: %d""
+ hun "%s: kapcsolatra kesz\nVersion: '%s' socket: '%s' port: %d""
+ ita "%s: Pronto per le connessioni\nVersion: '%s' socket: '%s' port: %d""
+ jpn "%s: 準備完了\nVersion: '%s' socket: '%s' port: %d""
+ kor "%s: 연결 준비중입니다\nVersion: '%s' socket: '%s' port: %d""
+ nor "%s: klar for tilkoblinger\nVersion: '%s' socket: '%s' port: %d""
+ norwegian-ny "%s: klar for tilkoblingar\nVersion: '%s' socket: '%s' port: %d""
+ pol "%s: gotowe do poł?czenia\nVersion: '%s' socket: '%s' port: %d""
+ por "%s: Pronto para conexões\nVersion: '%s' socket: '%s' port: %d""
+ rum "%s: sint gata pentru conectii\nVersion: '%s' socket: '%s' port: %d""
+ rus "%s: Готов принимать ÑоединениÑ.\nВерÑиÑ: '%s' Ñокет: '%s' порт: %d"
+ serbian "%s: Spreman za konekcije\nVersion: '%s' socket: '%s' port: %d""
+ slo "%s: pripravený na spojenie\nVersion: '%s' socket: '%s' port: %d""
+ spa "%s: preparado para conexiones\nVersion: '%s' socket: '%s' port: %d""
+ swe "%s: klar att ta emot klienter\nVersion: '%s' socket: '%s' port: %d""
+ ukr "%s: Готовий Ð´Ð»Ñ Ð·'єднань!\nVersion: '%s' socket: '%s' port: %d""
+ER_NORMAL_SHUTDOWN
+ cze "%s: norm-Bální ukonÄení\n"
+ dan "%s: Normal nedlukning\n"
+ nla "%s: Normaal afgesloten \n"
+ eng "%s: Normal shutdown\n"
+ est "%s: MySQL lõpetas\n"
+ fre "%s: Arrêt normal du serveur\n"
+ ger "%s: Normal heruntergefahren\n"
+ greek "%s: Φυσιολογική διαδικασία shutdown\n"
+ hun "%s: Normal leallitas\n"
+ ita "%s: Shutdown normale\n"
+ kor "%s: ì •ìƒì ì¸ shutdown\n"
+ nor "%s: Normal avslutning\n"
+ norwegian-ny "%s: Normal nedkopling\n"
+ pol "%s: Standardowe zakończenie działania\n"
+ por "%s: 'Shutdown' normal\n"
+ rum "%s: Terminare normala\n"
+ rus "%s: ÐšÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ñтановка\n"
+ serbian "%s: Normalno gašenje\n"
+ slo "%s: normálne ukonÄenie\n"
+ spa "%s: Apagado normal\n"
+ swe "%s: Normal avslutning\n"
+ ukr "%s: Ðормальне завершеннÑ\n"
+ER_GOT_SIGNAL
+ cze "%s: p-BÅ™ijat signal %d, konÄím\n"
+ dan "%s: Fangede signal %d. Afslutter!!\n"
+ nla "%s: Signaal %d. Systeem breekt af!\n"
+ eng "%s: Got signal %d. Aborting!\n"
+ jps "%s: Got signal %d. 中断!¥n",
+ est "%s: sain signaali %d. Lõpetan!\n"
+ fre "%s: Reçu le signal %d. Abandonne!\n"
+ ger "%s: Signal %d erhalten. Abbruch!\n"
+ greek "%s: Ελήφθη το μήνυμα %d. Η διαδικασία εγκαταλείπεται!\n"
+ hun "%s: %d jelzes. Megszakitva!\n"
+ ita "%s: Ricevuto segnale %d. Interruzione!\n"
+ jpn "%s: Got signal %d. 中断!\n"
+ kor "%s: %d 신호가 들어왔ìŒ. 중지!\n"
+ nor "%s: Oppdaget signal %d. Avslutter!\n"
+ norwegian-ny "%s: Oppdaga signal %d. Avsluttar!\n"
+ pol "%s: Otrzymano sygnał %d. Kończenie działania!\n"
+ por "%s: Obteve sinal %d. Abortando!\n"
+ rum "%s: Semnal %d obtinut. Aborting!\n"
+ rus "%s: Получен Ñигнал %d. Прекращаем!\n"
+ serbian "%s: Dobio signal %d. Prekidam!\n"
+ slo "%s: prijatý signál %d, ukonÄenie (Abort)!\n"
+ spa "%s: Recibiendo signal %d. Abortando!\n"
+ swe "%s: Fick signal %d. Avslutar!\n"
+ ukr "%s: Отримано Ñигнал %d. ПерериваюÑÑŒ!\n"
+ER_SHUTDOWN_COMPLETE
+ cze "%s: ukon-BÄení práce hotovo\n"
+ dan "%s: Server lukket\n"
+ nla "%s: Afsluiten afgerond\n"
+ eng "%s: Shutdown complete\n"
+ jps "%s: Shutdown 完了¥n",
+ est "%s: Lõpp\n"
+ fre "%s: Arrêt du serveur terminé\n"
+ ger "%s: Herunterfahren beendet\n"
+ greek "%s: Η διαδικασία Shutdown ολοκληÏώθηκε\n"
+ hun "%s: A leallitas kesz\n"
+ ita "%s: Shutdown completato\n"
+ jpn "%s: Shutdown 完了\n"
+ kor "%s: Shutdown ì´ ì™„ë£Œë¨!\n"
+ nor "%s: Avslutning komplett\n"
+ norwegian-ny "%s: Nedkopling komplett\n"
+ pol "%s: Zakończenie działania wykonane\n"
+ por "%s: 'Shutdown' completo\n"
+ rum "%s: Terminare completa\n"
+ rus "%s: ОÑтановка завершена\n"
+ serbian "%s: Gašenje završeno\n"
+ slo "%s: práca ukonÄená\n"
+ spa "%s: Apagado completado\n"
+ swe "%s: Avslutning klar\n"
+ ukr "%s: Роботу завершено\n"
+ER_FORCING_CLOSE 08S01
+ cze "%s: n-Básilné uzavření threadu %ld uživatele '%-.48s'\n"
+ dan "%s: Forceret nedlukning af tråd: %ld bruger: '%-.48s'\n"
+ nla "%s: Afsluiten afgedwongen van thread %ld gebruiker: '%-.48s'\n"
+ eng "%s: Forcing close of thread %ld user: '%-.48s'\n"
+ jps "%s: スレッド %ld 強制終了 user: '%-.48s'¥n",
+ est "%s: Sulgen jõuga lõime %ld kasutaja: '%-.48s'\n"
+ fre "%s: Arrêt forcé de la tâche (thread) %ld utilisateur: '%-.48s'\n"
+ ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'\n"
+ greek "%s: Το thread θα κλείσει %ld user: '%-.48s'\n"
+ hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'\n"
+ ita "%s: Forzata la chiusura del thread %ld utente: '%-.48s'\n"
+ jpn "%s: スレッド %ld 強制終了 user: '%-.48s'\n"
+ kor "%s: thread %ldì˜ ê°•ì œ 종료 user: '%-.48s'\n"
+ nor "%s: Påtvinget avslutning av tråd %ld bruker: '%-.48s'\n"
+ norwegian-ny "%s: Påtvinga avslutning av tråd %ld brukar: '%-.48s'\n"
+ pol "%s: Wymuszenie zamknięcia w?tku %ld użytkownik: '%-.48s'\n"
+ por "%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'\n"
+ rum "%s: Terminare fortata a thread-ului %ld utilizatorului: '%-.48s'\n"
+ rus "%s: Принудительно закрываем поток %ld пользователÑ: '%-.48s'\n"
+ serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'\n"
+ slo "%s: násilné ukonÄenie vlákna %ld užívateľa '%-.48s'\n"
+ spa "%s: Forzando a cerrar el thread %ld usuario: '%-.48s'\n"
+ swe "%s: Stänger av tråd %ld; användare: '%-.48s'\n"
+ ukr "%s: ПриÑкорюю Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ð³Ñ–Ð»ÐºÐ¸ %ld кориÑтувача: '%-.48s'\n"
+ER_IPSOCK_ERROR 08S01
+ cze "Nemohu vytvo-Břit IP socket"
+ dan "Kan ikke oprette IP socket"
+ nla "Kan IP-socket niet openen"
+ eng "Can't create IP socket"
+ jps "IP socket ãŒä½œã‚Œã¾ã›ã‚“",
+ est "Ei suuda luua IP socketit"
+ fre "Ne peut créer la connexion IP (socket)"
+ ger "Kann IP-Socket nicht erzeugen"
+ greek "Δεν είναι δυνατή η δημιουÏγία IP socket"
+ hun "Az IP socket nem hozhato letre"
+ ita "Impossibile creare il socket IP"
+ jpn "IP socket ãŒä½œã‚Œã¾ã›ã‚“"
+ kor "IP ì†Œì¼“ì„ ë§Œë“¤ì§€ 못했습니다."
+ nor "Kan ikke opprette IP socket"
+ norwegian-ny "Kan ikkje opprette IP socket"
+ pol "Nie można stworzyć socket'u IP"
+ por "Não pode criar o soquete IP"
+ rum "Nu pot crea IP socket"
+ rus "Ðевозможно Ñоздать IP-Ñокет"
+ serbian "Ne mogu da kreiram IP socket"
+ slo "Nemôžem vytvoriť IP socket"
+ spa "No puedo crear IP socket"
+ swe "Kan inte skapa IP-socket"
+ ukr "Ðе можу Ñтворити IP роз'єм"
+ER_NO_SUCH_INDEX 42S12 S1009
+ cze "Tabulka '%-.192s' nem-Bá index odpovídající CREATE INDEX. Vytvořte tabulku znovu"
+ dan "Tabellen '%-.192s' har ikke den nøgle, som blev brugt i CREATE INDEX. Genopret tabellen"
+ nla "Tabel '%-.192s' heeft geen INDEX zoals deze gemaakt worden met CREATE INDEX. Maak de tabel opnieuw"
+ eng "Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table"
+ jps "Table '%-.192s' ã¯ãã®ã‚ˆã†ãª index ã‚’æŒã£ã¦ã„ã¾ã›ã‚“(CREATE INDEX 実行時ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“). テーブルを作り直ã—ã¦ãã ã•ã„",
+ est "Tabelil '%-.192s' puuduvad võtmed. Loo tabel uuesti"
+ fre "La table '%-.192s' n'a pas d'index comme celle utilisée dans CREATE INDEX. Recréez la table"
+ ger "Tabelle '%-.192s' besitzt keinen wie den in CREATE INDEX verwendeten Index. Tabelle neu anlegen"
+ greek "Ο πίνακας '%-.192s' δεν έχει ευÏετήÏιο (index) σαν αυτό που χÏησιμοποιείτε στην CREATE INDEX. ΠαÏακαλώ, ξαναδημιουÏγήστε τον πίνακα"
+ hun "A(z) '%-.192s' tablahoz nincs meg a CREATE INDEX altal hasznalt index. Alakitsa at a tablat"
+ ita "La tabella '%-.192s' non ha nessun indice come quello specificatato dalla CREATE INDEX. Ricrea la tabella"
+ jpn "Table '%-.192s' ã¯ãã®ã‚ˆã†ãª index ã‚’æŒã£ã¦ã„ã¾ã›ã‚“(CREATE INDEX 実行時ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“). テーブルを作り直ã—ã¦ãã ã•ã„"
+ kor "í…Œì´ë¸” '%-.192s'는 ì¸ë±ìŠ¤ë¥¼ 만들지 않았습니다. alter í…Œì´ë¸”ëª…ë ¹ì„ ì´ìš©í•˜ì—¬ í…Œì´ë¸”ì„ ìˆ˜ì •í•˜ì„¸ìš”..."
+ nor "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Gjenopprett tabellen"
+ norwegian-ny "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Oprett tabellen på nytt"
+ pol "Tabela '%-.192s' nie ma indeksu takiego jak w CREATE INDEX. Stwórz tabelę"
+ por "Tabela '%-.192s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela"
+ rum "Tabela '%-.192s' nu are un index ca acela folosit in CREATE INDEX. Re-creeaza tabela"
+ rus "Ð’ таблице '%-.192s' нет такого индекÑа, как в CREATE INDEX. Создайте таблицу заново"
+ serbian "Tabela '%-.192s' nema isti indeks kao onaj upotrebljen pri komandi 'CREATE INDEX'. Napravite tabelu ponovo"
+ slo "Tabuľka '%-.192s' nemá index zodpovedajúci CREATE INDEX. Vytvorte tabulku znova"
+ spa "La tabla '%-.192s' no tiene indice como el usado en CREATE INDEX. Crea de nuevo la tabla"
+ swe "Tabellen '%-.192s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' має індекÑ, що не Ñпівпадає з вказанним у CREATE INDEX. Створіть таблицю знову"
+ER_WRONG_FIELD_TERMINATORS 42000 S1009
+ cze "Argument separ-Bátoru položek nebyl oÄekáván. PÅ™eÄtÄ›te si manuál"
+ dan "Felt adskiller er ikke som forventet, se dokumentationen"
+ nla "De argumenten om velden te scheiden zijn anders dan verwacht. Raadpleeg de handleiding"
+ eng "Field separator argument is not what is expected; check the manual"
+ est "Väljade eraldaja erineb oodatust. Tutvu kasutajajuhendiga"
+ fre "Séparateur de champs inconnu. Vérifiez dans le manuel"
+ ger "Feldbegrenzer-Argument ist nicht in der erwarteten Form. Bitte im Handbuch nachlesen"
+ greek "Ο διαχωÏιστής πεδίων δεν είναι αυτός που αναμενόταν. ΠαÏακαλώ ανατÏέξτε στο manual"
+ hun "A mezoelvalaszto argumentumok nem egyeznek meg a varttal. Nezze meg a kezikonyvben!"
+ ita "L'argomento 'Field separator' non e` quello atteso. Controlla il manuale"
+ kor "í•„ë“œ êµ¬ë¶„ìž ì¸ìˆ˜ë“¤ì´ 완전하지 않습니다. ë©”ë‰´ì–¼ì„ ì°¾ì•„ 보세요."
+ nor "Felt skiller argumentene er ikke som forventet, se dokumentasjonen"
+ norwegian-ny "Felt skiljer argumenta er ikkje som venta, sjå dokumentasjonen"
+ pol "Nie oczekiwano separatora. SprawdĽ podręcznik"
+ por "Argumento separador de campos não é o esperado. Cheque o manual"
+ rum "Argumentul pentru separatorul de cimpuri este diferit de ce ma asteptam. Verifica manualul"
+ rus "Ðргумент Ñ€Ð°Ð·Ð´ÐµÐ»Ð¸Ñ‚ÐµÐ»Ñ Ð¿Ð¾Ð»ÐµÐ¹ - не тот, который ожидалÑÑ. ОбращайтеÑÑŒ к документации"
+ serbian "Argument separatora polja nije ono Å¡to se oÄekivalo. Proverite uputstvo MySQL server-a"
+ slo "Argument oddeľovaÄ polí nezodpovedá požiadavkám. Skontrolujte v manuáli"
+ spa "Los separadores de argumentos del campo no son los especificados. Comprueba el manual"
+ swe "Fältseparatorerna är vad som förväntades. Kontrollera mot manualen"
+ ukr "Хибний розділювач полів. Почитайте документацію"
+ER_BLOBS_AND_NO_TERMINATED 42000 S1009
+ cze "Nen-Bí možné použít pevný rowlength s BLOBem. Použijte 'fields terminated by'."
+ dan "Man kan ikke bruge faste feltlængder med BLOB. Brug i stedet 'fields terminated by'."
+ nla "Bij het gebruik van BLOBs is het niet mogelijk om vaste rijlengte te gebruiken. Maak s.v.p. gebruik van 'fields terminated by'."
+ eng "You can't use fixed rowlength with BLOBs; please use 'fields terminated by'"
+ est "BLOB-tüüpi väljade olemasolul ei saa kasutada fikseeritud väljapikkust. Vajalik 'fields terminated by' määrang."
+ fre "Vous ne pouvez utiliser des lignes de longueur fixe avec des BLOBs. Utiliser 'fields terminated by'."
+ ger "Eine feste Zeilenlänge kann für BLOB-Felder nicht verwendet werden. Bitte 'fields terminated by' verwenden"
+ greek "Δεν μποÏείτε να χÏησιμοποιήσετε fixed rowlength σε BLOBs. ΠαÏακαλώ χÏησιμοποιείστε 'fields terminated by'."
+ hun "Fix hosszusagu BLOB-ok nem hasznalhatok. Hasznalja a 'mezoelvalaszto jelet' ."
+ ita "Non possono essere usate righe a lunghezza fissa con i BLOB. Usa 'FIELDS TERMINATED BY'."
+ jpn "You can't use fixed rowlength with BLOBs; please use 'fields terminated by'."
+ kor "BLOB로는 고정길ì´ì˜ lowlength를 사용할 수 없습니다. 'fields terminated by'를 사용하세요."
+ nor "En kan ikke bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'."
+ norwegian-ny "Ein kan ikkje bruke faste feltlengder med BLOB. Vennlisgt bruk 'fields terminated by'."
+ pol "Nie można użyć stałej długo?ci wiersza z polami typu BLOB. Użyj 'fields terminated by'."
+ por "Você não pode usar comprimento de linha fixo com BLOBs. Por favor, use campos com comprimento limitado."
+ rum "Nu poti folosi lungime de cimp fix pentru BLOB-uri. Foloseste 'fields terminated by'."
+ rus "ФикÑированный размер запиÑи Ñ Ð¿Ð¾Ð»Ñми типа BLOB иÑпользовать нельзÑ, применÑйте 'fields terminated by'"
+ serbian "Ne možete koristiti fiksnu veliÄinu sloga kada imate BLOB polja. Molim koristite 'fields terminated by' opciju."
+ slo "Nie je možné použiť fixnú dĺžku s BLOBom. Použite 'fields terminated by'."
+ spa "No puedes usar longitudes de filas fijos con BLOBs. Por favor usa 'campos terminados por '."
+ swe "Man kan inte använda fast radlängd med blobs. Använd 'fields terminated by'"
+ ukr "Ðе можна викориÑтовувати Ñталу довжину Ñтроки з BLOB. ЗкориÑтайтеÑÑ 'fields terminated by'"
+ER_TEXTFILE_NOT_READABLE
+ cze "Soubor '%-.128s' mus-Bí být v adresáři databáze nebo Äitelný pro vÅ¡echny"
+ dan "Filen '%-.128s' skal være i database-folderen og kunne læses af alle"
+ nla "Het bestand '%-.128s' dient in de database directory voor the komen of leesbaar voor iedereen te zijn."
+ eng "The file '%-.128s' must be in the database directory or be readable by all"
+ jps "ファイル '%-.128s' 㯠databse ã® directory ã«ã‚ã‚‹ã‹å…¨ã¦ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒèª­ã‚るよã†ã«è¨±å¯ã•ã‚Œã¦ã„ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“.",
+ est "Fail '%-.128s' peab asuma andmebaasi kataloogis või olema kõigile loetav"
+ fre "Le fichier '%-.128s' doit être dans le répertoire de la base et lisible par tous"
+ ger "Datei '%-.128s' muss im Datenbank-Verzeichnis vorhanden oder lesbar für alle sein"
+ greek "Το αÏχείο '%-.128s' Ï€Ïέπει να υπάÏχει στο database directory ή να μποÏεί να διαβαστεί από όλους"
+ hun "A(z) '%-.128s'-nak az adatbazis konyvtarban kell lennie, vagy mindenki szamara olvashatonak"
+ ita "Il file '%-.128s' deve essere nella directory del database e deve essere leggibile da tutti"
+ jpn "ファイル '%-.128s' 㯠databse ã® directory ã«ã‚ã‚‹ã‹å…¨ã¦ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒèª­ã‚るよã†ã«è¨±å¯ã•ã‚Œã¦ã„ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“."
+ kor "'%-.128s' í™”ì¼ëŠ” ë°ì´íƒ€ë² ì´ìŠ¤ ë””ë ‰í† ë¦¬ì— ì¡´ìž¬í•˜ê±°ë‚˜ 모ë‘ì—게 ì½ê¸° 가능하여야 합니다."
+ nor "Filen '%-.128s' må være i database-katalogen for å være lesbar for alle"
+ norwegian-ny "Filen '%-.128s' må være i database-katalogen for å være lesbar for alle"
+ pol "Plik '%-.128s' musi znajdować sie w katalogu bazy danych lub mieć prawa czytania przez wszystkich"
+ por "Arquivo '%-.128s' tem que estar no diretório do banco de dados ou ter leitura possível para todos"
+ rum "Fisierul '%-.128s' trebuie sa fie in directorul bazei de data sau trebuie sa poata sa fie citit de catre toata lumea (verifica permisiile)"
+ rus "Файл '%-.128s' должен находитьÑÑ Ð² том же каталоге, что и база данных, или быть общедоÑтупным Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ"
+ serbian "File '%-.128s' mora biti u direktorijumu gde su file-ovi baze i mora imati odgovarajuća prava pristupa"
+ slo "Súbor '%-.128s' musí byÅ¥ v adresári databázy, alebo Äitateľný pre vÅ¡etkých"
+ spa "El archivo '%-.128s' debe estar en el directorio de la base de datos o ser de lectura por todos"
+ swe "Textfilen '%-.128s' måste finnas i databasbiblioteket eller vara läsbar för alla"
+ ukr "Файл '%-.128s' повинен бути у теці бази данних або мати вÑтановлене право на Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð´Ð»Ñ ÑƒÑÑ–Ñ…"
+ER_FILE_EXISTS_ERROR
+ cze "Soubor '%-.200s' ji-Bž existuje"
+ dan "Filen '%-.200s' eksisterer allerede"
+ nla "Het bestand '%-.200s' bestaat reeds"
+ eng "File '%-.200s' already exists"
+ jps "File '%-.200s' ã¯æ—¢ã«å­˜åœ¨ã—ã¾ã™",
+ est "Fail '%-.200s' juba eksisteerib"
+ fre "Le fichier '%-.200s' existe déjà"
+ ger "Datei '%-.200s' bereits vorhanden"
+ greek "Το αÏχείο '%-.200s' υπάÏχει ήδη"
+ hun "A '%-.200s' file mar letezik."
+ ita "Il file '%-.200s' esiste gia`"
+ jpn "File '%-.200s' ã¯æ—¢ã«å­˜åœ¨ã—ã¾ã™"
+ kor "'%-.200s' í™”ì¼ì€ ì´ë¯¸ 존재합니다."
+ nor "Filen '%-.200s' eksisterte allerede"
+ norwegian-ny "Filen '%-.200s' eksisterte allereide"
+ pol "Plik '%-.200s' już istnieje"
+ por "Arquivo '%-.200s' já existe"
+ rum "Fisierul '%-.200s' exista deja"
+ rus "Файл '%-.200s' уже ÑущеÑтвует"
+ serbian "File '%-.200s' već postoji"
+ slo "Súbor '%-.200s' už existuje"
+ spa "El archivo '%-.200s' ya existe"
+ swe "Filen '%-.200s' existerar redan"
+ ukr "Файл '%-.200s' вже Ñ–Ñнує"
+ER_LOAD_INFO
+ cze "Z-Báznamů: %ld Vymazáno: %ld PÅ™eskoÄeno: %ld Varování: %ld"
+ dan "Poster: %ld Fjernet: %ld Sprunget over: %ld Advarsler: %ld"
+ nla "Records: %ld Verwijderd: %ld Overgeslagen: %ld Waarschuwingen: %ld"
+ eng "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld"
+ jps "レコード数: %ld 削除: %ld Skipped: %ld Warnings: %ld",
+ est "Kirjeid: %ld Kustutatud: %ld Vahele jäetud: %ld Hoiatusi: %ld"
+ fre "Enregistrements: %ld Effacés: %ld Non traités: %ld Avertissements: %ld"
+ ger "Datensätze: %ld Gelöscht: %ld Ausgelassen: %ld Warnungen: %ld"
+ greek "ΕγγÏαφές: %ld ΔιαγÏαφές: %ld ΠαÏεκάμφθησαν: %ld ΠÏοειδοποιήσεις: %ld"
+ hun "Rekordok: %ld Torolve: %ld Skipped: %ld Warnings: %ld"
+ ita "Records: %ld Cancellati: %ld Saltati: %ld Avvertimenti: %ld"
+ jpn "レコード数: %ld 削除: %ld Skipped: %ld Warnings: %ld"
+ kor "레코드: %ld개 삭제: %ld개 스킵: %ld개 경고: %ld개"
+ nor "Poster: %ld Fjernet: %ld Hoppet over: %ld Advarsler: %ld"
+ norwegian-ny "Poster: %ld Fjerna: %ld Hoppa over: %ld Ã…tvaringar: %ld"
+ pol "Recordów: %ld Usuniętych: %ld Pominiętych: %ld Ostrzeżeń: %ld"
+ por "Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld"
+ rum "Recorduri: %ld Sterse: %ld Sarite (skipped): %ld Atentionari (warnings): %ld"
+ rus "ЗапиÑей: %ld Удалено: %ld Пропущено: %ld Предупреждений: %ld"
+ serbian "Slogova: %ld Izbrisano: %ld PreskoÄeno: %ld Upozorenja: %ld"
+ slo "Záznamov: %ld Zmazaných: %ld PreskoÄených: %ld Varovania: %ld"
+ spa "Registros: %ld Borrados: %ld Saltados: %ld Peligros: %ld"
+ swe "Rader: %ld Bortagna: %ld Dubletter: %ld Varningar: %ld"
+ ukr "ЗапиÑів: %ld Видалено: %ld Пропущено: %ld ЗаÑтережень: %ld"
+ER_ALTER_INFO
+ cze "Z-Báznamů: %ld Zdvojených: %ld"
+ dan "Poster: %ld Ens: %ld"
+ nla "Records: %ld Dubbel: %ld"
+ eng "Records: %ld Duplicates: %ld"
+ jps "レコード数: %ld é‡è¤‡: %ld",
+ est "Kirjeid: %ld Kattuvaid: %ld"
+ fre "Enregistrements: %ld Doublons: %ld"
+ ger "Datensätze: %ld Duplikate: %ld"
+ greek "ΕγγÏαφές: %ld Επαναλήψεις: %ld"
+ hun "Rekordok: %ld Duplikalva: %ld"
+ ita "Records: %ld Duplicati: %ld"
+ jpn "レコード数: %ld é‡è¤‡: %ld"
+ kor "레코드: %ld개 중복: %ld개"
+ nor "Poster: %ld Like: %ld"
+ norwegian-ny "Poster: %ld Like: %ld"
+ pol "Rekordów: %ld Duplikatów: %ld"
+ por "Registros: %ld - Duplicados: %ld"
+ rum "Recorduri: %ld Duplicate: %ld"
+ rus "ЗапиÑей: %ld Дубликатов: %ld"
+ serbian "Slogova: %ld Duplikata: %ld"
+ slo "Záznamov: %ld Opakovaných: %ld"
+ spa "Registros: %ld Duplicados: %ld"
+ swe "Rader: %ld Dubletter: %ld"
+ ukr "ЗапиÑів: %ld Дублікатів: %ld"
+ER_WRONG_SUB_KEY
+ cze "Chybn-Bá podÄást klíÄe -- není to Å™etÄ›zec nebo je delší než délka Äásti klíÄe"
+ dan "Forkert indeksdel. Den anvendte nøgledel er ikke en streng eller længden er større end nøglelængden"
+ nla "Foutief sub-gedeelte van de zoeksleutel. De gebruikte zoeksleutel is geen onderdeel van een string of of de gebruikte lengte is langer dan de zoeksleutel"
+ eng "Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys"
+ est "Vigane võtme osa. Kasutatud võtmeosa ei ole string tüüpi, määratud pikkus on pikem kui võtmeosa või tabelihandler ei toeta seda tüüpi võtmeid"
+ fre "Mauvaise sous-clef. Ce n'est pas un 'string' ou la longueur dépasse celle définie dans la clef"
+ ger "Falscher Unterteilschlüssel. Der verwendete Schlüsselteil ist entweder kein String, die verwendete Länge ist länger als der Teilschlüssel oder die Speicher-Engine unterstützt keine Unterteilschlüssel"
+ greek "Εσφαλμένο sub part key. Το χÏησιμοποιοÏμενο key part δεν είναι string ή το μήκος του είναι μεγαλÏτεÏο"
+ hun "Rossz alkulcs. A hasznalt kulcsresz nem karaktersorozat vagy hosszabb, mint a kulcsresz"
+ ita "Sotto-parte della chiave errata. La parte di chiave utilizzata non e` una stringa o la lunghezza e` maggiore della parte di chiave."
+ jpn "Incorrect prefix key; the used key part isn't a string or the used length is longer than the key part"
+ kor "부정확한 서버 파트 키. ì‚¬ìš©ëœ í‚¤ 파트가 스트ë§ì´ 아니거나 키 íŒŒíŠ¸ì˜ ê¸¸ì´ê°€ 너무 ê¹ë‹ˆë‹¤."
+ nor "Feil delnøkkel. Den brukte delnøkkelen er ikke en streng eller den oppgitte lengde er lengre enn nøkkel lengden"
+ norwegian-ny "Feil delnykkel. Den brukte delnykkelen er ikkje ein streng eller den oppgitte lengda er lengre enn nykkellengden"
+ pol "Błędna podczę?ć klucza. Użyta czę?ć klucza nie jest łańcuchem lub użyta długo?ć jest większa niż czę?ć klucza"
+ por "Sub parte da chave incorreta. A parte da chave usada não é uma 'string' ou o comprimento usado é maior que parte da chave ou o manipulador de tabelas não suporta sub chaves únicas"
+ rum "Componentul cheii este incorrect. Componentul folosit al cheii nu este un sir sau lungimea folosita este mai lunga decit lungimea cheii"
+ rus "ÐÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ñ‡Ð°ÑÑ‚ÑŒ ключа. ИÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ñ‡Ð°ÑÑ‚ÑŒ ключа не ÑвлÑетÑÑ Ñтрокой, ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð°Ñ Ð´Ð»Ð¸Ð½Ð° больше, чем длина чаÑти ключа, или обработчик таблицы не поддерживает уникальные чаÑти ключа"
+ serbian "PogreÅ¡an pod-kljuÄ dela kljuÄa. Upotrebljeni deo kljuÄa nije string, upotrebljena dužina je veća od dela kljuÄa ili handler tabela ne podržava jedinstvene pod-kljuÄeve"
+ slo "Incorrect prefix key; the used key part isn't a string or the used length is longer than the key part"
+ spa "Parte de la clave es erronea. Una parte de la clave no es una cadena o la longitud usada es tan grande como la parte de la clave"
+ swe "Felaktig delnyckel. Nyckeldelen är inte en sträng eller den angivna längden är längre än kolumnlängden"
+ ukr "Ðевірна чаÑтина ключа. ВикориÑтана чаÑтина ключа не Ñ” Ñтрокою, задовга або вказівник таблиці не підтримує унікальних чаÑтин ключей"
+ER_CANT_REMOVE_ALL_FIELDS 42000
+ cze "Nen-Bí možné vymazat všechny položky s ALTER TABLE. Použijte DROP TABLE"
+ dan "Man kan ikke slette alle felter med ALTER TABLE. Brug DROP TABLE i stedet."
+ nla "Het is niet mogelijk alle velden te verwijderen met ALTER TABLE. Gebruik a.u.b. DROP TABLE hiervoor!"
+ eng "You can't delete all columns with ALTER TABLE; use DROP TABLE instead"
+ jps "ALTER TABLE ã§å…¨ã¦ã® column ã¯å‰Šé™¤ã§ãã¾ã›ã‚“. DROP TABLE を使用ã—ã¦ãã ã•ã„",
+ est "ALTER TABLE kasutades ei saa kustutada kõiki tulpasid. Kustuta tabel DROP TABLE abil"
+ fre "Vous ne pouvez effacer tous les champs avec ALTER TABLE. Utilisez DROP TABLE"
+ ger "Mit ALTER TABLE können nicht alle Felder auf einmal gelöscht werden. Dafür DROP TABLE verwenden"
+ greek "Δεν είναι δυνατή η διαγÏαφή όλων των πεδίων με ALTER TABLE. ΠαÏακαλώ χÏησιμοποιείστε DROP TABLE"
+ hun "Az osszes mezo nem torolheto az ALTER TABLE-lel. Hasznalja a DROP TABLE-t helyette"
+ ita "Non si possono cancellare tutti i campi con una ALTER TABLE. Utilizzare DROP TABLE"
+ jpn "ALTER TABLE ã§å…¨ã¦ã® column ã¯å‰Šé™¤ã§ãã¾ã›ã‚“. DROP TABLE を使用ã—ã¦ãã ã•ã„"
+ kor "ALTER TABLE 명령으로는 모든 ì¹¼ëŸ¼ì„ ì§€ìš¸ 수 없습니다. DROP TABLE ëª…ë ¹ì„ ì´ìš©í•˜ì„¸ìš”."
+ nor "En kan ikke slette alle felt med ALTER TABLE. Bruk DROP TABLE isteden."
+ norwegian-ny "Ein kan ikkje slette alle felt med ALTER TABLE. Bruk DROP TABLE istadenfor."
+ pol "Nie można usun?ć wszystkich pól wykorzystuj?c ALTER TABLE. W zamian użyj DROP TABLE"
+ por "Você não pode deletar todas as colunas com ALTER TABLE; use DROP TABLE em seu lugar"
+ rum "Nu poti sterge toate coloanele cu ALTER TABLE. Foloseste DROP TABLE in schimb"
+ rus "ÐÐµÐ»ÑŒÐ·Ñ ÑƒÐ´Ð°Ð»Ð¸Ñ‚ÑŒ вÑе Ñтолбцы Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ ALTER TABLE. ИÑпользуйте DROP TABLE"
+ serbian "Ne možete da izbrišete sve kolone pomoću komande 'ALTER TABLE'. Upotrebite komandu 'DROP TABLE' ako želite to da uradite"
+ slo "One nemôžem zmazať all fields with ALTER TABLE; use DROP TABLE instead"
+ spa "No puede borrar todos los campos con ALTER TABLE. Usa DROP TABLE para hacerlo"
+ swe "Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället"
+ ukr "Ðе можливо видалити вÑÑ– Ñтовбці за допомогою ALTER TABLE. Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ÑкориÑтайтеÑÑ DROP TABLE"
+ER_CANT_DROP_FIELD_OR_KEY 42000
+ cze "Nemohu zru-BÅ¡it '%-.192s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíÄe"
+ dan "Kan ikke udføre DROP '%-.192s'. Undersøg om feltet/nøglen eksisterer."
+ nla "Kan '%-.192s' niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat."
+ eng "Can't DROP '%-.192s'; check that column/key exists"
+ jps "'%-.192s' を破棄ã§ãã¾ã›ã‚“ã§ã—ãŸ; check that column/key exists",
+ est "Ei suuda kustutada '%-.192s'. Kontrolli kas tulp/võti eksisteerib"
+ fre "Ne peut effacer (DROP) '%-.192s'. Vérifiez s'il existe"
+ ger "Kann '%-.192s' nicht löschen. Existiert die Spalte oder der Schlüssel?"
+ greek "ΑδÏνατη η διαγÏαφή (DROP) '%-.192s'. ΠαÏακαλώ ελέγξτε αν το πεδίο/κλειδί υπάÏχει"
+ hun "A DROP '%-.192s' nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e"
+ ita "Impossibile cancellare '%-.192s'. Controllare che il campo chiave esista"
+ jpn "'%-.192s' を破棄ã§ãã¾ã›ã‚“ã§ã—ãŸ; check that column/key exists"
+ kor "'%-.192s'를 DROPí•  수 없습니다. 칼럼ì´ë‚˜ 키가 존재하는지 채í¬í•˜ì„¸ìš”."
+ nor "Kan ikke DROP '%-.192s'. Undersøk om felt/nøkkel eksisterer."
+ norwegian-ny "Kan ikkje DROP '%-.192s'. Undersøk om felt/nøkkel eksisterar."
+ pol "Nie można wykonać operacji DROP '%-.192s'. SprawdĽ, czy to pole/klucz istnieje"
+ por "Não se pode fazer DROP '%-.192s'. Confira se esta coluna/chave existe"
+ rum "Nu pot sa DROP '%-.192s'. Verifica daca coloana/cheia exista"
+ rus "Ðевозможно удалить (DROP) '%-.192s'. УбедитеÑÑŒ что Ñтолбец/ключ дейÑтвительно ÑущеÑтвует"
+ serbian "Ne mogu da izvrÅ¡im komandu drop 'DROP' na '%-.192s'. Proverite da li ta kolona (odnosno kljuÄ) postoji"
+ slo "Nemôžem zruÅ¡iÅ¥ (DROP) '%-.192s'. Skontrolujte, Äi neexistujú záznamy/kľúÄe"
+ spa "No puedo ELIMINAR '%-.192s'. compuebe que el campo/clave existe"
+ swe "Kan inte ta bort '%-.192s'. Kontrollera att fältet/nyckel finns"
+ ukr "Ðе можу DROP '%-.192s'. Перевірте, чи цей Ñтовбець/ключ Ñ–Ñнує"
+ER_INSERT_INFO
+ cze "Z-Báznamů: %ld Zdvojených: %ld Varování: %ld"
+ dan "Poster: %ld Ens: %ld Advarsler: %ld"
+ nla "Records: %ld Dubbel: %ld Waarschuwing: %ld"
+ eng "Records: %ld Duplicates: %ld Warnings: %ld"
+ jps "レコード数: %ld é‡è¤‡æ•°: %ld Warnings: %ld",
+ est "Kirjeid: %ld Kattuvaid: %ld Hoiatusi: %ld"
+ fre "Enregistrements: %ld Doublons: %ld Avertissements: %ld"
+ ger "Datensätze: %ld Duplikate: %ld Warnungen: %ld"
+ greek "ΕγγÏαφές: %ld Επαναλήψεις: %ld ΠÏοειδοποιήσεις: %ld"
+ hun "Rekordok: %ld Duplikalva: %ld Warnings: %ld"
+ ita "Records: %ld Duplicati: %ld Avvertimenti: %ld"
+ jpn "レコード数: %ld é‡è¤‡æ•°: %ld Warnings: %ld"
+ kor "레코드: %ld개 중복: %ld개 경고: %ld개"
+ nor "Poster: %ld Like: %ld Advarsler: %ld"
+ norwegian-ny "Postar: %ld Like: %ld Ã…tvaringar: %ld"
+ pol "Rekordów: %ld Duplikatów: %ld Ostrzeżeń: %ld"
+ por "Registros: %ld - Duplicados: %ld - Avisos: %ld"
+ rum "Recorduri: %ld Duplicate: %ld Atentionari (warnings): %ld"
+ rus "ЗапиÑей: %ld Дубликатов: %ld Предупреждений: %ld"
+ serbian "Slogova: %ld Duplikata: %ld Upozorenja: %ld"
+ slo "Záznamov: %ld Opakovaných: %ld Varovania: %ld"
+ spa "Registros: %ld Duplicados: %ld Peligros: %ld"
+ swe "Rader: %ld Dubletter: %ld Varningar: %ld"
+ ukr "ЗапиÑів: %ld Дублікатів: %ld ЗаÑтережень: %ld"
+ER_UPDATE_TABLE_USED
+ eng "You can't specify target table '%-.192s' for update in FROM clause"
+ ger "Die Verwendung der zu aktualisierenden Zieltabelle '%-.192s' ist in der FROM-Klausel nicht zulässig."
+ rus "Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ таблицы '%-.192s' в ÑпиÑке таблиц FROM Ð´Ð»Ñ Ð²Ð½ÐµÑÐµÐ½Ð¸Ñ Ð² нее изменений"
+ swe "INSERT-table '%-.192s' får inte finnas i FROM tabell-listan"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' що змінюєтьÑÑ Ð½Ðµ дозволена у переліку таблиць FROM"
+ER_NO_SUCH_THREAD
+ cze "Nezn-Bámá identifikace threadu: %lu"
+ dan "Ukendt tråd id: %lu"
+ nla "Onbekend thread id: %lu"
+ eng "Unknown thread id: %lu"
+ jps "thread id: %lu ã¯ã‚ã‚Šã¾ã›ã‚“",
+ est "Tundmatu lõim: %lu"
+ fre "Numéro de tâche inconnu: %lu"
+ ger "Unbekannte Thread-ID: %lu"
+ greek "Αγνωστο thread id: %lu"
+ hun "Ervenytelen szal (thread) id: %lu"
+ ita "Thread id: %lu sconosciuto"
+ jpn "thread id: %lu ã¯ã‚ã‚Šã¾ã›ã‚“"
+ kor "알수 없는 쓰레드 id: %lu"
+ nor "Ukjent tråd id: %lu"
+ norwegian-ny "Ukjent tråd id: %lu"
+ pol "Nieznany identyfikator w?tku: %lu"
+ por "'Id' de 'thread' %lu desconhecido"
+ rum "Id-ul: %lu thread-ului este necunoscut"
+ rus "ÐеизвеÑтный номер потока: %lu"
+ serbian "Nepoznat thread identifikator: %lu"
+ slo "Neznáma identifikácia vlákna: %lu"
+ spa "Identificador del thread: %lu desconocido"
+ swe "Finns ingen tråd med id %lu"
+ ukr "Ðевідомий ідентифікатор гілки: %lu"
+ER_KILL_DENIED_ERROR
+ cze "Nejste vlastn-Bíkem threadu %lu"
+ dan "Du er ikke ejer af tråden %lu"
+ nla "U bent geen bezitter van thread %lu"
+ eng "You are not owner of thread %lu"
+ jps "thread %lu ã®ã‚ªãƒ¼ãƒŠãƒ¼ã§ã¯ã‚ã‚Šã¾ã›ã‚“",
+ est "Ei ole lõime %lu omanik"
+ fre "Vous n'êtes pas propriétaire de la tâche no: %lu"
+ ger "Sie sind nicht Eigentümer von Thread %lu"
+ greek "Δεν είσθε owner του thread %lu"
+ hun "A %lu thread-nek mas a tulajdonosa"
+ ita "Utente non proprietario del thread %lu"
+ jpn "thread %lu ã®ã‚ªãƒ¼ãƒŠãƒ¼ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+ kor "쓰레드(Thread) %luì˜ ì†Œìœ ìžê°€ 아닙니다."
+ nor "Du er ikke eier av tråden %lu"
+ norwegian-ny "Du er ikkje eigar av tråd %lu"
+ pol "Nie jeste? wła?cicielem w?tku %lu"
+ por "Você não é proprietário da 'thread' %lu"
+ rum "Nu sinteti proprietarul threadului %lu"
+ rus "Ð’Ñ‹ не ÑвлÑетеÑÑŒ владельцем потока %lu"
+ serbian "Vi niste vlasnik thread-a %lu"
+ slo "Nie ste vlastníkom vlákna %lu"
+ spa "Tu no eres el propietario del thread%lu"
+ swe "Du är inte ägare till tråd %lu"
+ ukr "Ви не володар гілки %lu"
+ER_NO_TABLES_USED
+ cze "Nejsou pou-Bžity žádné tabulky"
+ dan "Ingen tabeller i brug"
+ nla "Geen tabellen gebruikt."
+ eng "No tables used"
+ est "Ãœhtegi tabelit pole kasutusel"
+ fre "Aucune table utilisée"
+ ger "Keine Tabellen verwendet"
+ greek "Δεν χÏησιμοποιήθηκαν πίνακες"
+ hun "Nincs hasznalt tabla"
+ ita "Nessuna tabella usata"
+ kor "ì–´ë–¤ í…Œì´ë¸”ë„ ì‚¬ìš©ë˜ì§€ 않았습니다."
+ nor "Ingen tabeller i bruk"
+ norwegian-ny "Ingen tabellar i bruk"
+ pol "Nie ma żadej użytej tabeli"
+ por "Nenhuma tabela usada"
+ rum "Nici o tabela folosita"
+ rus "Ðикакие таблицы не иÑпользованы"
+ serbian "Nema upotrebljenih tabela"
+ slo "Nie je použitá žiadna tabuľka"
+ spa "No ha tablas usadas"
+ swe "Inga tabeller angivna"
+ ukr "Ðе викориÑтано таблиць"
+ER_TOO_BIG_SET
+ cze "P-Bříliš mnoho řetězců pro sloupec %-.192s a SET"
+ dan "For mange tekststrenge til specifikationen af SET i kolonne %-.192s"
+ nla "Teveel strings voor kolom %-.192s en SET"
+ eng "Too many strings for column %-.192s and SET"
+ est "Liiga palju string tulbale %-.192s tüübile SET"
+ fre "Trop de chaînes dans la colonne %-.192s avec SET"
+ ger "Zu viele Strings für Feld %-.192s und SET angegeben"
+ greek "ΠάÏα πολλά strings για το πεδίο %-.192s και SET"
+ hun "Tul sok karakter: %-.192s es SET"
+ ita "Troppe stringhe per la colonna %-.192s e la SET"
+ kor "칼럼 %-.192s와 SETì—ì„œ 스트ë§ì´ 너무 많습니다."
+ nor "For mange tekststrenger kolonne %-.192s og SET"
+ norwegian-ny "For mange tekststrengar felt %-.192s og SET"
+ pol "Zbyt wiele łańcuchów dla kolumny %-.192s i polecenia SET"
+ por "'Strings' demais para coluna '%-.192s' e SET"
+ rum "Prea multe siruri pentru coloana %-.192s si SET"
+ rus "Слишком много значений Ð´Ð»Ñ Ñтолбца %-.192s в SET"
+ serbian "Previše string-ova za kolonu '%-.192s' i komandu 'SET'"
+ slo "Príliš mnoho reťazcov pre pole %-.192s a SET"
+ spa "Muchas strings para columna %-.192s y SET"
+ swe "För många alternativ till kolumn %-.192s för SET"
+ ukr "Забагато Ñтрок Ð´Ð»Ñ ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ %-.192s та SET"
+ER_NO_UNIQUE_LOGFILE
+ cze "Nemohu vytvo-BÅ™it jednoznaÄné jméno logovacího souboru %-.200s.(1-999)\n"
+ dan "Kan ikke lave unikt log-filnavn %-.200s.(1-999)\n"
+ nla "Het is niet mogelijk een unieke naam te maken voor de logfile %-.200s.(1-999)\n"
+ eng "Can't generate a unique log-filename %-.200s.(1-999)\n"
+ est "Ei suuda luua unikaalset logifaili nime %-.200s.(1-999)\n"
+ fre "Ne peut générer un unique nom de journal %-.200s.(1-999)\n"
+ ger "Kann keinen eindeutigen Dateinamen für die Logdatei %-.200s(1-999) erzeugen\n"
+ greek "ΑδÏνατη η δημιουÏγία unique log-filename %-.200s.(1-999)\n"
+ hun "Egyedi log-filenev nem generalhato: %-.200s.(1-999)\n"
+ ita "Impossibile generare un nome del file log unico %-.200s.(1-999)\n"
+ kor "Unique ë¡œê·¸í™”ì¼ '%-.200s'를 만들수 없습니다.(1-999)\n"
+ nor "Kan ikke lage unikt loggfilnavn %-.200s.(1-999)\n"
+ norwegian-ny "Kan ikkje lage unikt loggfilnavn %-.200s.(1-999)\n"
+ pol "Nie można stworzyć unikalnej nazwy pliku z logiem %-.200s.(1-999)\n"
+ por "Não pode gerar um nome de arquivo de 'log' único '%-.200s'.(1-999)\n"
+ rum "Nu pot sa generez un nume de log unic %-.200s.(1-999)\n"
+ rus "Ðевозможно Ñоздать уникальное Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° журнала %-.200s.(1-999)\n"
+ serbian "Ne mogu da generišem jedinstveno ime log-file-a: '%-.200s.(1-999)'\n"
+ slo "Nemôžem vytvoriť unikátne meno log-súboru %-.200s.(1-999)\n"
+ spa "No puede crear un unico archivo log %-.200s.(1-999)\n"
+ swe "Kan inte generera ett unikt filnamn %-.200s.(1-999)\n"
+ ukr "Ðе можу згенерувати унікальне ім'Ñ log-файлу %-.200s.(1-999)\n"
+ER_TABLE_NOT_LOCKED_FOR_WRITE
+ cze "Tabulka '%-.192s' byla zam-BÄena s READ a nemůže být zmÄ›nÄ›na"
+ dan "Tabellen '%-.192s' var låst med READ lås og kan ikke opdateres"
+ nla "Tabel '%-.192s' was gelocked met een lock om te lezen. Derhalve kunnen geen wijzigingen worden opgeslagen."
+ eng "Table '%-.192s' was locked with a READ lock and can't be updated"
+ jps "Table '%-.192s' 㯠READ lock ã«ãªã£ã¦ã„ã¦ã€æ›´æ–°ã¯ã§ãã¾ã›ã‚“",
+ est "Tabel '%-.192s' on lukustatud READ lukuga ning ei ole muudetav"
+ fre "Table '%-.192s' verrouillée lecture (READ): modification impossible"
+ ger "Tabelle '%-.192s' ist mit Lesesperre versehen und kann nicht aktualisiert werden"
+ greek "Ο πίνακας '%-.192s' έχει κλειδωθεί με READ lock και δεν επιτÏέπονται αλλαγές"
+ hun "A(z) '%-.192s' tabla zarolva lett (READ lock) es nem lehet frissiteni"
+ ita "La tabella '%-.192s' e` soggetta a lock in lettura e non puo` essere aggiornata"
+ jpn "Table '%-.192s' 㯠READ lock ã«ãªã£ã¦ã„ã¦ã€æ›´æ–°ã¯ã§ãã¾ã›ã‚“"
+ kor "í…Œì´ë¸” '%-.192s'는 READ ë½ì´ 잠겨있어서 갱신할 수 없습니다."
+ nor "Tabellen '%-.192s' var låst med READ lås og kan ikke oppdateres"
+ norwegian-ny "Tabellen '%-.192s' var låst med READ lås og kan ikkje oppdaterast"
+ pol "Tabela '%-.192s' została zablokowana przez READ i nie może zostać zaktualizowana"
+ por "Tabela '%-.192s' foi travada com trava de leitura e não pode ser atualizada"
+ rum "Tabela '%-.192s' a fost locked cu un READ lock si nu poate fi actualizata"
+ rus "Таблица '%-.192s' заблокирована уровнем READ lock и не может быть изменена"
+ serbian "Tabela '%-.192s' je zakljuÄana READ lock-om; iz nje se može samo Äitati ali u nju se ne može pisati"
+ slo "Tabuľka '%-.192s' bola zamknutá s READ a nemôže byť zmenená"
+ spa "Tabla '%-.192s' fue trabada con un READ lock y no puede ser actualizada"
+ swe "Tabell '%-.192s' kan inte uppdateras emedan den är låst för läsning"
+ ukr "Таблицю '%-.192s' заблоковано тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ, тому Ñ—Ñ— не можна оновити"
+ER_TABLE_NOT_LOCKED
+ cze "Tabulka '%-.192s' nebyla zam-BÄena s LOCK TABLES"
+ dan "Tabellen '%-.192s' var ikke låst med LOCK TABLES"
+ nla "Tabel '%-.192s' was niet gelocked met LOCK TABLES"
+ eng "Table '%-.192s' was not locked with LOCK TABLES"
+ jps "Table '%-.192s' 㯠LOCK TABLES ã«ã‚ˆã£ã¦ãƒ­ãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "Tabel '%-.192s' ei ole lukustatud käsuga LOCK TABLES"
+ fre "Table '%-.192s' non verrouillée: utilisez LOCK TABLES"
+ ger "Tabelle '%-.192s' wurde nicht mit LOCK TABLES gesperrt"
+ greek "Ο πίνακας '%-.192s' δεν έχει κλειδωθεί με LOCK TABLES"
+ hun "A(z) '%-.192s' tabla nincs zarolva a LOCK TABLES-szel"
+ ita "Non e` stato impostato il lock per la tabella '%-.192s' con LOCK TABLES"
+ jpn "Table '%-.192s' 㯠LOCK TABLES ã«ã‚ˆã£ã¦ãƒ­ãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "í…Œì´ë¸” '%-.192s'는 LOCK TABLES 명령으로 잠기지 않았습니다."
+ nor "Tabellen '%-.192s' var ikke låst med LOCK TABLES"
+ norwegian-ny "Tabellen '%-.192s' var ikkje låst med LOCK TABLES"
+ pol "Tabela '%-.192s' nie została zablokowana poleceniem LOCK TABLES"
+ por "Tabela '%-.192s' não foi travada com LOCK TABLES"
+ rum "Tabela '%-.192s' nu a fost locked cu LOCK TABLES"
+ rus "Таблица '%-.192s' не была заблокирована Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ LOCK TABLES"
+ serbian "Tabela '%-.192s' nije bila zakljuÄana komandom 'LOCK TABLES'"
+ slo "Tabuľka '%-.192s' nebola zamknutá s LOCK TABLES"
+ spa "Tabla '%-.192s' no fue trabada con LOCK TABLES"
+ swe "Tabell '%-.192s' är inte låst med LOCK TABLES"
+ ukr "Таблицю '%-.192s' не було блоковано з LOCK TABLES"
+ER_BLOB_CANT_HAVE_DEFAULT 42000
+ cze "Blob polo-Bžka '%-.192s' nemůže mít defaultní hodnotu"
+ dan "BLOB feltet '%-.192s' kan ikke have en standard værdi"
+ nla "Blob veld '%-.192s' can geen standaardwaarde bevatten"
+ eng "BLOB/TEXT column '%-.192s' can't have a default value"
+ est "BLOB-tüüpi tulp '%-.192s' ei saa omada vaikeväärtust"
+ fre "BLOB '%-.192s' ne peut avoir de valeur par défaut"
+ ger "BLOB/TEXT-Feld '%-.192s' darf keinen Vorgabewert (DEFAULT) haben"
+ greek "Τα Blob πεδία '%-.192s' δεν μποÏοÏν να έχουν Ï€ÏοκαθοÏισμένες τιμές (default value)"
+ hun "A(z) '%-.192s' blob objektumnak nem lehet alapertelmezett erteke"
+ ita "Il campo BLOB '%-.192s' non puo` avere un valore di default"
+ jpn "BLOB column '%-.192s' can't have a default value"
+ kor "BLOB 칼럼 '%-.192s' 는 ë””í´íŠ¸ ê°’ì„ ê°€ì§ˆ 수 없습니다."
+ nor "Blob feltet '%-.192s' kan ikke ha en standard verdi"
+ norwegian-ny "Blob feltet '%-.192s' kan ikkje ha ein standard verdi"
+ pol "Pole typu blob '%-.192s' nie może mieć domy?lnej warto?ci"
+ por "Coluna BLOB '%-.192s' não pode ter um valor padrão (default)"
+ rum "Coloana BLOB '%-.192s' nu poate avea o valoare default"
+ rus "Ðевозможно указывать значение по умолчанию Ð´Ð»Ñ Ñтолбца BLOB '%-.192s'"
+ serbian "BLOB kolona '%-.192s' ne može imati default vrednost"
+ slo "Pole BLOB '%-.192s' nemôže mať implicitnú hodnotu"
+ spa "Campo Blob '%-.192s' no puede tener valores patron"
+ swe "BLOB fält '%-.192s' kan inte ha ett DEFAULT-värde"
+ ukr "Стовбець BLOB '%-.192s' не може мати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾ замовчуванню"
+ER_WRONG_DB_NAME 42000
+ cze "Nep-Břípustné jméno databáze '%-.100s'"
+ dan "Ugyldigt database navn '%-.100s'"
+ nla "Databasenaam '%-.100s' is niet getoegestaan"
+ eng "Incorrect database name '%-.100s'"
+ jps "指定ã—㟠database å '%-.100s' ãŒé–“é•ã£ã¦ã„ã¾ã™",
+ est "Vigane andmebaasi nimi '%-.100s'"
+ fre "Nom de base de donnée illégal: '%-.100s'"
+ ger "Unerlaubter Datenbankname '%-.100s'"
+ greek "Λάθος όνομα βάσης δεδομένων '%-.100s'"
+ hun "Hibas adatbazisnev: '%-.100s'"
+ ita "Nome database errato '%-.100s'"
+ jpn "指定ã—㟠database å '%-.100s' ãŒé–“é•ã£ã¦ã„ã¾ã™"
+ kor "'%-.100s' ë°ì´íƒ€ë² ì´ìŠ¤ì˜ ì´ë¦„ì´ ë¶€ì •í™•í•©ë‹ˆë‹¤."
+ nor "Ugyldig database navn '%-.100s'"
+ norwegian-ny "Ugyldig database namn '%-.100s'"
+ pol "Niedozwolona nazwa bazy danych '%-.100s'"
+ por "Nome de banco de dados '%-.100s' incorreto"
+ rum "Numele bazei de date este incorect '%-.100s'"
+ rus "Ðекорректное Ð¸Ð¼Ñ Ð±Ð°Ð·Ñ‹ данных '%-.100s'"
+ serbian "Pogrešno ime baze '%-.100s'"
+ slo "Neprípustné meno databázy '%-.100s'"
+ spa "Nombre de base de datos ilegal '%-.100s'"
+ swe "Felaktigt databasnamn '%-.100s'"
+ ukr "Ðевірне ім'Ñ Ð±Ð°Ð·Ð¸ данних '%-.100s'"
+ER_WRONG_TABLE_NAME 42000
+ cze "Nep-Břípustné jméno tabulky '%-.100s'"
+ dan "Ugyldigt tabel navn '%-.100s'"
+ nla "Niet toegestane tabelnaam '%-.100s'"
+ eng "Incorrect table name '%-.100s'"
+ jps "指定ã—㟠table å '%-.100s' ã¯ã¾ã¡ãŒã£ã¦ã„ã¾ã™",
+ est "Vigane tabeli nimi '%-.100s'"
+ fre "Nom de table illégal: '%-.100s'"
+ ger "Unerlaubter Tabellenname '%-.100s'"
+ greek "Λάθος όνομα πίνακα '%-.100s'"
+ hun "Hibas tablanev: '%-.100s'"
+ ita "Nome tabella errato '%-.100s'"
+ jpn "指定ã—㟠table å '%-.100s' ã¯ã¾ã¡ãŒã£ã¦ã„ã¾ã™"
+ kor "'%-.100s' í…Œì´ë¸” ì´ë¦„ì´ ë¶€ì •í™•í•©ë‹ˆë‹¤."
+ nor "Ugyldig tabell navn '%-.100s'"
+ norwegian-ny "Ugyldig tabell namn '%-.100s'"
+ pol "Niedozwolona nazwa tabeli '%-.100s'..."
+ por "Nome de tabela '%-.100s' incorreto"
+ rum "Numele tabelei este incorect '%-.100s'"
+ rus "Ðекорректное Ð¸Ð¼Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹ '%-.100s'"
+ serbian "Pogrešno ime tabele '%-.100s'"
+ slo "Neprípustné meno tabuľky '%-.100s'"
+ spa "Nombre de tabla ilegal '%-.100s'"
+ swe "Felaktigt tabellnamn '%-.100s'"
+ ukr "Ðевірне ім'Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– '%-.100s'"
+ER_TOO_BIG_SELECT 42000
+ cze "Zadan-Bý SELECT by procházel příliš mnoho záznamů a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v pořádku, použijte SET SQL_BIG_SELECTS=1"
+ dan "SELECT ville undersøge for mange poster og ville sandsynligvis tage meget lang tid. Undersøg WHERE delen og brug SET SQL_BIG_SELECTS=1 hvis udtrykket er korrekt"
+ nla "Het SELECT-statement zou te veel records analyseren en dus veel tijd in beslagnemen. Kijk het WHERE-gedeelte van de query na en kies SET SQL_BIG_SELECTS=1 als het stament in orde is."
+ eng "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"
+ est "SELECT lause peab läbi vaatama suure hulga kirjeid ja võtaks tõenäoliselt liiga kaua aega. Tasub kontrollida WHERE klauslit ja vajadusel kasutada käsku SET SQL_BIG_SELECTS=1"
+ fre "SELECT va devoir examiner beaucoup d'enregistrements ce qui va prendre du temps. Vérifiez la clause WHERE et utilisez SET SQL_BIG_SELECTS=1 si SELECT se passe bien"
+ ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET SQL_MAX_JOIN_SIZE=# verwenden"
+ greek "Το SELECT θα εξετάσει μεγάλο αÏιθμό εγγÏαφών και πιθανώς θα καθυστεÏήσει. ΠαÏακαλώ εξετάστε τις παÏαμέτÏους του WHERE και χÏησιμοποιείστε SET SQL_BIG_SELECTS=1 αν το SELECT είναι σωστό"
+ hun "A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okay"
+ ita "La SELECT dovrebbe esaminare troppi record e usare troppo tempo. Controllare la WHERE e usa SET SQL_BIG_SELECTS=1 se e` tutto a posto."
+ kor "SELECT 명령ì—ì„œ 너무 ë§Žì€ ë ˆì½”ë“œë¥¼ 찾기 ë•Œë¬¸ì— ë§Žì€ ì‹œê°„ì´ ì†Œìš”ë©ë‹ˆë‹¤. ë”°ë¼ì„œ WHERE ë¬¸ì„ ì ê²€í•˜ê±°ë‚˜, 만약 SELECTê°€ okë˜ë©´ SET SQL_BIG_SELECTS=1 ì˜µì…˜ì„ ì‚¬ìš©í•˜ì„¸ìš”."
+ nor "SELECT ville undersøke for mange poster og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrekt"
+ norwegian-ny "SELECT ville undersøkje for mange postar og ville sannsynligvis ta veldig lang tid. Undersøk WHERE klausulen og bruk SET SQL_BIG_SELECTS=1 om SELECTen er korrekt"
+ pol "Operacja SELECT będzie dotyczyła zbyt wielu rekordów i prawdopodobnie zajmie bardzo dużo czasu. SprawdĽ warunek WHERE i użyj SQL_OPTION BIG_SELECTS=1 je?li operacja SELECT jest poprawna"
+ por "O SELECT examinaria registros demais e provavelmente levaria muito tempo. Cheque sua cláusula WHERE e use SET SQL_BIG_SELECTS=1, se o SELECT estiver correto"
+ rum "SELECT-ul ar examina prea multe cimpuri si probabil ar lua prea mult timp; verifica clauza WHERE si foloseste SET SQL_BIG_SELECTS=1 daca SELECT-ul e okay"
+ rus "Ð”Ð»Ñ Ñ‚Ð°ÐºÐ¾Ð¹ выборки SELECT должен будет проÑмотреть Ñлишком много запиÑей и, видимо, Ñто займет очень много времени. Проверьте ваше указание WHERE, и, еÑли в нем вÑе в порÑдке, укажите SET SQL_BIG_SELECTS=1"
+ serbian "Komanda 'SELECT' će ispitati previše slogova i potrošiti previše vremena. Proverite vaš 'WHERE' filter i upotrebite 'SET OPTION SQL_BIG_SELECTS=1' ako želite baš ovakvu komandu"
+ slo "Zadaná požiadavka SELECT by prechádzala príliš mnoho záznamov a trvala by príliš dlho. Skontrolujte tvar WHERE a ak je v poriadku, použite SET SQL_BIG_SELECTS=1"
+ spa "El SELECT puede examinar muchos registros y probablemente con mucho tiempo. Verifique tu WHERE y usa SET SQL_BIG_SELECTS=1 si el SELECT esta correcto"
+ swe "Den angivna frågan skulle läsa mer än MAX_JOIN_SIZE rader. Kontrollera din WHERE och använd SET SQL_BIG_SELECTS=1 eller SET MAX_JOIN_SIZE=# ifall du vill hantera stora joins"
+ ukr "Запиту SELECT потрібно обробити багато запиÑів, що, певне, займе дуже багато чаÑу. Перевірте ваше WHERE та викориÑтовуйте SET SQL_BIG_SELECTS=1, Ñкщо цей запит SELECT Ñ” вірним"
+ER_UNKNOWN_ERROR
+ cze "Nezn-Bámá chyba"
+ dan "Ukendt fejl"
+ nla "Onbekende Fout"
+ eng "Unknown error"
+ est "Tundmatu viga"
+ fre "Erreur inconnue"
+ ger "Unbekannter Fehler"
+ greek "ΠÏοέκυψε άγνωστο λάθος"
+ hun "Ismeretlen hiba"
+ ita "Errore sconosciuto"
+ kor "알수 없는 ì—러입니다."
+ nor "Ukjent feil"
+ norwegian-ny "Ukjend feil"
+ por "Erro desconhecido"
+ rum "Eroare unknown"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°"
+ serbian "Nepoznata greška"
+ slo "Neznámá chyba"
+ spa "Error desconocido"
+ swe "Oidentifierat fel"
+ ukr "Ðевідома помилка"
+ER_UNKNOWN_PROCEDURE 42000
+ cze "Nezn-Bámá procedura %-.192s"
+ dan "Ukendt procedure %-.192s"
+ nla "Onbekende procedure %-.192s"
+ eng "Unknown procedure '%-.192s'"
+ est "Tundmatu protseduur '%-.192s'"
+ fre "Procédure %-.192s inconnue"
+ ger "Unbekannte Prozedur '%-.192s'"
+ greek "Αγνωστη διαδικασία '%-.192s'"
+ hun "Ismeretlen eljaras: '%-.192s'"
+ ita "Procedura '%-.192s' sconosciuta"
+ kor "알수 없는 수행문 : '%-.192s'"
+ nor "Ukjent prosedyre %-.192s"
+ norwegian-ny "Ukjend prosedyre %-.192s"
+ pol "Unkown procedure %-.192s"
+ por "'Procedure' '%-.192s' desconhecida"
+ rum "Procedura unknown '%-.192s'"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¿Ñ€Ð¾Ñ†ÐµÐ´ÑƒÑ€Ð° '%-.192s'"
+ serbian "Nepoznata procedura '%-.192s'"
+ slo "Neznámá procedúra '%-.192s'"
+ spa "Procedimiento desconocido %-.192s"
+ swe "Okänd procedur: %-.192s"
+ ukr "Ðевідома процедура '%-.192s'"
+ER_WRONG_PARAMCOUNT_TO_PROCEDURE 42000
+ cze "Chybn-Bý poÄet parametrů procedury %-.192s"
+ dan "Forkert antal parametre til proceduren %-.192s"
+ nla "Foutief aantal parameters doorgegeven aan procedure %-.192s"
+ eng "Incorrect parameter count to procedure '%-.192s'"
+ est "Vale parameetrite hulk protseduurile '%-.192s'"
+ fre "Mauvais nombre de paramètres pour la procedure %-.192s"
+ ger "Falsche Parameterzahl für Prozedur '%-.192s'"
+ greek "Λάθος αÏιθμός παÏαμέτÏων στη διαδικασία '%-.192s'"
+ hun "Rossz parameter a(z) '%-.192s'eljaras szamitasanal"
+ ita "Numero di parametri errato per la procedura '%-.192s'"
+ kor "'%-.192s' ìˆ˜í–‰ë¬¸ì— ëŒ€í•œ 부정확한 파ë¼ë©”í„°"
+ nor "Feil parameter antall til prosedyren %-.192s"
+ norwegian-ny "Feil parameter tal til prosedyra %-.192s"
+ pol "Incorrect parameter count to procedure %-.192s"
+ por "Número de parâmetros incorreto para a 'procedure' '%-.192s'"
+ rum "Procedura '%-.192s' are un numar incorect de parametri"
+ rus "Ðекорректное количеÑтво параметров Ð´Ð»Ñ Ð¿Ñ€Ð¾Ñ†ÐµÐ´ÑƒÑ€Ñ‹ '%-.192s'"
+ serbian "Pogrešan broj parametara za proceduru '%-.192s'"
+ slo "Chybný poÄet parametrov procedúry '%-.192s'"
+ spa "Equivocado parametro count para procedimiento %-.192s"
+ swe "Felaktigt antal parametrar till procedur %-.192s"
+ ukr "Хибна кількіÑÑ‚ÑŒ параметрів процедури '%-.192s'"
+ER_WRONG_PARAMETERS_TO_PROCEDURE
+ cze "Chybn-Bé parametry procedury %-.192s"
+ dan "Forkert(e) parametre til proceduren %-.192s"
+ nla "Foutieve parameters voor procedure %-.192s"
+ eng "Incorrect parameters to procedure '%-.192s'"
+ est "Vigased parameetrid protseduurile '%-.192s'"
+ fre "Paramètre erroné pour la procedure %-.192s"
+ ger "Falsche Parameter für Prozedur '%-.192s'"
+ greek "Λάθος παÏάμετÏοι στην διαδικασία '%-.192s'"
+ hun "Rossz parameter a(z) '%-.192s' eljarasban"
+ ita "Parametri errati per la procedura '%-.192s'"
+ kor "'%-.192s' ìˆ˜í–‰ë¬¸ì— ëŒ€í•œ 부정확한 파ë¼ë©”í„°"
+ nor "Feil parametre til prosedyren %-.192s"
+ norwegian-ny "Feil parameter til prosedyra %-.192s"
+ pol "Incorrect parameters to procedure %-.192s"
+ por "Parâmetros incorretos para a 'procedure' '%-.192s'"
+ rum "Procedura '%-.192s' are parametrii incorecti"
+ rus "Ðекорректные параметры Ð´Ð»Ñ Ð¿Ñ€Ð¾Ñ†ÐµÐ´ÑƒÑ€Ñ‹ '%-.192s'"
+ serbian "Pogrešni parametri prosleđeni proceduri '%-.192s'"
+ slo "Chybné parametre procedúry '%-.192s'"
+ spa "Equivocados parametros para procedimiento %-.192s"
+ swe "Felaktiga parametrar till procedur %-.192s"
+ ukr "Хибний параметер процедури '%-.192s'"
+ER_UNKNOWN_TABLE 42S02
+ cze "Nezn-Bámá tabulka '%-.192s' v %-.32s"
+ dan "Ukendt tabel '%-.192s' i %-.32s"
+ nla "Onbekende tabel '%-.192s' in %-.32s"
+ eng "Unknown table '%-.192s' in %-.32s"
+ est "Tundmatu tabel '%-.192s' %-.32s-s"
+ fre "Table inconnue '%-.192s' dans %-.32s"
+ ger "Unbekannte Tabelle '%-.192s' in '%-.32s'"
+ greek "Αγνωστος πίνακας '%-.192s' σε %-.32s"
+ hun "Ismeretlen tabla: '%-.192s' %-.32s-ban"
+ ita "Tabella '%-.192s' sconosciuta in %-.32s"
+ jpn "Unknown table '%-.192s' in %-.32s"
+ kor "알수 없는 í…Œì´ë¸” '%-.192s' (ë°ì´íƒ€ë² ì´ìŠ¤ %-.32s)"
+ nor "Ukjent tabell '%-.192s' i %-.32s"
+ norwegian-ny "Ukjend tabell '%-.192s' i %-.32s"
+ pol "Unknown table '%-.192s' in %-.32s"
+ por "Tabela '%-.192s' desconhecida em '%-.32s'"
+ rum "Tabla '%-.192s' invalida in %-.32s"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ð° '%-.192s' в %-.32s"
+ serbian "Nepoznata tabela '%-.192s' u '%-.32s'"
+ slo "Neznáma tabuľka '%-.192s' v %-.32s"
+ spa "Tabla desconocida '%-.192s' in %-.32s"
+ swe "Okänd tabell '%-.192s' i '%-.32s'"
+ ukr "Ðевідома Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' у %-.32s"
+ER_FIELD_SPECIFIED_TWICE 42000
+ cze "Polo-Bžka '%-.192s' je zadána dvakrát"
+ dan "Feltet '%-.192s' er anvendt to gange"
+ nla "Veld '%-.192s' is dubbel gespecificeerd"
+ eng "Column '%-.192s' specified twice"
+ est "Tulp '%-.192s' on määratletud topelt"
+ fre "Champ '%-.192s' spécifié deux fois"
+ ger "Feld '%-.192s' wurde zweimal angegeben"
+ greek "Το πεδίο '%-.192s' έχει οÏισθεί δÏο φοÏές"
+ hun "A(z) '%-.192s' mezot ketszer definialta"
+ ita "Campo '%-.192s' specificato 2 volte"
+ kor "칼럼 '%-.192s'는 ë‘번 ì •ì˜ë˜ì–´ 있ì니다."
+ nor "Feltet '%-.192s' er spesifisert to ganger"
+ norwegian-ny "Feltet '%-.192s' er spesifisert to gangar"
+ pol "Field '%-.192s' specified twice"
+ por "Coluna '%-.192s' especificada duas vezes"
+ rum "Coloana '%-.192s' specificata de doua ori"
+ rus "Столбец '%-.192s' указан дважды"
+ serbian "Kolona '%-.192s' je navedena dva puta"
+ slo "Pole '%-.192s' je zadané dvakrát"
+ spa "Campo '%-.192s' especificado dos veces"
+ swe "Fält '%-.192s' är redan använt"
+ ukr "Стовбець '%-.192s' зазначено двічі"
+ER_INVALID_GROUP_FUNC_USE
+ cze "Nespr-Bávné použití funkce group"
+ dan "Forkert brug af grupperings-funktion"
+ nla "Ongeldig gebruik van GROUP-functie"
+ eng "Invalid use of group function"
+ est "Vigane grupeerimisfunktsiooni kasutus"
+ fre "Utilisation invalide de la clause GROUP"
+ ger "Falsche Verwendung einer Gruppierungsfunktion"
+ greek "Εσφαλμένη χÏήση της group function"
+ hun "A group funkcio ervenytelen hasznalata"
+ ita "Uso non valido di una funzione di raggruppamento"
+ kor "ìž˜ëª»ëœ ê·¸ë£¹ 함수를 사용하였습니다."
+ por "Uso inválido de função de agrupamento (GROUP)"
+ rum "Folosire incorecta a functiei group"
+ rus "Ðеправильное иÑпользование групповых функций"
+ serbian "Pogrešna upotreba 'GROUP' funkcije"
+ slo "Nesprávne použitie funkcie GROUP"
+ spa "Invalido uso de función en grupo"
+ swe "Felaktig användning av SQL grupp function"
+ ukr "Хибне викориÑÑ‚Ð°Ð½Ð½Ñ Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ— групуваннÑ"
+ER_UNSUPPORTED_EXTENSION 42000
+ cze "Tabulka '%-.192s' pou-Bžívá rozšíření, které v této verzi MySQL není"
+ dan "Tabellen '%-.192s' bruger et filtypenavn som ikke findes i denne MySQL version"
+ nla "Tabel '%-.192s' gebruikt een extensie, die niet in deze MySQL-versie voorkomt."
+ eng "Table '%-.192s' uses an extension that doesn't exist in this MySQL version"
+ est "Tabel '%-.192s' kasutab laiendust, mis ei eksisteeri antud MySQL versioonis"
+ fre "Table '%-.192s' : utilise une extension invalide pour cette version de MySQL"
+ ger "Tabelle '%-.192s' verwendet eine Erweiterung, die in dieser MySQL-Version nicht verfügbar ist"
+ greek "Ο πίνακς '%-.192s' χÏησιμοποιεί κάποιο extension που δεν υπάÏχει στην έκδοση αυτή της MySQL"
+ hun "A(z) '%-.192s' tabla olyan bovitest hasznal, amely nem letezik ebben a MySQL versioban."
+ ita "La tabella '%-.192s' usa un'estensione che non esiste in questa versione di MySQL"
+ kor "í…Œì´ë¸” '%-.192s'는 í™•ìž¥ëª…ë ¹ì„ ì´ìš©í•˜ì§€ë§Œ í˜„ìž¬ì˜ MySQL 버젼ì—서는 존재하지 않습니다."
+ nor "Table '%-.192s' uses a extension that doesn't exist in this MySQL version"
+ norwegian-ny "Table '%-.192s' uses a extension that doesn't exist in this MySQL version"
+ pol "Table '%-.192s' uses a extension that doesn't exist in this MySQL version"
+ por "Tabela '%-.192s' usa uma extensão que não existe nesta versão do MySQL"
+ rum "Tabela '%-.192s' foloseste o extensire inexistenta in versiunea curenta de MySQL"
+ rus "Ð’ таблице '%-.192s' иÑпользуютÑÑ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾Ñти, не поддерживаемые в Ñтой верÑии MySQL"
+ serbian "Tabela '%-.192s' koristi ekstenziju koje ne postoji u ovoj verziji MySQL-a"
+ slo "Tabuľka '%-.192s' používa rozšírenie, ktoré v tejto verzii MySQL nie je"
+ spa "Tabla '%-.192s' usa una extensión que no existe en esta MySQL versión"
+ swe "Tabell '%-.192s' har en extension som inte finns i denna version av MySQL"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' викориÑтовує розширеннÑ, що не Ñ–Ñнує у цій верÑÑ–Ñ— MySQL"
+ER_TABLE_MUST_HAVE_COLUMNS 42000
+ cze "Tabulka mus-Bí mít alespoň jeden sloupec"
+ dan "En tabel skal have mindst een kolonne"
+ nla "Een tabel moet minstens 1 kolom bevatten"
+ eng "A table must have at least 1 column"
+ jps "テーブルã¯æœ€ä½Ž 1 個㮠column ãŒå¿…è¦ã§ã™",
+ est "Tabelis peab olema vähemalt üks tulp"
+ fre "Une table doit comporter au moins une colonne"
+ ger "Eine Tabelle muss mindestens eine Spalte besitzen"
+ greek "Ενας πίνακας Ï€Ïέπει να έχει τουλάχιστον ένα πεδίο"
+ hun "A tablanak legalabb egy oszlopot tartalmazni kell"
+ ita "Una tabella deve avere almeno 1 colonna"
+ jpn "テーブルã¯æœ€ä½Ž 1 個㮠column ãŒå¿…è¦ã§ã™"
+ kor "í•˜ë‚˜ì˜ í…Œì´ë¸”ì—서는 ì ì–´ë„ í•˜ë‚˜ì˜ ì¹¼ëŸ¼ì´ ì¡´ìž¬í•˜ì—¬ì•¼ 합니다."
+ por "Uma tabela tem que ter pelo menos uma (1) coluna"
+ rum "O tabela trebuie sa aiba cel putin o coloana"
+ rus "Ð’ таблице должен быть как минимум один Ñтолбец"
+ serbian "Tabela mora imati najmanje jednu kolonu"
+ slo "Tabuľka musí mať aspoň 1 pole"
+ spa "Una tabla debe tener al menos 1 columna"
+ swe "Tabeller måste ha minst 1 kolumn"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° мати хочаб один Ñтовбець"
+ER_RECORD_FILE_FULL
+ cze "Tabulka '%-.192s' je pln-Bá"
+ dan "Tabellen '%-.192s' er fuld"
+ nla "De tabel '%-.192s' is vol"
+ eng "The table '%-.192s' is full"
+ jps "table '%-.192s' ã¯ã„ã£ã±ã„ã§ã™",
+ est "Tabel '%-.192s' on täis"
+ fre "La table '%-.192s' est pleine"
+ ger "Tabelle '%-.192s' ist voll"
+ greek "Ο πίνακας '%-.192s' είναι γεμάτος"
+ hun "A '%-.192s' tabla megtelt"
+ ita "La tabella '%-.192s' e` piena"
+ jpn "table '%-.192s' ã¯ã„ã£ã±ã„ã§ã™"
+ kor "í…Œì´ë¸” '%-.192s'ê°€ full났습니다. "
+ por "Tabela '%-.192s' está cheia"
+ rum "Tabela '%-.192s' e plina"
+ rus "Таблица '%-.192s' переполнена"
+ serbian "Tabela '%-.192s' je popunjena do kraja"
+ slo "Tabuľka '%-.192s' je plná"
+ spa "La tabla '%-.192s' está llena"
+ swe "Tabellen '%-.192s' är full"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s' заповнена"
+ER_UNKNOWN_CHARACTER_SET 42000
+ cze "Nezn-Bámá znaková sada: '%-.64s'"
+ dan "Ukendt tegnsæt: '%-.64s'"
+ nla "Onbekende character set: '%-.64s'"
+ eng "Unknown character set: '%-.64s'"
+ jps "character set '%-.64s' ã¯ã‚µãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“",
+ est "Vigane kooditabel '%-.64s'"
+ fre "Jeu de caractères inconnu: '%-.64s'"
+ ger "Unbekannter Zeichensatz: '%-.64s'"
+ greek "Αγνωστο character set: '%-.64s'"
+ hun "Ervenytelen karakterkeszlet: '%-.64s'"
+ ita "Set di caratteri '%-.64s' sconosciuto"
+ jpn "character set '%-.64s' ã¯ã‚µãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
+ kor "알수없는 언어 Set: '%-.64s'"
+ por "Conjunto de caracteres '%-.64s' desconhecido"
+ rum "Set de caractere invalid: '%-.64s'"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²ÐºÐ° '%-.64s'"
+ serbian "Nepoznati karakter-set: '%-.64s'"
+ slo "Neznáma znaková sada: '%-.64s'"
+ spa "Juego de caracteres desconocido: '%-.64s'"
+ swe "Okänd teckenuppsättning: '%-.64s'"
+ ukr "Ðевідома кодова таблицÑ: '%-.64s'"
+ER_TOO_MANY_TABLES
+ cze "P-Bříliš mnoho tabulek, MySQL jich může mít v joinu jen %d"
+ dan "For mange tabeller. MySQL kan kun bruge %d tabeller i et join"
+ nla "Teveel tabellen. MySQL kan slechts %d tabellen in een join bevatten"
+ eng "Too many tables; MySQL can only use %d tables in a join"
+ jps "テーブルãŒå¤šã™ãŽã¾ã™; MySQL can only use %d tables in a join",
+ est "Liiga palju tabeleid. MySQL suudab JOINiga ühendada kuni %d tabelit"
+ fre "Trop de tables. MySQL ne peut utiliser que %d tables dans un JOIN"
+ ger "Zu viele Tabellen. MySQL kann in einem Join maximal %d Tabellen verwenden"
+ greek "Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿Ï‚ αÏιθμός πινάκων. Η MySQL μποÏεί να χÏησιμοποιήσει %d πίνακες σε διαδικασία join"
+ hun "Tul sok tabla. A MySQL csak %d tablat tud kezelni osszefuzeskor"
+ ita "Troppe tabelle. MySQL puo` usare solo %d tabelle in una join"
+ jpn "テーブルãŒå¤šã™ãŽã¾ã™; MySQL can only use %d tables in a join"
+ kor "너무 ë§Žì€ í…Œì´ë¸”ì´ Joinë˜ì—ˆìŠµë‹ˆë‹¤. MySQLì—서는 JOINì‹œ %dê°œì˜ í…Œì´ë¸”만 사용할 수 있습니다."
+ por "Tabelas demais. O MySQL pode usar somente %d tabelas em uma junção (JOIN)"
+ rum "Prea multe tabele. MySQL nu poate folosi mai mult de %d tabele intr-un join"
+ rus "Слишком много таблиц. MySQL может иÑпользовать только %d таблиц в Ñоединении"
+ serbian "Previše tabela. MySQL može upotrebiti maksimum %d tabela pri 'JOIN' operaciji"
+ slo "Príliš mnoho tabuliek. MySQL môže použiť len %d v JOIN-e"
+ spa "Muchas tablas. MySQL solamente puede usar %d tablas en un join"
+ swe "För många tabeller. MySQL can ha högst %d tabeller i en och samma join"
+ ukr "Забагато таблиць. MySQL може викориÑтовувати лише %d таблиць у об'єднанні"
+ER_TOO_MANY_FIELDS
+ cze "P-Bříliš mnoho položek"
+ dan "For mange felter"
+ nla "Te veel velden"
+ eng "Too many columns"
+ jps "column ãŒå¤šã™ãŽã¾ã™",
+ est "Liiga palju tulpasid"
+ fre "Trop de champs"
+ ger "Zu viele Felder"
+ greek "Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿Ï‚ αÏιθμός πεδίων"
+ hun "Tul sok mezo"
+ ita "Troppi campi"
+ jpn "column ãŒå¤šã™ãŽã¾ã™"
+ kor "ì¹¼ëŸ¼ì´ ë„ˆë¬´ 많습니다."
+ por "Colunas demais"
+ rum "Prea multe coloane"
+ rus "Слишком много Ñтолбцов"
+ serbian "Previše kolona"
+ slo "Príliš mnoho polí"
+ spa "Muchos campos"
+ swe "För många fält"
+ ukr "Забагато Ñтовбців"
+ER_TOO_BIG_ROWSIZE 42000
+ cze "-BŘádek je příliÅ¡ velký. Maximální velikost řádku, nepoÄítaje položky blob, je %ld. Musíte zmÄ›nit nÄ›které položky na blob"
+ dan "For store poster. Max post størrelse, uden BLOB's, er %ld. Du må lave nogle felter til BLOB's"
+ nla "Rij-grootte is groter dan toegestaan. Maximale rij grootte, blobs niet meegeteld, is %ld. U dient sommige velden in blobs te veranderen."
+ eng "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs"
+ jps "row size ãŒå¤§ãã™ãŽã¾ã™. BLOB ã‚’å«ã¾ãªã„å ´åˆã® row size ã®æœ€å¤§ã¯ %ld ã§ã™. ã„ãã¤ã‹ã® field ã‚’ BLOB ã«å¤‰ãˆã¦ãã ã•ã„.",
+ est "Liiga pikk kirje. Kirje maksimumpikkus arvestamata BLOB-tüüpi välju on %ld. Muuda mõned väljad BLOB-tüüpi väljadeks"
+ fre "Ligne trop grande. Le taille maximale d'une ligne, sauf les BLOBs, est %ld. Changez le type de quelques colonnes en BLOB"
+ ger "Zeilenlänge zu groß. Die maximale Zeilenlänge für den verwendeten Tabellentyp (ohne BLOB-Felder) beträgt %ld. Einige Felder müssen in BLOB oder TEXT umgewandelt werden"
+ greek "Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿ μέγεθος εγγÏαφής. Το μέγιστο μέγεθος εγγÏαφής, χωÏίς να υπολογίζονται τα blobs, είναι %ld. ΠÏέπει να οÏίσετε κάποια πεδία σαν blobs"
+ hun "Tul nagy sormeret. A maximalis sormeret (nem szamolva a blob objektumokat) %ld. Nehany mezot meg kell valtoztatnia"
+ ita "Riga troppo grande. La massima grandezza di una riga, non contando i BLOB, e` %ld. Devi cambiare alcuni campi in BLOB"
+ jpn "row size ãŒå¤§ãã™ãŽã¾ã™. BLOB ã‚’å«ã¾ãªã„å ´åˆã® row size ã®æœ€å¤§ã¯ %ld ã§ã™. ã„ãã¤ã‹ã® field ã‚’ BLOB ã«å¤‰ãˆã¦ãã ã•ã„."
+ kor "너무 í° row 사ì´ì¦ˆìž…니다. BLOB를 계산하지 ì•Šê³  최대 row 사ì´ì¦ˆëŠ” %ld입니다. ì–¼ë§ˆê°„ì˜ í•„ë“œë“¤ì„ BLOBë¡œ 바꾸셔야 ê² êµ°ìš”.."
+ por "Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %ld. Você tem que mudar alguns campos para BLOBs"
+ rum "Marimea liniei (row) prea mare. Marimea maxima a liniei, excluzind BLOB-urile este de %ld. Trebuie sa schimbati unele cimpuri in BLOB-uri"
+ rus "Слишком большой размер запиÑи. МакÑимальный размер Ñтроки, иÑÐºÐ»ÑŽÑ‡Ð°Ñ Ð¿Ð¾Ð»Ñ BLOB, - %ld. Возможно, вам Ñледует изменить тип некоторых полей на BLOB"
+ serbian "Prevelik slog. Maksimalna veliÄina sloga, ne raÄunajući BLOB polja, je %ld. Trebali bi da promenite tip nekih polja u BLOB"
+ slo "Riadok je príliš veľký. Maximálna veľkosť riadku, okrem 'BLOB', je %ld. Musíte zmeniť niektoré položky na BLOB"
+ spa "Tamaño de línea muy grande. Máximo tamaño de línea, no contando blob, es %ld. Tu tienes que cambiar algunos campos para blob"
+ swe "För stor total radlängd. Den högst tillåtna radlängden, förutom BLOBs, är %ld. Ändra några av dina fält till BLOB"
+ ukr "Задовга Ñтрока. Ðайбільшою довжиною Ñтроки, не рахуючи BLOB, Ñ” %ld. Вам потрібно привеÑти деÑкі Ñтовбці до типу BLOB"
+ER_STACK_OVERRUN
+ cze "P-BÅ™eteÄení zásobníku threadu: použito %ld z %ld. Použijte 'mysqld -O thread_stack=#' k zadání vÄ›tšího zásobníku"
+ dan "Thread stack brugt: Brugt: %ld af en %ld stak. Brug 'mysqld -O thread_stack=#' for at allokere en større stak om nødvendigt"
+ nla "Thread stapel overrun: Gebruikte: %ld van een %ld stack. Gebruik 'mysqld -O thread_stack=#' om een grotere stapel te definieren (indien noodzakelijk)."
+ eng "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed"
+ jps "Thread stack overrun: Used: %ld of a %ld stack. スタック領域を多ãã¨ã‚ŠãŸã„å ´åˆã€'mysqld -O thread_stack=#' ã¨æŒ‡å®šã—ã¦ãã ã•ã„",
+ fre "Débordement de la pile des tâches (Thread stack). Utilisées: %ld pour une pile de %ld. Essayez 'mysqld -O thread_stack=#' pour indiquer une plus grande valeur"
+ ger "Thread-Stack-Überlauf. Benutzt: %ld von %ld Stack. 'mysqld -O thread_stack=#' verwenden, um bei Bedarf einen größeren Stack anzulegen"
+ greek "Stack overrun στο thread: Used: %ld of a %ld stack. ΠαÏακαλώ χÏησιμοποιείστε 'mysqld -O thread_stack=#' για να οÏίσετε ένα μεγαλÏτεÏο stack αν χÏειάζεται"
+ hun "Thread verem tullepes: Used: %ld of a %ld stack. Hasznalja a 'mysqld -O thread_stack=#' nagyobb verem definialasahoz"
+ ita "Thread stack overrun: Usati: %ld di uno stack di %ld. Usa 'mysqld -O thread_stack=#' per specificare uno stack piu` grande."
+ jpn "Thread stack overrun: Used: %ld of a %ld stack. スタック領域を多ãã¨ã‚ŠãŸã„å ´åˆã€'mysqld -O thread_stack=#' ã¨æŒ‡å®šã—ã¦ãã ã•ã„"
+ kor "쓰레드 스íƒì´ 넘쳤습니다. 사용: %ldê°œ 스íƒ: %ldê°œ. 만약 필요시 ë”í° ìŠ¤íƒì„ ì›í• ë•Œì—는 'mysqld -O thread_stack=#' 를 ì •ì˜í•˜ì„¸ìš”"
+ por "Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld. Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necessário"
+ rum "Stack-ul thread-ului a fost depasit (prea mic): Folositi: %ld intr-un stack de %ld. Folositi 'mysqld -O thread_stack=#' ca sa specifici un stack mai mare"
+ rus "Стек потоков переполнен: иÑпользовано: %ld из %ld Ñтека. ПрименÑйте 'mysqld -O thread_stack=#' Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð±Ð¾Ð»ÑŒÑˆÐµÐ³Ð¾ размера Ñтека, еÑли необходимо"
+ serbian "Prepisivanje thread stack-a: Upotrebljeno: %ld od %ld stack memorije. Upotrebite 'mysqld -O thread_stack=#' da navedete veći stack ako je potrebno"
+ slo "PreteÄenie zásobníku vlákna: použité: %ld z %ld. Použite 'mysqld -O thread_stack=#' k zadaniu väÄÅ¡ieho zásobníka"
+ spa "Sobrecarga de la pila de thread: Usada: %ld de una %ld pila. Use 'mysqld -O thread_stack=#' para especificar una mayor pila si necesario"
+ swe "Trådstacken tog slut: Har använt %ld av %ld bytes. Använd 'mysqld -O thread_stack=#' ifall du behöver en större stack"
+ ukr "Стек гілок переповнено: ВикориÑтано: %ld з %ld. ВикориÑтовуйте 'mysqld -O thread_stack=#' аби зазначити більший Ñтек, Ñкщо необхідно"
+ER_WRONG_OUTER_JOIN 42000
+ cze "V OUTER JOIN byl nalezen k-Břížový odkaz. Prověřte ON podmínky"
+ dan "Krydsreferencer fundet i OUTER JOIN; check dine ON conditions"
+ nla "Gekruiste afhankelijkheid gevonden in OUTER JOIN. Controleer uw ON-conditions"
+ eng "Cross dependency found in OUTER JOIN; examine your ON conditions"
+ est "Ristsõltuvus OUTER JOIN klauslis. Kontrolli oma ON tingimusi"
+ fre "Dépendance croisée dans une clause OUTER JOIN. Vérifiez la condition ON"
+ ger "OUTER JOIN enthält fehlerhafte Abhängigkeiten. In ON verwendete Bedingungen überprüfen"
+ greek "Cross dependency βÏέθηκε σε OUTER JOIN. ΠαÏακαλώ εξετάστε τις συνθήκες που θέσατε στο ON"
+ hun "Keresztfuggoseg van az OUTER JOIN-ban. Ellenorizze az ON felteteleket"
+ ita "Trovata una dipendenza incrociata nella OUTER JOIN. Controlla le condizioni ON"
+ por "Dependência cruzada encontrada em junção externa (OUTER JOIN); examine as condições utilizadas nas cláusulas 'ON'"
+ rum "Dependinta incrucisata (cross dependency) gasita in OUTER JOIN. Examinati conditiile ON"
+ rus "Ð’ OUTER JOIN обнаружена перекреÑÑ‚Ð½Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑ‚ÑŒ. Внимательно проанализируйте Ñвои уÑÐ»Ð¾Ð²Ð¸Ñ ON"
+ serbian "Unakrsna zavisnost pronađena u komandi 'OUTER JOIN'. Istražite vaše 'ON' uslove"
+ slo "V OUTER JOIN bol nájdený krížový odkaz. Skontrolujte podmienky ON"
+ spa "Dependencia cruzada encontrada en OUTER JOIN. Examine su condición ON"
+ swe "Felaktigt referens i OUTER JOIN. Kontrollera ON-uttrycket"
+ ukr "ПерехреÑна залежніÑÑ‚ÑŒ у OUTER JOIN. Перевірте умову ON"
+ER_NULL_COLUMN_IN_INDEX 42000
+ eng "Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler"
+ swe "Tabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.192s' till NOT NULL eller använd en annan hanterare"
+ER_CANT_FIND_UDF
+ cze "Nemohu na-BÄíst funkci '%-.192s'"
+ dan "Kan ikke læse funktionen '%-.192s'"
+ nla "Kan functie '%-.192s' niet laden"
+ eng "Can't load function '%-.192s'"
+ jps "function '%-.192s' ã‚’ ロードã§ãã¾ã›ã‚“",
+ est "Ei suuda avada funktsiooni '%-.192s'"
+ fre "Imposible de charger la fonction '%-.192s'"
+ ger "Kann Funktion '%-.192s' nicht laden"
+ greek "Δεν είναι δυνατή η διαδικασία load για τη συνάÏτηση '%-.192s'"
+ hun "A(z) '%-.192s' fuggveny nem toltheto be"
+ ita "Impossibile caricare la funzione '%-.192s'"
+ jpn "function '%-.192s' ã‚’ ロードã§ãã¾ã›ã‚“"
+ kor "'%-.192s' 함수를 로드하지 못했습니다."
+ por "Não pode carregar a função '%-.192s'"
+ rum "Nu pot incarca functia '%-.192s'"
+ rus "Ðевозможно загрузить функцию '%-.192s'"
+ serbian "Ne mogu da uÄitam funkciju '%-.192s'"
+ slo "Nemôžem naÄítaÅ¥ funkciu '%-.192s'"
+ spa "No puedo cargar función '%-.192s'"
+ swe "Kan inte ladda funktionen '%-.192s'"
+ ukr "Ðе можу завантажити функцію '%-.192s'"
+ER_CANT_INITIALIZE_UDF
+ cze "Nemohu inicializovat funkci '%-.192s'; %-.80s"
+ dan "Kan ikke starte funktionen '%-.192s'; %-.80s"
+ nla "Kan functie '%-.192s' niet initialiseren; %-.80s"
+ eng "Can't initialize function '%-.192s'; %-.80s"
+ jps "function '%-.192s' ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“; %-.80s",
+ est "Ei suuda algväärtustada funktsiooni '%-.192s'; %-.80s"
+ fre "Impossible d'initialiser la fonction '%-.192s'; %-.80s"
+ ger "Kann Funktion '%-.192s' nicht initialisieren: %-.80s"
+ greek "Δεν είναι δυνατή η έναÏξη της συνάÏτησης '%-.192s'; %-.80s"
+ hun "A(z) '%-.192s' fuggveny nem inicializalhato; %-.80s"
+ ita "Impossibile inizializzare la funzione '%-.192s'; %-.80s"
+ jpn "function '%-.192s' ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“; %-.80s"
+ kor "'%-.192s' 함수를 초기화 하지 못했습니다.; %-.80s"
+ por "Não pode inicializar a função '%-.192s' - '%-.80s'"
+ rum "Nu pot initializa functia '%-.192s'; %-.80s"
+ rus "Ðевозможно инициализировать функцию '%-.192s'; %-.80s"
+ serbian "Ne mogu da inicijalizujem funkciju '%-.192s'; %-.80s"
+ slo "Nemôžem inicializovať funkciu '%-.192s'; %-.80s"
+ spa "No puedo inicializar función '%-.192s'; %-.80s"
+ swe "Kan inte initialisera funktionen '%-.192s'; '%-.80s'"
+ ukr "Ðе можу ініціалізувати функцію '%-.192s'; %-.80s"
+ER_UDF_NO_PATHS
+ cze "Pro sd-Bílenou knihovnu nejsou povoleny cesty"
+ dan "Angivelse af sti ikke tilladt for delt bibliotek"
+ nla "Geen pad toegestaan voor shared library"
+ eng "No paths allowed for shared library"
+ jps "shared library ã¸ã®ãƒ‘スãŒé€šã£ã¦ã„ã¾ã›ã‚“",
+ est "Teegi nimes ei tohi olla kataloogi"
+ fre "Chemin interdit pour les bibliothèques partagées"
+ ger "Keine Pfade gestattet für Shared Library"
+ greek "Δεν βÏέθηκαν paths για την shared library"
+ hun "Nincs ut a megosztott konyvtarakhoz (shared library)"
+ ita "Non sono ammessi path per le librerie condivisa"
+ jpn "shared library ã¸ã®ãƒ‘スãŒé€šã£ã¦ã„ã¾ã›ã‚“"
+ kor "공유 ë¼ì´ë²„러리를 위한 패스가 ì •ì˜ë˜ì–´ 있지 않습니다."
+ por "Não há caminhos (paths) permitidos para biblioteca compartilhada"
+ rum "Nici un paths nu e permis pentru o librarie shared"
+ rus "ÐедопуÑтимо указывать пути Ð´Ð»Ñ Ð´Ð¸Ð½Ð°Ð¼Ð¸Ñ‡ÐµÑких библиотек"
+ serbian "Ne postoje dozvoljene putanje do share-ovane biblioteke"
+ slo "Neprípustné žiadne cesty k zdieľanej knižnici"
+ spa "No pasos permitidos para librarias conjugadas"
+ swe "Man får inte ange sökväg för dynamiska bibliotek"
+ ukr "Ðе дозволено викориÑтовувати путі Ð´Ð»Ñ Ñ€Ð¾Ð·Ð´Ñ–Ð»ÑŽÐ²Ð°Ð½Ð¸Ñ… бібліотек"
+ER_UDF_EXISTS
+ cze "Funkce '%-.192s' ji-Bž existuje"
+ dan "Funktionen '%-.192s' findes allerede"
+ nla "Functie '%-.192s' bestaat reeds"
+ eng "Function '%-.192s' already exists"
+ jps "Function '%-.192s' ã¯æ—¢ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™",
+ est "Funktsioon '%-.192s' juba eksisteerib"
+ fre "La fonction '%-.192s' existe déjà"
+ ger "Funktion '%-.192s' existiert schon"
+ greek "Η συνάÏτηση '%-.192s' υπάÏχει ήδη"
+ hun "A '%-.192s' fuggveny mar letezik"
+ ita "La funzione '%-.192s' esiste gia`"
+ jpn "Function '%-.192s' ã¯æ—¢ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
+ kor "'%-.192s' 함수는 ì´ë¯¸ 존재합니다."
+ por "Função '%-.192s' já existe"
+ rum "Functia '%-.192s' exista deja"
+ rus "Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ '%-.192s' уже ÑущеÑтвует"
+ serbian "Funkcija '%-.192s' već postoji"
+ slo "Funkcia '%-.192s' už existuje"
+ spa "Función '%-.192s' ya existe"
+ swe "Funktionen '%-.192s' finns redan"
+ ukr "Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ '%-.192s' вже Ñ–Ñнує"
+ER_CANT_OPEN_LIBRARY
+ cze "Nemohu otev-Břít sdílenou knihovnu '%-.192s' (errno: %d %-.128s)"
+ dan "Kan ikke åbne delt bibliotek '%-.192s' (errno: %d %-.128s)"
+ nla "Kan shared library '%-.192s' niet openen (Errcode: %d %-.128s)"
+ eng "Can't open shared library '%-.192s' (errno: %d %-.128s)"
+ jps "shared library '%-.192s' ã‚’é–‹ã事ãŒã§ãã¾ã›ã‚“ (errno: %d %-.128s)",
+ est "Ei suuda avada jagatud teeki '%-.192s' (veakood: %d %-.128s)"
+ fre "Impossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d %-.128s)"
+ ger "Kann Shared Library '%-.192s' nicht öffnen (Fehler: %d %-.128s)"
+ greek "Δεν είναι δυνατή η ανάγνωση της shared library '%-.192s' (κωδικός λάθους: %d %-.128s)"
+ hun "A(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)"
+ ita "Impossibile aprire la libreria condivisa '%-.192s' (errno: %d %-.128s)"
+ jpn "shared library '%-.192s' ã‚’é–‹ã事ãŒã§ãã¾ã›ã‚“ (errno: %d %-.128s)"
+ kor "'%-.192s' 공유 ë¼ì´ë²„러리를 열수 없습니다.(ì—러번호: %d %-.128s)"
+ nor "Can't open shared library '%-.192s' (errno: %d %-.128s)"
+ norwegian-ny "Can't open shared library '%-.192s' (errno: %d %-.128s)"
+ pol "Can't open shared library '%-.192s' (errno: %d %-.128s)"
+ por "Não pode abrir biblioteca compartilhada '%-.192s' (erro no. %d '%-.128s')"
+ rum "Nu pot deschide libraria shared '%-.192s' (Eroare: %d %-.128s)"
+ rus "Ðевозможно открыть динамичеÑкую библиотеку '%-.192s' (ошибка: %d %-.128s)"
+ serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d %-.128s)"
+ slo "Nemôžem otvoriť zdieľanú knižnicu '%-.192s' (chybový kód: %d %-.128s)"
+ spa "No puedo abrir libraria conjugada '%-.192s' (errno: %d %-.128s)"
+ swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d %-.128s)"
+ ukr "Ðе можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d %-.128s)"
+ER_CANT_FIND_DL_ENTRY
+ cze "Nemohu naj-Bít funkci '%-.128s' v knihovně"
+ dan "Kan ikke finde funktionen '%-.128s' i bibliotek"
+ nla "Kan functie '%-.128s' niet in library vinden"
+ eng "Can't find symbol '%-.128s' in library"
+ jps "function '%-.128s' をライブラリー中ã«è¦‹ä»˜ã‘る事ãŒã§ãã¾ã›ã‚“",
+ est "Ei leia funktsiooni '%-.128s' antud teegis"
+ fre "Impossible de trouver la fonction '%-.128s' dans la bibliothèque"
+ ger "Kann Funktion '%-.128s' in der Library nicht finden"
+ greek "Δεν είναι δυνατή η ανεÏÏεση της συνάÏτησης '%-.128s' στην βιβλιοθήκη"
+ hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban"
+ ita "Impossibile trovare la funzione '%-.128s' nella libreria"
+ jpn "function '%-.128s' をライブラリー中ã«è¦‹ä»˜ã‘る事ãŒã§ãã¾ã›ã‚“"
+ kor "ë¼ì´ë²„러리ì—ì„œ '%-.128s' 함수를 ì°¾ì„ ìˆ˜ 없습니다."
+ por "Não pode encontrar a função '%-.128s' na biblioteca"
+ rum "Nu pot gasi functia '%-.128s' in libraria"
+ rus "Ðевозможно отыÑкать Ñимвол '%-.128s' в библиотеке"
+ serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci"
+ slo "Nemôžem nájsť funkciu '%-.128s' v knižnici"
+ spa "No puedo encontrar función '%-.128s' en libraria"
+ swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket"
+ ukr "Ðе можу знайти функцію '%-.128s' у бібліотеці"
+ER_FUNCTION_NOT_DEFINED
+ cze "Funkce '%-.192s' nen-Bí definována"
+ dan "Funktionen '%-.192s' er ikke defineret"
+ nla "Functie '%-.192s' is niet gedefinieerd"
+ eng "Function '%-.192s' is not defined"
+ jps "Function '%-.192s' ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "Funktsioon '%-.192s' ei ole defineeritud"
+ fre "La fonction '%-.192s' n'est pas définie"
+ ger "Funktion '%-.192s' ist nicht definiert"
+ greek "Η συνάÏτηση '%-.192s' δεν έχει οÏισθεί"
+ hun "A '%-.192s' fuggveny nem definialt"
+ ita "La funzione '%-.192s' non e` definita"
+ jpn "Function '%-.192s' ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "'%-.192s' 함수가 ì •ì˜ë˜ì–´ 있지 않습니다."
+ por "Função '%-.192s' não está definida"
+ rum "Functia '%-.192s' nu e definita"
+ rus "Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ '%-.192s' не определена"
+ serbian "Funkcija '%-.192s' nije definisana"
+ slo "Funkcia '%-.192s' nie je definovaná"
+ spa "Función '%-.192s' no está definida"
+ swe "Funktionen '%-.192s' är inte definierad"
+ ukr "Функцію '%-.192s' не визначено"
+ER_HOST_IS_BLOCKED
+ cze "Stroj '%-.64s' je zablokov-Bán kvůli mnoha chybám při připojování. Odblokujete použitím 'mysqladmin flush-hosts'"
+ dan "Værten '%-.64s' er blokeret på grund af mange fejlforespørgsler. Lås op med 'mysqladmin flush-hosts'"
+ nla "Host '%-.64s' is geblokkeeerd vanwege te veel verbindings fouten. Deblokkeer met 'mysqladmin flush-hosts'"
+ eng "Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
+ jps "Host '%-.64s' 㯠many connection error ã®ãŸã‚ã€æ‹’å¦ã•ã‚Œã¾ã—ãŸ. 'mysqladmin flush-hosts' ã§è§£é™¤ã—ã¦ãã ã•ã„",
+ est "Masin '%-.64s' on blokeeritud hulgaliste ühendusvigade tõttu. Blokeeringu saab tühistada 'mysqladmin flush-hosts' käsuga"
+ fre "L'hôte '%-.64s' est bloqué à cause d'un trop grand nombre d'erreur de connexion. Débloquer le par 'mysqladmin flush-hosts'"
+ ger "Host '%-.64s' blockiert wegen zu vieler Verbindungsfehler. Aufheben der Blockierung mit 'mysqladmin flush-hosts'"
+ greek "Ο υπολογιστής '%-.64s' έχει αποκλεισθεί λόγω πολλαπλών λαθών σÏνδεσης. ΠÏοσπαθήστε να διοÏώσετε με 'mysqladmin flush-hosts'"
+ hun "A '%-.64s' host blokkolodott, tul sok kapcsolodasi hiba miatt. Hasznalja a 'mysqladmin flush-hosts' parancsot"
+ ita "Sistema '%-.64s' bloccato a causa di troppi errori di connessione. Per sbloccarlo: 'mysqladmin flush-hosts'"
+ jpn "Host '%-.64s' 㯠many connection error ã®ãŸã‚ã€æ‹’å¦ã•ã‚Œã¾ã—ãŸ. 'mysqladmin flush-hosts' ã§è§£é™¤ã—ã¦ãã ã•ã„"
+ kor "너무 ë§Žì€ ì—°ê²°ì˜¤ë¥˜ë¡œ ì¸í•˜ì—¬ 호스트 '%-.64s'는 블ë½ë˜ì—ˆìŠµë‹ˆë‹¤. 'mysqladmin flush-hosts'를 ì´ìš©í•˜ì—¬ 블ë½ì„ 해제하세요"
+ por "'Host' '%-.64s' está bloqueado devido a muitos erros de conexão. Desbloqueie com 'mysqladmin flush-hosts'"
+ rum "Host-ul '%-.64s' e blocat din cauza multelor erori de conectie. Poti deploca folosind 'mysqladmin flush-hosts'"
+ rus "ХоÑÑ‚ '%-.64s' заблокирован из-за Ñлишком большого количеÑтва ошибок ÑоединениÑ. Разблокировать его можно Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ 'mysqladmin flush-hosts'"
+ serbian "Host '%-.64s' je blokiran zbog previše grešaka u konekciji. Možete ga odblokirati pomoću komande 'mysqladmin flush-hosts'"
+ spa "Servidor '%-.64s' está bloqueado por muchos errores de conexión. Desbloquear con 'mysqladmin flush-hosts'"
+ swe "Denna dator, '%-.64s', är blockerad pga många felaktig paket. Gör 'mysqladmin flush-hosts' för att ta bort alla blockeringarna"
+ ukr "ХоÑÑ‚ '%-.64s' заблоковано з причини великої кількоÑÑ‚Ñ– помилок з'єднаннÑ. Ð”Ð»Ñ Ñ€Ð¾Ð·Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтовуйте 'mysqladmin flush-hosts'"
+ER_HOST_NOT_PRIVILEGED
+ cze "Stroj '%-.64s' nem-Bá povoleno se k tomuto MySQL serveru připojit"
+ dan "Værten '%-.64s' kan ikke tilkoble denne MySQL-server"
+ nla "Het is host '%-.64s' is niet toegestaan verbinding te maken met deze MySQL server"
+ eng "Host '%-.64s' is not allowed to connect to this MySQL server"
+ jps "Host '%-.64s' 㯠MySQL server ã«æŽ¥ç¶šã‚’許å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "Masinal '%-.64s' puudub ligipääs sellele MySQL serverile"
+ fre "Le hôte '%-.64s' n'est pas authorisé à se connecter à ce serveur MySQL"
+ ger "Host '%-.64s' hat keine Berechtigung, sich mit diesem MySQL-Server zu verbinden"
+ greek "Ο υπολογιστής '%-.64s' δεν έχει δικαίωμα σÏνδεσης με τον MySQL server"
+ hun "A '%-.64s' host szamara nem engedelyezett a kapcsolodas ehhez a MySQL szerverhez"
+ ita "Al sistema '%-.64s' non e` consentita la connessione a questo server MySQL"
+ jpn "Host '%-.64s' 㯠MySQL server ã«æŽ¥ç¶šã‚’許å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "'%-.64s' 호스트는 ì´ MySQLì„œë²„ì— ì ‘ì†í•  허가를 받지 못했습니다."
+ por "'Host' '%-.64s' não tem permissão para se conectar com este servidor MySQL"
+ rum "Host-ul '%-.64s' nu este permis a se conecta la aceste server MySQL"
+ rus "ХоÑту '%-.64s' не разрешаетÑÑ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡Ð°Ñ‚ÑŒÑÑ Ðº Ñтому Ñерверу MySQL"
+ serbian "Host-u '%-.64s' nije dozvoljeno da se konektuje na ovaj MySQL server"
+ spa "Servidor '%-.64s' no está permitido para conectar con este servidor MySQL"
+ swe "Denna dator, '%-.64s', har inte privileger att använda denna MySQL server"
+ ukr "ХоÑту '%-.64s' не доволено зв'ÑзуватиÑÑŒ з цим Ñервером MySQL"
+ER_PASSWORD_ANONYMOUS_USER 42000
+ cze "Pou-Bžíváte MySQL jako anonymní uživatel a anonymní uživatelé nemají povoleno měnit hesla"
+ dan "Du bruger MySQL som anonym bruger. Anonyme brugere må ikke ændre adgangskoder"
+ nla "U gebruikt MySQL als anonieme gebruiker en deze mogen geen wachtwoorden wijzigen"
+ eng "You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords"
+ jps "MySQL ã‚’ anonymous users ã§ä½¿ç”¨ã—ã¦ã„る状態ã§ã¯ã€ãƒ‘スワードã®å¤‰æ›´ã¯ã§ãã¾ã›ã‚“",
+ est "Te kasutate MySQL-i anonüümse kasutajana, kelledel pole parooli muutmise õigust"
+ fre "Vous utilisez un utilisateur anonyme et les utilisateurs anonymes ne sont pas autorisés à changer les mots de passe"
+ ger "Sie benutzen MySQL als anonymer Benutzer und dürfen daher keine Passwörter ändern"
+ greek "ΧÏησιμοποιείτε την MySQL σαν anonymous user και έτσι δεν μποÏείτε να αλλάξετε τα passwords άλλων χÏηστών"
+ hun "Nevtelen (anonymous) felhasznalokent nem negedelyezett a jelszovaltoztatas"
+ ita "Impossibile cambiare la password usando MySQL come utente anonimo"
+ jpn "MySQL ã‚’ anonymous users ã§ä½¿ç”¨ã—ã¦ã„る状態ã§ã¯ã€ãƒ‘スワードã®å¤‰æ›´ã¯ã§ãã¾ã›ã‚“"
+ kor "ë‹¹ì‹ ì€ MySQLì„œë²„ì— ìµëª…ì˜ ì‚¬ìš©ìžë¡œ ì ‘ì†ì„ 하셨습니다.ìµëª…ì˜ ì‚¬ìš©ìžëŠ” 암호를 변경할 수 없습니다."
+ por "Você está usando o MySQL como usuário anônimo e usuários anônimos não têm permissão para mudar senhas"
+ rum "Dumneavoastra folositi MySQL ca un utilizator anonim si utilizatorii anonimi nu au voie sa schime parolele"
+ rus "Ð’Ñ‹ иÑпользуете MySQL от имени анонимного пользователÑ, а анонимным пользователÑм не разрешаетÑÑ Ð¼ÐµÐ½ÑÑ‚ÑŒ пароли"
+ serbian "Vi koristite MySQL kao anonimni korisnik a anonimnim korisnicima nije dozvoljeno da menjaju lozinke"
+ spa "Tu estás usando MySQL como un usuario anonimo y usuarios anonimos no tienen permiso para cambiar las claves"
+ swe "Du använder MySQL som en anonym användare och som sådan får du inte ändra ditt lösenord"
+ ukr "Ви викориÑтовуєте MySQL Ñк анонімний кориÑтувач, тому вам не дозволено змінювати паролі"
+ER_PASSWORD_NOT_ALLOWED 42000
+ cze "Na zm-Běnu hesel ostatním musíte mít právo provést update tabulek v databázi mysql"
+ dan "Du skal have tilladelse til at opdatere tabeller i MySQL databasen for at ændre andres adgangskoder"
+ nla "U moet tabel update priveleges hebben in de mysql database om wachtwoorden voor anderen te mogen wijzigen"
+ eng "You must have privileges to update tables in the mysql database to be able to change passwords for others"
+ jps "ä»–ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ‘スワードを変更ã™ã‚‹ãŸã‚ã«ã¯, mysql データベースã«å¯¾ã—㦠update ã®è¨±å¯ãŒãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“.",
+ est "Teiste paroolide muutmiseks on nõutav tabelite muutmisõigus 'mysql' andmebaasis"
+ fre "Vous devez avoir le privilège update sur les tables de la base de donnée mysql pour pouvoir changer les mots de passe des autres"
+ ger "Sie benötigen die Berechtigung zum Aktualisieren von Tabellen in der Datenbank 'mysql', um die Passwörter anderer Benutzer ändern zu können"
+ greek "ΠÏέπει να έχετε δικαίωμα διόÏθωσης πινάκων (update) στη βάση δεδομένων mysql για να μποÏείτε να αλλάξετε τα passwords άλλων χÏηστών"
+ hun "Onnek tabla-update joggal kell rendelkeznie a mysql adatbazisban masok jelszavanak megvaltoztatasahoz"
+ ita "E` necessario il privilegio di update sulle tabelle del database mysql per cambiare le password per gli altri utenti"
+ jpn "ä»–ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ‘スワードを変更ã™ã‚‹ãŸã‚ã«ã¯, mysql データベースã«å¯¾ã—㦠update ã®è¨±å¯ãŒãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“."
+ kor "ë‹¹ì‹ ì€ ë‹¤ë¥¸ì‚¬ìš©ìžë“¤ì˜ 암호를 변경할 수 있ë„ë¡ ë°ì´íƒ€ë² ì´ìŠ¤ ë³€ê²½ê¶Œí•œì„ ê°€ì ¸ì•¼ 합니다."
+ por "Você deve ter privilégios para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros"
+ rum "Trebuie sa aveti privilegii sa actualizati tabelele in bazele de date mysql ca sa puteti sa schimati parolele altora"
+ rus "Ð”Ð»Ñ Ñ‚Ð¾Ð³Ð¾ чтобы изменÑÑ‚ÑŒ пароли других пользователей, у Ð²Ð°Ñ Ð´Ð¾Ð»Ð¶Ð½Ñ‹ быть привилегии на изменение таблиц в базе данных mysql"
+ serbian "Morate imati privilegije da možete da update-ujete određene tabele ako želite da menjate lozinke za druge korisnike"
+ spa "Tu debes de tener permiso para actualizar tablas en la base de datos mysql para cambiar las claves para otros"
+ swe "För att ändra lösenord för andra måste du ha rättigheter att uppdatera mysql-databasen"
+ ukr "Ви повині мати право на Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†ÑŒ у базі данних mysql, аби мати можливіÑÑ‚ÑŒ змінювати пароль іншим"
+ER_PASSWORD_NO_MATCH 42000
+ cze "V tabulce user nen-Bí žádný odpovídající řádek"
+ dan "Kan ikke finde nogen tilsvarende poster i bruger tabellen"
+ nla "Kan geen enkele passende rij vinden in de gebruikers tabel"
+ eng "Can't find any matching row in the user table"
+ est "Ei leia vastavat kirjet kasutajate tabelis"
+ fre "Impossible de trouver un enregistrement correspondant dans la table user"
+ ger "Kann keinen passenden Datensatz in Tabelle 'user' finden"
+ greek "Δεν είναι δυνατή η ανεÏÏεση της αντίστοιχης εγγÏαφής στον πίνακα των χÏηστών"
+ hun "Nincs megegyezo sor a user tablaban"
+ ita "Impossibile trovare la riga corrispondente nella tabella user"
+ kor "ì‚¬ìš©ìž í…Œì´ë¸”ì—ì„œ ì¼ì¹˜í•˜ëŠ” ê²ƒì„ ì°¾ì„ ìˆ˜ ì—†ì니다."
+ por "Não pode encontrar nenhuma linha que combine na tabela usuário (user table)"
+ rum "Nu pot gasi nici o linie corespunzatoare in tabela utilizatorului"
+ rus "Ðевозможно отыÑкать подходÑщую запиÑÑŒ в таблице пользователей"
+ serbian "Ne mogu da pronađem odgovarajući slog u 'user' tabeli"
+ spa "No puedo encontrar una línea correponsdiente en la tabla user"
+ swe "Hittade inte användaren i 'user'-tabellen"
+ ukr "Ðе можу знайти відповідних запиÑів у таблиці кориÑтувача"
+ER_UPDATE_INFO
+ cze "Nalezen-Bých řádků: %ld Změněno: %ld Varování: %ld"
+ dan "Poster fundet: %ld Ændret: %ld Advarsler: %ld"
+ nla "Passende rijen: %ld Gewijzigd: %ld Waarschuwingen: %ld"
+ eng "Rows matched: %ld Changed: %ld Warnings: %ld"
+ jps "一致数(Rows matched): %ld 変更: %ld Warnings: %ld",
+ est "Sobinud kirjeid: %ld Muudetud: %ld Hoiatusi: %ld"
+ fre "Enregistrements correspondants: %ld Modifiés: %ld Warnings: %ld"
+ ger "Datensätze gefunden: %ld Geändert: %ld Warnungen: %ld"
+ hun "Megegyezo sorok szama: %ld Valtozott: %ld Warnings: %ld"
+ ita "Rows riconosciute: %ld Cambiate: %ld Warnings: %ld"
+ jpn "一致数(Rows matched): %ld 変更: %ld Warnings: %ld"
+ kor "ì¼ì¹˜í•˜ëŠ” Rows : %ldê°œ 변경ë¨: %ldê°œ 경고: %ldê°œ"
+ por "Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld"
+ rum "Linii identificate (matched): %ld Schimbate: %ld Atentionari (warnings): %ld"
+ rus "Совпало запиÑей: %ld Изменено: %ld Предупреждений: %ld"
+ serbian "Odgovarajućih slogova: %ld Promenjeno: %ld Upozorenja: %ld"
+ spa "Líneas correspondientes: %ld Cambiadas: %ld Avisos: %ld"
+ swe "Rader: %ld Uppdaterade: %ld Varningar: %ld"
+ ukr "ЗапиÑів відповідає: %ld Змінено: %ld ЗаÑтережень: %ld"
+ER_CANT_CREATE_THREAD
+ cze "Nemohu vytvo-BÅ™it nový thread (errno %d). Pokud je jeÅ¡tÄ› nÄ›jaká volná paměť, podívejte se do manuálu na Äást o chybách specifických pro jednotlivé operaÄní systémy"
+ dan "Kan ikke danne en ny tråd (fejl nr. %d). Hvis computeren ikke er løbet tør for hukommelse, kan du se i brugervejledningen for en mulig operativ-system - afhængig fejl"
+ nla "Kan geen nieuwe thread aanmaken (Errcode: %d). Indien er geen tekort aan geheugen is kunt u de handleiding consulteren over een mogelijke OS afhankelijke fout"
+ eng "Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug"
+ jps "æ–°è¦ã«ã‚¹ãƒ¬ãƒƒãƒ‰ãŒä½œã‚Œã¾ã›ã‚“ã§ã—㟠(errno %d). ã‚‚ã—最大使用許å¯ãƒ¡ãƒ¢ãƒªãƒ¼æ•°ã‚’越ãˆã¦ã„ãªã„ã®ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¦ã„ã‚‹ãªã‚‰, マニュアルã®ä¸­ã‹ã‚‰ 'possible OS-dependent bug' ã¨ã„ã†æ–‡å­—を探ã—ã¦ãã¿ã¦ã ã•ã„.",
+ est "Ei suuda luua uut lõime (veakood %d). Kui mälu ei ole otsas, on tõenäoliselt tegemist operatsioonisüsteemispetsiifilise veaga"
+ fre "Impossible de créer une nouvelle tâche (errno %d). S'il reste de la mémoire libre, consultez le manual pour trouver un éventuel bug dépendant de l'OS"
+ ger "Kann keinen neuen Thread erzeugen (Fehler: %d). Sollte noch Speicher verfügbar sein, bitte im Handbuch wegen möglicher Fehler im Betriebssystem nachschlagen"
+ hun "Uj thread letrehozasa nem lehetseges (Hibakod: %d). Amenyiben van meg szabad memoria, olvassa el a kezikonyv operacios rendszerfuggo hibalehetosegekrol szolo reszet"
+ ita "Impossibile creare un nuovo thread (errno %d). Se non ci sono problemi di memoria disponibile puoi consultare il manuale per controllare possibili problemi dipendenti dal SO"
+ jpn "æ–°è¦ã«ã‚¹ãƒ¬ãƒƒãƒ‰ãŒä½œã‚Œã¾ã›ã‚“ã§ã—㟠(errno %d). ã‚‚ã—最大使用許å¯ãƒ¡ãƒ¢ãƒªãƒ¼æ•°ã‚’越ãˆã¦ã„ãªã„ã®ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¦ã„ã‚‹ãªã‚‰, マニュアルã®ä¸­ã‹ã‚‰ 'possible OS-dependent bug' ã¨ã„ã†æ–‡å­—を探ã—ã¦ãã¿ã¦ã ã•ã„."
+ kor "새로운 쓰레드를 만들 수 없습니다.(ì—러번호 %d). 만약 여유메모리가 있다면 OS-dependent버그 ì˜ ë©”ë‰´ì–¼ ë¶€ë¶„ì„ ì°¾ì•„ë³´ì‹œì˜¤."
+ nor "Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
+ norwegian-ny "Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
+ pol "Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug"
+ por "Não pode criar uma nova 'thread' (erro no. %d). Se você não estiver sem memória disponível, você pode consultar o manual sobre um possível 'bug' dependente do sistema operacional"
+ rum "Nu pot crea un thread nou (Eroare %d). Daca mai aveti memorie disponibila in sistem, puteti consulta manualul - ar putea exista un potential bug in legatura cu sistemul de operare"
+ rus "Ðевозможно Ñоздать новый поток (ошибка %d). ЕÑли Ñто не ÑитуациÑ, ÑвÑÐ·Ð°Ð½Ð½Ð°Ñ Ñ Ð½ÐµÑ…Ð²Ð°Ñ‚ÐºÐ¾Ð¹ памÑти, то вам Ñледует изучить документацию на предмет опиÑÐ°Ð½Ð¸Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾Ð¹ ошибки работы в конкретной ОС"
+ serbian "Ne mogu da kreiram novi thread (errno %d). Ako imate joÅ¡ slobodne memorije, trebali biste da pogledate u priruÄniku da li je ovo specifiÄna greÅ¡ka vaÅ¡eg operativnog sistema"
+ spa "No puedo crear un nuevo thread (errno %d). Si tu está con falta de memoria disponible, tu puedes consultar el Manual para posibles problemas con SO"
+ swe "Kan inte skapa en ny tråd (errno %d)"
+ ukr "Ðе можу Ñтворити нову гілку (помилка %d). Якщо ви не викориÑтали уÑÑŽ пам'ÑÑ‚ÑŒ, то прочитайте документацію до вашої ОС - можливо це помилка ОС"
+ER_WRONG_VALUE_COUNT_ON_ROW 21S01
+ cze "Po-BÄet sloupců neodpovídá poÄtu hodnot na řádku %ld"
+ dan "Kolonne antallet stemmer ikke overens med antallet af værdier i post %ld"
+ nla "Kolom aantal komt niet overeen met waarde aantal in rij %ld"
+ eng "Column count doesn't match value count at row %ld"
+ est "Tulpade hulk erineb väärtuste hulgast real %ld"
+ ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %ld überein"
+ hun "Az oszlopban talalhato ertek nem egyezik meg a %ld sorban szamitott ertekkel"
+ ita "Il numero delle colonne non corrisponde al conteggio alla riga %ld"
+ kor "Row %ldì—ì„œ 칼럼 카운트와 value 카운터와 ì¼ì¹˜í•˜ì§€ 않습니다."
+ por "Contagem de colunas não confere com a contagem de valores na linha %ld"
+ rum "Numarul de coloane nu corespunde cu numarul de valori la linia %ld"
+ rus "КоличеÑтво Ñтолбцов не Ñовпадает Ñ ÐºÐ¾Ð»Ð¸Ñ‡ÐµÑтвом значений в запиÑи %ld"
+ serbian "Broj kolona ne odgovara broju vrednosti u slogu %ld"
+ spa "El número de columnas no corresponde al número en la línea %ld"
+ swe "Antalet kolumner motsvarar inte antalet värden på rad: %ld"
+ ukr "КількіÑÑ‚ÑŒ Ñтовбців не Ñпівпадає з кількіÑÑ‚ÑŽ значень у Ñтроці %ld"
+ER_CANT_REOPEN_TABLE
+ cze "Nemohu znovuotev-Břít tabulku: '%-.192s"
+ dan "Kan ikke genåbne tabel '%-.192s"
+ nla "Kan tabel niet opnieuw openen: '%-.192s"
+ eng "Can't reopen table: '%-.192s'"
+ est "Ei suuda taasavada tabelit '%-.192s'"
+ fre "Impossible de réouvrir la table: '%-.192s"
+ ger "Kann Tabelle'%-.192s' nicht erneut öffnen"
+ hun "Nem lehet ujra-megnyitni a tablat: '%-.192s"
+ ita "Impossibile riaprire la tabella: '%-.192s'"
+ kor "í…Œì´ë¸”ì„ ë‹¤ì‹œ 열수 없군요: '%-.192s"
+ nor "Can't reopen table: '%-.192s"
+ norwegian-ny "Can't reopen table: '%-.192s"
+ pol "Can't reopen table: '%-.192s"
+ por "Não pode reabrir a tabela '%-.192s"
+ rum "Nu pot redeschide tabela: '%-.192s'"
+ rus "Ðевозможно заново открыть таблицу '%-.192s'"
+ serbian "Ne mogu da ponovo otvorim tabelu '%-.192s'"
+ slo "Can't reopen table: '%-.192s"
+ spa "No puedo reabrir tabla: '%-.192s"
+ swe "Kunde inte stänga och öppna tabell '%-.192s"
+ ukr "Ðе можу перевідкрити таблицю: '%-.192s'"
+ER_INVALID_USE_OF_NULL 22004
+ cze "Neplatn-Bé užití hodnoty NULL"
+ dan "Forkert brug af nulværdi (NULL)"
+ nla "Foutief gebruik van de NULL waarde"
+ eng "Invalid use of NULL value"
+ jps "NULL 値ã®ä½¿ç”¨æ–¹æ³•ãŒä¸é©åˆ‡ã§ã™",
+ est "NULL väärtuse väärkasutus"
+ fre "Utilisation incorrecte de la valeur NULL"
+ ger "Unerlaubte Verwendung eines NULL-Werts"
+ hun "A NULL ervenytelen hasznalata"
+ ita "Uso scorretto del valore NULL"
+ jpn "NULL 値ã®ä½¿ç”¨æ–¹æ³•ãŒä¸é©åˆ‡ã§ã™"
+ kor "NULL ê°’ì„ ìž˜ëª» 사용하셨군요..."
+ por "Uso inválido do valor NULL"
+ rum "Folosirea unei value NULL e invalida"
+ rus "Ðеправильное иÑпользование величины NULL"
+ serbian "Pogrešna upotreba vrednosti NULL"
+ spa "Invalido uso de valor NULL"
+ swe "Felaktig använding av NULL"
+ ukr "Хибне викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ NULL"
+ER_REGEXP_ERROR 42000
+ cze "Regul-Bární výraz vrátil chybu '%-.64s'"
+ dan "Fik fejl '%-.64s' fra regexp"
+ nla "Fout '%-.64s' ontvangen van regexp"
+ eng "Got error '%-.64s' from regexp"
+ est "regexp tagastas vea '%-.64s'"
+ fre "Erreur '%-.64s' provenant de regexp"
+ ger "regexp lieferte Fehler '%-.64s'"
+ hun "'%-.64s' hiba a regularis kifejezes hasznalata soran (regexp)"
+ ita "Errore '%-.64s' da regexp"
+ kor "regexpì—ì„œ '%-.64s'ê°€ 났습니다."
+ por "Obteve erro '%-.64s' em regexp"
+ rum "Eroarea '%-.64s' obtinuta din expresia regulara (regexp)"
+ rus "Получена ошибка '%-.64s' от регулÑрного выражениÑ"
+ serbian "Funkcija regexp je vratila grešku '%-.64s'"
+ spa "Obtenido error '%-.64s' de regexp"
+ swe "Fick fel '%-.64s' från REGEXP"
+ ukr "Отримано помилку '%-.64s' від регулÑрного виразу"
+ER_MIX_OF_GROUP_FUNC_AND_FIELDS 42000
+ cze "Pokud nen-Bí žádná GROUP BY klauzule, není dovoleno souÄasné použití GROUP položek (MIN(),MAX(),COUNT()...) s ne GROUP položkami"
+ dan "Sammenblanding af GROUP kolonner (MIN(),MAX(),COUNT()...) uden GROUP kolonner er ikke tilladt, hvis der ikke er noget GROUP BY prædikat"
+ nla "Het mixen van GROUP kolommen (MIN(),MAX(),COUNT()...) met no-GROUP kolommen is foutief indien er geen GROUP BY clausule is"
+ eng "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause"
+ est "GROUP tulpade (MIN(),MAX(),COUNT()...) kooskasutamine tavaliste tulpadega ilma GROUP BY klauslita ei ole lubatud"
+ fre "Mélanger les colonnes GROUP (MIN(),MAX(),COUNT()...) avec des colonnes normales est interdit s'il n'y a pas de clause GROUP BY"
+ ger "Das Vermischen von GROUP-Feldern (MIN(),MAX(),COUNT()...) mit Nicht-GROUP-Feldern ist nicht zulässig, wenn keine GROUP-BY-Klausel vorhanden ist"
+ hun "A GROUP mezok (MIN(),MAX(),COUNT()...) kevert hasznalata nem lehetseges GROUP BY hivatkozas nelkul"
+ ita "Il mescolare funzioni di aggregazione (MIN(),MAX(),COUNT()...) e non e` illegale se non c'e` una clausula GROUP BY"
+ kor "Mixing of GROUP 칼럼s (MIN(),MAX(),COUNT(),...) with no GROUP 칼럼s is illegal if there is no GROUP BY clause"
+ por "Mistura de colunas agrupadas (com MIN(), MAX(), COUNT(), ...) com colunas não agrupadas é ilegal, se não existir uma cláusula de agrupamento (cláusula GROUP BY)"
+ rum "Amestecarea de coloane GROUP (MIN(),MAX(),COUNT()...) fara coloane GROUP este ilegala daca nu exista o clauza GROUP BY"
+ rus "Одновременное иÑпользование Ñгруппированных (GROUP) Ñтолбцов (MIN(),MAX(),COUNT(),...) Ñ Ð½ÐµÑгруппированными Ñтолбцами ÑвлÑетÑÑ Ð½ÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼, еÑли в выражении еÑÑ‚ÑŒ GROUP BY"
+ serbian "Upotreba agregatnih funkcija (MIN(),MAX(),COUNT()...) bez 'GROUP' kolona je pogrešna ako ne postoji 'GROUP BY' iskaz"
+ spa "Mezcla de columnas GROUP (MIN(),MAX(),COUNT()...) con no GROUP columnas es ilegal si no hat la clausula GROUP BY"
+ swe "Man får ha både GROUP-kolumner (MIN(),MAX(),COUNT()...) och fält i en fråga om man inte har en GROUP BY-del"
+ ukr "Ð—Ð¼Ñ–ÑˆÑƒÐ²Ð°Ð½Ð½Ñ GROUP Ñтовбців (MIN(),MAX(),COUNT()...) з не GROUP ÑтовбцÑми Ñ” забороненим, Ñкщо не має GROUP BY"
+ER_NONEXISTING_GRANT 42000
+ cze "Neexistuje odpov-Bídající grant pro uživatele '%-.48s' na stroji '%-.64s'"
+ dan "Denne tilladelse findes ikke for brugeren '%-.48s' på vært '%-.64s'"
+ nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s'"
+ eng "There is no such grant defined for user '%-.48s' on host '%-.64s'"
+ jps "ユーザー '%-.48s' (ホスト '%-.64s' ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼) ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s'"
+ fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s'"
+ ger "Für Benutzer '%-.48s' auf Host '%-.64s' gibt es keine solche Berechtigung"
+ hun "A '%-.48s' felhasznalonak nincs ilyen joga a '%-.64s' host-on"
+ ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s'"
+ jpn "ユーザー '%-.48s' (ホスト '%-.64s' ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼) ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "ì‚¬ìš©ìž '%-.48s' (호스트 '%-.64s')를 위하여 ì •ì˜ëœ 그런 승ì¸ì€ 없습니다."
+ por "Não existe tal permissão (grant) definida para o usuário '%-.48s' no 'host' '%-.64s'"
+ rum "Nu exista un astfel de grant definit pentru utilzatorul '%-.48s' de pe host-ul '%-.64s'"
+ rus "Такие права не определены Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s' на хоÑте '%-.64s'"
+ serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s'"
+ spa "No existe permiso definido para usuario '%-.48s' en el servidor '%-.64s'"
+ swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s'"
+ ukr "Повноважень не визначено Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувача '%-.48s' з хоÑту '%-.64s'"
+ER_TABLEACCESS_DENIED_ERROR 42000
+ cze "%-.16s p-Bříkaz nepřístupný pro uživatele: '%-.48s'@'%-.64s' pro tabulku '%-.192s'"
+ dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.48s'@'%-.64s' for tabellen '%-.192s'"
+ nla "%-.16s commando geweigerd voor gebruiker: '%-.48s'@'%-.64s' voor tabel '%-.192s'"
+ eng "%-.16s command denied to user '%-.48s'@'%-.64s' for table '%-.192s'"
+ jps "コマンド %-.16s 㯠ユーザー '%-.48s'@'%-.64s' ,テーブル '%-.192s' ã«å¯¾ã—ã¦è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "%-.16s käsk ei ole lubatud kasutajale '%-.48s'@'%-.64s' tabelis '%-.192s'"
+ fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.48s'@'@%-.64s' sur la table '%-.192s'"
+ ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.48s'@'%-.64s' auf Tabelle '%-.192s'"
+ hun "%-.16s parancs a '%-.48s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.192s' tablaban"
+ ita "Comando %-.16s negato per l'utente: '%-.48s'@'%-.64s' sulla tabella '%-.192s'"
+ jpn "コマンド %-.16s 㯠ユーザー '%-.48s'@'%-.64s' ,テーブル '%-.192s' ã«å¯¾ã—ã¦è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "'%-.16s' ëª…ë ¹ì€ ë‹¤ìŒ ì‚¬ìš©ìžì—게 거부ë˜ì—ˆìŠµë‹ˆë‹¤. : '%-.48s'@'%-.64s' for í…Œì´ë¸” '%-.192s'"
+ por "Comando '%-.16s' negado para o usuário '%-.48s'@'%-.64s' na tabela '%-.192s'"
+ rum "Comanda %-.16s interzisa utilizatorului: '%-.48s'@'%-.64s' pentru tabela '%-.192s'"
+ rus "Команда %-.16s запрещена пользователю '%-.48s'@'%-.64s' Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹ '%-.192s'"
+ serbian "%-.16s komanda zabranjena za korisnika '%-.48s'@'%-.64s' za tabelu '%-.192s'"
+ spa "%-.16s comando negado para usuario: '%-.48s'@'%-.64s' para tabla '%-.192s'"
+ swe "%-.16s ej tillåtet för '%-.48s'@'%-.64s' för tabell '%-.192s'"
+ ukr "%-.16s команда заборонена кориÑтувачу: '%-.48s'@'%-.64s' у таблиці '%-.192s'"
+ER_COLUMNACCESS_DENIED_ERROR 42000
+ cze "%-.16s p-Bříkaz nepřístupný pro uživatele: '%-.48s'@'%-.64s' pro sloupec '%-.192s' v tabulce '%-.192s'"
+ dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.48s'@'%-.64s' for kolonne '%-.192s' in tabellen '%-.192s'"
+ nla "%-.16s commando geweigerd voor gebruiker: '%-.48s'@'%-.64s' voor kolom '%-.192s' in tabel '%-.192s'"
+ eng "%-.16s command denied to user '%-.48s'@'%-.64s' for column '%-.192s' in table '%-.192s'"
+ jps "コマンド %-.16s 㯠ユーザー '%-.48s'@'%-.64s'Â¥n カラム '%-.192s' テーブル '%-.192s' ã«å¯¾ã—ã¦è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“",
+ est "%-.16s käsk ei ole lubatud kasutajale '%-.48s'@'%-.64s' tulbale '%-.192s' tabelis '%-.192s'"
+ fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.48s'@'@%-.64s' sur la colonne '%-.192s' de la table '%-.192s'"
+ ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.48s'@'%-.64s' und Feld '%-.192s' in Tabelle '%-.192s'"
+ hun "%-.16s parancs a '%-.48s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.192s' mezo eseten a '%-.192s' tablaban"
+ ita "Comando %-.16s negato per l'utente: '%-.48s'@'%-.64s' sulla colonna '%-.192s' della tabella '%-.192s'"
+ jpn "コマンド %-.16s 㯠ユーザー '%-.48s'@'%-.64s'\n カラム '%-.192s' テーブル '%-.192s' ã«å¯¾ã—ã¦è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+ kor "'%-.16s' ëª…ë ¹ì€ ë‹¤ìŒ ì‚¬ìš©ìžì—게 거부ë˜ì—ˆìŠµë‹ˆë‹¤. : '%-.48s'@'%-.64s' for 칼럼 '%-.192s' in í…Œì´ë¸” '%-.192s'"
+ por "Comando '%-.16s' negado para o usuário '%-.48s'@'%-.64s' na coluna '%-.192s', na tabela '%-.192s'"
+ rum "Comanda %-.16s interzisa utilizatorului: '%-.48s'@'%-.64s' pentru coloana '%-.192s' in tabela '%-.192s'"
+ rus "Команда %-.16s запрещена пользователю '%-.48s'@'%-.64s' Ð´Ð»Ñ Ñтолбца '%-.192s' в таблице '%-.192s'"
+ serbian "%-.16s komanda zabranjena za korisnika '%-.48s'@'%-.64s' za kolonu '%-.192s' iz tabele '%-.192s'"
+ spa "%-.16s comando negado para usuario: '%-.48s'@'%-.64s' para columna '%-.192s' en la tabla '%-.192s'"
+ swe "%-.16s ej tillåtet för '%-.48s'@'%-.64s' för kolumn '%-.192s' i tabell '%-.192s'"
+ ukr "%-.16s команда заборонена кориÑтувачу: '%-.48s'@'%-.64s' Ð´Ð»Ñ ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%-.192s' у таблиці '%-.192s'"
+ER_ILLEGAL_GRANT_FOR_TABLE 42000
+ cze "Neplatn-Bý příkaz GRANT/REVOKE. Prosím, pÅ™eÄtÄ›te si v manuálu, jaká privilegia je možné použít."
+ dan "Forkert GRANT/REVOKE kommando. Se i brugervejledningen hvilke privilegier der kan specificeres."
+ nla "Foutief GRANT/REVOKE commando. Raadpleeg de handleiding welke priveleges gebruikt kunnen worden."
+ eng "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used"
+ est "Vigane GRANT/REVOKE käsk. Tutvu kasutajajuhendiga"
+ fre "Commande GRANT/REVOKE incorrecte. Consultez le manuel."
+ ger "Unzulässiger GRANT- oder REVOKE-Befehl. Verfügbare Berechtigungen sind im Handbuch aufgeführt"
+ greek "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used."
+ hun "Ervenytelen GRANT/REVOKE parancs. Kerem, nezze meg a kezikonyvben, milyen jogok lehetsegesek"
+ ita "Comando GRANT/REVOKE illegale. Prego consultare il manuale per sapere quali privilegi possono essere usati."
+ jpn "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used."
+ kor "ìž˜ëª»ëœ GRANT/REVOKE 명령. ì–´ë–¤ 권리와 승ì¸ì´ 사용ë˜ì–´ 질 수 있는지 ë©”ë‰´ì–¼ì„ ë³´ì‹œì˜¤."
+ nor "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used."
+ norwegian-ny "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used."
+ pol "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used."
+ por "Comando GRANT/REVOKE ilegal. Por favor consulte no manual quais privilégios podem ser usados."
+ rum "Comanda GRANT/REVOKE ilegala. Consultati manualul in privinta privilegiilor ce pot fi folosite."
+ rus "ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° GRANT или REVOKE. ОбратитеÑÑŒ к документации, чтобы выÑÑнить, какие привилегии можно иÑпользовать"
+ serbian "PogreÅ¡na 'GRANT' odnosno 'REVOKE' komanda. Molim Vas pogledajte u priruÄniku koje vrednosti mogu biti upotrebljene."
+ slo "Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used."
+ spa "Ilegal comando GRANT/REVOKE. Por favor consulte el manual para cuales permisos pueden ser usados."
+ swe "Felaktigt GRANT-privilegium använt"
+ ukr "Хибна GRANT/REVOKE команда; прочитайте документацію ÑтоÑовно того, Ñкі права можна викориÑтовувати"
+ER_GRANT_WRONG_HOST_OR_USER 42000
+ cze "Argument p-Bříkazu GRANT uživatel nebo stroj je příliš dlouhý"
+ dan "Værts- eller brugernavn for langt til GRANT"
+ nla "De host of gebruiker parameter voor GRANT is te lang"
+ eng "The host or user argument to GRANT is too long"
+ est "Masina või kasutaja nimi GRANT lauses on liiga pikk"
+ fre "L'hôte ou l'utilisateur donné en argument à GRANT est trop long"
+ ger "Das Host- oder User-Argument für GRANT ist zu lang"
+ hun "A host vagy felhasznalo argumentuma tul hosszu a GRANT parancsban"
+ ita "L'argomento host o utente per la GRANT e` troppo lungo"
+ kor "승ì¸(GRANT)ì„ ìœ„í•˜ì—¬ 사용한 사용ìžë‚˜ í˜¸ìŠ¤íŠ¸ì˜ ê°’ë“¤ì´ ë„ˆë¬´ ê¹ë‹ˆë‹¤."
+ por "Argumento de 'host' ou de usuário para o GRANT é longo demais"
+ rum "Argumentul host-ului sau utilizatorului pentru GRANT e prea lung"
+ rus "Слишком длинное Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ/хоÑта Ð´Ð»Ñ GRANT"
+ serbian "Argument 'host' ili 'korisnik' prosleÄ‘en komandi 'GRANT' je predugaÄak"
+ spa "El argumento para servidor o usuario para GRANT es demasiado grande"
+ swe "Felaktigt maskinnamn eller användarnamn använt med GRANT"
+ ukr "Ðргумент host або user Ð´Ð»Ñ GRANT задовгий"
+ER_NO_SUCH_TABLE 42S02
+ cze "Tabulka '%-.192s.%-.192s' neexistuje"
+ dan "Tabellen '%-.192s.%-.192s' eksisterer ikke"
+ nla "Tabel '%-.192s.%-.192s' bestaat niet"
+ eng "Table '%-.192s.%-.192s' doesn't exist"
+ est "Tabelit '%-.192s.%-.192s' ei eksisteeri"
+ fre "La table '%-.192s.%-.192s' n'existe pas"
+ ger "Tabelle '%-.192s.%-.192s' existiert nicht"
+ hun "A '%-.192s.%-.192s' tabla nem letezik"
+ ita "La tabella '%-.192s.%-.192s' non esiste"
+ jpn "Table '%-.192s.%-.192s' doesn't exist"
+ kor "í…Œì´ë¸” '%-.192s.%-.192s' 는 존재하지 않습니다."
+ nor "Table '%-.192s.%-.192s' doesn't exist"
+ norwegian-ny "Table '%-.192s.%-.192s' doesn't exist"
+ pol "Table '%-.192s.%-.192s' doesn't exist"
+ por "Tabela '%-.192s.%-.192s' não existe"
+ rum "Tabela '%-.192s.%-.192s' nu exista"
+ rus "Таблица '%-.192s.%-.192s' не ÑущеÑтвует"
+ serbian "Tabela '%-.192s.%-.192s' ne postoji"
+ slo "Table '%-.192s.%-.192s' doesn't exist"
+ spa "Tabla '%-.192s.%-.192s' no existe"
+ swe "Det finns ingen tabell som heter '%-.192s.%-.192s'"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ '%-.192s.%-.192s' не Ñ–Ñнує"
+ER_NONEXISTING_TABLE_GRANT 42000
+ cze "Neexistuje odpov-Bídající grant pro uživatele '%-.48s' na stroji '%-.64s' pro tabulku '%-.192s'"
+ dan "Denne tilladelse eksisterer ikke for brugeren '%-.48s' på vært '%-.64s' for tabellen '%-.192s'"
+ nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s' op tabel '%-.192s'"
+ eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'"
+ est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s' tabelile '%-.192s'"
+ fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s' sur la table '%-.192s'"
+ ger "Eine solche Berechtigung ist für User '%-.48s' auf Host '%-.64s' an Tabelle '%-.192s' nicht definiert"
+ hun "A '%-.48s' felhasznalo szamara a '%-.64s' host '%-.192s' tablajaban ez a parancs nem engedelyezett"
+ ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s' sulla tabella '%-.192s'"
+ kor "ì‚¬ìš©ìž '%-.48s'(호스트 '%-.64s')는 í…Œì´ë¸” '%-.192s'를 사용하기 위하여 ì •ì˜ëœ 승ì¸ì€ 없습니다. "
+ por "Não existe tal permissão (grant) definido para o usuário '%-.48s' no 'host' '%-.64s', na tabela '%-.192s'"
+ rum "Nu exista un astfel de privilegiu (grant) definit pentru utilizatorul '%-.48s' de pe host-ul '%-.64s' pentru tabela '%-.192s'"
+ rus "Такие права не определены Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s' на компьютере '%-.64s' Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹ '%-.192s'"
+ serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s' tabeli '%-.192s'"
+ spa "No existe tal permiso definido para usuario '%-.48s' en el servidor '%-.64s' en la tabla '%-.192s'"
+ swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s' för tabell '%-.192s'"
+ ukr "Повноважень не визначено Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувача '%-.48s' з хоÑту '%-.64s' Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– '%-.192s'"
+ER_NOT_ALLOWED_COMMAND 42000
+ cze "Pou-Bžitý příkaz není v této verzi MySQL povolen"
+ dan "Den brugte kommando er ikke tilladt med denne udgave af MySQL"
+ nla "Het used commando is niet toegestaan in deze MySQL versie"
+ eng "The used command is not allowed with this MySQL version"
+ est "Antud käsk ei ole lubatud käesolevas MySQL versioonis"
+ fre "Cette commande n'existe pas dans cette version de MySQL"
+ ger "Der verwendete Befehl ist in dieser MySQL-Version nicht zulässig"
+ hun "A hasznalt parancs nem engedelyezett ebben a MySQL verzioban"
+ ita "Il comando utilizzato non e` supportato in questa versione di MySQL"
+ kor "ì‚¬ìš©ëœ ëª…ë ¹ì€ í˜„ìž¬ì˜ MySQL 버젼ì—서는 ì´ìš©ë˜ì§€ 않습니다."
+ por "Comando usado não é permitido para esta versão do MySQL"
+ rum "Comanda folosita nu este permisa pentru aceasta versiune de MySQL"
+ rus "Эта команда не допуÑкаетÑÑ Ð² данной верÑии MySQL"
+ serbian "Upotrebljena komanda nije dozvoljena sa ovom verzijom MySQL servera"
+ spa "El comando usado no es permitido con esta versión de MySQL"
+ swe "Du kan inte använda detta kommando med denna MySQL version"
+ ukr "ВикориÑтовувана команда не дозволена у цій верÑÑ–Ñ— MySQL"
+ER_SYNTAX_ERROR 42000
+ cze "Va-Bše syntaxe je nějaká divná"
+ dan "Der er en fejl i SQL syntaksen"
+ nla "Er is iets fout in de gebruikte syntax"
+ eng "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use"
+ est "Viga SQL süntaksis"
+ fre "Erreur de syntaxe"
+ ger "Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen"
+ greek "You have an error in your SQL syntax"
+ hun "Szintaktikai hiba"
+ ita "Errore di sintassi nella query SQL"
+ jpn "Something is wrong in your syntax"
+ kor "SQL êµ¬ë¬¸ì— ì˜¤ë¥˜ê°€ 있습니다."
+ nor "Something is wrong in your syntax"
+ norwegian-ny "Something is wrong in your syntax"
+ pol "Something is wrong in your syntax"
+ por "Você tem um erro de sintaxe no seu SQL"
+ rum "Aveti o eroare in sintaxa RSQL"
+ rus "У Ð²Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° в запроÑе. Изучите документацию по иÑпользуемой верÑии MySQL на предмет корректного ÑинтакÑиÑа"
+ serbian "Imate grešku u vašoj SQL sintaksi"
+ slo "Something is wrong in your syntax"
+ spa "Algo está equivocado en su sintax"
+ swe "Du har något fel i din syntax"
+ ukr "У Ð²Ð°Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ° у ÑинтакÑиÑÑ– SQL"
+ER_DELAYED_CANT_CHANGE_LOCK
+ cze "Zpo-Bžděný insert threadu nebyl schopen získat požadovaný zámek pro tabulku %-.192s"
+ dan "Forsinket indsættelse tråden (delayed insert thread) kunne ikke opnå lås på tabellen %-.192s"
+ nla "'Delayed insert' thread kon de aangevraagde 'lock' niet krijgen voor tabel %-.192s"
+ eng "Delayed insert thread couldn't get requested lock for table %-.192s"
+ est "INSERT DELAYED lõim ei suutnud saada soovitud lukku tabelile %-.192s"
+ fre "La tâche 'delayed insert' n'a pas pu obtenir le verrou démandé sur la table %-.192s"
+ ger "Verzögerter (DELAYED) Einfüge-Thread konnte die angeforderte Sperre für Tabelle '%-.192s' nicht erhalten"
+ hun "A kesleltetett beillesztes (delayed insert) thread nem kapott zatolast a %-.192s tablahoz"
+ ita "Il thread di inserimento ritardato non riesce ad ottenere il lock per la tabella %-.192s"
+ kor "ì§€ì—°ëœ insert 쓰레드가 í…Œì´ë¸” %-.192sì˜ ìš”êµ¬ëœ ë½í‚¹ì„ 처리할 수 없었습니다."
+ por "'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.192s'"
+ rum "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.192s"
+ rus "Поток, обÑлуживающий отложенную вÑтавку (delayed insert), не Ñмог получить запрашиваемую блокировку на таблицу %-.192s"
+ serbian "Prolongirani 'INSERT' thread nije mogao da dobije traženo zakljuÄavanje tabele '%-.192s'"
+ spa "Thread de inserción retarda no pudiendo bloquear para la tabla %-.192s"
+ swe "DELAYED INSERT-tråden kunde inte låsa tabell '%-.192s'"
+ ukr "Гілка Ð´Ð»Ñ INSERT DELAYED не може отримати Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– %-.192s"
+ER_TOO_MANY_DELAYED_THREADS
+ cze "P-Bříliš mnoho zpožděných threadů"
+ dan "For mange slettede tråde (threads) i brug"
+ nla "Te veel 'delayed' threads in gebruik"
+ eng "Too many delayed threads in use"
+ est "Liiga palju DELAYED lõimesid kasutusel"
+ fre "Trop de tâche 'delayed' en cours"
+ ger "Zu viele verzögerte (DELAYED) Threads in Verwendung"
+ hun "Tul sok kesletetett thread (delayed)"
+ ita "Troppi threads ritardati in uso"
+ kor "너무 ë§Žì€ ì§€ì—° 쓰레드를 사용하고 있습니다."
+ por "Excesso de 'threads' retardadas (atrasadas) em uso"
+ rum "Prea multe threaduri aminate care sint in uz"
+ rus "Слишком много потоков, обÑлуживающих отложенную вÑтавку (delayed insert)"
+ serbian "Previše prolongiranih thread-ova je u upotrebi"
+ spa "Muchos threads retardados en uso"
+ swe "Det finns redan 'max_delayed_threads' trådar i använding"
+ ukr "Забагато затриманих гілок викориÑтовуєтьÑÑ"
+ER_ABORTING_CONNECTION 08S01
+ cze "Zru-Bšeno spojení %ld do databáze: '%-.192s' uživatel: '%-.48s' (%-.64s)"
+ dan "Afbrudt forbindelse %ld til database: '%-.192s' bruger: '%-.48s' (%-.64s)"
+ nla "Afgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' (%-.64s)"
+ eng "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ est "Ãœhendus katkestatud %ld andmebaasile: '%-.192s' kasutajale: '%-.48s' (%-.64s)"
+ fre "Connection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' (%-.64s)"
+ ger "Abbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s' (%-.64s)"
+ hun "Megszakitott kapcsolat %ld db: '%-.192s' adatbazishoz, felhasznalo: '%-.48s' (%-.64s)"
+ ita "Interrotta la connessione %ld al db: '%-.192s' utente: '%-.48s' (%-.64s)"
+ jpn "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ kor "ë°ì´íƒ€ë² ì´ìŠ¤ ì ‘ì†ì„ 위한 ì—°ê²° %ldê°€ ì¤‘ë‹¨ë¨ : '%-.192s' 사용ìž: '%-.48s' (%-.64s)"
+ nor "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ norwegian-ny "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ pol "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ por "Conexão %ld abortou para o banco de dados '%-.192s' - usuário '%-.48s' (%-.64s)"
+ rum "Conectie terminata %ld la baza de date: '%-.192s' utilizator: '%-.48s' (%-.64s)"
+ rus "Прервано Ñоединение %ld к базе данных '%-.192s' Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s' (%-.64s)"
+ serbian "Prekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' (%-.64s)"
+ slo "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)"
+ spa "Conexión abortada %ld para db: '%-.192s' usuario: '%-.48s' (%-.64s)"
+ swe "Avbröt länken för tråd %ld till db '%-.192s', användare '%-.48s' (%-.64s)"
+ ukr "Перервано з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %ld до бази данних: '%-.192s' кориÑтувача: '%-.48s' (%-.64s)"
+ER_NET_PACKET_TOO_LARGE 08S01
+ cze "Zji-Bštěn příchozí packet delší než 'max_allowed_packet'"
+ dan "Modtog en datapakke som var større end 'max_allowed_packet'"
+ nla "Groter pakket ontvangen dan 'max_allowed_packet'"
+ eng "Got a packet bigger than 'max_allowed_packet' bytes"
+ est "Saabus suurem pakett kui lubatud 'max_allowed_packet' muutujaga"
+ fre "Paquet plus grand que 'max_allowed_packet' reçu"
+ ger "Empfangenes Paket ist größer als 'max_allowed_packet' Bytes"
+ hun "A kapott csomag nagyobb, mint a maximalisan engedelyezett: 'max_allowed_packet'"
+ ita "Ricevuto un pacchetto piu` grande di 'max_allowed_packet'"
+ kor "'max_allowed_packet'보다 ë”í° íŒ¨í‚·ì„ ë°›ì•˜ìŠµë‹ˆë‹¤."
+ por "Obteve um pacote maior do que a taxa máxima de pacotes definida (max_allowed_packet)"
+ rum "Un packet mai mare decit 'max_allowed_packet' a fost primit"
+ rus "Полученный пакет больше, чем 'max_allowed_packet'"
+ serbian "Primio sam mrežni paket veći od definisane vrednosti 'max_allowed_packet'"
+ spa "Obtenido un paquete mayor que 'max_allowed_packet'"
+ swe "Kommunkationspaketet är större än 'max_allowed_packet'"
+ ukr "Отримано пакет більший ніж max_allowed_packet"
+ER_NET_READ_ERROR_FROM_PIPE 08S01
+ cze "Zji-BÅ¡tÄ›na chyba pÅ™i Ätení z roury spojení"
+ dan "Fik læsefejl fra forbindelse (connection pipe)"
+ nla "Kreeg leesfout van de verbindings pipe"
+ eng "Got a read error from the connection pipe"
+ est "Viga ühendustoru lugemisel"
+ fre "Erreur de lecture reçue du pipe de connexion"
+ ger "Lese-Fehler bei einer Verbindungs-Pipe"
+ hun "Olvasasi hiba a kapcsolat soran"
+ ita "Rilevato un errore di lettura dalla pipe di connessione"
+ kor "ì—°ê²° 파ì´í”„로부터 ì—러가 ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve um erro de leitura no 'pipe' da conexão"
+ rum "Eroare la citire din cauza lui 'connection pipe'"
+ rus "Получена ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð¾Ñ‚ потока ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (connection pipe)"
+ serbian "GreÅ¡ka pri Äitanju podataka sa pipe-a"
+ spa "Obtenido un error de lectura de la conexión pipe"
+ swe "Fick läsfel från klienten vid läsning från 'PIPE'"
+ ukr "Отримано помилку Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð· комунікаційного каналу"
+ER_NET_FCNTL_ERROR 08S01
+ cze "Zji-Bštěna chyba fcntl()"
+ dan "Fik fejlmeddelelse fra fcntl()"
+ nla "Kreeg fout van fcntl()"
+ eng "Got an error from fcntl()"
+ est "fcntl() tagastas vea"
+ fre "Erreur reçue de fcntl() "
+ ger "fcntl() lieferte einen Fehler"
+ hun "Hiba a fcntl() fuggvenyben"
+ ita "Rilevato un errore da fcntl()"
+ kor "fcntl() 함수로부터 ì—러가 ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve um erro em fcntl()"
+ rum "Eroare obtinuta de la fcntl()"
+ rus "Получена ошибка от fcntl()"
+ serbian "Greška pri izvršavanju funkcije fcntl()"
+ spa "Obtenido un error de fcntl()"
+ swe "Fick fatalt fel från 'fcntl()'"
+ ukr "Отримано помилкку від fcntl()"
+ER_NET_PACKETS_OUT_OF_ORDER 08S01
+ cze "P-Bříchozí packety v chybném pořadí"
+ dan "Modtog ikke datapakker i korrekt rækkefølge"
+ nla "Pakketten in verkeerde volgorde ontvangen"
+ eng "Got packets out of order"
+ est "Paketid saabusid vales järjekorras"
+ fre "Paquets reçus dans le désordre"
+ ger "Pakete nicht in der richtigen Reihenfolge empfangen"
+ hun "Helytelen sorrendben erkezett adatcsomagok"
+ ita "Ricevuti pacchetti non in ordine"
+ kor "순서가 맞지않는 íŒ¨í‚·ì„ ë°›ì•˜ìŠµë‹ˆë‹¤."
+ por "Obteve pacotes fora de ordem"
+ rum "Packets care nu sint ordonati au fost gasiti"
+ rus "Пакеты получены в неверном порÑдке"
+ serbian "Primio sam mrežne pakete van reda"
+ spa "Obtenido paquetes desordenados"
+ swe "Kommunikationspaketen kom i fel ordning"
+ ukr "Отримано пакети у неналежному порÑдку"
+ER_NET_UNCOMPRESS_ERROR 08S01
+ cze "Nemohu rozkomprimovat komunika-BÄní packet"
+ dan "Kunne ikke dekomprimere kommunikations-pakke (communication packet)"
+ nla "Communicatiepakket kon niet worden gedecomprimeerd"
+ eng "Couldn't uncompress communication packet"
+ est "Viga andmepaketi lahtipakkimisel"
+ fre "Impossible de décompresser le paquet reçu"
+ ger "Kommunikationspaket lässt sich nicht entpacken"
+ hun "A kommunikacios adatcsomagok nem tomorithetok ki"
+ ita "Impossibile scompattare i pacchetti di comunicazione"
+ kor "통신 íŒ¨í‚·ì˜ ì••ì¶•í•´ì œë¥¼ í•  수 없었습니다."
+ por "Não conseguiu descomprimir pacote de comunicação"
+ rum "Nu s-a putut decompresa pachetul de comunicatie (communication packet)"
+ rus "Ðевозможно раÑпаковать пакет, полученный через коммуникационный протокол"
+ serbian "Ne mogu da dekompresujem mrežne pakete"
+ spa "No puedo descomprimir paquetes de comunicación"
+ swe "Kunde inte packa up kommunikationspaketet"
+ ukr "Ðе можу декомпреÑувати комунікаційний пакет"
+ER_NET_READ_ERROR 08S01
+ cze "Zji-BÅ¡tÄ›na chyba pÅ™i Ätení komunikaÄního packetu"
+ dan "Fik fejlmeddelelse ved læsning af kommunikations-pakker (communication packets)"
+ nla "Fout bij het lezen van communicatiepakketten"
+ eng "Got an error reading communication packets"
+ est "Viga andmepaketi lugemisel"
+ fre "Erreur de lecture des paquets reçus"
+ ger "Fehler beim Lesen eines Kommunikationspakets"
+ hun "HIba a kommunikacios adatcsomagok olvasasa soran"
+ ita "Rilevato un errore ricevendo i pacchetti di comunicazione"
+ kor "통신 íŒ¨í‚·ì„ ì½ëŠ” 중 오류가 ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve um erro na leitura de pacotes de comunicação"
+ rum "Eroare obtinuta citind pachetele de comunicatie (communication packets)"
+ rus "Получена ошибка в процеÑÑе Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð°ÐºÐµÑ‚Ð° через коммуникационный протокол "
+ serbian "Greška pri primanju mrežnih paketa"
+ spa "Obtenido un error leyendo paquetes de comunicación"
+ swe "Fick ett fel vid läsning från klienten"
+ ukr "Отримано помилку Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼ÑƒÐ½Ñ–ÐºÐ°Ñ†Ñ–Ð¹Ð½Ð¸Ñ… пакетів"
+ER_NET_READ_INTERRUPTED 08S01
+ cze "Zji-BÅ¡tÄ›n timeout pÅ™i Ätení komunikaÄního packetu"
+ dan "Timeout-fejl ved læsning af kommunukations-pakker (communication packets)"
+ nla "Timeout bij het lezen van communicatiepakketten"
+ eng "Got timeout reading communication packets"
+ est "Kontrollaja ületamine andmepakettide lugemisel"
+ fre "Timeout en lecture des paquets reçus"
+ ger "Zeitüberschreitung beim Lesen eines Kommunikationspakets"
+ hun "Idotullepes a kommunikacios adatcsomagok olvasasa soran"
+ ita "Rilevato un timeout ricevendo i pacchetti di comunicazione"
+ kor "통신 íŒ¨í‚·ì„ ì½ëŠ” 중 timeoutì´ ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve expiração de tempo (timeout) na leitura de pacotes de comunicação"
+ rum "Timeout obtinut citind pachetele de comunicatie (communication packets)"
+ rus "Получен таймаут Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð¿Ð°ÐºÐµÑ‚Ð° через коммуникационный протокол "
+ serbian "Vremenski limit za Äitanje mrežnih paketa je istekao"
+ spa "Obtenido timeout leyendo paquetes de comunicación"
+ swe "Fick 'timeout' vid läsning från klienten"
+ ukr "Отримано затримку Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼ÑƒÐ½Ñ–ÐºÐ°Ñ†Ñ–Ð¹Ð½Ð¸Ñ… пакетів"
+ER_NET_ERROR_ON_WRITE 08S01
+ cze "Zji-BÅ¡tÄ›na chyba pÅ™i zápisu komunikaÄního packetu"
+ dan "Fik fejlmeddelelse ved skrivning af kommunukations-pakker (communication packets)"
+ nla "Fout bij het schrijven van communicatiepakketten"
+ eng "Got an error writing communication packets"
+ est "Viga andmepaketi kirjutamisel"
+ fre "Erreur d'écriture des paquets envoyés"
+ ger "Fehler beim Schreiben eines Kommunikationspakets"
+ hun "Hiba a kommunikacios csomagok irasa soran"
+ ita "Rilevato un errore inviando i pacchetti di comunicazione"
+ kor "통신 íŒ¨í‚·ì„ ê¸°ë¡í•˜ëŠ” 중 오류가 ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve um erro na escrita de pacotes de comunicação"
+ rum "Eroare in scrierea pachetelor de comunicatie (communication packets)"
+ rus "Получена ошибка при передаче пакета через коммуникационный протокол "
+ serbian "Greška pri slanju mrežnih paketa"
+ spa "Obtenido un error de escribiendo paquetes de comunicación"
+ swe "Fick ett fel vid skrivning till klienten"
+ ukr "Отримано помилку запиÑу комунікаційних пакетів"
+ER_NET_WRITE_INTERRUPTED 08S01
+ cze "Zji-BÅ¡tÄ›n timeout pÅ™i zápisu komunikaÄního packetu"
+ dan "Timeout-fejl ved skrivning af kommunukations-pakker (communication packets)"
+ nla "Timeout bij het schrijven van communicatiepakketten"
+ eng "Got timeout writing communication packets"
+ est "Kontrollaja ületamine andmepakettide kirjutamisel"
+ fre "Timeout d'écriture des paquets envoyés"
+ ger "Zeitüberschreitung beim Schreiben eines Kommunikationspakets"
+ hun "Idotullepes a kommunikacios csomagok irasa soran"
+ ita "Rilevato un timeout inviando i pacchetti di comunicazione"
+ kor "통신 íŒ¨íŒƒì„ ê¸°ë¡í•˜ëŠ” 중 timeoutì´ ë°œìƒí•˜ì˜€ìŠµë‹ˆë‹¤."
+ por "Obteve expiração de tempo ('timeout') na escrita de pacotes de comunicação"
+ rum "Timeout obtinut scriind pachetele de comunicatie (communication packets)"
+ rus "Получен таймаут в процеÑÑе передачи пакета через коммуникационный протокол "
+ serbian "Vremenski limit za slanje mrežnih paketa je istekao"
+ spa "Obtenido timeout escribiendo paquetes de comunicación"
+ swe "Fick 'timeout' vid skrivning till klienten"
+ ukr "Отримано затримку запиÑу комунікаційних пакетів"
+ER_TOO_LONG_STRING 42000
+ cze "V-Býsledný řetězec je delší než 'max_allowed_packet'"
+ dan "Strengen med resultater er større end 'max_allowed_packet'"
+ nla "Resultaat string is langer dan 'max_allowed_packet'"
+ eng "Result string is longer than 'max_allowed_packet' bytes"
+ est "Tulemus on pikem kui lubatud 'max_allowed_packet' muutujaga"
+ fre "La chaîne résultat est plus grande que 'max_allowed_packet'"
+ ger "Ergebnis-String ist länger als 'max_allowed_packet' Bytes"
+ hun "Ez eredmeny sztring nagyobb, mint a lehetseges maximum: 'max_allowed_packet'"
+ ita "La stringa di risposta e` piu` lunga di 'max_allowed_packet'"
+ por "'String' resultante é mais longa do que 'max_allowed_packet'"
+ rum "Sirul rezultat este mai lung decit 'max_allowed_packet'"
+ rus "Ð ÐµÐ·ÑƒÐ»ÑŒÑ‚Ð¸Ñ€ÑƒÑŽÑ‰Ð°Ñ Ñтрока больше, чем 'max_allowed_packet'"
+ serbian "RezultujuÄi string je duži nego Å¡to to dozvoljava parametar servera 'max_allowed_packet'"
+ spa "La string resultante es mayor que max_allowed_packet"
+ swe "Resultatsträngen är längre än max_allowed_packet"
+ ukr "Строка результату довша ніж max_allowed_packet"
+ER_TABLE_CANT_HANDLE_BLOB 42000
+ cze "Typ pou-Bžité tabulky nepodporuje BLOB/TEXT sloupce"
+ dan "Denne tabeltype understøtter ikke brug af BLOB og TEXT kolonner"
+ nla "Het gebruikte tabel type ondersteunt geen BLOB/TEXT kolommen"
+ eng "The used table type doesn't support BLOB/TEXT columns"
+ est "Valitud tabelitüüp ei toeta BLOB/TEXT tüüpi välju"
+ fre "Ce type de table ne supporte pas les colonnes BLOB/TEXT"
+ ger "Der verwendete Tabellentyp unterstützt keine BLOB- und TEXT-Felder"
+ hun "A hasznalt tabla tipus nem tamogatja a BLOB/TEXT mezoket"
+ ita "Il tipo di tabella usata non supporta colonne di tipo BLOB/TEXT"
+ por "Tipo de tabela usado não permite colunas BLOB/TEXT"
+ rum "Tipul de tabela folosit nu suporta coloane de tip BLOB/TEXT"
+ rus "ИÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ð° не поддерживает типы BLOB/TEXT"
+ serbian "Iskorišteni tip tabele ne podržava kolone tipa 'BLOB' odnosno 'TEXT'"
+ spa "El tipo de tabla usada no permite soporte para columnas BLOB/TEXT"
+ swe "Den använda tabelltypen kan inte hantera BLOB/TEXT-kolumner"
+ ukr "ВикориÑтаний тип таблиці не підтримує BLOB/TEXT Ñтовбці"
+ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 42000
+ cze "Typ pou-Bžité tabulky nepodporuje AUTO_INCREMENT sloupce"
+ dan "Denne tabeltype understøtter ikke brug af AUTO_INCREMENT kolonner"
+ nla "Het gebruikte tabel type ondersteunt geen AUTO_INCREMENT kolommen"
+ eng "The used table type doesn't support AUTO_INCREMENT columns"
+ est "Valitud tabelitüüp ei toeta AUTO_INCREMENT tüüpi välju"
+ fre "Ce type de table ne supporte pas les colonnes AUTO_INCREMENT"
+ ger "Der verwendete Tabellentyp unterstützt keine AUTO_INCREMENT-Felder"
+ hun "A hasznalt tabla tipus nem tamogatja az AUTO_INCREMENT tipusu mezoket"
+ ita "Il tipo di tabella usata non supporta colonne di tipo AUTO_INCREMENT"
+ por "Tipo de tabela usado não permite colunas AUTO_INCREMENT"
+ rum "Tipul de tabela folosit nu suporta coloane de tip AUTO_INCREMENT"
+ rus "ИÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ð° не поддерживает автоинкрементные Ñтолбцы"
+ serbian "Iskorišteni tip tabele ne podržava kolone tipa 'AUTO_INCREMENT'"
+ spa "El tipo de tabla usada no permite soporte para columnas AUTO_INCREMENT"
+ swe "Den använda tabelltypen kan inte hantera AUTO_INCREMENT-kolumner"
+ ukr "ВикориÑтаний тип таблиці не підтримує AUTO_INCREMENT Ñтовбці"
+ER_DELAYED_INSERT_TABLE_LOCKED
+ cze "INSERT DELAYED nen-Bí možno s tabulkou '%-.192s' použít, protože je zamÄená pomocí LOCK TABLES"
+ dan "INSERT DELAYED kan ikke bruges med tabellen '%-.192s', fordi tabellen er låst med LOCK TABLES"
+ nla "INSERT DELAYED kan niet worden gebruikt bij table '%-.192s', vanwege een 'lock met LOCK TABLES"
+ eng "INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES"
+ est "INSERT DELAYED ei saa kasutada tabeli '%-.192s' peal, kuna see on lukustatud LOCK TABLES käsuga"
+ fre "INSERT DELAYED ne peut être utilisé avec la table '%-.192s', car elle est verrouée avec LOCK TABLES"
+ ger "INSERT DELAYED kann für Tabelle '%-.192s' nicht verwendet werden, da sie mit LOCK TABLES gesperrt ist"
+ greek "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ hun "Az INSERT DELAYED nem hasznalhato a '%-.192s' tablahoz, mert a tabla zarolt (LOCK TABLES)"
+ ita "L'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.192s', perche` soggetta a lock da 'LOCK TABLES'"
+ jpn "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ kor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ nor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ norwegian-ny "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ pol "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ por "INSERT DELAYED não pode ser usado com a tabela '%-.192s', porque ela está travada com LOCK TABLES"
+ rum "INSERT DELAYED nu poate fi folosit cu tabela '%-.192s', deoarece este locked folosing LOCK TABLES"
+ rus "ÐÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать INSERT DELAYED Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ‹ '%-.192s', потому что она заблокирована Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ LOCK TABLES"
+ serbian "Komanda 'INSERT DELAYED' ne može biti iskoriÅ¡tena u tabeli '%-.192s', zbog toga Å¡to je zakljuÄana komandom 'LOCK TABLES'"
+ slo "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES"
+ spa "INSERT DELAYED no puede ser usado con tablas '%-.192s', porque esta bloqueada con LOCK TABLES"
+ swe "INSERT DELAYED kan inte användas med tabell '%-.192s', emedan den är låst med LOCK TABLES"
+ ukr "INSERT DELAYED не може бути викориÑтано з таблицею '%-.192s', тому що Ñ—Ñ— заблоковано з LOCK TABLES"
+ER_WRONG_COLUMN_NAME 42000
+ cze "Nespr-Bávné jméno sloupce '%-.100s'"
+ dan "Forkert kolonnenavn '%-.100s'"
+ nla "Incorrecte kolom naam '%-.100s'"
+ eng "Incorrect column name '%-.100s'"
+ est "Vigane tulba nimi '%-.100s'"
+ fre "Nom de colonne '%-.100s' incorrect"
+ ger "Falscher Spaltenname '%-.100s'"
+ hun "Ervenytelen mezonev: '%-.100s'"
+ ita "Nome colonna '%-.100s' non corretto"
+ por "Nome de coluna '%-.100s' incorreto"
+ rum "Nume increct de coloana '%-.100s'"
+ rus "Ðеверное Ð¸Ð¼Ñ Ñтолбца '%-.100s'"
+ serbian "Pogrešno ime kolone '%-.100s'"
+ spa "Incorrecto nombre de columna '%-.100s'"
+ swe "Felaktigt kolumnnamn '%-.100s'"
+ ukr "Ðевірне ім'Ñ ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%-.100s'"
+ER_WRONG_KEY_COLUMN 42000
+ cze "Handler pou-Bžité tabulky neumí indexovat sloupce '%-.192s'"
+ dan "Den brugte tabeltype kan ikke indeksere kolonnen '%-.192s'"
+ nla "De gebruikte tabel 'handler' kan kolom '%-.192s' niet indexeren"
+ eng "The used storage engine can't index column '%-.192s'"
+ est "Tabelihandler ei oska indekseerida tulpa '%-.192s'"
+ fre "Le handler de la table ne peut indexé la colonne '%-.192s'"
+ ger "Die verwendete Speicher-Engine kann die Spalte '%-.192s' nicht indizieren"
+ greek "The used table handler can't index column '%-.192s'"
+ hun "A hasznalt tablakezelo nem tudja a '%-.192s' mezot indexelni"
+ ita "Il gestore delle tabelle non puo` indicizzare la colonna '%-.192s'"
+ jpn "The used table handler can't index column '%-.192s'"
+ kor "The used table handler can't index column '%-.192s'"
+ nor "The used table handler can't index column '%-.192s'"
+ norwegian-ny "The used table handler can't index column '%-.192s'"
+ pol "The used table handler can't index column '%-.192s'"
+ por "O manipulador de tabela usado não pode indexar a coluna '%-.192s'"
+ rum "Handler-ul tabelei folosite nu poate indexa coloana '%-.192s'"
+ rus "ИÑпользованный обработчик таблицы не может проиндекÑировать Ñтолбец '%-.192s'"
+ serbian "Handler tabele ne može da indeksira kolonu '%-.192s'"
+ slo "The used table handler can't index column '%-.192s'"
+ spa "El manipulador de tabla usado no puede indexar columna '%-.192s'"
+ swe "Den använda tabelltypen kan inte indexera kolumn '%-.192s'"
+ ukr "ВикориÑтаний вказівник таблиці не може індекÑувати Ñтовбець '%-.192s'"
+ER_WRONG_MRG_TABLE
+ cze "V-Bšechny tabulky v MERGE tabulce nejsou definovány stejně"
+ dan "Tabellerne i MERGE er ikke defineret ens"
+ nla "Niet alle tabellen in de MERGE tabel hebben identieke gedefinities"
+ eng "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist"
+ est "Kõik tabelid MERGE tabeli määratluses ei ole identsed"
+ fre "Toutes les tables de la table de type MERGE n'ont pas la même définition"
+ ger "Nicht alle Tabellen in der MERGE-Tabelle sind gleich definiert"
+ hun "A MERGE tablaban talalhato tablak definicioja nem azonos"
+ ita "Non tutte le tabelle nella tabella di MERGE sono definite in maniera identica"
+ jpn "All tables in the MERGE table are not defined identically"
+ kor "All tables in the MERGE table are not defined identically"
+ nor "All tables in the MERGE table are not defined identically"
+ norwegian-ny "All tables in the MERGE table are not defined identically"
+ pol "All tables in the MERGE table are not defined identically"
+ por "Todas as tabelas contidas na tabela fundida (MERGE) não estão definidas identicamente"
+ rum "Toate tabelele din tabela MERGE nu sint definite identic"
+ rus "Ðе вÑе таблицы в MERGE определены одинаково"
+ serbian "Tabele iskoriÅ¡tene u 'MERGE' tabeli nisu definisane na isti naÄin"
+ slo "All tables in the MERGE table are not defined identically"
+ spa "Todas las tablas en la MERGE tabla no estan definidas identicamente"
+ swe "Tabellerna i MERGE-tabellen är inte identiskt definierade"
+ ukr "Таблиці у MERGE TABLE мають різну Ñтруктуру"
+ER_DUP_UNIQUE 23000
+ cze "Kv-Bůli unique constraintu nemozu zapsat do tabulky '%-.192s'"
+ dan "Kan ikke skrive til tabellen '%-.192s' fordi det vil bryde CONSTRAINT regler"
+ nla "Kan niet opslaan naar table '%-.192s' vanwege 'unique' beperking"
+ eng "Can't write, because of unique constraint, to table '%-.192s'"
+ est "Ei suuda kirjutada tabelisse '%-.192s', kuna see rikub ühesuse kitsendust"
+ fre "Écriture impossible à cause d'un index UNIQUE sur la table '%-.192s'"
+ ger "Schreiben in Tabelle '%-.192s' nicht möglich wegen einer Eindeutigkeitsbeschränkung (unique constraint)"
+ hun "A '%-.192s' nem irhato, az egyedi mezok miatt"
+ ita "Impossibile scrivere nella tabella '%-.192s' per limitazione di unicita`"
+ por "Não pode gravar, devido à restrição UNIQUE, na tabela '%-.192s'"
+ rum "Nu pot scrie pe hard-drive, din cauza constraintului unic (unique constraint) pentru tabela '%-.192s'"
+ rus "Ðевозможно запиÑать в таблицу '%-.192s' из-за ограничений уникального ключа"
+ serbian "Zbog provere jedinstvenosti ne mogu da upišem podatke u tabelu '%-.192s'"
+ spa "No puedo escribir, debido al único constraint, para tabla '%-.192s'"
+ swe "Kan inte skriva till tabell '%-.192s'; UNIQUE-test"
+ ukr "Ðе можу запиÑати до таблиці '%-.192s', з причини вимог унікальноÑÑ‚Ñ–"
+ER_BLOB_KEY_WITHOUT_LENGTH 42000
+ cze "BLOB sloupec '%-.192s' je pou-Bžit ve specifikaci klíÄe bez délky"
+ dan "BLOB kolonnen '%-.192s' brugt i nøglespecifikation uden nøglelængde"
+ nla "BLOB kolom '%-.192s' gebruikt in zoeksleutel specificatie zonder zoeksleutel lengte"
+ eng "BLOB/TEXT column '%-.192s' used in key specification without a key length"
+ est "BLOB-tüüpi tulp '%-.192s' on kasutusel võtmes ilma pikkust määratlemata"
+ fre "La colonne '%-.192s' de type BLOB est utilisée dans une définition d'index sans longueur d'index"
+ ger "BLOB- oder TEXT-Spalte '%-.192s' wird in der Schlüsseldefinition ohne Schlüssellängenangabe verwendet"
+ greek "BLOB column '%-.192s' used in key specification without a key length"
+ hun "BLOB mezo '%-.192s' hasznalt a mezo specifikacioban, a mezohossz megadasa nelkul"
+ ita "La colonna '%-.192s' di tipo BLOB e` usata in una chiave senza specificarne la lunghezza"
+ jpn "BLOB column '%-.192s' used in key specification without a key length"
+ kor "BLOB column '%-.192s' used in key specification without a key length"
+ nor "BLOB column '%-.192s' used in key specification without a key length"
+ norwegian-ny "BLOB column '%-.192s' used in key specification without a key length"
+ pol "BLOB column '%-.192s' used in key specification without a key length"
+ por "Coluna BLOB '%-.192s' usada na especificação de chave sem o comprimento da chave"
+ rum "Coloana BLOB '%-.192s' este folosita in specificarea unei chei fara ca o lungime de cheie sa fie folosita"
+ rus "Столбец типа BLOB '%-.192s' был указан в определении ключа без ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð´Ð»Ð¸Ð½Ñ‹ ключа"
+ serbian "BLOB kolona '%-.192s' je upotrebljena u specifikaciji kljuÄa bez navoÄ‘enja dužine kljuÄa"
+ slo "BLOB column '%-.192s' used in key specification without a key length"
+ spa "Columna BLOB column '%-.192s' usada en especificación de clave sin tamaño de la clave"
+ swe "Du har inte angett någon nyckellängd för BLOB '%-.192s'"
+ ukr "Стовбець BLOB '%-.192s' викориÑтано у визначенні ключа без Ð²ÐºÐ°Ð·Ð°Ð½Ð½Ñ Ð´Ð¾Ð²Ð¶Ð¸Ð½Ð¸ ключа"
+ER_PRIMARY_CANT_HAVE_NULL 42000
+ cze "V-BÅ¡echny Äásti primárního klíÄe musejí být NOT NULL; pokud potÅ™ebujete NULL, použijte UNIQUE"
+ dan "Alle dele af en PRIMARY KEY skal være NOT NULL; Hvis du skal bruge NULL i nøglen, brug UNIQUE istedet"
+ nla "Alle delen van een PRIMARY KEY moeten NOT NULL zijn; Indien u NULL in een zoeksleutel nodig heeft kunt u UNIQUE gebruiken"
+ eng "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead"
+ est "Kõik PRIMARY KEY peavad olema määratletud NOT NULL piiranguga; vajadusel kasuta UNIQUE tüüpi võtit"
+ fre "Toutes les parties d'un index PRIMARY KEY doivent être NOT NULL; Si vous avez besoin d'un NULL dans l'index, utilisez un index UNIQUE"
+ ger "Alle Teile eines PRIMARY KEY müssen als NOT NULL definiert sein. Wenn NULL in einem Schlüssel benötigt wird, muss ein UNIQUE-Schlüssel verwendet werden"
+ hun "Az elsodleges kulcs teljes egeszeben csak NOT NULL tipusu lehet; Ha NULL mezot szeretne a kulcskent, hasznalja inkabb a UNIQUE-ot"
+ ita "Tutte le parti di una chiave primaria devono essere dichiarate NOT NULL; se necessitano valori NULL nelle chiavi utilizzare UNIQUE"
+ por "Todas as partes de uma chave primária devem ser não-nulas. Se você precisou usar um valor nulo (NULL) em uma chave, use a cláusula UNIQUE em seu lugar"
+ rum "Toate partile unei chei primare (PRIMARY KEY) trebuie sa fie NOT NULL; Daca aveti nevoie de NULL in vreo cheie, folositi UNIQUE in schimb"
+ rus "Ð’Ñе чаÑти первичного ключа (PRIMARY KEY) должны быть определены как NOT NULL; ЕÑли вам нужна поддержка величин NULL в ключе, воÑпользуйтеÑÑŒ индекÑом UNIQUE"
+ serbian "Svi delovi primarnog kljuÄa moraju biti razliÄiti od NULL; Ako Vam ipak treba NULL vrednost u kljuÄu, upotrebite 'UNIQUE'"
+ spa "Todas las partes de un PRIMARY KEY deben ser NOT NULL; Si necesitas NULL en una clave, use UNIQUE"
+ swe "Alla delar av en PRIMARY KEY måste vara NOT NULL; Om du vill ha en nyckel med NULL, använd UNIQUE istället"
+ ukr "УÑÑ– чаÑтини PRIMARY KEY повинні бути NOT NULL; Якщо ви потребуєте NULL у ключі, ÑкориÑтайтеÑÑ UNIQUE"
+ER_TOO_MANY_ROWS 42000
+ cze "V-Býsledek obsahuje více než jeden řádek"
+ dan "Resultatet bestod af mere end een række"
+ nla "Resultaat bevatte meer dan een rij"
+ eng "Result consisted of more than one row"
+ est "Tulemis oli rohkem kui üks kirje"
+ fre "Le résultat contient plus d'un enregistrement"
+ ger "Ergebnis besteht aus mehr als einer Zeile"
+ hun "Az eredmeny tobb, mint egy sort tartalmaz"
+ ita "Il risultato consiste di piu` di una riga"
+ por "O resultado consistiu em mais do que uma linha"
+ rum "Resultatul constista din mai multe linii"
+ rus "Ð’ результате возвращена более чем одна Ñтрока"
+ serbian "Rezultat je saÄinjen od viÅ¡e slogova"
+ spa "Resultado compuesto de mas que una línea"
+ swe "Resultet bestod av mera än en rad"
+ ukr "Результат знаходитьÑÑ Ñƒ більше ніж одній Ñтроці"
+ER_REQUIRES_PRIMARY_KEY 42000
+ cze "Tento typ tabulky vy-Bžaduje primární klíÄ"
+ dan "Denne tabeltype kræver en primærnøgle"
+ nla "Dit tabel type heeft een primaire zoeksleutel nodig"
+ eng "This table type requires a primary key"
+ est "Antud tabelitüüp nõuab primaarset võtit"
+ fre "Ce type de table nécessite une clé primaire (PRIMARY KEY)"
+ ger "Dieser Tabellentyp benötigt einen Primärschlüssel (PRIMARY KEY)"
+ hun "Az adott tablatipushoz elsodleges kulcs hasznalata kotelezo"
+ ita "Questo tipo di tabella richiede una chiave primaria"
+ por "Este tipo de tabela requer uma chave primária"
+ rum "Aceast tip de tabela are nevoie de o cheie primara"
+ rus "Этот тип таблицы требует Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¸Ñ‡Ð½Ð¾Ð³Ð¾ ключа"
+ serbian "Ovaj tip tabele zahteva da imate definisan primarni kljuÄ"
+ spa "Este tipo de tabla necesita de una primary key"
+ swe "Denna tabelltyp kräver en PRIMARY KEY"
+ ukr "Цей тип таблиці потребує первинного ключа"
+ER_NO_RAID_COMPILED
+ cze "Tato verze MySQL nen-Bí zkompilována s podporou RAID"
+ dan "Denne udgave af MySQL er ikke oversat med understøttelse af RAID"
+ nla "Deze versie van MySQL is niet gecompileerd met RAID ondersteuning"
+ eng "This version of MySQL is not compiled with RAID support"
+ est "Antud MySQL versioon on kompileeritud ilma RAID toeta"
+ fre "Cette version de MySQL n'est pas compilée avec le support RAID"
+ ger "Diese MySQL-Version ist nicht mit RAID-Unterstützung kompiliert"
+ hun "Ezen leforditott MySQL verzio nem tartalmaz RAID support-ot"
+ ita "Questa versione di MYSQL non e` compilata con il supporto RAID"
+ por "Esta versão do MySQL não foi compilada com suporte a RAID"
+ rum "Aceasta versiune de MySQL, nu a fost compilata cu suport pentru RAID"
+ rus "Эта верÑÐ¸Ñ MySQL Ñкомпилирована без поддержки RAID"
+ serbian "Ova verzija MySQL servera nije kompajlirana sa podrškom za RAID uređaje"
+ spa "Esta versión de MySQL no es compilada con soporte RAID"
+ swe "Denna version av MySQL är inte kompilerad med RAID"
+ ukr "Ð¦Ñ Ð²ÐµÑ€ÑÑ–Ñ MySQL не зкомпільована з підтримкою RAID"
+ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+ cze "Update tabulky bez WHERE s kl-BíÄem není v módu bezpeÄných update dovoleno"
+ dan "Du bruger sikker opdaterings modus ('safe update mode') og du forsøgte at opdatere en tabel uden en WHERE klausul, der gør brug af et KEY felt"
+ nla "U gebruikt 'safe update mode' en u probeerde een tabel te updaten zonder een WHERE met een KEY kolom"
+ eng "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column"
+ est "Katse muuta tabelit turvalises rezhiimis ilma WHERE klauslita"
+ fre "Vous êtes en mode 'safe update' et vous essayez de faire un UPDATE sans clause WHERE utilisant un index"
+ ger "MySQL läuft im sicheren Aktualisierungsmodus (safe update mode). Sie haben versucht, eine Tabelle zu aktualisieren, ohne in der WHERE-Klausel ein KEY-Feld anzugeben"
+ hun "On a biztonsagos update modot hasznalja, es WHERE that uses a KEY column"
+ ita "In modalita` 'safe update' si e` cercato di aggiornare una tabella senza clausola WHERE su una chiave"
+ por "Você está usando modo de atualização seguro e tentou atualizar uma tabela sem uma cláusula WHERE que use uma coluna chave"
+ rus "Ð’Ñ‹ работаете в режиме безопаÑных обновлений (safe update mode) и попробовали изменить таблицу без иÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ ÐºÐ»ÑŽÑ‡ÐµÐ²Ð¾Ð³Ð¾ Ñтолбца в чаÑти WHERE"
+ serbian "Vi koristite safe update mod servera, a probali ste da promenite podatke bez 'WHERE' komande koja koristi kolonu kljuÄa"
+ spa "Tu estás usando modo de actualización segura y tentado actualizar una tabla sin un WHERE que usa una KEY columna"
+ swe "Du använder 'säker uppdateringsmod' och försökte uppdatera en tabell utan en WHERE-sats som använder sig av en nyckel"
+ ukr "Ви у режимі безпечного Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ‚Ð° намагаєтеÑÑŒ оновити таблицю без оператора WHERE, що викориÑтовує KEY Ñтовбець"
+ER_KEY_DOES_NOT_EXITS 42000 S1009
+ cze "Kl-BÃ­Ä '%-.192s' v tabulce '%-.192s' neexistuje"
+ dan "Nøglen '%-.192s' eksisterer ikke i tabellen '%-.192s'"
+ nla "Zoeksleutel '%-.192s' bestaat niet in tabel '%-.192s'"
+ eng "Key '%-.192s' doesn't exist in table '%-.192s'"
+ est "Võti '%-.192s' ei eksisteeri tabelis '%-.192s'"
+ fre "L'index '%-.192s' n'existe pas sur la table '%-.192s'"
+ ger "Schlüssel '%-.192s' existiert in der Tabelle '%-.192s' nicht"
+ hun "A '%-.192s' kulcs nem letezik a '%-.192s' tablaban"
+ ita "La chiave '%-.192s' non esiste nella tabella '%-.192s'"
+ por "Chave '%-.192s' não existe na tabela '%-.192s'"
+ rus "Ключ '%-.192s' не ÑущеÑтвует в таблице '%-.192s'"
+ serbian "KljuÄ '%-.192s' ne postoji u tabeli '%-.192s'"
+ spa "Clave '%-.192s' no existe en la tabla '%-.192s'"
+ swe "Nyckel '%-.192s' finns inte in tabell '%-.192s'"
+ ukr "Ключ '%-.192s' не Ñ–Ñнує в таблиці '%-.192s'"
+ER_CHECK_NO_SUCH_TABLE 42000
+ cze "Nemohu otev-Břít tabulku"
+ dan "Kan ikke åbne tabellen"
+ nla "Kan tabel niet openen"
+ eng "Can't open table"
+ est "Ei suuda avada tabelit"
+ fre "Impossible d'ouvrir la table"
+ ger "Kann Tabelle nicht öffnen"
+ hun "Nem tudom megnyitni a tablat"
+ ita "Impossibile aprire la tabella"
+ por "Não pode abrir a tabela"
+ rus "Ðевозможно открыть таблицу"
+ serbian "Ne mogu da otvorim tabelu"
+ spa "No puedo abrir tabla"
+ swe "Kan inte öppna tabellen"
+ ukr "Ðе можу відкрити таблицю"
+ER_CHECK_NOT_IMPLEMENTED 42000
+ cze "Handler tabulky nepodporuje %s"
+ dan "Denne tabeltype understøtter ikke %s"
+ nla "De 'handler' voor de tabel ondersteund geen %s"
+ eng "The storage engine for the table doesn't support %s"
+ est "Antud tabelitüüp ei toeta %s käske"
+ fre "Ce type de table ne supporte pas les %s"
+ ger "Die Speicher-Engine für diese Tabelle unterstützt kein %s"
+ greek "The handler for the table doesn't support %s"
+ hun "A tabla kezeloje (handler) nem tamogatja az %s"
+ ita "Il gestore per la tabella non supporta il %s"
+ jpn "The handler for the table doesn't support %s"
+ kor "The handler for the table doesn't support %s"
+ nor "The handler for the table doesn't support %s"
+ norwegian-ny "The handler for the table doesn't support %s"
+ pol "The handler for the table doesn't support %s"
+ por "O manipulador de tabela não suporta %s"
+ rum "The handler for the table doesn't support %s"
+ rus "Обработчик таблицы не поддерживает Ñтого: %s"
+ serbian "Handler za ovu tabelu ne dozvoljava %s komande"
+ slo "The handler for the table doesn't support %s"
+ spa "El manipulador de la tabla no permite soporte para %s"
+ swe "Tabellhanteraren för denna tabell kan inte göra %s"
+ ukr "Вказівник таблиці не підтримуе %s"
+ER_CANT_DO_THIS_DURING_AN_TRANSACTION 25000
+ cze "Proveden-Bí tohoto příkazu není v transakci dovoleno"
+ dan "Du må ikke bruge denne kommando i en transaktion"
+ nla "Het is u niet toegestaan dit commando uit te voeren binnen een transactie"
+ eng "You are not allowed to execute this command in a transaction"
+ est "Seda käsku ei saa kasutada transaktsiooni sees"
+ fre "Vous n'êtes pas autorisé à exécute cette commande dans une transaction"
+ ger "Sie dürfen diesen Befehl nicht in einer Transaktion ausführen"
+ hun "Az On szamara nem engedelyezett a parancs vegrehajtasa a tranzakcioban"
+ ita "Non puoi eseguire questo comando in una transazione"
+ por "Não lhe é permitido executar este comando em uma transação"
+ rus "Вам не разрешено выполнÑÑ‚ÑŒ Ñту команду в транзакции"
+ serbian "Nije Vam dozvoljeno da izvršite ovu komandu u transakciji"
+ spa "No tienes el permiso para ejecutar este comando en una transición"
+ swe "Du får inte utföra detta kommando i en transaktion"
+ ukr "Вам не дозволено виконувати цю команду в транзакції"
+ER_ERROR_DURING_COMMIT
+ cze "Chyba %d p-Bři COMMIT"
+ dan "Modtog fejl %d mens kommandoen COMMIT blev udført"
+ nla "Kreeg fout %d tijdens COMMIT"
+ eng "Got error %d during COMMIT"
+ est "Viga %d käsu COMMIT täitmisel"
+ fre "Erreur %d lors du COMMIT"
+ ger "Fehler %d beim COMMIT"
+ hun "%d hiba a COMMIT vegrehajtasa soran"
+ ita "Rilevato l'errore %d durante il COMMIT"
+ por "Obteve erro %d durante COMMIT"
+ rus "Получена ошибка %d в процеÑÑе COMMIT"
+ serbian "Greška %d za vreme izvršavanja komande 'COMMIT'"
+ spa "Obtenido error %d durante COMMIT"
+ swe "Fick fel %d vid COMMIT"
+ ukr "Отримано помилку %d під Ñ‡Ð°Ñ COMMIT"
+ER_ERROR_DURING_ROLLBACK
+ cze "Chyba %d p-Bři ROLLBACK"
+ dan "Modtog fejl %d mens kommandoen ROLLBACK blev udført"
+ nla "Kreeg fout %d tijdens ROLLBACK"
+ eng "Got error %d during ROLLBACK"
+ est "Viga %d käsu ROLLBACK täitmisel"
+ fre "Erreur %d lors du ROLLBACK"
+ ger "Fehler %d beim ROLLBACK"
+ hun "%d hiba a ROLLBACK vegrehajtasa soran"
+ ita "Rilevato l'errore %d durante il ROLLBACK"
+ por "Obteve erro %d durante ROLLBACK"
+ rus "Получена ошибка %d в процеÑÑе ROLLBACK"
+ serbian "Greška %d za vreme izvršavanja komande 'ROLLBACK'"
+ spa "Obtenido error %d durante ROLLBACK"
+ swe "Fick fel %d vid ROLLBACK"
+ ukr "Отримано помилку %d під Ñ‡Ð°Ñ ROLLBACK"
+ER_ERROR_DURING_FLUSH_LOGS
+ cze "Chyba %d p-Bři FLUSH_LOGS"
+ dan "Modtog fejl %d mens kommandoen FLUSH_LOGS blev udført"
+ nla "Kreeg fout %d tijdens FLUSH_LOGS"
+ eng "Got error %d during FLUSH_LOGS"
+ est "Viga %d käsu FLUSH_LOGS täitmisel"
+ fre "Erreur %d lors du FLUSH_LOGS"
+ ger "Fehler %d bei FLUSH_LOGS"
+ hun "%d hiba a FLUSH_LOGS vegrehajtasa soran"
+ ita "Rilevato l'errore %d durante il FLUSH_LOGS"
+ por "Obteve erro %d durante FLUSH_LOGS"
+ rus "Получена ошибка %d в процеÑÑе FLUSH_LOGS"
+ serbian "Greška %d za vreme izvršavanja komande 'FLUSH_LOGS'"
+ spa "Obtenido error %d durante FLUSH_LOGS"
+ swe "Fick fel %d vid FLUSH_LOGS"
+ ukr "Отримано помилку %d під Ñ‡Ð°Ñ FLUSH_LOGS"
+ER_ERROR_DURING_CHECKPOINT
+ cze "Chyba %d p-Bři CHECKPOINT"
+ dan "Modtog fejl %d mens kommandoen CHECKPOINT blev udført"
+ nla "Kreeg fout %d tijdens CHECKPOINT"
+ eng "Got error %d during CHECKPOINT"
+ est "Viga %d käsu CHECKPOINT täitmisel"
+ fre "Erreur %d lors du CHECKPOINT"
+ ger "Fehler %d bei CHECKPOINT"
+ hun "%d hiba a CHECKPOINT vegrehajtasa soran"
+ ita "Rilevato l'errore %d durante il CHECKPOINT"
+ por "Obteve erro %d durante CHECKPOINT"
+ rus "Получена ошибка %d в процеÑÑе CHECKPOINT"
+ serbian "Greška %d za vreme izvršavanja komande 'CHECKPOINT'"
+ spa "Obtenido error %d durante CHECKPOINT"
+ swe "Fick fel %d vid CHECKPOINT"
+ ukr "Отримано помилку %d під Ñ‡Ð°Ñ CHECKPOINT"
+ER_NEW_ABORTING_CONNECTION 08S01
+ cze "Spojen-Bí %ld do databáze: '%-.192s' uživatel: '%-.48s' stroj: '%-.64s' (%-.64s) bylo přerušeno"
+ dan "Afbrød forbindelsen %ld til databasen '%-.192s' bruger: '%-.48s' vært: '%-.64s' (%-.64s)"
+ nla "Afgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' host: '%-.64s' (%-.64s)"
+ eng "Aborted connection %ld to db: '%-.192s' user: '%-.48s' host: '%-.64s' (%-.64s)"
+ est "Ãœhendus katkestatud %ld andmebaas: '%-.192s' kasutaja: '%-.48s' masin: '%-.64s' (%-.64s)"
+ fre "Connection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' hôte: '%-.64s' (%-.64s)"
+ ger "Abbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s', Host: '%-.64s' (%-.64s)"
+ ita "Interrotta la connessione %ld al db: ''%-.192s' utente: '%-.48s' host: '%-.64s' (%-.64s)"
+ por "Conexão %ld abortada para banco de dados '%-.192s' - usuário '%-.48s' - 'host' '%-.64s' ('%-.64s')"
+ rus "Прервано Ñоединение %ld к базе данных '%-.192s' Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s' Ñ Ñ…Ð¾Ñта '%-.64s' (%-.64s)"
+ serbian "Prekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' a host: '%-.64s' (%-.64s)"
+ spa "Abortada conexión %ld para db: '%-.192s' usuario: '%-.48s' servidor: '%-.64s' (%-.64s)"
+ swe "Avbröt länken för tråd %ld till db '%-.192s', användare '%-.48s', host '%-.64s' (%-.64s)"
+ ukr "Перервано з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ %ld до бази данних: '%-.192s' кориÑтувач: '%-.48s' хоÑÑ‚: '%-.64s' (%-.64s)"
+ER_DUMP_NOT_IMPLEMENTED
+ cze "Handler tabulky nepodporuje bin-Bární dump"
+ dan "Denne tabeltype unserstøtter ikke binært tabeldump"
+ nla "De 'handler' voor de tabel ondersteund geen binaire tabel dump"
+ eng "The storage engine for the table does not support binary table dump"
+ fre "Ce type de table ne supporte pas les copies binaires"
+ ger "Die Speicher-Engine für die Tabelle unterstützt keinen binären Tabellen-Dump"
+ ita "Il gestore per la tabella non supporta il dump binario"
+ jpn "The handler for the table does not support binary table dump"
+ por "O manipulador de tabela não suporta 'dump' binário de tabela"
+ rum "The handler for the table does not support binary table dump"
+ rus "Обработчик Ñтой таблицы не поддерживает двоичного ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð¾Ð±Ñ€Ð°Ð·Ð° таблицы (dump)"
+ serbian "Handler tabele ne podržava binarni dump tabele"
+ spa "El manipulador de tabla no soporta dump para tabla binaria"
+ swe "Tabellhanteraren klarar inte en binär kopiering av tabellen"
+ ukr "Цей тип таблиці не підтримує бінарну передачу таблиці"
+ER_FLUSH_MASTER_BINLOG_CLOSED
+ eng "Binlog closed, cannot RESET MASTER"
+ ger "Binlog geschlossen. Kann RESET MASTER nicht ausführen"
+ por "Binlog fechado. Não pode fazer RESET MASTER"
+ rus "Двоичный журнал Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð·Ð°ÐºÑ€Ñ‹Ñ‚, невозможно выполнить RESET MASTER"
+ serbian "Binarni log file zatvoren, ne mogu da izvršim komandu 'RESET MASTER'"
+ ukr "Реплікаційний лог закрито, не можу виконати RESET MASTER"
+ER_INDEX_REBUILD
+ cze "P-Břebudování indexu dumpnuté tabulky '%-.192s' nebylo úspěšné"
+ dan "Kunne ikke genopbygge indekset for den dumpede tabel '%-.192s'"
+ nla "Gefaald tijdens heropbouw index van gedumpte tabel '%-.192s'"
+ eng "Failed rebuilding the index of dumped table '%-.192s'"
+ fre "La reconstruction de l'index de la table copiée '%-.192s' a échoué"
+ ger "Neuerstellung des Index der Dump-Tabelle '%-.192s' fehlgeschlagen"
+ greek "Failed rebuilding the index of dumped table '%-.192s'"
+ hun "Failed rebuilding the index of dumped table '%-.192s'"
+ ita "Fallita la ricostruzione dell'indice della tabella copiata '%-.192s'"
+ por "Falhou na reconstrução do índice da tabela 'dumped' '%-.192s'"
+ rus "Ошибка переÑтройки индекÑа Ñохраненной таблицы '%-.192s'"
+ serbian "Izgradnja indeksa dump-ovane tabele '%-.192s' nije uspela"
+ spa "Falla reconstruyendo el indice de la tabla dumped '%-.192s'"
+ ukr "Ðевдале Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑа переданої таблиці '%-.192s'"
+ER_MASTER
+ cze "Chyba masteru: '%-.64s'"
+ dan "Fejl fra master: '%-.64s'"
+ nla "Fout van master: '%-.64s'"
+ eng "Error from master: '%-.64s'"
+ fre "Erreur reçue du maître: '%-.64s'"
+ ger "Fehler vom Master: '%-.64s'"
+ ita "Errore dal master: '%-.64s"
+ por "Erro no 'master' '%-.64s'"
+ rus "Ошибка от головного Ñервера: '%-.64s'"
+ serbian "Greška iz glavnog servera '%-.64s' u klasteru"
+ spa "Error del master: '%-.64s'"
+ swe "Fick en master: '%-.64s'"
+ ukr "Помилка від головного: '%-.64s'"
+ER_MASTER_NET_READ 08S01
+ cze "S-Bíťová chyba pÅ™i Ätení z masteru"
+ dan "Netværksfejl ved læsning fra master"
+ nla "Net fout tijdens lezen van master"
+ eng "Net error reading from master"
+ fre "Erreur de lecture réseau reçue du maître"
+ ger "Netzfehler beim Lesen vom Master"
+ ita "Errore di rete durante la ricezione dal master"
+ por "Erro de rede lendo do 'master'"
+ rus "Возникла ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð² процеÑÑе коммуникации Ñ Ð³Ð¾Ð»Ð¾Ð²Ð½Ñ‹Ð¼ Ñервером"
+ serbian "Greška u primanju mrežnih paketa sa glavnog servera u klasteru"
+ spa "Error de red leyendo del master"
+ swe "Fick nätverksfel vid läsning från master"
+ ukr "Мережева помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð²Ñ–Ð´ головного"
+ER_MASTER_NET_WRITE 08S01
+ cze "S-Bíťová chyba při zápisu na master"
+ dan "Netværksfejl ved skrivning til master"
+ nla "Net fout tijdens schrijven naar master"
+ eng "Net error writing to master"
+ fre "Erreur d'écriture réseau reçue du maître"
+ ger "Netzfehler beim Schreiben zum Master"
+ ita "Errore di rete durante l'invio al master"
+ por "Erro de rede gravando no 'master'"
+ rus "Возникла ошибка запиÑи в процеÑÑе коммуникации Ñ Ð³Ð¾Ð»Ð¾Ð²Ð½Ñ‹Ð¼ Ñервером"
+ serbian "Greška u slanju mrežnih paketa na glavni server u klasteru"
+ spa "Error de red escribiendo para el master"
+ swe "Fick nätverksfel vid skrivning till master"
+ ukr "Мережева помилка запиÑу до головного"
+ER_FT_MATCHING_KEY_NOT_FOUND
+ cze "-BŽádný sloupec nemá vytvořen fulltextový index"
+ dan "Kan ikke finde en FULLTEXT nøgle som svarer til kolonne listen"
+ nla "Kan geen FULLTEXT index vinden passend bij de kolom lijst"
+ eng "Can't find FULLTEXT index matching the column list"
+ est "Ei suutnud leida FULLTEXT indeksit, mis kattuks kasutatud tulpadega"
+ fre "Impossible de trouver un index FULLTEXT correspondant à cette liste de colonnes"
+ ger "Kann keinen FULLTEXT-Index finden, der der Feldliste entspricht"
+ ita "Impossibile trovare un indice FULLTEXT che corrisponda all'elenco delle colonne"
+ por "Não pode encontrar um índice para o texto todo que combine com a lista de colunas"
+ rus "Ðевозможно отыÑкать полнотекÑтовый (FULLTEXT) индекÑ, ÑоответÑтвующий ÑпиÑку Ñтолбцов"
+ serbian "Ne mogu da pronađem 'FULLTEXT' indeks koli odgovara listi kolona"
+ spa "No puedo encontrar índice FULLTEXT correspondiendo a la lista de columnas"
+ swe "Hittar inte ett FULLTEXT-index i kolumnlistan"
+ ukr "Ðе можу знайти FULLTEXT індекÑ, що відповідає переліку Ñтовбців"
+ER_LOCK_OR_ACTIVE_TRANSACTION
+ cze "Nemohu prov-Bést zadaný příkaz, protože existují aktivní zamÄené tabulky nebo aktivní transakce"
+ dan "Kan ikke udføre den givne kommando fordi der findes aktive, låste tabeller eller fordi der udføres en transaktion"
+ nla "Kan het gegeven commando niet uitvoeren, want u heeft actieve gelockte tabellen of een actieve transactie"
+ eng "Can't execute the given command because you have active locked tables or an active transaction"
+ est "Ei suuda täita antud käsku kuna on aktiivseid lukke või käimasolev transaktsioon"
+ fre "Impossible d'exécuter la commande car vous avez des tables verrouillées ou une transaction active"
+ ger "Kann den angegebenen Befehl wegen einer aktiven Tabellensperre oder einer aktiven Transaktion nicht ausführen"
+ ita "Impossibile eseguire il comando richiesto: tabelle sotto lock o transazione in atto"
+ por "Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativa"
+ rus "Ðевозможно выполнить указанную команду, поÑкольку у Ð²Ð°Ñ Ð¿Ñ€Ð¸ÑутÑтвуют активно заблокированные таблица или Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ð¸Ñ"
+ serbian "Ne mogu da izvrÅ¡im datu komandu zbog toga Å¡to su tabele zakljuÄane ili je transakcija u toku"
+ spa "No puedo ejecutar el comando dado porque tienes tablas bloqueadas o una transición activa"
+ swe "Kan inte utföra kommandot emedan du har en låst tabell eller an aktiv transaktion"
+ ukr "Ðе можу виконати подану команду тому, що Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ Ð·Ð°Ð±Ð»Ð¾ÐºÐ¾Ð²Ð°Ð½Ð° або виконуєтьÑÑ Ñ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ñ–Ñ"
+ER_UNKNOWN_SYSTEM_VARIABLE
+ cze "Nezn-Bámá systémová proměnná '%-.64s'"
+ dan "Ukendt systemvariabel '%-.64s'"
+ nla "Onbekende systeem variabele '%-.64s'"
+ eng "Unknown system variable '%-.64s'"
+ est "Tundmatu süsteemne muutuja '%-.64s'"
+ fre "Variable système '%-.64s' inconnue"
+ ger "Unbekannte Systemvariable '%-.64s'"
+ ita "Variabile di sistema '%-.64s' sconosciuta"
+ por "Variável de sistema '%-.64s' desconhecida"
+ rus "ÐеизвеÑÑ‚Ð½Ð°Ñ ÑиÑÑ‚ÐµÐ¼Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s'"
+ serbian "Nepoznata sistemska promenljiva '%-.64s'"
+ spa "Desconocida variable de sistema '%-.64s'"
+ swe "Okänd systemvariabel: '%-.64s'"
+ ukr "Ðевідома ÑиÑтемна змінна '%-.64s'"
+ER_CRASHED_ON_USAGE
+ cze "Tabulka '%-.192s' je ozna-BÄena jako poruÅ¡ená a mÄ›la by být opravena"
+ dan "Tabellen '%-.192s' er markeret med fejl og bør repareres"
+ nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en dient te worden gerepareerd"
+ eng "Table '%-.192s' is marked as crashed and should be repaired"
+ est "Tabel '%-.192s' on märgitud vigaseks ja tuleb parandada"
+ fre "La table '%-.192s' est marquée 'crashed' et devrait être réparée"
+ ger "Tabelle '%-.192s' ist als defekt markiert und sollte repariert werden"
+ ita "La tabella '%-.192s' e` segnalata come corrotta e deve essere riparata"
+ por "Tabela '%-.192s' está marcada como danificada e deve ser reparada"
+ rus "Таблица '%-.192s' помечена как иÑÐ¿Ð¾Ñ€Ñ‡ÐµÐ½Ð½Ð°Ñ Ð¸ должна пройти проверку и ремонт"
+ serbian "Tabela '%-.192s' je markirana kao oštećena i trebala bi biti popravljena"
+ spa "Tabla '%-.192s' está marcada como crashed y debe ser reparada"
+ swe "Tabell '%-.192s' är trasig och bör repareras med REPAIR TABLE"
+ ukr "Таблицю '%-.192s' марковано Ñк зіпÑовану та Ñ—Ñ— потрібно відновити"
+ER_CRASHED_ON_REPAIR
+ cze "Tabulka '%-.192s' je ozna-BÄena jako poruÅ¡ená a poslední (automatická?) oprava se nezdaÅ™ila"
+ dan "Tabellen '%-.192s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede"
+ nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte"
+ eng "Table '%-.192s' is marked as crashed and last (automatic?) repair failed"
+ est "Tabel '%-.192s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus"
+ fre "La table '%-.192s' est marquée 'crashed' et le dernier 'repair' a échoué"
+ ger "Tabelle '%-.192s' ist als defekt markiert und der letzte (automatische?) Reparaturversuch schlug fehl"
+ ita "La tabella '%-.192s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita"
+ por "Tabela '%-.192s' está marcada como danificada e a última reparação (automática?) falhou"
+ rus "Таблица '%-.192s' помечена как иÑÐ¿Ð¾Ñ€Ñ‡ÐµÐ½Ð½Ð°Ñ Ð¸ поÑледний (автоматичеÑкий?) ремонт не был уÑпешным"
+ serbian "Tabela '%-.192s' je markirana kao oštećena, a zadnja (automatska?) popravka je bila neuspela"
+ spa "Tabla '%-.192s' está marcada como crashed y la última reparación (automactica?) falló"
+ swe "Tabell '%-.192s' är trasig och senast (automatiska?) reparation misslyckades"
+ ukr "Таблицю '%-.192s' марковано Ñк зіпÑовану та оÑтаннє (автоматичне?) Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ðµ вдалоÑÑ"
+ER_WARNING_NOT_COMPLETE_ROLLBACK
+ dan "Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles"
+ nla "Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen"
+ eng "Some non-transactional changed tables couldn't be rolled back"
+ est "Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida"
+ fre "Attention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituées"
+ ger "Änderungen an einigen nicht transaktionalen Tabellen konnten nicht zurückgerollt werden"
+ ita "Attenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)"
+ por "Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)"
+ rus "Внимание: по некоторым измененным нетранзакционным таблицам невозможно будет произвеÑти откат транзакции"
+ serbian "Upozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'"
+ spa "Aviso: Algunas tablas no transancionales no pueden tener rolled back"
+ swe "Warning: Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK"
+ ukr "ЗаÑтереженнÑ: ДеÑкі нетранзакційні зміни таблиць не можна буде повернути"
+ER_TRANS_CACHE_FULL
+ dan "Fler-udtryks transaktion krævede mere plads en 'max_binlog_cache_size' bytes. Forhøj værdien af denne variabel og prøv igen"
+ nla "Multi-statement transactie vereist meer dan 'max_binlog_cache_size' bytes opslag. Verhoog deze mysqld variabele en probeer opnieuw"
+ eng "Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again"
+ est "Mitme lausendiga transaktsioon nõudis rohkem ruumi kui lubatud 'max_binlog_cache_size' muutujaga. Suurenda muutuja väärtust ja proovi uuesti"
+ fre "Cette transaction à commandes multiples nécessite plus de 'max_binlog_cache_size' octets de stockage, augmentez cette variable de mysqld et réessayez"
+ ger "Transaktionen, die aus mehreren Befehlen bestehen, benötigten mehr als 'max_binlog_cache_size' Bytes an Speicher. Btte vergrössern Sie diese Server-Variable versuchen Sie es noch einmal"
+ ita "La transazione a comandi multipli (multi-statement) ha richiesto piu` di 'max_binlog_cache_size' bytes di disco: aumentare questa variabile di mysqld e riprovare"
+ por "Transações multi-declaradas (multi-statement transactions) requeriram mais do que o valor limite (max_binlog_cache_size) de bytes para armazenagem. Aumente o valor desta variável do mysqld e tente novamente"
+ rus "Транзакции, включающей большое количеÑтво команд, потребовалоÑÑŒ более чем 'max_binlog_cache_size' байт. Увеличьте Ñту переменную Ñервера mysqld и попробуйте еще раз"
+ spa "Multipla transición necesita mas que 'max_binlog_cache_size' bytes de almacenamiento. Aumente esta variable mysqld y tente de nuevo"
+ swe "Transaktionen krävde mera än 'max_binlog_cache_size' minne. Öka denna mysqld-variabel och försök på nytt"
+ ukr "Ð¢Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ñ–Ñ Ð· багатьма виразами вимагає більше ніж 'max_binlog_cache_size' байтів Ð´Ð»Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ. Збільште цю змінну mysqld та Ñпробуйте знову"
+ER_SLAVE_MUST_STOP
+ dan "Denne handling kunne ikke udføres med kørende slave, brug først kommandoen STOP SLAVE"
+ nla "Deze operatie kan niet worden uitgevoerd met een actieve slave, doe eerst STOP SLAVE"
+ eng "This operation cannot be performed with a running slave; run STOP SLAVE first"
+ fre "Cette opération ne peut être réalisée avec un esclave actif, faites STOP SLAVE d'abord"
+ ger "Diese Operation kann bei einem aktiven Slave nicht durchgeführt werden. Bitte zuerst STOP SLAVE ausführen"
+ ita "Questa operazione non puo' essere eseguita con un database 'slave' che gira, lanciare prima STOP SLAVE"
+ por "Esta operação não pode ser realizada com um 'slave' em execução. Execute STOP SLAVE primeiro"
+ rus "Эту операцию невозможно выполнить при работающем потоке подчиненного Ñервера. Сначала выполните STOP SLAVE"
+ serbian "Ova operacija ne može biti izvršena dok je aktivan podređeni server. Zadajte prvo komandu 'STOP SLAVE' da zaustavite podređeni server."
+ spa "Esta operación no puede ser hecha con el esclavo funcionando, primero use STOP SLAVE"
+ swe "Denna operation kan inte göras under replikering; Gör STOP SLAVE först"
+ ukr "ÐžÐ¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ðµ може бути виконана з запущеним підлеглим, Ñпочатку виконайте STOP SLAVE"
+ER_SLAVE_NOT_RUNNING
+ dan "Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen START SLAVE"
+ nla "Deze operatie vereist een actieve slave, configureer slave en doe dan START SLAVE"
+ eng "This operation requires a running slave; configure slave and do START SLAVE"
+ fre "Cette opération nécessite un esclave actif, configurez les esclaves et faites START SLAVE"
+ ger "Diese Operation benötigt einen aktiven Slave. Bitte Slave konfigurieren und mittels START SLAVE aktivieren"
+ ita "Questa operaione richiede un database 'slave', configurarlo ed eseguire START SLAVE"
+ por "Esta operação requer um 'slave' em execução. Configure o 'slave' e execute START SLAVE"
+ rus "Ð”Ð»Ñ Ñтой операции требуетÑÑ Ñ€Ð°Ð±Ð¾Ñ‚Ð°ÑŽÑ‰Ð¸Ð¹ подчиненный Ñервер. Сначала выполните START SLAVE"
+ serbian "Ova operacija zahteva da je aktivan podređeni server. Konfigurišite prvo podređeni server i onda izvršite komandu 'START SLAVE'"
+ spa "Esta operación necesita el esclavo funcionando, configure esclavo y haga el START SLAVE"
+ swe "Denna operation kan endast göras under replikering; Konfigurera slaven och gör START SLAVE"
+ ukr "ÐžÐ¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð²Ð¸Ð¼Ð°Ð³Ð°Ñ” запущеного підлеглого, зконфігуруйте підлеглого та виконайте START SLAVE"
+ER_BAD_SLAVE
+ dan "Denne server er ikke konfigureret som slave. Ret in config-filen eller brug kommandoen CHANGE MASTER TO"
+ nla "De server is niet geconfigureerd als slave, fix in configuratie bestand of met CHANGE MASTER TO"
+ eng "The server is not configured as slave; fix in config file or with CHANGE MASTER TO"
+ fre "Le server n'est pas configuré comme un esclave, changez le fichier de configuration ou utilisez CHANGE MASTER TO"
+ ger "Der Server ist nicht als Slave konfiguriert. Bitte in der Konfigurationsdatei oder mittels CHANGE MASTER TO beheben"
+ ita "Il server non e' configurato come 'slave', correggere il file di configurazione cambiando CHANGE MASTER TO"
+ por "O servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TO"
+ rus "Этот Ñервер не наÑтроен как подчиненный. ВнеÑите иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² конфигурационном файле или Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ CHANGE MASTER TO"
+ serbian "Server nije konfigurisan kao podređeni server, ispravite konfiguracioni file ili na njemu izvršite komandu 'CHANGE MASTER TO'"
+ spa "El servidor no está configurado como esclavo, edite el archivo config file o con CHANGE MASTER TO"
+ swe "Servern är inte konfigurerade som en replikationsslav. Ändra konfigurationsfilen eller gör CHANGE MASTER TO"
+ ukr "Сервер не зконфігуровано Ñк підлеглий, виправте це у файлі конфігурації або з CHANGE MASTER TO"
+ER_MASTER_INFO
+ eng "Could not initialize master info structure; more error messages can be found in the MySQL error log"
+ fre "Impossible d'initialiser les structures d'information de maître, vous trouverez des messages d'erreur supplémentaires dans le journal des erreurs de MySQL"
+ ger "Konnte Master-Info-Struktur nicht initialisieren. Weitere Fehlermeldungen können im MySQL-Error-Log eingesehen werden"
+ serbian "Nisam mogao da inicijalizujem informacionu strukturu glavnog servera, proverite da li imam privilegije potrebne za pristup file-u 'master.info'"
+ swe "Kunde inte initialisera replikationsstrukturerna. See MySQL fel fil för mera information"
+ER_SLAVE_THREAD
+ dan "Kunne ikke danne en slave-tråd; check systemressourcerne"
+ nla "Kon slave thread niet aanmaken, controleer systeem resources"
+ eng "Could not create slave thread; check system resources"
+ fre "Impossible de créer une tâche esclave, vérifiez les ressources système"
+ ger "Konnte Slave-Thread nicht starten. Bitte System-Ressourcen überprüfen"
+ ita "Impossibile creare il thread 'slave', controllare le risorse di sistema"
+ por "Não conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistema"
+ rus "Ðевозможно Ñоздать поток подчиненного Ñервера. Проверьте ÑиÑтемные реÑурÑÑ‹"
+ serbian "Nisam mogao da startujem thread za podređeni server, proverite sistemske resurse"
+ spa "No puedo crear el thread esclavo, verifique recursos del sistema"
+ swe "Kunde inte starta en tråd för replikering"
+ ukr "Ðе можу Ñтворити підлеглу гілку, перевірте ÑиÑтемні реÑурÑи"
+ER_TOO_MANY_USER_CONNECTIONS 42000
+ dan "Brugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelser"
+ nla "Gebruiker %-.64s heeft reeds meer dan 'max_user_connections' actieve verbindingen"
+ eng "User %-.64s already has more than 'max_user_connections' active connections"
+ est "Kasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujaga"
+ fre "L'utilisateur %-.64s possède déjà plus de 'max_user_connections' connexions actives"
+ ger "Benutzer '%-.64s' hat mehr als 'max_user_connections' aktive Verbindungen"
+ ita "L'utente %-.64s ha gia' piu' di 'max_user_connections' connessioni attive"
+ por "Usuário '%-.64s' já possui mais que o valor máximo de conexões (max_user_connections) ativas"
+ rus "У Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ %-.64s уже больше чем 'max_user_connections' активных Ñоединений"
+ serbian "Korisnik %-.64s već ima više aktivnih konekcija nego što je to određeno 'max_user_connections' promenljivom"
+ spa "Usario %-.64s ya tiene mas que 'max_user_connections' conexiones activas"
+ swe "Användare '%-.64s' har redan 'max_user_connections' aktiva inloggningar"
+ ukr "КориÑтувач %-.64s вже має більше ніж 'max_user_connections' активних з'єднань"
+ER_SET_CONSTANTS_ONLY
+ dan "Du må kun bruge konstantudtryk med SET"
+ nla "U mag alleen constante expressies gebruiken bij SET"
+ eng "You may only use constant expressions with SET"
+ est "Ainult konstantsed suurused on lubatud SET klauslis"
+ fre "Seules les expressions constantes sont autorisées avec SET"
+ ger "Bei SET dürfen nur konstante Ausdrücke verwendet werden"
+ ita "Si possono usare solo espressioni costanti con SET"
+ por "Você pode usar apenas expressões constantes com SET"
+ rus "Ð’Ñ‹ можете иÑпользовать в SET только конÑтантные выражениÑ"
+ serbian "Možete upotrebiti samo konstantan iskaz sa komandom 'SET'"
+ spa "Tu solo debes usar expresiones constantes con SET"
+ swe "Man kan endast använda konstantuttryck med SET"
+ ukr "Можна викориÑтовувати лише вирази зі Ñталими у SET"
+ER_LOCK_WAIT_TIMEOUT
+ dan "Lock wait timeout overskredet"
+ nla "Lock wacht tijd overschreden"
+ eng "Lock wait timeout exceeded; try restarting transaction"
+ est "Kontrollaeg ületatud luku järel ootamisel; Proovi transaktsiooni otsast alata"
+ fre "Timeout sur l'obtention du verrou"
+ ger "Beim Warten auf eine Sperre wurde die zulässige Wartezeit überschritten. Bitte versuchen Sie, die Transaktion neu zu starten"
+ ita "E' scaduto il timeout per l'attesa del lock"
+ por "Tempo de espera (timeout) de travamento excedido. Tente reiniciar a transação."
+ rus "Таймаут Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ¸ иÑтек; попробуйте перезапуÑтить транзакцию"
+ serbian "Vremenski limit za zakljuÄavanje tabele je istekao; Probajte da ponovo startujete transakciju"
+ spa "Tiempo de bloqueo de espera excedido"
+ swe "Fick inte ett lås i tid ; Försök att starta om transaktionen"
+ ukr "Затримку Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ñ‡ÐµÑ€Ð¿Ð°Ð½Ð¾"
+ER_LOCK_TABLE_FULL
+ dan "Det totale antal låse overstiger størrelsen på låse-tabellen"
+ nla "Het totale aantal locks overschrijdt de lock tabel grootte"
+ eng "The total number of locks exceeds the lock table size"
+ est "Lukkude koguarv ületab lukutabeli suuruse"
+ fre "Le nombre total de verrou dépasse la taille de la table des verrous"
+ ger "Die Gesamtzahl der Sperren überschreitet die Größe der Sperrtabelle"
+ ita "Il numero totale di lock e' maggiore della grandezza della tabella di lock"
+ por "O número total de travamentos excede o tamanho da tabela de travamentos"
+ rus "Общее количеÑтво блокировок превыÑило размеры таблицы блокировок"
+ serbian "Broj totalnih zakljuÄavanja tabele premaÅ¡uje veliÄinu tabele zakljuÄavanja"
+ spa "El número total de bloqueos excede el tamaño de bloqueo de la tabla"
+ swe "Antal lås överskrider antalet reserverade lås"
+ ukr "Загальна кількіÑÑ‚ÑŒ блокувань перевищила розмір блокувань Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ–"
+ER_READ_ONLY_TRANSACTION 25000
+ dan "Update lås kan ikke opnås under en READ UNCOMMITTED transaktion"
+ nla "Update locks kunnen niet worden verkregen tijdens een READ UNCOMMITTED transactie"
+ eng "Update locks cannot be acquired during a READ UNCOMMITTED transaction"
+ est "Uuenduslukke ei saa kasutada READ UNCOMMITTED transaktsiooni käigus"
+ fre "Un verrou en update ne peut être acquit pendant une transaction READ UNCOMMITTED"
+ ger "Während einer READ-UNCOMMITTED-Transaktion können keine UPDATE-Sperren angefordert werden"
+ ita "I lock di aggiornamento non possono essere acquisiti durante una transazione 'READ UNCOMMITTED'"
+ por "Travamentos de atualização não podem ser obtidos durante uma transação de tipo READ UNCOMMITTED"
+ rus "Блокировки обновлений Ð½ÐµÐ»ÑŒÐ·Ñ Ð¿Ð¾Ð»ÑƒÑ‡Ð¸Ñ‚ÑŒ в процеÑÑе Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð½Ðµ принÑтой (в режиме READ UNCOMMITTED) транзакции"
+ serbian "ZakljuÄavanja izmena ne mogu biti realizovana sve dok traje 'READ UNCOMMITTED' transakcija"
+ spa "Bloqueos de actualización no pueden ser adqueridos durante una transición READ UNCOMMITTED"
+ swe "Updateringslås kan inte göras när man använder READ UNCOMMITTED"
+ ukr "Оновити Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ можливо на протÑзі транзакції READ UNCOMMITTED"
+ER_DROP_DB_WITH_READ_LOCK
+ dan "DROP DATABASE er ikke tilladt mens en tråd holder på globalt read lock"
+ nla "DROP DATABASE niet toegestaan terwijl thread een globale 'read lock' bezit"
+ eng "DROP DATABASE not allowed while thread is holding global read lock"
+ est "DROP DATABASE ei ole lubatud kui lõim omab globaalset READ lukku"
+ fre "DROP DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lecture"
+ ger "DROP DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hält"
+ ita "DROP DATABASE non e' permesso mentre il thread ha un lock globale di lettura"
+ por "DROP DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura"
+ rus "Ðе допуÑкаетÑÑ DROP DATABASE, пока поток держит глобальную блокировку чтениÑ"
+ serbian "Komanda 'DROP DATABASE' nije dozvoljena dok thread globalno zakljuÄava Äitanje podataka"
+ spa "DROP DATABASE no permitido mientras un thread está ejerciendo un bloqueo de lectura global"
+ swe "DROP DATABASE är inte tillåtet när man har ett globalt läslås"
+ ukr "DROP DATABASE не дозволено доки гілка перебуває під загальним блокуваннÑм читаннÑ"
+ER_CREATE_DB_WITH_READ_LOCK
+ dan "CREATE DATABASE er ikke tilladt mens en tråd holder på globalt read lock"
+ nla "CREATE DATABASE niet toegestaan terwijl thread een globale 'read lock' bezit"
+ eng "CREATE DATABASE not allowed while thread is holding global read lock"
+ est "CREATE DATABASE ei ole lubatud kui lõim omab globaalset READ lukku"
+ fre "CREATE DATABASE n'est pas autorisée pendant qu'une tâche possède un verrou global en lecture"
+ ger "CREATE DATABASE ist nicht erlaubt, solange der Thread eine globale Lesesperre hält"
+ ita "CREATE DATABASE non e' permesso mentre il thread ha un lock globale di lettura"
+ por "CREATE DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura"
+ rus "Ðе допуÑкаетÑÑ CREATE DATABASE, пока поток держит глобальную блокировку чтениÑ"
+ serbian "Komanda 'CREATE DATABASE' nije dozvoljena dok thread globalno zakljuÄava Äitanje podataka"
+ spa "CREATE DATABASE no permitido mientras un thread está ejerciendo un bloqueo de lectura global"
+ swe "CREATE DATABASE är inte tillåtet när man har ett globalt läslås"
+ ukr "CREATE DATABASE не дозволено доки гілка перебуває під загальним блокуваннÑм читаннÑ"
+ER_WRONG_ARGUMENTS
+ nla "Foutieve parameters voor %s"
+ eng "Incorrect arguments to %s"
+ est "Vigased parameetrid %s-le"
+ fre "Mauvais arguments à %s"
+ ger "Falsche Argumente für %s"
+ ita "Argomenti errati a %s"
+ por "Argumentos errados para %s"
+ rus "Ðеверные параметры Ð´Ð»Ñ %s"
+ serbian "Pogrešni argumenti prosleđeni na %s"
+ spa "Argumentos errados para %s"
+ swe "Felaktiga argument till %s"
+ ukr "Хибний аргумент Ð´Ð»Ñ %s"
+ER_NO_PERMISSION_TO_CREATE_USER 42000
+ nla "'%-.48s'@'%-.64s' mag geen nieuwe gebruikers creeren"
+ eng "'%-.48s'@'%-.64s' is not allowed to create new users"
+ est "Kasutajal '%-.48s'@'%-.64s' ei ole lubatud luua uusi kasutajaid"
+ fre "'%-.48s'@'%-.64s' n'est pas autorisé à créer de nouveaux utilisateurs"
+ ger "'%-.48s'@'%-.64s' ist nicht berechtigt, neue Benutzer hinzuzufügen"
+ ita "A '%-.48s'@'%-.64s' non e' permesso creare nuovi utenti"
+ por "Não é permitido a '%-.48s'@'%-.64s' criar novos usuários"
+ rus "'%-.48s'@'%-.64s' не разрешаетÑÑ Ñоздавать новых пользователей"
+ serbian "Korisniku '%-.48s'@'%-.64s' nije dozvoljeno da kreira nove korisnike"
+ spa "'%-.48s`@`%-.64s` no es permitido para crear nuevos usuarios"
+ swe "'%-.48s'@'%-.64s' har inte rättighet att skapa nya användare"
+ ukr "КориÑтувачу '%-.48s'@'%-.64s' не дозволено Ñтворювати нових кориÑтувачів"
+ER_UNION_TABLES_IN_DIFFERENT_DIR
+ nla "Incorrecte tabel definitie; alle MERGE tabellen moeten tot dezelfde database behoren"
+ eng "Incorrect table definition; all MERGE tables must be in the same database"
+ est "Vigane tabelimääratlus; kõik MERGE tabeli liikmed peavad asuma samas andmebaasis"
+ fre "Définition de table incorrecte; toutes les tables MERGE doivent être dans la même base de donnée"
+ ger "Falsche Tabellendefinition. Alle MERGE-Tabellen müssen sich in derselben Datenbank befinden"
+ ita "Definizione della tabella errata; tutte le tabelle di tipo MERGE devono essere nello stesso database"
+ por "Definição incorreta da tabela. Todas as tabelas contidas na junção devem estar no mesmo banco de dados."
+ rus "Ðеверное определение таблицы; Ð’Ñе таблицы в MERGE должны принадлежать одной и той же базе данных"
+ serbian "Pogrešna definicija tabele; sve 'MERGE' tabele moraju biti u istoj bazi podataka"
+ spa "Incorrecta definición de la tabla; Todas las tablas MERGE deben estar en el mismo banco de datos"
+ swe "Felaktig tabelldefinition; alla tabeller i en MERGE-tabell måste vara i samma databas"
+ER_LOCK_DEADLOCK 40001
+ nla "Deadlock gevonden tijdens lock-aanvraag poging; Probeer herstart van de transactie"
+ eng "Deadlock found when trying to get lock; try restarting transaction"
+ est "Lukustamisel tekkis tupik (deadlock); alusta transaktsiooni otsast"
+ fre "Deadlock découvert en essayant d'obtenir les verrous : essayez de redémarrer la transaction"
+ ger "Beim Versuch, eine Sperre anzufordern, ist ein Deadlock aufgetreten. Versuchen Sie, die Transaktion neu zu starten"
+ ita "Trovato deadlock durante il lock; Provare a far ripartire la transazione"
+ por "Encontrado um travamento fatal (deadlock) quando tentava obter uma trava. Tente reiniciar a transação."
+ rus "Возникла Ñ‚ÑƒÐ¿Ð¸ÐºÐ¾Ð²Ð°Ñ ÑÐ¸Ñ‚ÑƒÐ°Ñ†Ð¸Ñ Ð² процеÑÑе Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ¸; Попробуйте перезапуÑтить транзакцию"
+ serbian "Unakrsno zakljuÄavanje pronaÄ‘eno kada sam pokuÅ¡ao da dobijem pravo na zakljuÄavanje; Probajte da restartujete transakciju"
+ spa "Encontrado deadlock cuando tentando obtener el bloqueo; Tente recomenzar la transición"
+ swe "Fick 'DEADLOCK' vid låsförsök av block/rad. Försök att starta om transaktionen"
+ER_TABLE_CANT_HANDLE_FT
+ nla "Het gebruikte tabel type ondersteund geen FULLTEXT indexen"
+ eng "The used table type doesn't support FULLTEXT indexes"
+ est "Antud tabelitüüp ei toeta FULLTEXT indekseid"
+ fre "Le type de table utilisé ne supporte pas les index FULLTEXT"
+ ger "Der verwendete Tabellentyp unterstützt keine FULLTEXT-Indizes"
+ ita "La tabella usata non supporta gli indici FULLTEXT"
+ por "O tipo de tabela utilizado não suporta índices de texto completo (fulltext indexes)"
+ rus "ИÑпользуемый тип таблиц не поддерживает полнотекÑтовых индекÑов"
+ serbian "Upotrebljeni tip tabele ne podržava 'FULLTEXT' indekse"
+ spa "El tipo de tabla usada no soporta índices FULLTEXT"
+ swe "Tabelltypen har inte hantering av FULLTEXT-index"
+ ukr "ВикориÑтаний тип таблиці не підтримує FULLTEXT індекÑів"
+ER_CANNOT_ADD_FOREIGN
+ nla "Kan foreign key beperking niet toevoegen"
+ eng "Cannot add foreign key constraint"
+ fre "Impossible d'ajouter des contraintes d'index externe"
+ ger "Fremdschlüssel-Beschränkung kann nicht hinzugefügt werden"
+ ita "Impossibile aggiungere il vincolo di integrita' referenziale (foreign key constraint)"
+ por "Não pode acrescentar uma restrição de chave estrangeira"
+ rus "Ðевозможно добавить Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡ÐµÐ½Ð¸Ñ Ð²Ð½ÐµÑˆÐ½ÐµÐ³Ð¾ ключа"
+ serbian "Ne mogu da dodam proveru spoljnog kljuÄa"
+ spa "No puede adicionar clave extranjera constraint"
+ swe "Kan inte lägga till 'FOREIGN KEY constraint'"
+ER_NO_REFERENCED_ROW 23000
+ nla "Kan onderliggende rij niet toevoegen: foreign key beperking gefaald"
+ eng "Cannot add or update a child row: a foreign key constraint fails"
+ fre "Impossible d'ajouter un enregistrement fils : une constrainte externe l'empèche"
+ ger "Hinzufügen oder Aktualisieren eines Kind-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehl"
+ greek "Cannot add a child row: a foreign key constraint fails"
+ hun "Cannot add a child row: a foreign key constraint fails"
+ ita "Impossibile aggiungere la riga: un vincolo d'integrita' referenziale non e' soddisfatto"
+ norwegian-ny "Cannot add a child row: a foreign key constraint fails"
+ por "Não pode acrescentar uma linha filha: uma restrição de chave estrangeira falhou"
+ rus "Ðевозможно добавить или обновить дочернюю Ñтроку: проверка ограничений внешнего ключа не выполнÑетÑÑ"
+ spa "No puede adicionar una línea hijo: falla de clave extranjera constraint"
+ swe "FOREIGN KEY-konflikt: Kan inte skriva barn"
+ER_ROW_IS_REFERENCED 23000
+ eng "Cannot delete or update a parent row: a foreign key constraint fails"
+ fre "Impossible de supprimer un enregistrement père : une constrainte externe l'empèche"
+ ger "Löschen oder Aktualisieren eines Eltern-Datensatzes schlug aufgrund einer Fremdschlüssel-Beschränkung fehl"
+ greek "Cannot delete a parent row: a foreign key constraint fails"
+ hun "Cannot delete a parent row: a foreign key constraint fails"
+ ita "Impossibile cancellare la riga: un vincolo d'integrita' referenziale non e' soddisfatto"
+ por "Não pode apagar uma linha pai: uma restrição de chave estrangeira falhou"
+ rus "Ðевозможно удалить или обновить родительÑкую Ñтроку: проверка ограничений внешнего ключа не выполнÑетÑÑ"
+ serbian "Ne mogu da izbriÅ¡em roditeljski slog: provera spoljnog kljuÄa je neuspela"
+ spa "No puede deletar una línea padre: falla de clave extranjera constraint"
+ swe "FOREIGN KEY-konflikt: Kan inte radera fader"
+ER_CONNECT_TO_MASTER 08S01
+ nla "Fout bij opbouwen verbinding naar master: %-.128s"
+ eng "Error connecting to master: %-.128s"
+ ger "Fehler bei der Verbindung zum Master: %-.128s"
+ ita "Errore durante la connessione al master: %-.128s"
+ por "Erro conectando com o master: %-.128s"
+ rus "Ошибка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð³Ð¾Ð»Ð¾Ð²Ð½Ñ‹Ð¼ Ñервером: %-.128s"
+ spa "Error de coneccion a master: %-.128s"
+ swe "Fick fel vid anslutning till master: %-.128s"
+ER_QUERY_ON_MASTER
+ nla "Fout bij uitvoeren query op master: %-.128s"
+ eng "Error running query on master: %-.128s"
+ ger "Beim Ausführen einer Abfrage auf dem Master trat ein Fehler auf: %-.128s"
+ ita "Errore eseguendo una query sul master: %-.128s"
+ por "Erro rodando consulta no master: %-.128s"
+ rus "Ошибка Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа на головном Ñервере: %-.128s"
+ spa "Error executando el query en master: %-.128s"
+ swe "Fick fel vid utförande av command på mastern: %-.128s"
+ER_ERROR_WHEN_EXECUTING_COMMAND
+ nla "Fout tijdens uitvoeren van commando %s: %-.128s"
+ eng "Error when executing command %s: %-.128s"
+ est "Viga käsu %s täitmisel: %-.128s"
+ ger "Fehler beim Ausführen des Befehls %s: %-.128s"
+ ita "Errore durante l'esecuzione del comando %s: %-.128s"
+ por "Erro quando executando comando %s: %-.128s"
+ rus "Ошибка при выполнении команды %s: %-.128s"
+ serbian "Greška pri izvršavanju komande %s: %-.128s"
+ spa "Error de %s: %-.128s"
+ swe "Fick fel vid utförande av %s: %-.128s"
+ER_WRONG_USAGE
+ nla "Foutief gebruik van %s en %s"
+ eng "Incorrect usage of %s and %s"
+ est "Vigane %s ja %s kasutus"
+ ger "Falsche Verwendung von %s und %s"
+ ita "Uso errato di %s e %s"
+ por "Uso errado de %s e %s"
+ rus "Ðеверное иÑпользование %s и %s"
+ serbian "Pogrešna upotreba %s i %s"
+ spa "Equivocado uso de %s y %s"
+ swe "Felaktig använding av %s and %s"
+ ukr "Wrong usage of %s and %s"
+ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 21000
+ nla "De gebruikte SELECT commando's hebben een verschillend aantal kolommen"
+ eng "The used SELECT statements have a different number of columns"
+ est "Tulpade arv kasutatud SELECT lausetes ei kattu"
+ ger "Die verwendeten SELECT-Befehle liefern unterschiedliche Anzahlen von Feldern zurück"
+ ita "La SELECT utilizzata ha un numero di colonne differente"
+ por "Os comandos SELECT usados têm diferente número de colunas"
+ rus "ИÑпользованные операторы выборки (SELECT) дают разное количеÑтво Ñтолбцов"
+ serbian "Upotrebljene 'SELECT' komande adresiraju razliÄit broj kolona"
+ spa "El comando SELECT usado tiene diferente número de columnas"
+ swe "SELECT-kommandona har olika antal kolumner"
+ER_CANT_UPDATE_WITH_READLOCK
+ nla "Kan de query niet uitvoeren vanwege een conflicterende read lock"
+ eng "Can't execute the query because you have a conflicting read lock"
+ est "Ei suuda täita päringut konfliktse luku tõttu"
+ ger "Augrund eines READ-LOCK-Konflikts kann die Abfrage nicht ausgeführt werden"
+ ita "Impossibile eseguire la query perche' c'e' un conflitto con in lock di lettura"
+ por "Não posso executar a consulta porque você tem um conflito de travamento de leitura"
+ rus "Ðевозможно иÑполнить запроÑ, поÑкольку у Ð²Ð°Ñ ÑƒÑтановлены конфликтующие блокировки чтениÑ"
+ serbian "Ne mogu da izvrÅ¡im upit zbog toga Å¡to imate zakljuÄavanja Äitanja podataka u konfliktu"
+ spa "No puedo ejecutar el query porque usted tiene conflicto de traba de lectura"
+ swe "Kan inte utföra kommandot emedan du har ett READ-lås"
+ER_MIXING_NOT_ALLOWED
+ nla "Het combineren van transactionele en niet-transactionele tabellen is uitgeschakeld."
+ eng "Mixing of transactional and non-transactional tables is disabled"
+ est "Transaktsioone toetavate ning mittetoetavate tabelite kooskasutamine ei ole lubatud"
+ ger "Die gleichzeitige Verwendung von Tabellen mit und ohne Transaktionsunterstützung ist deaktiviert"
+ ita "E' disabilitata la possibilita' di mischiare tabelle transazionali e non-transazionali"
+ por "Mistura de tabelas transacional e não-transacional está desabilitada"
+ rus "ИÑпользование транзакционных таблиц нарÑду Ñ Ð½ÐµÑ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ð¸Ð¾Ð½Ð½Ñ‹Ð¼Ð¸ запрещено"
+ serbian "MeÅ¡anje tabela koje podržavaju transakcije i onih koje ne podržavaju transakcije je iskljuÄeno"
+ spa "Mezla de transancional y no-transancional tablas está deshabilitada"
+ swe "Blandning av transaktionella och icke-transaktionella tabeller är inaktiverat"
+ER_DUP_ARGUMENT
+ nla "Optie '%s' tweemaal gebruikt in opdracht"
+ eng "Option '%s' used twice in statement"
+ est "Määrangut '%s' on lauses kasutatud topelt"
+ ger "Option '%s' wird im Befehl zweimal verwendet"
+ ita "L'opzione '%s' e' stata usata due volte nel comando"
+ por "Opção '%s' usada duas vezes no comando"
+ rus "ÐžÐ¿Ñ†Ð¸Ñ '%s' дважды иÑпользована в выражении"
+ spa "Opción '%s' usada dos veces en el comando"
+ swe "Option '%s' användes två gånger"
+ER_USER_LIMIT_REACHED 42000
+ nla "Gebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)"
+ eng "User '%-.64s' has exceeded the '%s' resource (current value: %ld)"
+ ger "Benutzer '%-.64s' hat die Ressourcenbeschränkung '%s' überschritten (aktueller Wert: %ld)"
+ ita "L'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)"
+ por "Usuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)"
+ rus "Пользователь '%-.64s' превыÑил иÑпользование реÑурÑа '%s' (текущее значение: %ld)"
+ spa "Usuario '%-.64s' ha excedido el recurso '%s' (actual valor: %ld)"
+ swe "Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)"
+ER_SPECIFIC_ACCESS_DENIED_ERROR 42000
+ nla "Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie"
+ eng "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation"
+ ger "Kein Zugriff. Hierfür wird die Berechtigung %-.128s benötigt"
+ ita "Accesso non consentito. Serve il privilegio %-.128s per questa operazione"
+ por "Acesso negado. Você precisa o privilégio %-.128s para essa operação"
+ rus "Ð’ доÑтупе отказано. Вам нужны привилегии %-.128s Ð´Ð»Ñ Ñтой операции"
+ spa "Acceso negado. Usted necesita el privilegio %-.128s para esta operación"
+ swe "Du har inte privlegiet '%-.128s' som behövs för denna operation"
+ ukr "Access denied. You need the %-.128s privilege for this operation"
+ER_LOCAL_VARIABLE
+ nla "Variabele '%-.64s' is SESSION en kan niet worden gebruikt met SET GLOBAL"
+ eng "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL"
+ ger "Variable '%-.64s' ist eine lokale Variable und kann nicht mit SET GLOBAL verändert werden"
+ ita "La variabile '%-.64s' e' una variabile locale ( SESSION ) e non puo' essere cambiata usando SET GLOBAL"
+ por "Variável '%-.64s' é uma SESSION variável e não pode ser usada com SET GLOBAL"
+ rus "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s' ÑвлÑетÑÑ Ð¿Ð¾Ñ‚Ð¾ÐºÐ¾Ð²Ð¾Ð¹ (SESSION) переменной и не может быть изменена Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ SET GLOBAL"
+ spa "Variable '%-.64s' es una SESSION variable y no puede ser usada con SET GLOBAL"
+ swe "Variabel '%-.64s' är en SESSION variabel och kan inte ändrad med SET GLOBAL"
+ER_GLOBAL_VARIABLE
+ nla "Variabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBAL"
+ eng "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL"
+ ger "Variable '%-.64s' ist eine globale Variable und muss mit SET GLOBAL verändert werden"
+ ita "La variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBAL"
+ por "Variável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBAL"
+ rus "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s' ÑвлÑетÑÑ Ð³Ð»Ð¾Ð±Ð°Ð»ÑŒÐ½Ð¾Ð¹ (GLOBAL) переменной, и ее Ñледует изменÑÑ‚ÑŒ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ SET GLOBAL"
+ spa "Variable '%-.64s' es una GLOBAL variable y no puede ser configurada con SET GLOBAL"
+ swe "Variabel '%-.64s' är en GLOBAL variabel och bör sättas med SET GLOBAL"
+ER_NO_DEFAULT 42000
+ nla "Variabele '%-.64s' heeft geen standaard waarde"
+ eng "Variable '%-.64s' doesn't have a default value"
+ ger "Variable '%-.64s' hat keinen Vorgabewert"
+ ita "La variabile '%-.64s' non ha un valore di default"
+ por "Variável '%-.64s' não tem um valor padrão"
+ rus "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s' не имеет Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ умолчанию"
+ spa "Variable '%-.64s' no tiene un valor patrón"
+ swe "Variabel '%-.64s' har inte ett DEFAULT-värde"
+ER_WRONG_VALUE_FOR_VAR 42000
+ nla "Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.200s'"
+ eng "Variable '%-.64s' can't be set to the value of '%-.200s'"
+ ger "Variable '%-.64s' kann nicht auf '%-.200s' gesetzt werden"
+ ita "Alla variabile '%-.64s' non puo' essere assegato il valore '%-.200s'"
+ por "Variável '%-.64s' não pode ser configurada para o valor de '%-.200s'"
+ rus "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s' не может быть уÑтановлена в значение '%-.200s'"
+ spa "Variable '%-.64s' no puede ser configurada para el valor de '%-.200s'"
+ swe "Variabel '%-.64s' kan inte sättas till '%-.200s'"
+ER_WRONG_TYPE_FOR_VAR 42000
+ nla "Foutief argumenttype voor variabele '%-.64s'"
+ eng "Incorrect argument type to variable '%-.64s'"
+ ger "Falscher Argumenttyp für Variable '%-.64s'"
+ ita "Tipo di valore errato per la variabile '%-.64s'"
+ por "Tipo errado de argumento para variável '%-.64s'"
+ rus "Ðеверный тип аргумента Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ '%-.64s'"
+ spa "Tipo de argumento equivocado para variable '%-.64s'"
+ swe "Fel typ av argument till variabel '%-.64s'"
+ER_VAR_CANT_BE_READ
+ nla "Variabele '%-.64s' kan alleen worden gewijzigd, niet gelezen"
+ eng "Variable '%-.64s' can only be set, not read"
+ ger "Variable '%-.64s' kann nur verändert, nicht gelesen werden"
+ ita "Alla variabile '%-.64s' e' di sola scrittura quindi puo' essere solo assegnato un valore, non letto"
+ por "Variável '%-.64s' somente pode ser configurada, não lida"
+ rus "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ '%-.64s' может быть только уÑтановлена, но не Ñчитана"
+ spa "Variable '%-.64s' solamente puede ser configurada, no leída"
+ swe "Variabeln '%-.64s' kan endast sättas, inte läsas"
+ER_CANT_USE_OPTION_HERE 42000
+ nla "Foutieve toepassing/plaatsing van '%s'"
+ eng "Incorrect usage/placement of '%s'"
+ ger "Falsche Verwendung oder Platzierung von '%s'"
+ ita "Uso/posizione di '%s' sbagliato"
+ por "Errado uso/colocação de '%s'"
+ rus "Ðеверное иÑпользование или в неверном меÑте указан '%s'"
+ spa "Equivocado uso/colocación de '%s'"
+ swe "Fel använding/placering av '%s'"
+ER_NOT_SUPPORTED_YET 42000
+ nla "Deze versie van MySQL ondersteunt nog geen '%s'"
+ eng "This version of MySQL doesn't yet support '%s'"
+ ger "Diese MySQL-Version unterstützt '%s' nicht"
+ ita "Questa versione di MySQL non supporta ancora '%s'"
+ por "Esta versão de MySQL não suporta ainda '%s'"
+ rus "Эта верÑÐ¸Ñ MySQL пока еще не поддерживает '%s'"
+ spa "Esta versión de MySQL no soporta todavia '%s'"
+ swe "Denna version av MySQL kan ännu inte utföra '%s'"
+ER_MASTER_FATAL_ERROR_READING_BINLOG
+ nla "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log"
+ eng "Got fatal error %d from master when reading data from binary log: '%-.128s'"
+ ger "Schwerer Fehler %d: '%-.128s vom Master beim Lesen des binären Logs"
+ ita "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario"
+ por "Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log"
+ rus "Получена неиÑÐ¿Ñ€Ð°Ð²Ð¸Ð¼Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° %d: '%-.128s' от головного Ñервера в процеÑÑе выборки данных из двоичного журнала"
+ spa "Recibió fatal error %d: '%-.128s' del master cuando leyendo datos del binary log"
+ swe "Fick fatalt fel %d: '%-.128s' från master vid läsning av binärloggen"
+ER_SLAVE_IGNORED_TABLE
+ eng "Slave SQL thread ignored the query because of replicate-*-table rules"
+ ger "Slave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriert"
+ nla "Slave SQL thread negeerde de query vanwege replicate-*-table opties"
+ por "Slave SQL thread ignorado a consulta devido às normas de replicação-*-tabela"
+ spa "Slave SQL thread ignorado el query debido a las reglas de replicación-*-tabla"
+ swe "Slav SQL tråden ignorerade frågan pga en replicate-*-table regel"
+ER_INCORRECT_GLOBAL_LOCAL_VAR
+ eng "Variable '%-.192s' is a %s variable"
+ serbian "Promenljiva '%-.192s' je %s promenljiva"
+ ger "Variable '%-.192s' ist eine %s-Variable"
+ nla "Variabele '%-.192s' is geen %s variabele"
+ spa "Variable '%-.192s' es una %s variable"
+ swe "Variabel '%-.192s' är av typ %s"
+ER_WRONG_FK_DEF 42000
+ eng "Incorrect foreign key definition for '%-.192s': %s"
+ ger "Falsche Fremdschlüssel-Definition für '%-.192s': %s"
+ nla "Incorrecte foreign key definitie voor '%-.192s': %s"
+ por "Definição errada da chave estrangeira para '%-.192s': %s"
+ spa "Equivocada definición de llave extranjera para '%-.192s': %s"
+ swe "Felaktig FOREIGN KEY-definition för '%-.192s': %s"
+ER_KEY_REF_DO_NOT_MATCH_TABLE_REF
+ eng "Key reference and table reference don't match"
+ ger "Schlüssel- und Tabellenverweis passen nicht zusammen"
+ nla "Sleutel- en tabelreferentie komen niet overeen"
+ por "Referência da chave e referência da tabela não coincidem"
+ spa "Referencia de llave y referencia de tabla no coinciden"
+ swe "Nyckelreferensen och tabellreferensen stämmer inte överens"
+ER_OPERAND_COLUMNS 21000
+ eng "Operand should contain %d column(s)"
+ ger "Operand sollte %d Spalte(n) enthalten"
+ nla "Operand behoort %d kolommen te bevatten"
+ rus "Операнд должен Ñодержать %d колонок"
+ spa "Operando debe tener %d columna(s)"
+ ukr "Операнд має ÑкладатиÑÑ Ð· %d Ñтовбців"
+ER_SUBQUERY_NO_1_ROW 21000
+ eng "Subquery returns more than 1 row"
+ ger "Unterabfrage lieferte mehr als einen Datensatz zurück"
+ nla "Subquery retourneert meer dan 1 rij"
+ por "Subconsulta retorna mais que 1 registro"
+ rus "ÐŸÐ¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‰Ð°ÐµÑ‚ более одной запиÑи"
+ spa "Subconsulta retorna mas que 1 línea"
+ swe "Subquery returnerade mer än 1 rad"
+ ukr "Підзапит повертає більш нiж 1 запиÑ"
+ER_UNKNOWN_STMT_HANDLER
+ dan "Unknown prepared statement handler (%.*s) given to %s"
+ eng "Unknown prepared statement handler (%.*s) given to %s"
+ ger "Unbekannter Prepared-Statement-Handler (%.*s) für %s angegeben"
+ nla "Onebekende prepared statement handler (%.*s) voor %s aangegeven"
+ por "Desconhecido manipulador de declaração preparado (%.*s) determinado para %s"
+ spa "Desconocido preparado comando handler (%.*s) dado para %s"
+ swe "Okänd PREPARED STATEMENT id (%.*s) var given till %s"
+ ukr "Unknown prepared statement handler (%.*s) given to %s"
+ER_CORRUPT_HELP_DB
+ eng "Help database is corrupt or does not exist"
+ ger "Die Hilfe-Datenbank ist beschädigt oder existiert nicht"
+ nla "Help database is beschadigd of bestaat niet"
+ por "Banco de dado de ajuda corrupto ou não existente"
+ spa "Base de datos Help está corrupto o no existe"
+ swe "Hjälpdatabasen finns inte eller är skadad"
+ER_CYCLIC_REFERENCE
+ eng "Cyclic reference on subqueries"
+ ger "Zyklischer Verweis in Unterabfragen"
+ nla "Cyclische verwijzing in subqueries"
+ por "Referência cíclica em subconsultas"
+ rus "ЦикличеÑÐºÐ°Ñ ÑÑылка на подзапроÑ"
+ spa "Cíclica referencia en subconsultas"
+ swe "Cyklisk referens i subqueries"
+ ukr "Циклічне поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° підзапит"
+ER_AUTO_CONVERT
+ eng "Converting column '%s' from %s to %s"
+ ger "Feld '%s' wird von %s nach %s umgewandelt"
+ nla "Veld '%s' wordt van %s naar %s geconverteerd"
+ por "Convertendo coluna '%s' de %s para %s"
+ rus "Преобразование Ð¿Ð¾Ð»Ñ '%s' из %s в %s"
+ spa "Convirtiendo columna '%s' de %s para %s"
+ swe "Konvertar kolumn '%s' från %s till %s"
+ ukr "ÐŸÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñтовбца '%s' з %s у %s"
+ER_ILLEGAL_REFERENCE 42S22
+ eng "Reference '%-.64s' not supported (%s)"
+ ger "Verweis '%-.64s' wird nicht unterstützt (%s)"
+ nla "Verwijzing '%-.64s' niet ondersteund (%s)"
+ por "Referência '%-.64s' não suportada (%s)"
+ rus "СÑылка '%-.64s' не поддерживаетÑÑ (%s)"
+ spa "Referencia '%-.64s' no soportada (%s)"
+ swe "Referens '%-.64s' stöds inte (%s)"
+ ukr "ПоÑÐ¸Ð»Ð°Ð½Ð½Ñ '%-.64s' не пiдтримуетÑÑ (%s)"
+ER_DERIVED_MUST_HAVE_ALIAS 42000
+ eng "Every derived table must have its own alias"
+ ger "Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden"
+ nla "Voor elke afgeleide tabel moet een unieke alias worden gebruikt"
+ por "Cada tabela derivada deve ter seu próprio alias"
+ spa "Cada tabla derivada debe tener su propio alias"
+ swe "Varje 'derived table' måste ha sitt eget alias"
+ER_SELECT_REDUCED 01000
+ eng "Select %u was reduced during optimization"
+ ger "Select %u wurde während der Optimierung reduziert"
+ nla "Select %u werd geredureerd tijdens optimtalisatie"
+ por "Select %u foi reduzido durante otimização"
+ rus "Select %u был упразднен в процеÑÑе оптимизации"
+ spa "Select %u fué reducido durante optimización"
+ swe "Select %u reducerades vid optimiering"
+ ukr "Select %u was ÑкаÑовано при оптимiзацii"
+ER_TABLENAME_NOT_ALLOWED_HERE 42000
+ eng "Table '%-.192s' from one of the SELECTs cannot be used in %-.32s"
+ ger "Tabelle '%-.192s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werden"
+ nla "Tabel '%-.192s' uit een van de SELECTS kan niet in %-.32s gebruikt worden"
+ por "Tabela '%-.192s' de um dos SELECTs não pode ser usada em %-.32s"
+ spa "Tabla '%-.192s' de uno de los SELECT no puede ser usada en %-.32s"
+ swe "Tabell '%-.192s' från en SELECT kan inte användas i %-.32s"
+ER_NOT_SUPPORTED_AUTH_MODE 08004
+ eng "Client does not support authentication protocol requested by server; consider upgrading MySQL client"
+ ger "Client unterstützt das vom Server erwartete Authentifizierungsprotokoll nicht. Bitte aktualisieren Sie Ihren MySQL-Client"
+ nla "Client ondersteunt het door de server verwachtte authenticatieprotocol niet. Overweeg een nieuwere MySQL client te gebruiken"
+ por "Cliente não suporta o protocolo de autenticação exigido pelo servidor; considere a atualização do cliente MySQL"
+ spa "Cliente no soporta protocolo de autenticación solicitado por el servidor; considere actualizar el cliente MySQL"
+ swe "Klienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammet."
+ER_SPATIAL_CANT_HAVE_NULL 42000
+ eng "All parts of a SPATIAL index must be NOT NULL"
+ ger "Alle Teile eines SPATIAL-Index müssen als NOT NULL deklariert sein"
+ nla "Alle delete van een SPATIAL index dienen als NOT NULL gedeclareerd te worden"
+ por "Todas as partes de uma SPATIAL index devem ser NOT NULL"
+ spa "Todas las partes de una SPATIAL index deben ser NOT NULL"
+ swe "Alla delar av en SPATIAL index måste vara NOT NULL"
+ER_COLLATION_CHARSET_MISMATCH 42000
+ eng "COLLATION '%s' is not valid for CHARACTER SET '%s'"
+ ger "COLLATION '%s' ist für CHARACTER SET '%s' ungültig"
+ nla "COLLATION '%s' is niet geldig voor CHARACTER SET '%s'"
+ por "COLLATION '%s' não é válida para CHARACTER SET '%s'"
+ spa "COLLATION '%s' no es válido para CHARACTER SET '%s'"
+ swe "COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'"
+ER_SLAVE_WAS_RUNNING
+ eng "Slave is already running"
+ ger "Slave läuft bereits"
+ nla "Slave is reeds actief"
+ por "O slave já está rodando"
+ spa "Slave ya está funcionando"
+ swe "Slaven har redan startat"
+ER_SLAVE_WAS_NOT_RUNNING
+ eng "Slave already has been stopped"
+ ger "Slave wurde bereits angehalten"
+ nla "Slave is reeds gestopt"
+ por "O slave já está parado"
+ spa "Slave ya fué parado"
+ swe "Slaven har redan stoppat"
+ER_TOO_BIG_FOR_UNCOMPRESS
+ eng "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)"
+ ger "Unkomprimierte Daten sind zu groß. Die maximale Größe beträgt %d (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)"
+ nla "Ongecomprimeerder data is te groot; de maximum lengte is %d (waarschijnlijk, de lengte van de gecomprimeerde data was beschadigd)"
+ por "Tamanho muito grande dos dados des comprimidos. O máximo tamanho é %d. (provavelmente, o comprimento dos dados descomprimidos está corrupto)"
+ spa "Tamaño demasiado grande para datos descomprimidos. El máximo tamaño es %d. (probablemente, extensión de datos descomprimidos fué corrompida)"
+ER_ZLIB_Z_MEM_ERROR
+ eng "ZLIB: Not enough memory"
+ ger "ZLIB: Nicht genug Speicher"
+ nla "ZLIB: Onvoldoende geheugen"
+ por "ZLIB: Não suficiente memória disponível"
+ spa "Z_MEM_ERROR: No suficiente memoria para zlib"
+ER_ZLIB_Z_BUF_ERROR
+ eng "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)"
+ ger "ZLIB: Im Ausgabepuffer ist nicht genug Platz vorhanden (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)"
+ nla "ZLIB: Onvoldoende ruimte in uitgaande buffer (waarschijnlijk, de lengte van de ongecomprimeerde data was beschadigd)"
+ por "ZLIB: Não suficiente espaço no buffer emissor (provavelmente, o comprimento dos dados descomprimidos está corrupto)"
+ spa "Z_BUF_ERROR: No suficiente espacio en el búfer de salida para zlib (probablemente, extensión de datos descomprimidos fué corrompida)"
+ER_ZLIB_Z_DATA_ERROR
+ eng "ZLIB: Input data corrupted"
+ ger "ZLIB: Eingabedaten beschädigt"
+ nla "ZLIB: Invoer data beschadigd"
+ por "ZLIB: Dados de entrada está corrupto"
+ spa "ZLIB: Dato de entrada fué corrompido para zlib"
+ER_CUT_VALUE_GROUP_CONCAT
+ eng "Row %u was cut by GROUP_CONCAT()"
+ER_WARN_TOO_FEW_RECORDS 01000
+ eng "Row %ld doesn't contain data for all columns"
+ ger "Zeile %ld enthält nicht für alle Felder Daten"
+ nla "Rij %ld bevat niet de data voor alle kolommen"
+ por "Conta de registro é menor que a conta de coluna na linha %ld"
+ spa "Línea %ld no contiene datos para todas las columnas"
+ER_WARN_TOO_MANY_RECORDS 01000
+ eng "Row %ld was truncated; it contained more data than there were input columns"
+ ger "Zeile %ld gekürzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
+ nla "Regel %ld ingekort, bevatte meer data dan invoer kolommen"
+ por "Conta de registro é maior que a conta de coluna na linha %ld"
+ spa "Línea %ld fué truncada; La misma contine mas datos que las que existen en las columnas de entrada"
+ER_WARN_NULL_TO_NOTNULL 22004
+ eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld"
+ ger "Feld auf Vorgabewert gesetzt, da NULL für NOT-NULL-Feld '%s' in Zeile %ld angegeben"
+ por "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %ld"
+ spa "Datos truncado, NULL suministrado para NOT NULL columna '%s' en la línea %ld"
+ER_WARN_DATA_OUT_OF_RANGE 22003
+ eng "Out of range value for column '%s' at row %ld"
+WARN_DATA_TRUNCATED 01000
+ eng "Data truncated for column '%s' at row %ld"
+ ger "Daten abgeschnitten für Feld '%s' in Zeile %ld"
+ por "Dado truncado para coluna '%s' na linha %ld"
+ spa "Datos truncados para columna '%s' en la línea %ld"
+ER_WARN_USING_OTHER_HANDLER
+ eng "Using storage engine %s for table '%s'"
+ ger "Für Tabelle '%s' wird Speicher-Engine %s benutzt"
+ por "Usando engine de armazenamento %s para tabela '%s'"
+ spa "Usando motor de almacenamiento %s para tabla '%s'"
+ swe "Använder handler %s för tabell '%s'"
+ER_CANT_AGGREGATE_2COLLATIONS
+ eng "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'"
+ ger "Unerlaubte Mischung von Sortierreihenfolgen (%s, %s) und (%s, %s) für Operation '%s'"
+ por "Combinação ilegal de collations (%s,%s) e (%s,%s) para operação '%s'"
+ spa "Ilegal mezcla de collations (%s,%s) y (%s,%s) para operación '%s'"
+ER_DROP_USER
+ eng "Cannot drop one or more of the requested users"
+ ger "Kann einen oder mehrere der angegebenen Benutzer nicht löschen"
+ER_REVOKE_GRANTS
+ eng "Can't revoke all privileges for one or more of the requested users"
+ ger "Kann nicht alle Berechtigungen widerrufen, die für einen oder mehrere Benutzer gewährt wurden"
+ por "Não pode revocar todos os privilégios, grant para um ou mais dos usuários pedidos"
+ spa "No puede revocar todos los privilegios, derecho para uno o mas de los usuarios solicitados"
+ER_CANT_AGGREGATE_3COLLATIONS
+ eng "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'"
+ ger "Unerlaubte Mischung von Sortierreihenfolgen (%s, %s), (%s, %s), (%s, %s) für Operation '%s'"
+ por "Ilegal combinação de collations (%s,%s), (%s,%s), (%s,%s) para operação '%s'"
+ spa "Ilegal mezcla de collations (%s,%s), (%s,%s), (%s,%s) para operación '%s'"
+ER_CANT_AGGREGATE_NCOLLATIONS
+ eng "Illegal mix of collations for operation '%s'"
+ ger "Unerlaubte Mischung von Sortierreihenfolgen für Operation '%s'"
+ por "Ilegal combinação de collations para operação '%s'"
+ spa "Ilegal mezcla de collations para operación '%s'"
+ER_VARIABLE_IS_NOT_STRUCT
+ eng "Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)"
+ ger "Variable '%-.64s' ist keine Variablen-Komponente (kann nicht als XXXX.variablen_name verwendet werden)"
+ por "Variável '%-.64s' não é uma variável componente (Não pode ser usada como XXXX.variável_nome)"
+ spa "Variable '%-.64s' no es una variable componente (No puede ser usada como XXXX.variable_name)"
+ER_UNKNOWN_COLLATION
+ eng "Unknown collation: '%-.64s'"
+ ger "Unbekannte Sortierreihenfolge: '%-.64s'"
+ por "Collation desconhecida: '%-.64s'"
+ spa "Collation desconocida: '%-.64s'"
+ER_SLAVE_IGNORED_SSL_PARAMS
+ eng "SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started"
+ ger "SSL-Parameter in CHANGE MASTER werden ignoriert, weil dieser MySQL-Slave ohne SSL-Unterstützung kompiliert wurde. Sie können aber später verwendet werden, wenn ein MySQL-Slave mit SSL gestartet wird"
+ por "SSL parâmetros em CHANGE MASTER são ignorados porque este escravo MySQL foi compilado sem o SSL suporte. Os mesmos podem ser usados mais tarde quando o escravo MySQL com SSL seja iniciado."
+ spa "Parametros SSL en CHANGE MASTER son ignorados porque este slave MySQL fue compilado sin soporte SSL; pueden ser usados despues cuando el slave MySQL con SSL sea inicializado"
+ER_SERVER_IS_IN_SECURE_AUTH_MODE
+ eng "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format"
+ ger "Server läuft im Modus --secure-auth, aber '%s'@'%s' hat ein Passwort im alten Format. Bitte Passwort ins neue Format ändern"
+ por "Servidor está rodando em --secure-auth modo, porêm '%s'@'%s' tem senha no formato antigo; por favor troque a senha para o novo formato"
+ rus "Сервер запущен в режиме --secure-auth (безопаÑной авторизации), но Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%s'@'%s' пароль Ñохранён в Ñтаром формате; необходимо обновить формат паролÑ"
+ spa "Servidor está rodando en modo --secure-auth, pero '%s'@'%s' tiene clave en el antiguo formato; por favor cambie la clave para el nuevo formato"
+ER_WARN_FIELD_RESOLVED
+ eng "Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d"
+ ger "Feld oder Verweis '%-.192s%s%-.192s%s%-.192s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöst"
+ por "Campo ou referência '%-.192s%s%-.192s%s%-.192s' de SELECT #%d foi resolvido em SELECT #%d"
+ rus "Поле или ÑÑылка '%-.192s%s%-.192s%s%-.192s' из SELECTа #%d была найдена в SELECTе #%d"
+ spa "Campo o referencia '%-.192s%s%-.192s%s%-.192s' de SELECT #%d fue resolvido en SELECT #%d"
+ ukr "Стовбець або поÑÐ¸Ð»Ð°Ð½Ð½Ñ '%-.192s%s%-.192s%s%-.192s' із SELECTу #%d було знайдене у SELECTÑ– #%d"
+ER_BAD_SLAVE_UNTIL_COND
+ eng "Incorrect parameter or combination of parameters for START SLAVE UNTIL"
+ ger "Falscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTIL"
+ por "Parâmetro ou combinação de parâmetros errado para START SLAVE UNTIL"
+ spa "Parametro equivocado o combinación de parametros para START SLAVE UNTIL"
+ER_MISSING_SKIP_SLAVE
+ eng "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart"
+ ger "Es wird empfohlen, mit --skip-slave-start zu starten, wenn mit START SLAVE UNTIL eine Schritt-für-Schritt-Replikation ausgeführt wird. Ansonsten gibt es Probleme, wenn ein Slave-Server unerwartet neu startet"
+ por "É recomendado para rodar com --skip-slave-start quando fazendo replicação passo-por-passo com START SLAVE UNTIL, de outra forma você não está seguro em caso de inesperada reinicialição do mysqld escravo"
+ spa "Es recomendado rodar con --skip-slave-start cuando haciendo replicación step-by-step con START SLAVE UNTIL, a menos que usted no esté seguro en caso de inesperada reinicialización del mysqld slave"
+ER_UNTIL_COND_IGNORED
+ eng "SQL thread is not to be started so UNTIL options are ignored"
+ ger "SQL-Thread soll nicht gestartet werden. Daher werden UNTIL-Optionen ignoriert"
+ por "Thread SQL não pode ser inicializado tal que opções UNTIL são ignoradas"
+ spa "SQL thread no es inicializado tal que opciones UNTIL son ignoradas"
+ER_WRONG_NAME_FOR_INDEX 42000
+ eng "Incorrect index name '%-.100s'"
+ ger "Falscher Indexname '%-.100s'"
+ por "Incorreto nome de índice '%-.100s'"
+ spa "Nombre de índice incorrecto '%-.100s'"
+ swe "Felaktigt index namn '%-.100s'"
+ER_WRONG_NAME_FOR_CATALOG 42000
+ eng "Incorrect catalog name '%-.100s'"
+ ger "Falscher Katalogname '%-.100s'"
+ por "Incorreto nome de catálogo '%-.100s'"
+ spa "Nombre de catalog incorrecto '%-.100s'"
+ swe "Felaktigt katalog namn '%-.100s'"
+ER_WARN_QC_RESIZE
+ eng "Query cache failed to set size %lu; new query cache size is %lu"
+ ger "Änderung der Query-Cache-Größe auf %lu fehlgeschlagen; neue Query-Cache-Größe ist %lu"
+ por "Falha em Query cache para configurar tamanho %lu, novo tamanho de query cache é %lu"
+ rus "Кеш запроÑов не может уÑтановить размер %lu, новый размер кеша зпроÑов - %lu"
+ spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu"
+ swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu"
+ ukr "Кеш запитів неÑпроможен вÑтановити розмір %lu, новий розмір кеша запитів - %lu"
+ER_BAD_FT_COLUMN
+ eng "Column '%-.192s' cannot be part of FULLTEXT index"
+ ger "Feld '%-.192s' kann nicht Teil eines FULLTEXT-Index sein"
+ por "Coluna '%-.192s' não pode ser parte de índice FULLTEXT"
+ spa "Columna '%-.192s' no puede ser parte de FULLTEXT index"
+ swe "Kolumn '%-.192s' kan inte vara del av ett FULLTEXT index"
+ER_UNKNOWN_KEY_CACHE
+ eng "Unknown key cache '%-.100s'"
+ ger "Unbekannter Schlüssel-Cache '%-.100s'"
+ por "Key cache desconhecida '%-.100s'"
+ spa "Desconocida key cache '%-.100s'"
+ swe "Okänd nyckel cache '%-.100s'"
+ER_WARN_HOSTNAME_WONT_WORK
+ eng "MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work"
+ ger "MySQL wurde mit --skip-name-resolve gestartet. Diese Option darf nicht verwendet werden, damit diese Rechtevergabe möglich ist"
+ por "MySQL foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionar"
+ spa "MySQL esta inicializado en modo --skip-name-resolve. Usted necesita reinicializarlo sin esta opción para este derecho funcionar"
+ER_UNKNOWN_STORAGE_ENGINE 42000
+ eng "Unknown table engine '%s'"
+ ger "Unbekannte Speicher-Engine '%s'"
+ por "Motor de tabela desconhecido '%s'"
+ spa "Desconocido motor de tabla '%s'"
+# When using this error code, use ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER)
+# for the message string. See, for example, code in mysql_priv.h.
+ER_WARN_DEPRECATED_SYNTAX
+ eng "'%s' is deprecated; use '%s' instead"
+ ger "'%s' ist veraltet. Bitte benutzen Sie '%s'"
+ por "'%s' é desatualizado. Use '%s' em seu lugar"
+ spa "'%s' está desaprobado, use '%s' en su lugar"
+ER_NON_UPDATABLE_TABLE
+ eng "The target table %-.100s of the %s is not updatable"
+ ger "Die Zieltabelle %-.100s von %s ist nicht aktualisierbar"
+ por "A tabela destino %-.100s do %s não é atualizável"
+ rus "Таблица %-.100s в %s не может изменÑÑ‚ÑÑ"
+ spa "La tabla destino %-.100s del %s no es actualizable"
+ swe "Tabell %-.100s använd med '%s' är inte uppdateringsbar"
+ ukr "Ð¢Ð°Ð±Ð»Ð¸Ñ†Ñ %-.100s у %s не може оновлюватиÑÑŒ"
+ER_FEATURE_DISABLED
+ eng "The '%s' feature is disabled; you need MySQL built with '%s' to have it working"
+ ger "Das Feature '%s' ist ausgeschaltet, Sie müssen MySQL mit '%s' übersetzen, damit es verfügbar ist"
+ por "O recurso '%s' foi desativado; você necessita MySQL construído com '%s' para ter isto funcionando"
+ spa "El recurso '%s' fue deshabilitado; usted necesita construir MySQL con '%s' para tener eso funcionando"
+ swe "'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definerad"
+ER_OPTION_PREVENTS_STATEMENT
+ eng "The MySQL server is running with the %s option so it cannot execute this statement"
+ ger "Der MySQL-Server läuft mit der Option %s und kann diese Anweisung deswegen nicht ausführen"
+ por "O servidor MySQL está rodando com a opção %s razão pela qual não pode executar esse commando"
+ spa "El servidor MySQL está rodando con la opción %s tal que no puede ejecutar este comando"
+ swe "MySQL är startad med %s. Pga av detta kan du inte använda detta kommando"
+ER_DUPLICATED_VALUE_IN_TYPE
+ eng "Column '%-.100s' has duplicated value '%-.64s' in %s"
+ ger "Feld '%-.100s' hat doppelten Wert '%-.64s' in %s"
+ por "Coluna '%-.100s' tem valor duplicado '%-.64s' em %s"
+ spa "Columna '%-.100s' tiene valor doblado '%-.64s' en %s"
+ER_TRUNCATED_WRONG_VALUE 22007
+ eng "Truncated incorrect %-.32s value: '%-.128s'"
+ ger "Falscher %-.32s-Wert gekürzt: '%-.128s'"
+ por "Truncado errado %-.32s valor: '%-.128s'"
+ spa "Equivocado truncado %-.32s valor: '%-.128s'"
+ER_TOO_MUCH_AUTO_TIMESTAMP_COLS
+ eng "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"
+ ger "Fehlerhafte Tabellendefinition. Es kann nur eine einzige TIMESTAMP-Spalte mit CURRENT_TIMESTAMP als DEFAULT oder in einer ON-UPDATE-Klausel geben"
+ por "Incorreta definição de tabela; Pode ter somente uma coluna TIMESTAMP com CURRENT_TIMESTAMP em DEFAULT ou ON UPDATE cláusula"
+ spa "Incorrecta definición de tabla; Solamente debe haber una columna TIMESTAMP con CURRENT_TIMESTAMP en DEFAULT o ON UPDATE cláusula"
+ER_INVALID_ON_UPDATE
+ eng "Invalid ON UPDATE clause for '%-.192s' column"
+ ger "Ungültige ON-UPDATE-Klausel für Spalte '%-.192s'"
+ por "Inválida cláusula ON UPDATE para campo '%-.192s'"
+ spa "Inválido ON UPDATE cláusula para campo '%-.192s'"
+ER_UNSUPPORTED_PS
+ eng "This command is not supported in the prepared statement protocol yet"
+ ger "Dieser Befehl wird im Protokoll für vorbereitete Anweisungen noch nicht unterstützt"
+ER_GET_ERRMSG
+ dan "Modtog fejl %d '%-.100s' fra %s"
+ eng "Got error %d '%-.100s' from %s"
+ ger "Fehler %d '%-.100s' von %s"
+ nor "Mottok feil %d '%-.100s' fa %s"
+ norwegian-ny "Mottok feil %d '%-.100s' fra %s"
+ER_GET_TEMPORARY_ERRMSG
+ dan "Modtog temporary fejl %d '%-.100s' fra %s"
+ eng "Got temporary error %d '%-.100s' from %s"
+ ger "Temporärer Fehler %d '%-.100s' von %s"
+ nor "Mottok temporary feil %d '%-.100s' fra %s"
+ norwegian-ny "Mottok temporary feil %d '%-.100s' fra %s"
+ER_UNKNOWN_TIME_ZONE
+ eng "Unknown or incorrect time zone: '%-.64s'"
+ ger "Unbekannte oder falsche Zeitzone: '%-.64s'"
+ER_WARN_INVALID_TIMESTAMP
+ eng "Invalid TIMESTAMP value in column '%s' at row %ld"
+ ger "Ungültiger TIMESTAMP-Wert in Feld '%s', Zeile %ld"
+ER_INVALID_CHARACTER_STRING
+ eng "Invalid %s character string: '%.64s'"
+ ger "Ungültiger %s-Zeichen-String: '%.64s'"
+ER_WARN_ALLOWED_PACKET_OVERFLOWED
+ eng "Result of %s() was larger than max_allowed_packet (%ld) - truncated"
+ ger "Ergebnis von %s() war größer als max_allowed_packet (%ld) Bytes und wurde deshalb gekürzt"
+ER_CONFLICTING_DECLARATIONS
+ eng "Conflicting declarations: '%s%s' and '%s%s'"
+ ger "Widersprüchliche Deklarationen: '%s%s' und '%s%s'"
+ER_SP_NO_RECURSIVE_CREATE 2F003
+ eng "Can't create a %s from within another stored routine"
+ ger "Kann kein %s innerhalb einer anderen gespeicherten Routine erzeugen"
+ER_SP_ALREADY_EXISTS 42000
+ eng "%s %s already exists"
+ ger "%s %s existiert bereits"
+ER_SP_DOES_NOT_EXIST 42000
+ eng "%s %s does not exist"
+ ger "%s %s existiert nicht"
+ER_SP_DROP_FAILED
+ eng "Failed to DROP %s %s"
+ ger "DROP %s %s ist fehlgeschlagen"
+ER_SP_STORE_FAILED
+ eng "Failed to CREATE %s %s"
+ ger "CREATE %s %s ist fehlgeschlagen"
+ER_SP_LILABEL_MISMATCH 42000
+ eng "%s with no matching label: %s"
+ ger "%s ohne passende Marke: %s"
+ER_SP_LABEL_REDEFINE 42000
+ eng "Redefining label %s"
+ ger "Neudefinition der Marke %s"
+ER_SP_LABEL_MISMATCH 42000
+ eng "End-label %s without match"
+ ger "Ende-Marke %s ohne zugehörigen Anfang"
+ER_SP_UNINIT_VAR 01000
+ eng "Referring to uninitialized variable %s"
+ ger "Zugriff auf nichtinitialisierte Variable %s"
+ER_SP_BADSELECT 0A000
+ eng "PROCEDURE %s can't return a result set in the given context"
+ ger "PROCEDURE %s kann im gegebenen Kontext keine Ergebnismenge zurückgeben"
+ER_SP_BADRETURN 42000
+ eng "RETURN is only allowed in a FUNCTION"
+ ger "RETURN ist nur innerhalb einer FUNCTION erlaubt"
+ER_SP_BADSTATEMENT 0A000
+ eng "%s is not allowed in stored procedures"
+ ger "%s ist in gespeicherten Prozeduren nicht erlaubt"
+ER_UPDATE_LOG_DEPRECATED_IGNORED 42000
+ eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored"
+ ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wird ignoriert"
+ER_UPDATE_LOG_DEPRECATED_TRANSLATED 42000
+ eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN"
+ ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wurde in SET SQL_LOG_BIN übersetzt"
+ER_QUERY_INTERRUPTED 70100
+ eng "Query execution was interrupted"
+ ger "Ausführung der Abfrage wurde unterbrochen"
+ER_SP_WRONG_NO_OF_ARGS 42000
+ eng "Incorrect number of arguments for %s %s; expected %u, got %u"
+ ger "Falsche Anzahl von Argumenten für %s %s; erwarte %u, erhalte %u"
+ER_SP_COND_MISMATCH 42000
+ eng "Undefined CONDITION: %s"
+ ger "Undefinierte CONDITION: %s"
+ER_SP_NORETURN 42000
+ eng "No RETURN found in FUNCTION %s"
+ ger "Kein RETURN in FUNCTION %s gefunden"
+ER_SP_NORETURNEND 2F005
+ eng "FUNCTION %s ended without RETURN"
+ ger "FUNCTION %s endete ohne RETURN"
+ER_SP_BAD_CURSOR_QUERY 42000
+ eng "Cursor statement must be a SELECT"
+ ger "Cursor-Anweisung muss ein SELECT sein"
+ER_SP_BAD_CURSOR_SELECT 42000
+ eng "Cursor SELECT must not have INTO"
+ ger "Cursor-SELECT darf kein INTO haben"
+ER_SP_CURSOR_MISMATCH 42000
+ eng "Undefined CURSOR: %s"
+ ger "Undefinierter CURSOR: %s"
+ER_SP_CURSOR_ALREADY_OPEN 24000
+ eng "Cursor is already open"
+ ger "Cursor ist schon geöffnet"
+ER_SP_CURSOR_NOT_OPEN 24000
+ eng "Cursor is not open"
+ ger "Cursor ist nicht geöffnet"
+ER_SP_UNDECLARED_VAR 42000
+ eng "Undeclared variable: %s"
+ ger "Nicht deklarierte Variable: %s"
+ER_SP_WRONG_NO_OF_FETCH_ARGS
+ eng "Incorrect number of FETCH variables"
+ ger "Falsche Anzahl von FETCH-Variablen"
+ER_SP_FETCH_NO_DATA 02000
+ eng "No data - zero rows fetched, selected, or processed"
+ ger "Keine Daten - null Zeilen geholt (fetch), ausgewählt oder verarbeitet"
+ER_SP_DUP_PARAM 42000
+ eng "Duplicate parameter: %s"
+ ger "Doppelter Parameter: %s"
+ER_SP_DUP_VAR 42000
+ eng "Duplicate variable: %s"
+ ger "Doppelte Variable: %s"
+ER_SP_DUP_COND 42000
+ eng "Duplicate condition: %s"
+ ger "Doppelte Bedingung: %s"
+ER_SP_DUP_CURS 42000
+ eng "Duplicate cursor: %s"
+ ger "Doppelter Cursor: %s"
+ER_SP_CANT_ALTER
+ eng "Failed to ALTER %s %s"
+ ger "ALTER %s %s fehlgeschlagen"
+ER_SP_SUBSELECT_NYI 0A000
+ eng "Subquery value not supported"
+ ger "Subquery-Wert wird nicht unterstützt"
+ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 0A000
+ eng "%s is not allowed in stored function or trigger"
+ ger "%s ist in gespeicherten Funktionen und in Triggern nicht erlaubt"
+ER_SP_VARCOND_AFTER_CURSHNDLR 42000
+ eng "Variable or condition declaration after cursor or handler declaration"
+ ger "Deklaration einer Variablen oder einer Bedingung nach der Deklaration eines Cursors oder eines Handlers"
+ER_SP_CURSOR_AFTER_HANDLER 42000
+ eng "Cursor declaration after handler declaration"
+ ger "Deklaration eines Cursors nach der Deklaration eines Handlers"
+ER_SP_CASE_NOT_FOUND 20000
+ eng "Case not found for CASE statement"
+ ger "Fall für CASE-Anweisung nicht gefunden"
+ER_FPARSER_TOO_BIG_FILE
+ eng "Configuration file '%-.192s' is too big"
+ ger "Konfigurationsdatei '%-.192s' ist zu groß"
+ rus "Слишком большой конфигурационный файл '%-.192s'"
+ ukr "Занадто великий конфігураційний файл '%-.192s'"
+ER_FPARSER_BAD_HEADER
+ eng "Malformed file type header in file '%-.192s'"
+ ger "Nicht wohlgeformter Dateityp-Header in Datei '%-.192s'"
+ rus "Ðеверный заголовок типа файла '%-.192s'"
+ ukr "Ðевірний заголовок типу у файлі '%-.192s'"
+ER_FPARSER_EOF_IN_COMMENT
+ eng "Unexpected end of file while parsing comment '%-.200s'"
+ ger "Unerwartetes Dateiende beim Parsen des Kommentars '%-.200s'"
+ rus "Ðеожиданный конец файла в коментарии '%-.200s'"
+ ukr "ÐеÑподіванний кінець файлу у коментарі '%-.200s'"
+ER_FPARSER_ERROR_IN_PARAMETER
+ eng "Error while parsing parameter '%-.192s' (line: '%-.192s')"
+ ger "Fehler beim Parsen des Parameters '%-.192s' (Zeile: '%-.192s')"
+ rus "Ошибка при раÑпознавании параметра '%-.192s' (Ñтрока: '%-.192s')"
+ ukr "Помилка в роÑпізнаванні параметру '%-.192s' (Ñ€Ñдок: '%-.192s')"
+ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER
+ eng "Unexpected end of file while skipping unknown parameter '%-.192s'"
+ ger "Unerwartetes Dateiende beim Ãœberspringen des unbekannten Parameters '%-.192s'"
+ rus "Ðеожиданный конец файла при пропуÑке неизвеÑтного параметра '%-.192s'"
+ ukr "ÐеÑподіванний кінець файлу у Ñпробі проминути невідомий параметр '%-.192s'"
+ER_VIEW_NO_EXPLAIN
+ eng "EXPLAIN/SHOW can not be issued; lacking privileges for underlying table"
+ ger "EXPLAIN/SHOW kann nicht verlangt werden. Rechte für zugrunde liegende Tabelle fehlen"
+ rus "EXPLAIN/SHOW не может быть выполненно; недоÑтаточно прав на такблицы запроÑа"
+ ukr "EXPLAIN/SHOW не може бути віконано; немає прав на тиблиці запиту"
+ER_FRM_UNKNOWN_TYPE
+ eng "File '%-.192s' has unknown type '%-.64s' in its header"
+ ger "Datei '%-.192s' hat unbekannten Typ '%-.64s' im Header"
+ rus "Файл '%-.192s' Ñодержит неизвеÑтный тип '%-.64s' в заголовке"
+ ukr "Файл '%-.192s' має невідомий тип '%-.64s' у заголовку"
+ER_WRONG_OBJECT
+ eng "'%-.192s.%-.192s' is not %s"
+ ger "'%-.192s.%-.192s' ist nicht %s"
+ rus "'%-.192s.%-.192s' - не %s"
+ ukr "'%-.192s.%-.192s' не є %s"
+ER_NONUPDATEABLE_COLUMN
+ eng "Column '%-.192s' is not updatable"
+ ger "Feld '%-.192s' ist nicht aktualisierbar"
+ rus "Столбец '%-.192s' не обновлÑемый"
+ ukr "Стовбець '%-.192s' не може бути зминений"
+ER_VIEW_SELECT_DERIVED
+ eng "View's SELECT contains a subquery in the FROM clause"
+ ger "SELECT der View enthält eine Subquery in der FROM-Klausel"
+ rus "View SELECT Ñодержит Ð¿Ð¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð² конÑтрукции FROM"
+ ukr "View SELECT має підзапит у конÑтрукції FROM"
+ER_VIEW_SELECT_CLAUSE
+ eng "View's SELECT contains a '%s' clause"
+ ger "SELECT der View enthält eine '%s'-Klausel"
+ rus "View SELECT Ñодержит конÑтрукцию '%s'"
+ ukr "View SELECT має конÑтрукцію '%s'"
+ER_VIEW_SELECT_VARIABLE
+ eng "View's SELECT contains a variable or parameter"
+ ger "SELECT der View enthält eine Variable oder einen Parameter"
+ rus "View SELECT Ñодержит переменную или параметр"
+ ukr "View SELECT має зминну або параметер"
+ER_VIEW_SELECT_TMPTABLE
+ eng "View's SELECT refers to a temporary table '%-.192s'"
+ ger "SELECT der View verweist auf eine temporäre Tabelle '%-.192s'"
+ rus "View SELECT Ñодержит ÑÑылку на временную таблицу '%-.192s'"
+ ukr "View SELECT викориÑтовує тимчаÑову таблицю '%-.192s'"
+ER_VIEW_WRONG_LIST
+ eng "View's SELECT and view's field list have different column counts"
+ ger "SELECT- und Feldliste der Views haben unterschiedliche Anzahlen von Spalten"
+ rus "View SELECT и ÑпиÑок полей view имеют разное количеÑтво Ñтолбцов"
+ ukr "View SELECT Ñ– перелік Ñтовбців view мають різну кількіÑÑ‚ÑŒ Ñковбців"
+ER_WARN_VIEW_MERGE
+ eng "View merge algorithm can't be used here for now (assumed undefined algorithm)"
+ ger "View-Merge-Algorithmus kann hier momentan nicht verwendet werden (undefinierter Algorithmus wird angenommen)"
+ rus "Ðлгоритм ÑлиÑÐ½Ð¸Ñ view не может быть иÑпользован ÑÐµÐ¹Ñ‡Ð°Ñ (алгоритм будет неопеределенным)"
+ ukr "Ðлгоритм Ð·Ð»Ð¸Ð²Ð°Ð½Ð½Ñ view не може бути викориÑтаний зараз (алгоритм буде невизначений)"
+ER_WARN_VIEW_WITHOUT_KEY
+ eng "View being updated does not have complete key of underlying table in it"
+ ger "Die aktualisierte View enthält nicht den vollständigen Schlüssel der zugrunde liegenden Tabelle"
+ rus "ОбновлÑемый view не Ñодержит ключа иÑпользованных(ой) в нем таблиц(Ñ‹)"
+ ukr "View, що оновлюетьÑÑ, не міÑтить повного ключа таблиці(ÑŒ), що викоріÑтана в ньюому"
+ER_VIEW_INVALID
+ eng "View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them"
+ER_SP_NO_DROP_SP
+ eng "Can't drop or alter a %s from within another stored routine"
+ ger "Kann eine %s nicht von innerhalb einer anderen gespeicherten Routine löschen oder ändern"
+ER_SP_GOTO_IN_HNDLR
+ eng "GOTO is not allowed in a stored procedure handler"
+ ger "GOTO ist im Handler einer gespeicherten Prozedur nicht erlaubt"
+ER_TRG_ALREADY_EXISTS
+ eng "Trigger already exists"
+ ger "Trigger existiert bereits"
+ER_TRG_DOES_NOT_EXIST
+ eng "Trigger does not exist"
+ ger "Trigger existiert nicht"
+ER_TRG_ON_VIEW_OR_TEMP_TABLE
+ eng "Trigger's '%-.192s' is view or temporary table"
+ ger "'%-.192s' des Triggers ist View oder temporäre Tabelle"
+ER_TRG_CANT_CHANGE_ROW
+ eng "Updating of %s row is not allowed in %strigger"
+ ger "Aktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubt"
+ER_TRG_NO_SUCH_ROW_IN_TRG
+ eng "There is no %s row in %s trigger"
+ ger "Es gibt keine %s-Zeile im %s-Trigger"
+ER_NO_DEFAULT_FOR_FIELD
+ eng "Field '%-.192s' doesn't have a default value"
+ ger "Feld '%-.192s' hat keinen Vorgabewert"
+ER_DIVISION_BY_ZERO 22012
+ eng "Division by 0"
+ ger "Division durch 0"
+ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+ eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld"
+ ger "Falscher %-.32s-Wert: '%-.128s' für Feld '%.192s' in Zeile %ld"
+ER_ILLEGAL_VALUE_FOR_TYPE 22007
+ eng "Illegal %s '%-.192s' value found during parsing"
+ ger "Nicht zulässiger %s-Wert '%-.192s' beim Parsen gefunden"
+ER_VIEW_NONUPD_CHECK
+ eng "CHECK OPTION on non-updatable view '%-.192s.%-.192s'"
+ ger "CHECK OPTION auf nicht-aktualisierbarem View '%-.192s.%-.192s'"
+ rus "CHECK OPTION Ð´Ð»Ñ Ð½ÐµÐ¾Ð±Ð½Ð¾Ð²Ð»Ñемого VIEW '%-.192s.%-.192s'"
+ ukr "CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' що не може бути оновленним"
+ER_VIEW_CHECK_FAILED
+ eng "CHECK OPTION failed '%-.192s.%-.192s'"
+ ger "CHECK OPTION fehlgeschlagen: '%-.192s.%-.192s'"
+ rus "проверка CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' провалилаÑÑŒ"
+ ukr "Перевірка CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' не пройшла"
+ER_PROCACCESS_DENIED_ERROR 42000
+ eng "%-.16s command denied to user '%-.48s'@'%-.64s' for routine '%-.192s'"
+ ger "Befehl %-.16s nicht zulässig für Benutzer '%-.48s'@'%-.64s' in Routine '%-.192s'"
+ER_RELAY_LOG_FAIL
+ eng "Failed purging old relay logs: %s"
+ ger "Bereinigen alter Relais-Logs fehlgeschlagen: %s"
+ER_PASSWD_LENGTH
+ eng "Password hash should be a %d-digit hexadecimal number"
+ ger "Passwort-Hash sollte eine Hexdaezimalzahl mit %d Stellen sein"
+ER_UNKNOWN_TARGET_BINLOG
+ eng "Target log not found in binlog index"
+ ger "Ziel-Log im Binlog-Index nicht gefunden"
+ER_IO_ERR_LOG_INDEX_READ
+ eng "I/O error reading log index file"
+ ger "Fehler beim Lesen der Log-Index-Datei"
+ER_BINLOG_PURGE_PROHIBITED
+ eng "Server configuration does not permit binlog purge"
+ ger "Server-Konfiguration erlaubt keine Binlog-Bereinigung"
+ER_FSEEK_FAIL
+ eng "Failed on fseek()"
+ ger "fseek() fehlgeschlagen"
+ER_BINLOG_PURGE_FATAL_ERR
+ eng "Fatal error during log purge"
+ ger "Schwerwiegender Fehler bei der Log-Bereinigung"
+ER_LOG_IN_USE
+ eng "A purgeable log is in use, will not purge"
+ ger "Ein zu bereinigendes Log wird gerade benutzt, daher keine Bereinigung"
+ER_LOG_PURGE_UNKNOWN_ERR
+ eng "Unknown error during log purge"
+ ger "Unbekannter Fehler bei Log-Bereinigung"
+ER_RELAY_LOG_INIT
+ eng "Failed initializing relay log position: %s"
+ ger "Initialisierung der Relais-Log-Position fehlgeschlagen: %s"
+ER_NO_BINARY_LOGGING
+ eng "You are not using binary logging"
+ ger "Sie verwenden keine Binärlogs"
+ER_RESERVED_SYNTAX
+ eng "The '%-.64s' syntax is reserved for purposes internal to the MySQL server"
+ ger "Die Schreibweise '%-.64s' ist für interne Zwecke des MySQL-Servers reserviert"
+ER_WSAS_FAILED
+ eng "WSAStartup Failed"
+ ger "WSAStartup fehlgeschlagen"
+ER_DIFF_GROUPS_PROC
+ eng "Can't handle procedures with different groups yet"
+ ger "Kann Prozeduren mit unterschiedlichen Gruppen noch nicht verarbeiten"
+ER_NO_GROUP_FOR_PROC
+ eng "Select must have a group with this procedure"
+ ger "SELECT muss bei dieser Prozedur ein GROUP BY haben"
+ER_ORDER_WITH_PROC
+ eng "Can't use ORDER clause with this procedure"
+ ger "Kann bei dieser Prozedur keine ORDER-BY-Klausel verwenden"
+ER_LOGGING_PROHIBIT_CHANGING_OF
+ eng "Binary logging and replication forbid changing the global server %s"
+ ger "Binärlogs und Replikation verhindern Wechsel des globalen Servers %s"
+ER_NO_FILE_MAPPING
+ eng "Can't map file: %-.200s, errno: %d"
+ ger "Kann Datei nicht abbilden: %-.200s, Fehler: %d"
+ER_WRONG_MAGIC
+ eng "Wrong magic in %-.64s"
+ ger "Falsche magische Zahlen in %-.64s"
+ER_PS_MANY_PARAM
+ eng "Prepared statement contains too many placeholders"
+ ger "Vorbereitete Anweisung enthält zu viele Platzhalter"
+ER_KEY_PART_0
+ eng "Key part '%-.192s' length cannot be 0"
+ ger "Länge des Schlüsselteils '%-.192s' kann nicht 0 sein"
+ER_VIEW_CHECKSUM
+ eng "View text checksum failed"
+ ger "View-Text-Prüfsumme fehlgeschlagen"
+ rus "Проверка контрольной Ñуммы текÑта VIEW провалилаÑÑŒ"
+ ukr "Перевірка контрольної Ñуми текÑту VIEW не пройшла"
+ER_VIEW_MULTIUPDATE
+ eng "Can not modify more than one base table through a join view '%-.192s.%-.192s'"
+ ger "Kann nicht mehr als eine Basistabelle über Join-View '%-.192s.%-.192s' ändern"
+ rus "ÐÐµÐ»ÑŒÐ·Ñ Ð¸Ð·Ð¼ÐµÐ½Ð¸Ñ‚ÑŒ больше чем одну базовую таблицу иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð¼Ð½Ð¾Ð³Ð¾Ñ‚Ð°Ð±Ð»Ð¸Ñ‡Ð½Ñ‹Ð¹ VIEW '%-.192s.%-.192s'"
+ ukr "Ðеможливо оновити більш ниж одну базову таблицю выкориÑтовуючи VIEW '%-.192s.%-.192s', що міÑÑ‚Ñ–Ñ‚ÑŒ декілька таблиць"
+ER_VIEW_NO_INSERT_FIELD_LIST
+ eng "Can not insert into join view '%-.192s.%-.192s' without fields list"
+ ger "Kann nicht ohne Feldliste in Join-View '%-.192s.%-.192s' einfügen"
+ rus "ÐÐµÐ»ÑŒÐ·Ñ Ð²ÑтавлÑÑ‚ÑŒ запиÑи в многотабличный VIEW '%-.192s.%-.192s' без ÑпиÑка полей"
+ ukr "Ðеможливо уÑтавити Ñ€Ñдки у VIEW '%-.192s.%-.192s', що міÑтить декілька таблиць, без ÑпиÑку Ñтовбців"
+ER_VIEW_DELETE_MERGE_VIEW
+ eng "Can not delete from join view '%-.192s.%-.192s'"
+ ger "Kann nicht aus Join-View '%-.192s.%-.192s' löschen"
+ rus "ÐÐµÐ»ÑŒÐ·Ñ ÑƒÐ´Ð°Ð»ÑÑ‚ÑŒ из многотабличного VIEW '%-.192s.%-.192s'"
+ ukr "Ðеможливо видалити Ñ€Ñдки у VIEW '%-.192s.%-.192s', що міÑтить декілька таблиць"
+ER_CANNOT_USER
+ eng "Operation %s failed for %.256s"
+ ger "Operation %s schlug fehl für %.256s"
+ norwegian-ny "Operation %s failed for '%.256s'"
+ER_XAER_NOTA XAE04
+ eng "XAER_NOTA: Unknown XID"
+ ger "XAER_NOTA: Unbekannte XID"
+ER_XAER_INVAL XAE05
+ eng "XAER_INVAL: Invalid arguments (or unsupported command)"
+ ger "XAER_INVAL: Ungültige Argumente (oder nicht unterstützter Befehl)"
+ER_XAER_RMFAIL XAE07
+ eng "XAER_RMFAIL: The command cannot be executed when global transaction is in the %.64s state"
+ ger "XAER_RMFAIL: DEr Befehl kann nicht ausgeführt werden, wenn die globale Transaktion im Zustand %.64s ist"
+ rus "XAER_RMFAIL: Ñту команду Ð½ÐµÐ»ÑŒÐ·Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÑÑ‚ÑŒ когда Ð³Ð»Ð¾Ð±Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ð¸Ñ Ð½Ð°Ñ…Ð¾Ð´Ð¸Ñ‚ÑÑ Ð² ÑоÑтоÑнии '%.64s'"
+ER_XAER_OUTSIDE XAE09
+ eng "XAER_OUTSIDE: Some work is done outside global transaction"
+ ger "XAER_OUTSIDE: Einige Arbeiten werden außerhalb der globalen Transaktion verrichtet"
+ER_XAER_RMERR XAE03
+ eng "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency"
+ ger "XAER_RMERR: Schwerwiegender Fehler im Transaktionszweig - prüfen Sie Ihre Daten auf Konsistenz"
+ER_XA_RBROLLBACK XA100
+ eng "XA_RBROLLBACK: Transaction branch was rolled back"
+ ger "XA_RBROLLBACK: Transaktionszweig wurde zurückgerollt"
+ER_NONEXISTING_PROC_GRANT 42000
+ eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'"
+ ger "Es gibt diese Berechtigung für Benutzer '%-.48s' auf Host '%-.64s' für Routine '%-.192s' nicht"
+ER_PROC_AUTO_GRANT_FAIL
+ eng "Failed to grant EXECUTE and ALTER ROUTINE privileges"
+ ger "Gewährung von EXECUTE- und ALTER-ROUTINE-Rechten fehlgeschlagen"
+ER_PROC_AUTO_REVOKE_FAIL
+ eng "Failed to revoke all privileges to dropped routine"
+ ger "Rücknahme aller Rechte für die gelöschte Routine fehlgeschlagen"
+ER_DATA_TOO_LONG 22001
+ eng "Data too long for column '%s' at row %ld"
+ ger "Daten zu lang für Feld '%s' in Zeile %ld"
+ER_SP_BAD_SQLSTATE 42000
+ eng "Bad SQLSTATE: '%s'"
+ ger "Ungültiger SQLSTATE: '%s'"
+ER_STARTUP
+ eng "%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d %s"
+ ger "%s: bereit für Verbindungen.\nVersion: '%s' Socket: '%s' Port: %d %s"
+ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR
+ eng "Can't load value from file with fixed size rows to variable"
+ ger "Kann Wert aus Datei mit Zeilen fester Größe nicht in Variable laden"
+ER_CANT_CREATE_USER_WITH_GRANT 42000
+ eng "You are not allowed to create a user with GRANT"
+ ger "Sie dürfen keinen Benutzer mit GRANT anlegen"
+ER_WRONG_VALUE_FOR_TYPE
+ eng "Incorrect %-.32s value: '%-.128s' for function %-.32s"
+ ger "Falscher %-.32s-Wert: '%-.128s' für Funktion %-.32s"
+ER_TABLE_DEF_CHANGED
+ eng "Table definition has changed, please retry transaction"
+ ger "Tabellendefinition wurde geändert, bitte starten Sie die Transaktion neu"
+ER_SP_DUP_HANDLER 42000
+ eng "Duplicate handler declared in the same block"
+ ger "Doppelter Handler im selben Block deklariert"
+ER_SP_NOT_VAR_ARG 42000
+ eng "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger"
+ ger "OUT- oder INOUT-Argument %d für Routine %s ist keine Variable"
+ER_SP_NO_RETSET 0A000
+ eng "Not allowed to return a result set from a %s"
+ ger "Rückgabe einer Ergebnismenge aus einer %s ist nicht erlaubt"
+ER_CANT_CREATE_GEOMETRY_OBJECT 22003
+ eng "Cannot get geometry object from data you send to the GEOMETRY field"
+ ger "Kann kein Geometrieobjekt aus den Daten machen, die Sie dem GEOMETRY-Feld übergeben haben"
+ER_FAILED_ROUTINE_BREAK_BINLOG
+ eng "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes"
+ ger "Eine Routine, die weder NO SQL noch READS SQL DATA in der Deklaration hat, schlug fehl und Binärlogging ist aktiv. Wenn Nicht-Transaktions-Tabellen aktualisiert wurden, enthält das Binärlog ihre Änderungen nicht"
+ER_BINLOG_UNSAFE_ROUTINE
+ eng "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)"
+ ger "Diese Routine hat weder DETERMINISTIC, NO SQL noch READS SQL DATA in der Deklaration und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_routine_creators verwenden)"
+ER_BINLOG_CREATE_ROUTINE_NEED_SUPER
+ eng "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)"
+ ger "Sie haben keine SUPER-Berechtigung und Binärlogging ist aktiv (*vielleicht* sollten Sie die weniger sichere Variable log_bin_trust_routine_creators verwenden)"
+ER_EXEC_STMT_WITH_OPEN_CURSOR
+ eng "You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it."
+ ger "Sie können keine vorbereitete Anweisung ausführen, die mit einem geöffneten Cursor verknüpft ist. Setzen Sie die Anweisung zurück, um sie neu auszuführen"
+ER_STMT_HAS_NO_OPEN_CURSOR
+ eng "The statement (%lu) has no open cursor."
+ ger "Die Anweisung (%lu) hat keinen geöffneten Cursor"
+ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+ eng "Explicit or implicit commit is not allowed in stored function or trigger."
+ ger "Explizites oder implizites Commit ist in gespeicherten Funktionen und in Triggern nicht erlaubt"
+ER_NO_DEFAULT_FOR_VIEW_FIELD
+ eng "Field of view '%-.192s.%-.192s' underlying table doesn't have a default value"
+ ger "Ein Feld der dem View '%-.192s.%-.192s' zugrundeliegenden Tabelle hat keinen Vorgabewert"
+ER_SP_NO_RECURSION
+ eng "Recursive stored functions and triggers are not allowed."
+ ger "Rekursive gespeicherte Routinen und Triggers sind nicht erlaubt"
+ER_TOO_BIG_SCALE 42000 S1009
+ eng "Too big scale %d specified for column '%-.192s'. Maximum is %lu."
+ ger "Zu großer Skalierungsfaktor %d für Feld '%-.192s' angegeben. Maximum ist %lu"
+ER_TOO_BIG_PRECISION 42000 S1009
+ eng "Too big precision %d specified for column '%-.192s'. Maximum is %lu."
+ ger "Zu große Genauigkeit %d für Feld '%-.192s' angegeben. Maximum ist %lu"
+ER_M_BIGGER_THAN_D 42000 S1009
+ eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')."
+ ger "Für FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.192s')"
+ER_WRONG_LOCK_OF_SYSTEM_TABLE
+ eng "You can't combine write-locking of system tables with other tables or lock types"
+ ger "Sie können Schreibsperren auf der Systemtabelle nicht mit anderen Tabellen kombinieren"
+ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+ eng "Unable to connect to foreign data source: %.64s"
+ ger "Kann nicht mit Fremddatenquelle verbinden: %.64s"
+ER_QUERY_ON_FOREIGN_DATA_SOURCE
+ eng "There was a problem processing the query on the foreign data source. Data source error: %-.64s"
+ ger "Bei der Verarbeitung der Abfrage ist in der Fremddatenquelle ein Problem aufgetreten. Datenquellenfehlermeldung: %-.64s"
+ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
+ eng "The foreign data source you are trying to reference does not exist. Data source error: %-.64s"
+ ger "Die Fremddatenquelle, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
+ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
+ eng "Can't create federated table. The data source connection string '%-.64s' is not in the correct format"
+ ger "Kann föderierte Tabelle nicht erzeugen. Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
+ER_FOREIGN_DATA_STRING_INVALID
+ eng "The data source connection string '%-.64s' is not in the correct format"
+ ger "Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
+ER_CANT_CREATE_FEDERATED_TABLE
+ eng "Can't create federated table. Foreign data src error: %-.64s"
+ ger "Kann föderierte Tabelle nicht erzeugen. Fremddatenquellenfehlermeldung: %-.64s"
+ER_TRG_IN_WRONG_SCHEMA
+ eng "Trigger in wrong schema"
+ ger "Trigger im falschen Schema"
+ER_STACK_OVERRUN_NEED_MORE
+ eng "Thread stack overrun: %ld bytes used of a %ld byte stack, and %ld bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack."
+ ger "Thread-Stack-Überlauf: %ld Bytes eines %ld-Byte-Stacks in Verwendung, und %ld Bytes benötigt. Verwenden Sie 'mysqld -O thread_stack=#', um einen größeren Stack anzugeben"
+ER_TOO_LONG_BODY 42000 S1009
+ eng "Routine body for '%-.100s' is too long"
+ ger "Routinen-Body für '%-.100s' ist zu lang"
+ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
+ eng "Cannot drop default keycache"
+ ger "Der vorgabemäßige Schlüssel-Cache kann nicht gelöscht werden"
+ER_TOO_BIG_DISPLAYWIDTH 42000 S1009
+ eng "Display width out of range for column '%-.192s' (max = %lu)"
+ ger "Anzeigebreite außerhalb des zulässigen Bereichs für Spalte '%-.192s' (Maximum: %lu)"
+ER_XAER_DUPID XAE08
+ eng "XAER_DUPID: The XID already exists"
+ ger "XAER_DUPID: Die XID existiert bereits"
+ER_DATETIME_FUNCTION_OVERFLOW 22008
+ eng "Datetime function: %-.32s field overflow"
+ ger "Datetime-Funktion: %-.32s Feldüberlauf"
+ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+ eng "Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger."
+ ger "Kann Tabelle '%-.192s' in gespeicherter Funktion oder Trigger nicht aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte Funktion oder den Trigger aufrief"
+ER_VIEW_PREVENT_UPDATE
+ eng "The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'."
+ ger "Die Definition der Tabelle '%-.192s' verhindert die Operation %.192s auf Tabelle '%-.192s'"
+ER_PS_NO_RECURSION
+ eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner"
+ ger "Die vorbereitete Anweisung enthält einen Aufruf einer gespeicherten Routine, die auf eben dieselbe Anweisung verweist. Es ist nicht erlaubt, eine vorbereitete Anweisung in solch rekursiver Weise auszuführen"
+ER_SP_CANT_SET_AUTOCOMMIT
+ eng "Not allowed to set autocommit from a stored function or trigger"
+ ger "Es ist nicht erlaubt, innerhalb einer gespeicherten Funktion oder eines Triggers AUTOCOMMIT zu setzen"
+ER_MALFORMED_DEFINER
+ eng "Definer is not fully qualified"
+ ger "Definierer des View ist nicht vollständig spezifiziert"
+ER_VIEW_FRM_NO_USER
+ eng "View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!"
+ ger "View '%-.192s'.'%-.192s' hat keine Definierer-Information (altes Tabellenformat). Der aktuelle Benutzer wird als Definierer verwendet. Bitte erstellen Sie den View neu"
+ER_VIEW_OTHER_USER
+ eng "You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer"
+ ger "Sie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.192s'@'%-.192s' zu erzeugen"
+ER_NO_SUCH_USER
+ eng "The user specified as a definer ('%-.64s'@'%-.64s') does not exist"
+ER_FORBID_SCHEMA_CHANGE
+ eng "Changing schema from '%-.192s' to '%-.192s' is not allowed."
+ ger "Wechsel des Schemas von '%-.192s' auf '%-.192s' ist nicht erlaubt"
+ER_ROW_IS_REFERENCED_2 23000
+ eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)"
+ ger "Kann Eltern-Zeile nicht löschen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%.192s)"
+ER_NO_REFERENCED_ROW_2 23000
+ eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
+ ger "Kann Kind-Zeile nicht hinzufügen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%.192s)"
+ER_SP_BAD_VAR_SHADOW 42000
+ eng "Variable '%-.64s' must be quoted with `...`, or renamed"
+ ger "Variable '%-.64s' muss mit `...` geschützt oder aber umbenannt werden"
+ER_TRG_NO_DEFINER
+ eng "No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger."
+ ger "Kein Definierer-Attribut für Trigger '%-.192s'.'%-.192s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an."
+ER_OLD_FILE_FORMAT
+ eng "'%-.192s' has an old format, you should re-create the '%s' object(s)"
+ ger "'%-.192s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugen"
+ER_SP_RECURSION_LIMIT
+ eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s"
+ ger "Rekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.192s überschritten"
+ER_SP_PROC_TABLE_CORRUPT
+ eng "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)"
+ ger "Routine %-.192s konnte nicht geladen werden. Die Tabelle mysql.proc fehlt, ist beschädigt, oder enthält fehlerhaften Daten (interner Code: %d)"
+ER_SP_WRONG_NAME 42000
+ eng "Incorrect routine name '%-.192s'"
+ ger "Ungültiger Routinenname '%-.192s'"
+ER_TABLE_NEEDS_UPGRADE
+ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" or dump/reload to fix it!"
+ ger "Tabellenaktualisierung erforderlich. Bitte zum Reparieren \"REPAIR TABLE `%-.32s`\" eingeben!"
+ER_SP_NO_AGGREGATE 42000
+ eng "AGGREGATE is not supported for stored functions"
+ ger "AGGREGATE wird bei gespeicherten Funktionen nicht unterstützt"
+ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
+ eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
+ ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %lu)"
+ER_VIEW_RECURSIVE
+ eng "`%-.192s`.`%-.192s` contains view recursion"
+ ger "`%-.192s`.`%-.192s` enthält View-Rekursion"
+ER_NON_GROUPING_FIELD_USED 42000
+ eng "non-grouping field '%-.192s' is used in %-.64s clause"
+ ger "In der %-.192s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendet"
+ER_TABLE_CANT_HANDLE_SPKEYS
+ eng "The used table type doesn't support SPATIAL indexes"
+ ger "Der verwendete Tabellentyp unterstützt keine SPATIAL-Indizes"
+ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
+ eng "Triggers can not be created on system tables"
+ ger "Trigger können nicht auf Systemtabellen erzeugt werden"
+ER_REMOVED_SPACES
+ eng "Leading spaces are removed from name '%s'"
+ ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt"
+ER_AUTOINC_READ_FAILED
+ eng "Failed to read auto-increment value from storage engine"
+ ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen"
+ER_USERNAME
+ eng "user name"
+ ger "Benutzername"
+ER_HOSTNAME
+ eng "host name"
+ ger "Hostname"
+ER_WRONG_STRING_LENGTH
+ eng "String '%-.70s' is too long for %s (should be no longer than %d)"
+ ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)"
+ER_NON_INSERTABLE_TABLE
+ eng "The target table %-.100s of the %s is not insertable-into"
+ ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
+ER_ADMIN_WRONG_MRG_TABLE
+ eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
+ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
+ eng "Too high level of nesting for select"
+ER_NAME_BECOMES_EMPTY
+ eng "Name '%-.64s' has become ''"
+ER_AMBIGUOUS_FIELD_TERM
+ eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
+ER_FOREIGN_SERVER_EXISTS
+ eng "The foreign server, %s, you are trying to create already exists."
+ER_FOREIGN_SERVER_DOESNT_EXIST
+ eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s"
+ ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
+ER_ILLEGAL_HA_CREATE_OPTION
+ eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
+ ger "Speicher-Engine '%-.64s' der Tabelle unterstützt die Option '%.64s' nicht"
+ER_PARTITION_REQUIRES_VALUES_ERROR
+ eng "Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition"
+ ger "Fehler in der SQL-Syntax: %-.64s-PARTITIONierung erfordert Definition von VALUES %-.64s für jede Partition"
+ swe "Syntaxfel: %-.64s PARTITIONering kräver definition av VALUES %-.64s för varje partition"
+ER_PARTITION_WRONG_VALUES_ERROR
+ eng "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition"
+ ger "Nur %-.64s-PARTITIONierung kann VALUES %-.64s in der Partitionsdefinition verwenden"
+ swe "Endast %-.64s partitionering kan använda VALUES %-.64s i definition av partitionen"
+ER_PARTITION_MAXVALUE_ERROR
+ eng "MAXVALUE can only be used in last partition definition"
+ ger "MAXVALUE kann nur für die Definition der letzten Partition verwendet werden"
+ swe "MAXVALUE kan bara användas i definitionen av den sista partitionen"
+ER_PARTITION_SUBPARTITION_ERROR
+ eng "Subpartitions can only be hash partitions and by key"
+ ger "Unterpartitionen dürfen nur HASH- oder KEY-Partitionen sein"
+ swe "Subpartitioner kan bara vara hash och key partitioner"
+ER_PARTITION_SUBPART_MIX_ERROR
+ eng "Must define subpartitions on all partitions if on one partition"
+ ger "Unterpartitionen können nur Hash- oder Key-Partitionen sein"
+ swe "Subpartitioner måste definieras på alla partitioner om på en"
+ER_PARTITION_WRONG_NO_PART_ERROR
+ eng "Wrong number of partitions defined, mismatch with previous setting"
+ ger "Falsche Anzahl von Partitionen definiert, stimmt nicht mit vorherigen Einstellungen überein"
+ swe "Antal partitioner definierade och antal partitioner är inte lika"
+ER_PARTITION_WRONG_NO_SUBPART_ERROR
+ eng "Wrong number of subpartitions defined, mismatch with previous setting"
+ ger "Falsche Anzahl von Unterpartitionen definiert, stimmt nicht mit vorherigen Einstellungen überein"
+ swe "Antal subpartitioner definierade och antal subpartitioner är inte lika"
+ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR
+ eng "Constant/Random expression in (sub)partitioning function is not allowed"
+ ger "Konstante oder Random-Ausdrücke in (Unter-)Partitionsfunktionen sind nicht erlaubt"
+ swe "Konstanta uttryck eller slumpmässiga uttryck är inte tillåtna (sub)partitioneringsfunktioner"
+ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR
+ eng "Expression in RANGE/LIST VALUES must be constant"
+ ger "Ausdrücke in RANGE/LIST VALUES müssen konstant sein"
+ swe "Uttryck i RANGE/LIST VALUES måste vara ett konstant uttryck"
+ER_FIELD_NOT_FOUND_PART_ERROR
+ eng "Field in list of fields for partition function not found in table"
+ ger "Felder in der Feldliste der Partitionierungsfunktion wurden in der Tabelle nicht gefunden"
+ swe "Fält i listan av fält för partitionering med key inte funnen i tabellen"
+ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR
+ eng "List of fields is only allowed in KEY partitions"
+ ger "Eine Feldliste ist nur in KEY-Partitionen erlaubt"
+ swe "En lista av fält är endast tillåtet för KEY partitioner"
+ER_INCONSISTENT_PARTITION_INFO_ERROR
+ eng "The partition info in the frm file is not consistent with what can be written into the frm file"
+ ger "Die Partitionierungsinformationen in der frm-Datei stimmen nicht mit dem überein, was in die frm-Datei geschrieben werden kann"
+ swe "Partitioneringsinformationen i frm-filen är inte konsistent med vad som kan skrivas i frm-filen"
+ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+ eng "The %-.192s function returns the wrong type"
+ ger "Die %-.192s-Funktion gibt einen falschen Typ zurück"
+ swe "%-.192s-funktionen returnerar felaktig typ"
+ER_PARTITIONS_MUST_BE_DEFINED_ERROR
+ eng "For %-.64s partitions each partition must be defined"
+ ger "Für %-.64s-Partitionen muss jede Partition definiert sein"
+ swe "För %-.64s partitionering så måste varje partition definieras"
+ER_RANGE_NOT_INCREASING_ERROR
+ eng "VALUES LESS THAN value must be strictly increasing for each partition"
+ ger "Werte in VALUES LESS THAN müssen für jede Partition strikt aufsteigend sein"
+ swe "Värden i VALUES LESS THAN måste vara strikt växande för varje partition"
+ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+ eng "VALUES value must be of same type as partition function"
+ ger "VALUES-Werte müssen vom selben Typ wie die Partitionierungsfunktion sein"
+ swe "Värden i VALUES måste vara av samma typ som partitioneringsfunktionen"
+ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
+ eng "Multiple definition of same constant in list partitioning"
+ ger "Mehrfachdefinition derselben Konstante bei Listen-Partitionierung"
+ swe "Multipel definition av samma konstant i list partitionering"
+ER_PARTITION_ENTRY_ERROR
+ eng "Partitioning can not be used stand-alone in query"
+ ger "Partitionierung kann in einer Abfrage nicht alleinstehend benutzt werden"
+ swe "Partitioneringssyntax kan inte användas på egen hand i en SQL-fråga"
+ER_MIX_HANDLER_ERROR
+ eng "The mix of handlers in the partitions is not allowed in this version of MySQL"
+ ger "Das Vermischen von Handlern in Partitionen ist in dieser Version von MySQL nicht erlaubt"
+ swe "Denna mix av lagringsmotorer är inte tillåten i denna version av MySQL"
+ER_PARTITION_NOT_DEFINED_ERROR
+ eng "For the partitioned engine it is necessary to define all %-.64s"
+ ger "Für die partitionierte Engine müssen alle %-.64s definiert sein"
+ swe "För partitioneringsmotorn så är det nödvändigt att definiera alla %-.64s"
+ER_TOO_MANY_PARTITIONS_ERROR
+ eng "Too many partitions (including subpartitions) were defined"
+ ger "Es wurden zu vielen Partitionen (einschließlich Unterpartitionen) definiert"
+ swe "För många partitioner (inkluderande subpartitioner) definierades"
+ER_SUBPARTITION_ERROR
+ eng "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning"
+ ger "RANGE/LIST-Partitionierung kann bei Unterpartitionen nur zusammen mit HASH/KEY-Partitionierung verwendet werden"
+ swe "Det är endast möjligt att blanda RANGE/LIST partitionering med HASH/KEY partitionering för subpartitionering"
+ER_CANT_CREATE_HANDLER_FILE
+ eng "Failed to create specific handler file"
+ ger "Erzeugen einer spezifischen Handler-Datei fehlgeschlagen"
+ swe "Misslyckades med att skapa specifik fil i lagringsmotor"
+ER_BLOB_FIELD_IN_PART_FUNC_ERROR
+ eng "A BLOB field is not allowed in partition function"
+ ger "In der Partitionierungsfunktion sind BLOB-Spalten nicht erlaubt"
+ swe "Ett BLOB-fält är inte tillåtet i partitioneringsfunktioner"
+ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
+ eng "A %-.192s must include all columns in the table's partitioning function"
+ER_NO_PARTS_ERROR
+ eng "Number of %-.64s = 0 is not an allowed value"
+ ger "Eine Anzahl von %-.64s = 0 ist kein erlaubter Wert"
+ swe "Antal %-.64s = 0 är inte ett tillåten värde"
+ER_PARTITION_MGMT_ON_NONPARTITIONED
+ eng "Partition management on a not partitioned table is not possible"
+ ger "Partitionsverwaltung einer nicht partitionierten Tabelle ist nicht möglich"
+ swe "Partitioneringskommando på en opartitionerad tabell är inte möjligt"
+ER_FOREIGN_KEY_ON_PARTITIONED
+ eng "Foreign key clause is not yet supported in conjunction with partitioning"
+ ger "Fremdschlüssel-Beschränkungen sind im Zusammenhang mit Partitionierung nicht zulässig"
+ swe "Foreign key klausul är inte ännu implementerad i kombination med partitionering"
+ER_DROP_PARTITION_NON_EXISTENT
+ eng "Error in list of partitions to %-.64s"
+ ger "Fehler in der Partitionsliste bei %-.64s"
+ swe "Fel i listan av partitioner att %-.64s"
+ER_DROP_LAST_PARTITION
+ eng "Cannot remove all partitions, use DROP TABLE instead"
+ ger "Es lassen sich nicht sämtliche Partitionen löschen, benutzen Sie statt dessen DROP TABLE"
+ swe "Det är inte tillåtet att ta bort alla partitioner, använd DROP TABLE istället"
+ER_COALESCE_ONLY_ON_HASH_PARTITION
+ eng "COALESCE PARTITION can only be used on HASH/KEY partitions"
+ ger "COALESCE PARTITION kann nur auf HASH- oder KEY-Partitionen benutzt werden"
+ swe "COALESCE PARTITION kan bara användas på HASH/KEY partitioner"
+ER_REORG_HASH_ONLY_ON_SAME_NO
+ eng "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers"
+ ger "REORGANIZE PARTITION kann nur zur Reorganisation von Partitionen verwendet werden, nicht, um ihre Nummern zu ändern"
+ swe "REORGANIZE PARTITION kan bara användas för att omorganisera partitioner, inte för att ändra deras antal"
+ER_REORG_NO_PARAM_ERROR
+ eng "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs"
+ ger "REORGANIZE PARTITION ohne Parameter kann nur für auto-partitionierte Tabellen verwendet werden, die HASH-Partitionierung benutzen"
+ swe "REORGANIZE PARTITION utan parametrar kan bara användas på auto-partitionerade tabeller som använder HASH partitionering"
+ER_ONLY_ON_RANGE_LIST_PARTITION
+ eng "%-.64s PARTITION can only be used on RANGE/LIST partitions"
+ ger "%-.64s PARTITION kann nur für RANGE- oder LIST-Partitionen verwendet werden"
+ swe "%-.64s PARTITION kan bara användas på RANGE/LIST-partitioner"
+ER_ADD_PARTITION_SUBPART_ERROR
+ eng "Trying to Add partition(s) with wrong number of subpartitions"
+ ger "Es wurde versucht, eine oder mehrere Partitionen mit der falschen Anzahl von Unterpartitionen hinzuzufügen"
+ swe "ADD PARTITION med fel antal subpartitioner"
+ER_ADD_PARTITION_NO_NEW_PARTITION
+ eng "At least one partition must be added"
+ ger "Es muss zumindest eine Partition hinzugefügt werden"
+ swe "Åtminstone en partition måste läggas till vid ADD PARTITION"
+ER_COALESCE_PARTITION_NO_PARTITION
+ eng "At least one partition must be coalesced"
+ ger "Zumindest eine Partition muss mit COALESCE PARTITION zusammengefügt werden"
+ swe "Åtminstone en partition måste slås ihop vid COALESCE PARTITION"
+ER_REORG_PARTITION_NOT_EXIST
+ eng "More partitions to reorganize than there are partitions"
+ ger "Es wurde versucht, mehr Partitionen als vorhanden zu reorganisieren"
+ swe "Fler partitioner att reorganisera än det finns partitioner"
+ER_SAME_NAME_PARTITION
+ eng "Duplicate partition name %-.192s"
+ ger "Doppelter Partitionsname: %-.192s"
+ swe "Duplicerat partitionsnamn %-.192s"
+ER_NO_BINLOG_ERROR
+ eng "It is not allowed to shut off binlog on this command"
+ ger "Es es nicht erlaubt, bei diesem Befehl binlog abzuschalten"
+ swe "Det är inte tillåtet att stänga av binlog på detta kommando"
+ER_CONSECUTIVE_REORG_PARTITIONS
+ eng "When reorganizing a set of partitions they must be in consecutive order"
+ ger "Bei der Reorganisation eines Satzes von Partitionen müssen diese in geordneter Reihenfolge vorliegen"
+ swe "När ett antal partitioner omorganiseras måste de vara i konsekutiv ordning"
+ER_REORG_OUTSIDE_RANGE
+ eng "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range"
+ ger "Die Reorganisation von RANGE-Partitionen kann Gesamtbereiche nicht verändern, mit Ausnahme der letzten Partition, die den Bereich erweitern kann"
+ swe "Reorganisering av rangepartitioner kan inte ändra den totala intervallet utom för den sista partitionen där intervallet kan utökas"
+ER_PARTITION_FUNCTION_FAILURE
+ eng "Partition function not supported in this version for this handler"
+ ger "Partitionsfunktion in dieser Version dieses Handlers nicht unterstützt"
+ER_PART_STATE_ERROR
+ eng "Partition state cannot be defined from CREATE/ALTER TABLE"
+ ger "Partitionszustand kann nicht von CREATE oder ALTER TABLE aus definiert werden"
+ swe "Partition state kan inte definieras från CREATE/ALTER TABLE"
+ER_LIMITED_PART_RANGE
+ eng "The %-.64s handler only supports 32 bit integers in VALUES"
+ ger "Der Handler %-.64s unterstützt in VALUES nur 32-Bit-Integers"
+ swe "%-.64s stödjer endast 32 bitar i integers i VALUES"
+ER_PLUGIN_IS_NOT_LOADED
+ eng "Plugin '%-.192s' is not loaded"
+ ger "Plugin '%-.192s' ist nicht geladen"
+ER_WRONG_VALUE
+ eng "Incorrect %-.32s value: '%-.128s'"
+ ger "Falscher %-.32s-Wert: '%-.128s'"
+ER_NO_PARTITION_FOR_GIVEN_VALUE
+ eng "Table has no partition for value %-.64s"
+ ger "Tabelle hat für den Wert %-.64s keine Partition"
+ER_FILEGROUP_OPTION_ONLY_ONCE
+ eng "It is not allowed to specify %s more than once"
+ ger "%s darf nicht mehr als einmal angegegeben werden"
+ER_CREATE_FILEGROUP_FAILED
+ eng "Failed to create %s"
+ ger "Anlegen von %s fehlgeschlagen"
+ER_DROP_FILEGROUP_FAILED
+ eng "Failed to drop %s"
+ ger "Löschen (drop) von %s fehlgeschlagen"
+ER_TABLESPACE_AUTO_EXTEND_ERROR
+ eng "The handler doesn't support autoextend of tablespaces"
+ ger "Der Handler unterstützt keine automatische Erweiterung (Autoextend) von Tablespaces"
+ER_WRONG_SIZE_NUMBER
+ eng "A size parameter was incorrectly specified, either number or on the form 10M"
+ ger "Ein Größen-Parameter wurde unkorrekt angegeben, muss entweder Zahl sein oder im Format 10M"
+ER_SIZE_OVERFLOW_ERROR
+ eng "The size number was correct but we don't allow the digit part to be more than 2 billion"
+ ger "Die Zahl für die Größe war korrekt, aber der Zahlanteil darf nicht größer als 2 Milliarden sein"
+ER_ALTER_FILEGROUP_FAILED
+ eng "Failed to alter: %s"
+ ger "Änderung von %s fehlgeschlagen"
+ER_BINLOG_ROW_LOGGING_FAILED
+ eng "Writing one row to the row-based binary log failed"
+ ger "Schreiben einer Zeilen ins zeilenbasierte Binärlog fehlgeschlagen"
+ER_BINLOG_ROW_WRONG_TABLE_DEF
+ eng "Table definition on master and slave does not match: %s"
+ ger "Tabellendefinition auf Master und Slave stimmt nicht überein: %s"
+ER_BINLOG_ROW_RBR_TO_SBR
+ eng "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events"
+ ger "Slave, die mit --log-slave-updates laufen, müssen zeilenbasiertes Loggen verwenden, um zeilenbasierte Binärlog-Ereignisse loggen zu können"
+ER_EVENT_ALREADY_EXISTS
+ eng "Event '%-.192s' already exists"
+ ger "Event '%-.192s' existiert bereits"
+ER_EVENT_STORE_FAILED
+ eng "Failed to store event %s. Error code %d from storage engine."
+ ger "Speichern von Event %s fehlgeschlagen. Fehlercode der Speicher-Engine: %d"
+ER_EVENT_DOES_NOT_EXIST
+ eng "Unknown event '%-.192s'"
+ ger "Unbekanntes Event '%-.192s'"
+ER_EVENT_CANT_ALTER
+ eng "Failed to alter event '%-.192s'"
+ ger "Ändern des Events '%-.192s' fehlgeschlagen"
+ER_EVENT_DROP_FAILED
+ eng "Failed to drop %s"
+ ger "Löschen von %s fehlgeschlagen"
+ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+ eng "INTERVAL is either not positive or too big"
+ ger "INTERVAL ist entweder nicht positiv oder zu groß"
+ER_EVENT_ENDS_BEFORE_STARTS
+ eng "ENDS is either invalid or before STARTS"
+ ger "ENDS ist entweder ungültig oder liegt vor STARTS"
+ER_EVENT_EXEC_TIME_IN_THE_PAST
+ eng "Event execution time is in the past. Event has been disabled"
+ER_EVENT_OPEN_TABLE_FAILED
+ eng "Failed to open mysql.event"
+ ger "Öffnen von mysql.event fehlgeschlagen"
+ER_EVENT_NEITHER_M_EXPR_NOR_M_AT
+ eng "No datetime expression provided"
+ ger "Kein DATETIME-Ausdruck angegeben"
+ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
+ eng "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted"
+ ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d gefunden. Tabelle ist wahrscheinlich beschädigt"
+ER_CANNOT_LOAD_FROM_TABLE
+ eng "Cannot load from mysql.%s. The table is probably corrupted"
+ ger "Kann mysql.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigt"
+ER_EVENT_CANNOT_DELETE
+ eng "Failed to delete the event from mysql.event"
+ ger "Löschen des Events aus mysql.event fehlgeschlagen"
+ER_EVENT_COMPILE_ERROR
+ eng "Error during compilation of event's body"
+ ger "Fehler beim Kompilieren des Event-Bodys"
+ER_EVENT_SAME_NAME
+ eng "Same old and new event name"
+ ger "Alter und neuer Event-Name sind gleich"
+ER_EVENT_DATA_TOO_LONG
+ eng "Data for column '%s' too long"
+ ger "Daten der Spalte '%s' zu lang"
+ER_DROP_INDEX_FK
+ eng "Cannot drop index '%-.192s': needed in a foreign key constraint"
+ ger "Kann Index '%-.192s' nicht löschen: wird für einen Fremdschlüssel benötigt"
+# When using this error message, use the ER_WARN_DEPRECATED_SYNTAX error
+# code. See, for example, code in mysql_priv.h.
+ER_WARN_DEPRECATED_SYNTAX_WITH_VER
+ eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead"
+ ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt. Bitte benutzen Sie statt dessen %s"
+ER_CANT_WRITE_LOCK_LOG_TABLE
+ eng "You can't write-lock a log table. Only read access is possible"
+ ger "Eine Log-Tabelle kann nicht schreibgesperrt werden. Es ist ohnehin nur Lesezugriff möglich"
+ER_CANT_LOCK_LOG_TABLE
+ eng "You can't use locks with log tables."
+ ger "Log-Tabellen können nicht mit normalen Lesesperren gesperrt werden. Verwenden Sie statt dessen READ LOCAL"
+ER_FOREIGN_DUPLICATE_KEY 23000 S1009
+ eng "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry"
+ ger "Aufrechterhalten der Fremdschlüssel-Constraints für Tabelle '%.192s', Eintrag '%-.192s', Schlüssel %d würde zu einem doppelten Eintrag führen"
+ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
+ eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
+ ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben"
+ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+ eng "Cannot switch out of the row-based binary log format when the session has open temporary tables"
+ ger "Kann nicht aus dem zeilenbasierten Binärlog-Format herauswechseln, wenn die Sitzung offene temporäre Tabellen hat"
+ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
+ eng "Cannot change the binary logging format inside a stored function or trigger"
+ ger "Das Binärlog-Format kann innerhalb einer gespeicherten Funktion oder eines Triggers nicht geändert werden"
+ER_NDB_CANT_SWITCH_BINLOG_FORMAT
+ eng "The NDB cluster engine does not support changing the binlog format on the fly yet"
+ ger "Die Speicher-Engine NDB Cluster unterstützt das Ändern des Binärlog-Formats zur Laufzeit noch nicht"
+ER_PARTITION_NO_TEMPORARY
+ eng "Cannot create temporary table with partitions"
+ ger "Anlegen temporärer Tabellen mit Partitionen nicht möglich"
+ER_PARTITION_CONST_DOMAIN_ERROR
+ eng "Partition constant is out of partition function domain"
+ ger "Partitionskonstante liegt außerhalb der Partitionsfunktionsdomäne"
+ swe "Partitionskonstanten är utanför partitioneringsfunktionens domän"
+ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+ eng "This partition function is not allowed"
+ ger "Diese Partitionierungsfunktion ist nicht erlaubt"
+ swe "Denna partitioneringsfunktion är inte tillåten"
+ER_DDL_LOG_ERROR
+ eng "Error in DDL log"
+ ger "Fehler im DDL-Log"
+ER_NULL_IN_VALUES_LESS_THAN
+ eng "Not allowed to use NULL value in VALUES LESS THAN"
+ ger "In VALUES LESS THAN dürfen keine NULL-Werte verwendet werden"
+ swe "Det är inte tillåtet att använda NULL-värden i VALUES LESS THAN"
+ER_WRONG_PARTITION_NAME
+ eng "Incorrect partition name"
+ ger "Falscher Partitionsname"
+ swe "Felaktigt partitionsnamn"
+ER_CANT_CHANGE_TX_ISOLATION 25001
+ eng "Transaction isolation level can't be changed while a transaction is in progress"
+ ger "Transaktionsisolationsebene kann während einer laufenden Transaktion nicht geändert werden"
+ER_DUP_ENTRY_AUTOINCREMENT_CASE
+ eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'"
+ ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192s' für Schlüssel '%-.192s' auftritt"
+ER_EVENT_MODIFY_QUEUE_ERROR
+ eng "Internal scheduler error %d"
+ ger "Interner Scheduler-Fehler %d"
+ER_EVENT_SET_VAR_ERROR
+ eng "Error during starting/stopping of the scheduler. Error code %u"
+ ger "Fehler während des Startens oder Anhalten des Schedulers. Fehlercode %u"
+ER_PARTITION_MERGE_ERROR
+ eng "Engine cannot be used in partitioned tables"
+ ger "Engine kann in partitionierten Tabellen nicht verwendet werden"
+ swe "Engine inte användas i en partitionerad tabell"
+ER_CANT_ACTIVATE_LOG
+ eng "Cannot activate '%-.64s' log"
+ ger "Kann Logdatei '%-.64s' nicht aktivieren"
+ER_RBR_NOT_AVAILABLE
+ eng "The server was not built with row-based replication"
+ER_BASE64_DECODE_ERROR
+ eng "Decoding of base64 string failed"
+ swe "Avkodning av base64 sträng misslyckades"
+ ger "Der Server hat keine zeilenbasierte Replikation"
+ER_EVENT_RECURSION_FORBIDDEN
+ eng "Recursion of EVENT DDL statements is forbidden when body is present"
+ ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert"
+ER_EVENTS_DB_ERROR
+ eng "Cannot proceed because system tables used by Event Scheduler were found damaged at server start"
+ ger "Kann nicht weitermachen, weil die Tabellen, die von Events verwendet werden, beim Serverstart als beschädigt markiert wurden"
+ER_ONLY_INTEGERS_ALLOWED
+ eng "Only integers allowed as number here"
+ ger "An dieser Stelle sind nur Ganzzahlen zulässig"
+ER_UNSUPORTED_LOG_ENGINE
+ eng "This storage engine cannot be used for log tables""
+ ger "Diese Speicher-Engine kann für Logtabellen nicht verwendet werden"
+ER_BAD_LOG_STATEMENT
+ eng "You cannot '%s' a log table if logging is enabled"
+ ger "Sie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet ist"
+ER_CANT_RENAME_LOG_TABLE
+ eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'"
+ ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen beim Umbenennen zu/von einer Logtabelle zwei Tabellen angegeben werden: die Logtabelle zu einer Archivtabelle und eine weitere Tabelle zurück zu '%s'"
+ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 42000
+ eng "Incorrect parameter count in the call to native function '%-.192s'"
+ ger "Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.192s'"
+ER_WRONG_PARAMETERS_TO_NATIVE_FCT 42000
+ eng "Incorrect parameters in the call to native function '%-.192s'"
+ ger "Falscher Parameter beim Aufruf der nativen Funktion '%-.192s'"
+ER_WRONG_PARAMETERS_TO_STORED_FCT 42000
+ eng "Incorrect parameters in the call to stored function '%-.192s'"
+ ger "Falsche Parameter beim Aufruf der gespeicherten Funktion '%-.192s'"
+ER_NATIVE_FCT_NAME_COLLISION
+ eng "This function '%-.192s' has the same name as a native function"
+ ger "Die Funktion '%-.192s' hat denselben Namen wie eine native Funktion"
+# When using this error message, use the ER_DUP_ENTRY error code. See, for
+# example, code in handler.cc.
+ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
+ cze "Zvojen-Bý klÃ­Ä '%-.64s' (Äíslo klíÄe '%-.192s')"
+ dan "Ens værdier '%-.64s' for indeks '%-.192s'"
+ nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.192s'"
+ eng "Duplicate entry '%-.64s' for key '%-.192s'"
+ jps "'%-.64s' 㯠key '%-.192s' ã«ãŠã„ã¦é‡è¤‡ã—ã¦ã„ã¾ã™",
+ est "Kattuv väärtus '%-.64s' võtmele '%-.192s'"
+ fre "Duplicata du champ '%-.64s' pour la clef '%-.192s'"
+ ger "Doppelter Eintrag '%-.64s' für Schlüssel '%-.192s'"
+ greek "Διπλή εγγÏαφή '%-.64s' για το κλειδί '%-.192s'"
+ hun "Duplikalt bejegyzes '%-.64s' a '%-.192s' kulcs szerint."
+ ita "Valore duplicato '%-.64s' per la chiave '%-.192s'"
+ jpn "'%-.64s' 㯠key '%-.192s' ã«ãŠã„ã¦é‡è¤‡ã—ã¦ã„ã¾ã™"
+ kor "ì¤‘ë³µëœ ìž…ë ¥ ê°’ '%-.64s': key '%-.192s'"
+ nor "Like verdier '%-.64s' for nøkkel '%-.192s'"
+ norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.192s'"
+ pol "Powtórzone wyst?pienie '%-.64s' dla klucza '%-.192s'"
+ por "Entrada '%-.64s' duplicada para a chave '%-.192s'"
+ rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.192s'"
+ rus "ДублирующаÑÑÑ Ð·Ð°Ð¿Ð¸ÑÑŒ '%-.64s' по ключу '%-.192s'"
+ serbian "Dupliran unos '%-.64s' za kljuÄ '%-.192s'"
+ slo "Opakovaný kÄ¾ÃºÄ '%-.64s' (Äíslo kľúÄa '%-.192s')"
+ spa "Entrada duplicada '%-.64s' para la clave '%-.192s'"
+ swe "Dubbel nyckel '%-.64s' för nyckel '%-.192s'"
+ ukr "Дублюючий Ð·Ð°Ð¿Ð¸Ñ '%-.64s' Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð° '%-.192s'"
+ER_BINLOG_PURGE_EMFILE
+ eng "Too many files opened, please execute the command again"
+ ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
+ER_EVENT_CANNOT_CREATE_IN_THE_PAST
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ER_EVENT_CANNOT_ALTER_IN_THE_PAST
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ER_SLAVE_INCIDENT
+ eng "The incident %s occured on the master. Message: %-.64s"
+ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
+ eng "Table has no partition for some existing values"
+ER_BINLOG_UNSAFE_STATEMENT
+ eng "Statement may not be safe to log in statement format."
+ swe "Detta är inte säkert att logga i statement-format."
+ER_SLAVE_FATAL_ERROR
+ eng "Fatal error: %s"
+ER_SLAVE_RELAY_LOG_READ_FAILURE
+ eng "Relay log read failure: %s"
+ER_SLAVE_RELAY_LOG_WRITE_FAILURE
+ eng "Relay log write failure: %s"
+ER_SLAVE_CREATE_EVENT_FAILURE
+ eng "Failed to create %s"
+ER_SLAVE_MASTER_COM_FAILURE
+ eng "Master command %s failed: %s"
+ER_BINLOG_LOGGING_IMPOSSIBLE
+ eng "Binary logging not possible. Message: %s"
+
+ER_VIEW_NO_CREATION_CTX
+ eng "View `%-.64s`.`%-.64s` has no creation context"
+ER_VIEW_INVALID_CREATION_CTX
+ eng "Creation context of view `%-.64s`.`%-.64s' is invalid"
+
+ER_SR_INVALID_CREATION_CTX
+ eng "Creation context of stored routine `%-.64s`.`%-.64s` is invalid"
+
+ER_TRG_CORRUPTED_FILE
+ eng "Corrupted TRG file for table `%-.64s`.`%-.64s`"
+ER_TRG_NO_CREATION_CTX
+ eng "Triggers for table `%-.64s`.`%-.64s` have no creation context"
+ER_TRG_INVALID_CREATION_CTX
+ eng "Trigger creation context of table `%-.64s`.`%-.64s` is invalid"
+
+ER_EVENT_INVALID_CREATION_CTX
+ eng "Creation context of event `%-.64s`.`%-.64s` is invalid"
+
+ER_TRG_CANT_OPEN_TABLE
+ eng "Cannot open table for trigger `%-.64s`.`%-.64s`"
+
+ER_CANT_CREATE_SROUTINE
+ eng "Cannot create stored routine `%-.64s`. Check warnings"
+ER_SLAVE_AMBIGOUS_EXEC_MODE
+ eng "Ambiguous slave modes combination. %s"
+
+ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
+ eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement."
+ER_SLAVE_CORRUPT_EVENT
+ eng "Corrupted replication event was detected"
+
+ER_LOAD_DATA_INVALID_COLUMN
+ eng "Invalid column reference (%-.64s) in LOAD DATA"
+
+ER_LOG_PURGE_NO_FILE
+ eng "Being purged log %s was not found"
+
+ER_XA_RBTIMEOUT XA106
+ eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
+
+ER_XA_RBDEADLOCK XA102
+ eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
+
+ER_NEED_REPREPARE
+ eng "Prepared statement needs to be re-prepared"
+
+ER_DELAYED_NOT_SUPPORTED
+ eng "DELAYED option not supported for table '%-.192s'"
+
+WARN_NO_MASTER_INFO
+ eng "The master info structure does not exist"
+
+WARN_OPTION_IGNORED
+ eng "<%-.64s> option ignored"
+
+WARN_PLUGIN_DELETE_BUILTIN
+ eng "Built-in plugins cannot be deleted"
+
+WARN_PLUGIN_BUSY
+ eng "Plugin is busy and will be uninstalled on shutdown"
+
+ER_VARIABLE_IS_READONLY
+ eng "%s variable '%s' is read-only. Use SET %s to assign the value"
+
+ER_WARN_ENGINE_TRANSACTION_ROLLBACK
+ eng "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted"
+
+ER_SLAVE_HEARTBEAT_FAILURE
+ eng "Unexpected master's heartbeat data: %s"
+ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
+ eng "The requested value for the heartbeat period %s %s"
+
+ER_NDB_REPLICATION_SCHEMA_ERROR
+ eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
+ER_CONFLICT_FN_PARSE_ERROR
+ eng "Error in parsing conflict function. Message: %-.64s"
+ER_EXCEPTIONS_WRITE_ERROR
+ eng "Write to exceptions table failed. Message: %-.128s""
+
+ER_TOO_LONG_TABLE_COMMENT
+ eng "Comment for table '%-.64s' is too long (max = %lu)"
+ por "Comentário para a tabela '%-.64s' é longo demais (max = %lu)"
+
+ER_TOO_LONG_FIELD_COMMENT
+ eng "Comment for field '%-.64s' is too long (max = %lu)"
+ por "Comentário para o campo '%-.64s' é longo demais (max = %lu)"
+
+ER_FUNC_INEXISTENT_NAME_COLLISION 42000
+ eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
+
+# When updating these, please update EXPLAIN_FILENAME_MAX_EXTRA_LENGTH in
+# mysql_priv.h with the new maximal additional length for explain_filename.
+ER_DATABASE_NAME
+ eng "Database"
+ swe "Databas"
+ER_TABLE_NAME
+ eng "Table"
+ swe "Tabell"
+ER_PARTITION_NAME
+ eng "Partition"
+ swe "Partition"
+ER_SUBPARTITION_NAME
+ eng "Subpartition"
+ swe "Subpartition"
+ER_TEMPORARY_NAME
+ eng "Temporary"
+ swe "Temporär"
+ER_RENAMED_NAME
+ eng "Renamed"
+ swe "Namnändrad"
+ER_TOO_MANY_CONCURRENT_TRXS
+ eng "Too many active concurrent transactions"
+
+WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
+ eng "Non-ASCII separator arguments are not fully supported"
+
+ER_DEBUG_SYNC_TIMEOUT
+ eng "debug sync point wait timed out"
+ ger "Debug Sync Point Wartezeit überschritten"
+ER_DEBUG_SYNC_HIT_LIMIT
+ eng "debug sync point hit limit reached"
+ ger "Debug Sync Point Hit Limit erreicht"
+
+ER_DUP_SIGNAL_SET 42000
+ eng "Duplicate condition information item '%s'"
+
+# Note that the SQLSTATE is not 01000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_WARN 01000
+ eng "Unhandled user-defined warning condition"
+
+# Note that the SQLSTATE is not 02000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_NOT_FOUND 02000
+ eng "Unhandled user-defined not found condition"
+
+# Note that the SQLSTATE is not HY000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_EXCEPTION HY000
+ eng "Unhandled user-defined exception condition"
+
+ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 0K000
+ eng "RESIGNAL when handler not active"
+
+ER_SIGNAL_BAD_CONDITION_TYPE
+ eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
+
+WARN_COND_ITEM_TRUNCATED
+ eng "Data truncated for condition item '%s'"
+
+ER_COND_ITEM_TOO_LONG
+ eng "Data too long for condition item '%s'"
+
+ER_UNKNOWN_LOCALE
+ eng "Unknown locale: '%-.64s'"
+
+ER_SLAVE_IGNORE_SERVER_IDS
+ eng "The requested server id %d clashes with the slave startup option --replicate-same-server-id"
+ER_QUERY_CACHE_DISABLED
+ eng "Query cache is disabled; restart the server with query_cache_type=1 to enable it"
+ER_SAME_NAME_PARTITION_FIELD
+ eng "Duplicate partition field name '%-.192s'"
+ER_PARTITION_COLUMN_LIST_ERROR
+ eng "Inconsistency in usage of column lists for partitioning"
+ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+ eng "Partition column values of incorrect type"
+ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR
+ eng "Too many fields in '%-.192s'"
+ER_MAXVALUE_IN_VALUES_IN
+ eng "Cannot use MAXVALUE as value in VALUES IN"
+ER_TOO_MANY_VALUES_ERROR
+ eng "Cannot have more than one value for this type of %-.64s partitioning"
+ER_ROW_SINGLE_PARTITION_FIELD_ERROR
+ eng "Row expressions in VALUES IN only allowed for multi-field column partitioning"
+ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+ eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
+ER_PARTITION_FIELDS_TOO_LONG
+ eng "The total length of the partitioning fields is too large"
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index a17ad94ba82..034f987e0e7 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -4620,7 +4620,7 @@ ER_USER_LIMIT_REACHED 42000
swe "Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)"
ER_SPECIFIC_ACCESS_DENIED_ERROR 42000
nla "Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie"
- eng "Access denied; you need the %-.128s privilege for this operation"
+ eng "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation"
ger "Kein Zugriff. Hierfür wird die Berechtigung %-.128s benötigt"
ita "Accesso non consentito. Serve il privilegio %-.128s per questa operazione"
por "Acesso negado. Você precisa o privilégio %-.128s para essa operação"
@@ -4879,13 +4879,7 @@ ER_ZLIB_Z_DATA_ERROR
por "ZLIB: Dados de entrada está corrupto"
spa "ZLIB: Dato de entrada fué corrompido para zlib"
ER_CUT_VALUE_GROUP_CONCAT
- eng "%d line(s) were cut by GROUP_CONCAT()"
- ger "%d Zeile(n) durch GROUP_CONCAT() abgeschnitten"
- nla "%d regel(s) door GROUP_CONCAT() ingekort"
- por "%d linha(s) foram cortada(s) por GROUP_CONCAT()"
- spa "%d línea(s) fue(fueron) cortadas por group_concat()"
- swe "%d rad(er) kapades av group_concat()"
- ukr "%d line(s) was(were) cut by group_concat()"
+ eng "Row %u was cut by GROUP_CONCAT()"
ER_WARN_TOO_FEW_RECORDS 01000
eng "Row %ld doesn't contain data for all columns"
ger "Zeile %ld enthält nicht für alle Felder Daten"
@@ -6213,3 +6207,55 @@ ER_DEBUG_SYNC_TIMEOUT
ER_DEBUG_SYNC_HIT_LIMIT
eng "debug sync point hit limit reached"
ger "Debug Sync Point Hit Limit erreicht"
+
+ER_DUP_SIGNAL_SET 42000
+ eng "Duplicate condition information item '%s'"
+
+# Note that the SQLSTATE is not 01000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_WARN 01000
+ eng "Unhandled user-defined warning condition"
+
+# Note that the SQLSTATE is not 02000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_NOT_FOUND 02000
+ eng "Unhandled user-defined not found condition"
+
+# Note that the SQLSTATE is not HY000, it is provided by SIGNAL/RESIGNAL
+ER_SIGNAL_EXCEPTION HY000
+ eng "Unhandled user-defined exception condition"
+
+ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 0K000
+ eng "RESIGNAL when handler not active"
+
+ER_SIGNAL_BAD_CONDITION_TYPE
+ eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
+
+WARN_COND_ITEM_TRUNCATED
+ eng "Data truncated for condition item '%s'"
+
+ER_COND_ITEM_TOO_LONG
+ eng "Data too long for condition item '%s'"
+
+ER_UNKNOWN_LOCALE
+ eng "Unknown locale: '%-.64s'"
+
+ER_SLAVE_IGNORE_SERVER_IDS
+ eng "The requested server id %d clashes with the slave startup option --replicate-same-server-id"
+
+ER_SAME_NAME_PARTITION_FIELD
+ eng "Duplicate partition field name '%-.192s'"
+ER_PARTITION_COLUMN_LIST_ERROR
+ eng "Inconsistency in usage of column lists for partitioning"
+ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+ eng "Partition column values of incorrect type"
+ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR
+ eng "Too many fields in '%-.192s'"
+ER_MAXVALUE_IN_VALUES_IN
+ eng "Cannot use MAXVALUE as value in VALUES IN"
+ER_TOO_MANY_VALUES_ERROR
+ eng "Cannot have more than one value for this type of %-.64s partitioning"
+ER_ROW_SINGLE_PARTITION_FIELD_ERROR
+ eng "Row expressions in VALUES IN only allowed for multi-field column partitioning"
+ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+ eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
+ER_PARTITION_FIELDS_TOO_LONG
+ eng "The total length of the partitioning fields is too large"
diff --git a/sql/slave.cc b/sql/slave.cc
index f6660e5a5c8..8be17860c61 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -40,6 +40,7 @@
#include <errmsg.h>
#include <mysqld_error.h>
#include <mysys_err.h>
+#include "rpl_handler.h"
#ifdef HAVE_REPLICATION
@@ -48,6 +49,10 @@
#define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
#define MAX_SLAVE_RETRY_PAUSE 5
+/*
+ a parameter of sql_slave_killed() to defer the killed status
+*/
+#define SLAVE_WAIT_GROUP_DONE 60
bool use_slave_mask = 0;
MY_BITMAP slave_error_mask;
char slave_skip_error_names[SHOW_VAR_FUNC_BUFF_SIZE];
@@ -69,6 +74,8 @@ ulonglong relay_log_space_limit = 0;
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
int events_till_abort = -1;
+static pthread_key(Master_info*, RPL_MASTER_INFO);
+
enum enum_slave_reconnect_actions
{
SLAVE_RECON_ACT_REG= 0,
@@ -220,6 +227,7 @@ void unlock_slave_threads(Master_info* mi)
int init_slave()
{
DBUG_ENTER("init_slave");
+ int error= 0;
/*
This is called when mysqld starts. Before client connections are
@@ -231,7 +239,10 @@ int init_slave()
TODO: re-write this to interate through the list of files
for multi-master
*/
- active_mi= new Master_info;
+ active_mi= new Master_info(relay_log_recovery);
+
+ if (pthread_key_create(&RPL_MASTER_INFO, NULL))
+ goto err;
/*
If --slave-skip-errors=... was not used, the string value for the
@@ -250,6 +261,7 @@ int init_slave()
if (!active_mi)
{
sql_print_error("Failed to allocate memory for the master info structure");
+ error= 1;
goto err;
}
@@ -257,6 +269,7 @@ int init_slave()
!master_host, (SLAVE_IO | SLAVE_SQL)))
{
sql_print_error("Failed to initialize the master info structure");
+ error= 1;
goto err;
}
@@ -275,18 +288,69 @@ int init_slave()
SLAVE_IO | SLAVE_SQL))
{
sql_print_error("Failed to create slave threads");
+ error= 1;
goto err;
}
}
- pthread_mutex_unlock(&LOCK_active_mi);
- DBUG_RETURN(0);
err:
pthread_mutex_unlock(&LOCK_active_mi);
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
+/*
+ Updates the master info based on the information stored in the
+ relay info and ignores relay logs previously retrieved by the IO
+ thread, which thus starts fetching again based on to the
+ group_master_log_pos and group_master_log_name. Eventually, the old
+ relay logs will be purged by the normal purge mechanism.
+
+ In the feature, we should improve this routine in order to avoid throwing
+ away logs that are safely stored in the disk. Note also that this recovery
+ routine relies on the correctness of the relay-log.info and only tolerates
+ coordinate problems in master.info.
+
+ In this function, there is no need for a mutex as the caller
+ (i.e. init_slave) already has one acquired.
+
+ Specifically, the following structures are updated:
+
+ 1 - mi->master_log_pos <-- rli->group_master_log_pos
+ 2 - mi->master_log_name <-- rli->group_master_log_name
+ 3 - It moves the relay log to the new relay log file, by
+ rli->group_relay_log_pos <-- BIN_LOG_HEADER_SIZE;
+ rli->event_relay_log_pos <-- BIN_LOG_HEADER_SIZE;
+ rli->group_relay_log_name <-- rli->relay_log.get_log_fname();
+ rli->event_relay_log_name <-- rli->relay_log.get_log_fname();
+
+ If there is an error, it returns (1), otherwise returns (0).
+ */
+int init_recovery(Master_info* mi, const char** errmsg)
+{
+ DBUG_ENTER("init_recovery");
+
+ Relay_log_info *rli= &mi->rli;
+ if (rli->group_master_log_name[0])
+ {
+ mi->master_log_pos= max(BIN_LOG_HEADER_SIZE,
+ rli->group_master_log_pos);
+ strmake(mi->master_log_name, rli->group_master_log_name,
+ sizeof(mi->master_log_name)-1);
+
+ sql_print_warning("Recovery from master pos %ld and file %s.",
+ (ulong) mi->master_log_pos, mi->master_log_name);
+
+ strmake(rli->group_relay_log_name, rli->relay_log.get_log_fname(),
+ sizeof(rli->group_relay_log_name)-1);
+ strmake(rli->event_relay_log_name, rli->relay_log.get_log_fname(),
+ sizeof(mi->rli.event_relay_log_name)-1);
+
+ rli->group_relay_log_pos= rli->event_relay_log_pos= BIN_LOG_HEADER_SIZE;
+ }
+ DBUG_RETURN(0);
+}
+
/**
Convert slave skip errors bitmap into a printable string.
*/
@@ -519,7 +583,7 @@ terminate_slave_thread(THD *thd,
EINVAL: invalid signal number (can't happen)
ESRCH: thread already killed (can happen, should be ignored)
*/
- IF_DBUG(int err= ) pthread_kill(thd->real_id, thr_client_alarm);
+ int err __attribute__((unused))= pthread_kill(thd->real_id, thr_client_alarm);
DBUG_ASSERT(err != EINVAL);
#endif
thd->awake(THD::NOT_KILLED);
@@ -730,44 +794,92 @@ static bool io_slave_killed(THD* thd, Master_info* mi)
DBUG_RETURN(mi->abort_slave || abort_loop || thd->killed);
}
+/**
+ The function analyzes a possible killed status and makes
+ a decision whether to accept it or not.
+ Normally upon accepting the sql thread goes to shutdown.
+ In the event of deffering decision @rli->last_event_start_time waiting
+ timer is set to force the killed status be accepted upon its expiration.
+
+ @param thd pointer to a THD instance
+ @param rli pointer to Relay_log_info instance
+ @return TRUE the killed status is recognized, FALSE a possible killed
+ status is deferred.
+*/
static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
{
+ bool ret= FALSE;
DBUG_ENTER("sql_slave_killed");
DBUG_ASSERT(rli->sql_thd == thd);
DBUG_ASSERT(rli->slave_running == 1);// tracking buffer overrun
if (abort_loop || thd->killed || rli->abort_slave)
{
- if (rli->abort_slave && rli->is_in_group() &&
- thd->transaction.all.modified_non_trans_table)
- DBUG_RETURN(0);
- /*
- If we are in an unsafe situation (stopping could corrupt replication),
- we give one minute to the slave SQL thread of grace before really
- terminating, in the hope that it will be able to read more events and
- the unsafe situation will soon be left. Note that this one minute starts
- from the last time anything happened in the slave SQL thread. So it's
- really one minute of idleness, we don't timeout if the slave SQL thread
- is actively working.
- */
- if (rli->last_event_start_time == 0)
- DBUG_RETURN(1);
- DBUG_PRINT("info", ("Slave SQL thread is in an unsafe situation, giving "
- "it some grace period"));
- if (difftime(time(0), rli->last_event_start_time) > 60)
+ if (thd->transaction.all.modified_non_trans_table && rli->is_in_group())
{
- rli->report(ERROR_LEVEL, 0,
- "SQL thread had to stop in an unsafe situation, in "
- "the middle of applying updates to a "
- "non-transactional table without any primary key. "
- "There is a risk of duplicate updates when the slave "
- "SQL thread is restarted. Please check your tables' "
- "contents after restart.");
- DBUG_RETURN(1);
+ char msg_stopped[]=
+ "... The slave SQL is stopped, leaving the current group "
+ "of events unfinished with a non-transaction table changed. "
+ "If the group consists solely of Row-based events, you can try "
+ "restarting the slave with --slave-exec-mode=IDEMPOTENT, which "
+ "ignores duplicate key, key not found, and similar errors (see "
+ "documentation for details).";
+
+ if (rli->abort_slave)
+ {
+ DBUG_PRINT("info", ("Slave SQL thread is being stopped in the middle of"
+ " a group having updated a non-trans table, giving"
+ " it some grace period"));
+
+ /*
+ Slave sql thread shutdown in face of unfinished group modified
+ Non-trans table is handled via a timer. The slave may eventually
+ give out to complete the current group and in that case there
+ might be issues at consequent slave restart, see the error message.
+ WL#2975 offers a robust solution requiring to store the last exectuted
+ event's coordinates along with the group's coordianates
+ instead of waiting with @c last_event_start_time the timer.
+ */
+
+ if (rli->last_event_start_time == 0)
+ rli->last_event_start_time= my_time(0);
+ ret= difftime(my_time(0), rli->last_event_start_time) <=
+ SLAVE_WAIT_GROUP_DONE ? FALSE : TRUE;
+
+ DBUG_EXECUTE_IF("stop_slave_middle_group",
+ DBUG_EXECUTE_IF("incomplete_group_in_relay_log",
+ ret= TRUE;);); // time is over
+
+ if (ret == 0)
+ {
+ rli->report(WARNING_LEVEL, 0,
+ "slave SQL thread is being stopped in the middle "
+ "of applying of a group having updated a non-transaction "
+ "table; waiting for the group completion ... ");
+ }
+ else
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), msg_stopped);
+ }
+ }
+ else
+ {
+ ret= TRUE;
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR),
+ msg_stopped);
+ }
+ }
+ else
+ {
+ ret= TRUE;
}
}
- DBUG_RETURN(0);
+ if (ret)
+ rli->last_event_start_time= 0;
+
+ DBUG_RETURN(ret);
}
@@ -860,6 +972,126 @@ int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
DBUG_RETURN(1);
}
+int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val)
+{
+ char buf[16];
+ DBUG_ENTER("init_floatvar_from_file");
+
+
+ if (my_b_gets(f, buf, sizeof(buf)))
+ {
+ if (sscanf(buf, "%f", var) != 1)
+ DBUG_RETURN(1);
+ else
+ DBUG_RETURN(0);
+ }
+ else if (default_val != 0.0)
+ {
+ *var = default_val;
+ DBUG_RETURN(0);
+ }
+ DBUG_RETURN(1);
+}
+
+
+/**
+ A master info read method
+
+ This function is called from @c init_master_info() along with
+ relatives to restore some of @c active_mi members.
+ Particularly, this function is responsible for restoring
+ IGNORE_SERVER_IDS list of servers whose events the slave is
+ going to ignore (to not log them in the relay log).
+ Items being read are supposed to be decimal output of values of a
+ type shorter or equal of @c long and separated by the single space.
+
+ @param arr @c DYNAMIC_ARRAY pointer to storage for servers id
+ @param f @c IO_CACHE pointer to the source file
+
+ @retval 0 All OK
+ @retval non-zero An error
+*/
+
+int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f)
+{
+ int ret= 0;
+ char buf[16 * (sizeof(long)*4 + 1)]; // static buffer to use most of times
+ char *buf_act= buf; // actual buffer can be dynamic if static is short
+ char *token, *last;
+ uint num_items; // number of items of `arr'
+ size_t read_size;
+ DBUG_ENTER("init_dynarray_intvar_from_file");
+
+ if ((read_size= my_b_gets(f, buf_act, sizeof(buf))) == 0)
+ {
+ return 0; // no line in master.info
+ }
+ if (read_size + 1 == sizeof(buf) && buf[sizeof(buf) - 2] != '\n')
+ {
+ /*
+ short read happend; allocate sufficient memory and make the 2nd read
+ */
+ char buf_work[(sizeof(long)*3 + 1)*16];
+ memcpy(buf_work, buf, sizeof(buf_work));
+ num_items= atoi(strtok_r(buf_work, " ", &last));
+ size_t snd_size;
+ /*
+ max size lower bound approximate estimation bases on the formula:
+ (the items number + items themselves) *
+ (decimal size + space) - 1 + `\n' + '\0'
+ */
+ size_t max_size= (1 + num_items) * (sizeof(long)*3 + 1) + 1;
+ buf_act= (char*) my_malloc(max_size, MYF(MY_WME));
+ memcpy(buf_act, buf, read_size);
+ snd_size= my_b_gets(f, buf_act + read_size, max_size - read_size);
+ if (snd_size == 0 ||
+ (snd_size + 1 == max_size - read_size) && buf[max_size - 2] != '\n')
+ {
+ /*
+ failure to make the 2nd read or short read again
+ */
+ ret= 1;
+ goto err;
+ }
+ }
+ token= strtok_r(buf_act, " ", &last);
+ if (token == NULL)
+ {
+ ret= 1;
+ goto err;
+ }
+ num_items= atoi(token);
+ for (uint i=0; i < num_items; i++)
+ {
+ token= strtok_r(NULL, " ", &last);
+ if (token == NULL)
+ {
+ ret= 1;
+ goto err;
+ }
+ else
+ {
+ ulong val= atol(token);
+ insert_dynamic(arr, (uchar *) &val);
+ }
+ }
+err:
+ if (buf_act != buf)
+ my_free(buf_act, MYF(0));
+ DBUG_RETURN(ret);
+}
+
+
+static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info)
+{
+ if (io_slave_killed(thd, mi))
+ {
+ if (info && global_system_variables.log_warnings)
+ sql_print_information("%s", info);
+ return TRUE;
+ }
+ return FALSE;
+}
/*
Check if the error is caused by network.
@@ -1028,7 +1260,7 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
(master_res= mysql_store_result(mysql)) &&
(master_row= mysql_fetch_row(master_res)))
{
- if ((::server_id == strtoul(master_row[1], 0, 10)) &&
+ if ((::server_id == (mi->master_id= strtoul(master_row[1], 0, 10))) &&
!mi->rli.replicate_same_server_id)
{
errmsg= "The slave I/O thread stops because master and slave have equal \
@@ -1066,6 +1298,13 @@ maybe it is a *VERY OLD MASTER*.");
mysql_free_result(master_res);
master_res= NULL;
}
+ if (mi->master_id == 0 && mi->ignore_server_ids.elements > 0)
+ {
+ errmsg= "Slave configured with server id filtering could not detect the master server id.";
+ err_code= ER_SLAVE_FATAL_ERROR;
+ sprintf(err_buff, ER(err_code), errmsg);
+ goto err;
+ }
/*
Check that the master's global character_set_server and ours are the same.
@@ -1189,6 +1428,31 @@ when it try to get the value of TIME_ZONE global variable from master.";
}
}
+ if (mi->heartbeat_period != 0.0)
+ {
+ char llbuf[22];
+ const char query_format[]= "SET @master_heartbeat_period= %s";
+ char query[sizeof(query_format) - 2 + sizeof(llbuf)];
+ /*
+ the period is an ulonglong of nano-secs.
+ */
+ llstr((ulonglong) (mi->heartbeat_period*1000000000UL), llbuf);
+ my_sprintf(query, (query, query_format, llbuf));
+
+ if (mysql_real_query(mysql, query, strlen(query))
+ && !check_io_slave_killed(mi->io_thd, mi, NULL))
+ {
+ errmsg= "The slave I/O thread stops because SET @master_heartbeat_period "
+ "on master failed.";
+ err_code= ER_SLAVE_FATAL_ERROR;
+ sprintf(err_buff, "%s Error: %s", errmsg, mysql_error(mysql));
+ mysql_free_result(mysql_store_result(mysql));
+ goto err;
+ }
+ mysql_free_result(mysql_store_result(mysql));
+ }
+
+
err:
if (errmsg)
{
@@ -1274,7 +1538,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
else
{
/* Clear the OK result of mysql_rm_table(). */
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
}
}
@@ -1298,7 +1562,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
goto err; // mysql_parse took care of the error send
thd_proc_info(thd, "Opening master dump table");
- thd->main_da.reset_diagnostics_area(); /* cleanup from CREATE_TABLE */
+ thd->stmt_da->reset_diagnostics_area(); /* cleanup from CREATE_TABLE */
/*
Note: If this function starts to fail for MERGE tables,
change the next two lines to these:
@@ -1605,8 +1869,12 @@ bool show_master_info(THD* thd, Master_info* mi)
field_list.push_back(new Item_empty_string("Last_IO_Error", 20));
field_list.push_back(new Item_return_int("Last_SQL_Errno", 4, MYSQL_TYPE_LONG));
field_list.push_back(new Item_empty_string("Last_SQL_Error", 20));
+ field_list.push_back(new Item_empty_string("Replicate_Ignore_Server_Ids",
+ FN_REFLEN));
+ field_list.push_back(new Item_return_int("Master_Server_Id", sizeof(ulong),
+ MYSQL_TYPE_LONG));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -1640,7 +1908,8 @@ bool show_master_info(THD* thd, Master_info* mi)
protocol->store((ulonglong) mi->rli.group_relay_log_pos);
protocol->store(mi->rli.group_master_log_name, &my_charset_bin);
protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT ?
- "Yes" : "No", &my_charset_bin);
+ "Yes" : (mi->slave_running == MYSQL_SLAVE_RUN_NOT_CONNECT ?
+ "Connecting" : "No"), &my_charset_bin);
protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin);
protocol->store(rpl_filter->get_do_db());
protocol->store(rpl_filter->get_ignore_db());
@@ -1726,6 +1995,32 @@ bool show_master_info(THD* thd, Master_info* mi)
protocol->store(mi->rli.last_error().number);
// Last_SQL_Error
protocol->store(mi->rli.last_error().message, &my_charset_bin);
+ // Replicate_Ignore_Server_Ids
+ {
+ char buff[FN_REFLEN];
+ ulong i, cur_len;
+ for (i= 0, buff[0]= 0, cur_len= 0;
+ i < mi->ignore_server_ids.elements; i++)
+ {
+ ulong s_id, slen;
+ char sbuff[FN_REFLEN];
+ get_dynamic(&mi->ignore_server_ids, (uchar*) &s_id, i);
+ slen= my_sprintf(sbuff, (sbuff, (i==0? "%lu" : ", %lu"), s_id));
+ if (cur_len + slen + 4 > FN_REFLEN)
+ {
+ /*
+ break the loop whenever remained space could not fit
+ ellipses on the next cycle
+ */
+ my_sprintf(buff + cur_len, (buff + cur_len, "..."));
+ break;
+ }
+ cur_len += my_sprintf(buff + cur_len, (buff + cur_len, "%s", sbuff));
+ }
+ protocol->store(buff, &my_charset_bin);
+ }
+ // Master_Server_id
+ protocol->store((uint32) mi->master_id);
pthread_mutex_unlock(&mi->rli.err_lock);
pthread_mutex_unlock(&mi->err_lock);
@@ -1869,17 +2164,22 @@ static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
}
-static int request_dump(MYSQL* mysql, Master_info* mi,
- bool *suppress_warnings)
+static int request_dump(THD *thd, MYSQL* mysql, Master_info* mi,
+ bool *suppress_warnings)
{
uchar buf[FN_REFLEN + 10];
int len;
- int binlog_flags = 0; // for now
+ ushort binlog_flags = 0; // for now
char* logname = mi->master_log_name;
DBUG_ENTER("request_dump");
*suppress_warnings= FALSE;
+ if (RUN_HOOK(binlog_relay_io,
+ before_request_transmit,
+ (thd, mi, binlog_flags)))
+ DBUG_RETURN(1);
+
// TODO if big log files: Change next to int8store()
int4store(buf, (ulong) mi->master_log_pos);
int2store(buf + 4, binlog_flags);
@@ -2012,7 +2312,7 @@ static int has_temporary_error(THD *thd)
DBUG_ENTER("has_temporary_error");
DBUG_EXECUTE_IF("all_errors_are_temporary_errors",
- if (thd->main_da.is_error())
+ if (thd->stmt_da->is_error())
{
thd->clear_error();
my_error(ER_LOCK_DEADLOCK, MYF(0));
@@ -2031,20 +2331,21 @@ static int has_temporary_error(THD *thd)
currently, InnoDB deadlock detected by InnoDB or lock
wait timeout (innodb_lock_wait_timeout exceeded
*/
- if (thd->main_da.sql_errno() == ER_LOCK_DEADLOCK ||
- thd->main_da.sql_errno() == ER_LOCK_WAIT_TIMEOUT)
+ if (thd->stmt_da->sql_errno() == ER_LOCK_DEADLOCK ||
+ thd->stmt_da->sql_errno() == ER_LOCK_WAIT_TIMEOUT)
DBUG_RETURN(1);
#ifdef HAVE_NDB_BINLOG
/*
currently temporary error set in ndbcluster
*/
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
while ((err= it++))
{
- DBUG_PRINT("info", ("has warning %d %s", err->code, err->msg));
- switch (err->code)
+ DBUG_PRINT("info", ("has condition %d %s", err->get_sql_errno(),
+ err->get_message_text()));
+ switch (err->get_sql_errno())
{
case ER_GET_TEMPORARY_ERRMSG:
DBUG_RETURN(1);
@@ -2274,6 +2575,27 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
delete ev;
DBUG_RETURN(1);
}
+
+ { /**
+ The following failure injecion works in cooperation with tests
+ setting @@global.debug= 'd,incomplete_group_in_relay_log'.
+ Xid or Commit events are not executed to force the slave sql
+ read hanging if the realy log does not have any more events.
+ */
+ DBUG_EXECUTE_IF("incomplete_group_in_relay_log",
+ if ((ev->get_type_code() == XID_EVENT) ||
+ ((ev->get_type_code() == QUERY_EVENT) &&
+ strcmp("COMMIT", ((Query_log_event *) ev)->query) == 0))
+ {
+ DBUG_ASSERT(thd->transaction.all.modified_non_trans_table);
+ rli->abort_slave= 1;
+ pthread_mutex_unlock(&rli->data_lock);
+ delete ev;
+ rli->inc_event_relay_log_pos();
+ DBUG_RETURN(0);
+ };);
+ }
+
exec_res= apply_event_and_update_pos(ev, thd, rli);
/*
@@ -2377,18 +2699,6 @@ on this slave.\
}
-static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info)
-{
- if (io_slave_killed(thd, mi))
- {
- if (info && global_system_variables.log_warnings)
- sql_print_information("%s", info);
- return TRUE;
- }
- return FALSE;
-}
-
-
/**
@brief Try to reconnect slave IO thread.
@@ -2528,6 +2838,16 @@ pthread_handler_t handle_slave_io(void *arg)
mi->master_log_name,
llstr(mi->master_log_pos,llbuff)));
+ /* This must be called before run any binlog_relay_io hooks */
+ my_pthread_setspecific_ptr(RPL_MASTER_INFO, mi);
+
+ if (RUN_HOOK(binlog_relay_io, thread_start, (thd, mi)))
+ {
+ mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), "Failed to run 'thread_start' hook");
+ goto err;
+ }
+
if (!(mi->mysql = mysql = mysql_init(NULL)))
{
mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
@@ -2617,7 +2937,7 @@ connected:
while (!io_slave_killed(thd,mi))
{
thd_proc_info(thd, "Requesting binlog dump");
- if (request_dump(mysql, mi, &suppress_warnings))
+ if (request_dump(thd, mysql, mi, &suppress_warnings))
{
sql_print_error("Failed on request_dump()");
if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
@@ -2637,6 +2957,7 @@ requesting master dump") ||
goto err;
goto connected;
});
+ const char *event_buf;
DBUG_ASSERT(mi->last_error().number == 0);
while (!io_slave_killed(thd,mi))
@@ -2697,14 +3018,37 @@ Stopping slave I/O thread due to out-of-memory error from master");
retry_count=0; // ok event, reset retry counter
thd_proc_info(thd, "Queueing master event to the relay log");
- if (queue_event(mi,(const char*)mysql->net.read_pos + 1,
- event_len))
+ event_buf= (const char*)mysql->net.read_pos + 1;
+ if (RUN_HOOK(binlog_relay_io, after_read_event,
+ (thd, mi,(const char*)mysql->net.read_pos + 1,
+ event_len, &event_buf, &event_len)))
+ {
+ mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR),
+ "Failed to run 'after_read_event' hook");
+ goto err;
+ }
+
+ /* XXX: 'synced' should be updated by queue_event to indicate
+ whether event has been synced to disk */
+ bool synced= 0;
+ if (queue_event(mi, event_buf, event_len))
{
mi->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_WRITE_FAILURE,
ER(ER_SLAVE_RELAY_LOG_WRITE_FAILURE),
"could not queue event from master");
goto err;
}
+
+ if (RUN_HOOK(binlog_relay_io, after_queue_event,
+ (thd, mi, event_buf, event_len, synced)))
+ {
+ mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR),
+ "Failed to run 'after_queue_event' hook");
+ goto err;
+ }
+
if (flush_master_info(mi, 1))
{
sql_print_error("Failed to flush master info file");
@@ -2750,6 +3094,7 @@ err:
// print the current replication position
sql_print_information("Slave I/O thread exiting, read up to log '%s', position %s",
IO_RPL_LOG_NAME, llstr(mi->master_log_pos,llbuff));
+ RUN_HOOK(binlog_relay_io, thread_stop, (thd, mi));
thd->set_query(NULL, 0);
thd->reset_db(NULL, 0);
if (mysql)
@@ -2979,9 +3324,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
if (check_temp_dir(rli->slave_patternload_file))
{
- rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Unable to use slave's temporary directory %s - %s",
- slave_load_tmpdir, thd->main_da.message());
+ slave_load_tmpdir, thd->stmt_da->message());
goto err;
}
@@ -2991,7 +3336,7 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave);
if (thd->is_slave_error)
{
- rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Slave SQL thread aborted. Can't execute init_slave query");
goto err;
}
@@ -3035,20 +3380,20 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
if (thd->is_error())
{
- char const *const errmsg= thd->main_da.message();
+ char const *const errmsg= thd->stmt_da->message();
DBUG_PRINT("info",
- ("thd->main_da.sql_errno()=%d; rli->last_error.number=%d",
- thd->main_da.sql_errno(), last_errno));
+ ("thd->stmt_da->sql_errno()=%d; rli->last_error.number=%d",
+ thd->stmt_da->sql_errno(), last_errno));
if (last_errno == 0)
{
/*
This function is reporting an error which was not reported
while executing exec_relay_log_event().
*/
- rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), "%s", errmsg);
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(), "%s", errmsg);
}
- else if (last_errno != thd->main_da.sql_errno())
+ else if (last_errno != thd->stmt_da->sql_errno())
{
/*
* An error was reported while executing exec_relay_log_event()
@@ -3057,12 +3402,12 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
* what caused the problem.
*/
sql_print_error("Slave (additional info): %s Error_code: %d",
- errmsg, thd->main_da.sql_errno());
+ errmsg, thd->stmt_da->sql_errno());
}
}
/* Print any warnings issued */
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
/*
Added controlled slave thread cancel for replication
@@ -3071,9 +3416,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
bool udf_error = false;
while ((err= it++))
{
- if (err->code == ER_CANT_OPEN_LIBRARY)
+ if (err->get_sql_errno() == ER_CANT_OPEN_LIBRARY)
udf_error = true;
- sql_print_warning("Slave: %s Error_code: %d",err->msg, err->code);
+ sql_print_warning("Slave: %s Error_code: %d", err->get_message_text(), err->get_sql_errno());
}
if (udf_error)
sql_print_error("Error loading user-defined library, slave SQL "
@@ -3555,9 +3900,11 @@ static int queue_old_event(Master_info *mi, const char *buf,
static int queue_event(Master_info* mi,const char* buf, ulong event_len)
{
int error= 0;
+ String error_msg;
ulong inc_pos;
Relay_log_info *rli= &mi->rli;
pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
+ ulong s_id;
DBUG_ENTER("queue_event");
LINT_INIT(inc_pos);
@@ -3589,7 +3936,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
Rotate_log_event rev(buf,event_len,mi->rli.relay_log.description_event_for_queue);
if (unlikely(process_io_rotate(mi,&rev)))
{
- error= 1;
+ error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
goto err;
}
/*
@@ -3616,7 +3963,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
Log_event::read_log_event(buf, event_len, &errmsg,
mi->rli.relay_log.description_event_for_queue)))
{
- error= 2;
+ error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
goto err;
}
delete mi->rli.relay_log.description_event_for_queue;
@@ -3635,6 +3982,56 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
}
break;
+
+ case HEARTBEAT_LOG_EVENT:
+ {
+ /*
+ HB (heartbeat) cannot come before RL (Relay)
+ */
+ char llbuf[22];
+ Heartbeat_log_event hb(buf, event_len, mi->rli.relay_log.description_event_for_queue);
+ if (!hb.is_valid())
+ {
+ error= ER_SLAVE_HEARTBEAT_FAILURE;
+ error_msg.append(STRING_WITH_LEN("inconsistent heartbeat event content;"));
+ error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
+ error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident()));
+ error_msg.append(STRING_WITH_LEN(" log_pos "));
+ llstr(hb.log_pos, llbuf);
+ error_msg.append(llbuf, strlen(llbuf));
+ goto err;
+ }
+ mi->received_heartbeats++;
+ /*
+ compare local and event's versions of log_file, log_pos.
+
+ Heartbeat is sent only after an event corresponding to the corrdinates
+ the heartbeat carries.
+ Slave can not have a difference in coordinates except in the only
+ special case when mi->master_log_name, master_log_pos have never
+ been updated by Rotate event i.e when slave does not have any history
+ with the master (and thereafter mi->master_log_pos is NULL).
+
+ TODO: handling `when' for SHOW SLAVE STATUS' snds behind
+ */
+ if ((memcmp(mi->master_log_name, hb.get_log_ident(), hb.get_ident_len())
+ && mi->master_log_name != NULL)
+ || mi->master_log_pos != hb.log_pos)
+ {
+ /* missed events of heartbeat from the past */
+ error= ER_SLAVE_HEARTBEAT_FAILURE;
+ error_msg.append(STRING_WITH_LEN("heartbeat is not compatible with local info;"));
+ error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
+ error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident()));
+ error_msg.append(STRING_WITH_LEN(" log_pos "));
+ llstr(hb.log_pos, llbuf);
+ error_msg.append(llbuf, strlen(llbuf));
+ goto err;
+ }
+ goto skip_relay_logging;
+ }
+ break;
+
default:
inc_pos= event_len;
break;
@@ -3654,9 +4051,20 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
*/
pthread_mutex_lock(log_lock);
-
- if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) &&
- !mi->rli.replicate_same_server_id)
+ s_id= uint4korr(buf + SERVER_ID_OFFSET);
+ if ((s_id == ::server_id && !mi->rli.replicate_same_server_id) ||
+ /*
+ the following conjunction deals with IGNORE_SERVER_IDS, if set
+ If the master is on the ignore list, execution of
+ format description log events and rotate events is necessary.
+ */
+ (mi->ignore_server_ids.elements > 0 &&
+ mi->shall_ignore_server_id(s_id) &&
+ /* everything is filtered out from non-master */
+ (s_id != mi->master_id ||
+ /* for the master meta information is necessary */
+ buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT &&
+ buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT)))
{
/*
Do not write it to the relay log.
@@ -3671,10 +4079,14 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
But events which were generated by this slave and which do not exist in
the master's binlog (i.e. Format_desc, Rotate & Stop) should not increment
mi->master_log_pos.
+ If the event is originated remotely and is being filtered out by
+ IGNORE_SERVER_IDS it increments mi->master_log_pos
+ as well as rli->group_relay_log_pos.
*/
- if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT &&
- buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT &&
- buf[EVENT_TYPE_OFFSET]!=STOP_EVENT)
+ if (!(s_id == ::server_id && !mi->rli.replicate_same_server_id) ||
+ buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT &&
+ buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT &&
+ buf[EVENT_TYPE_OFFSET] != STOP_EVENT)
{
mi->master_log_pos+= inc_pos;
memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN);
@@ -3682,8 +4094,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
rli->ign_master_log_pos_end= mi->master_log_pos;
}
rli->relay_log.signal_update(); // the slave SQL thread needs to re-check
- DBUG_PRINT("info", ("master_log_pos: %lu, event originating from the same server, ignored",
- (ulong) mi->master_log_pos));
+ DBUG_PRINT("info", ("master_log_pos: %lu, event originating from %u server, ignored",
+ (ulong) mi->master_log_pos, uint4korr(buf + SERVER_ID_OFFSET)));
}
else
{
@@ -3695,15 +4107,23 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
}
else
- error= 3;
+ {
+ error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
+ }
rli->ign_master_log_name_end[0]= 0; // last event is not ignored
}
pthread_mutex_unlock(log_lock);
-
+skip_relay_logging:
+
err:
pthread_mutex_unlock(&mi->data_lock);
DBUG_PRINT("info", ("error: %d", error));
+ if (error)
+ mi->report(ERROR_LEVEL, error, ER(error),
+ (error == ER_SLAVE_RELAY_LOG_WRITE_FAILURE)?
+ "could not queue event from master" :
+ error_msg.ptr());
DBUG_RETURN(error);
}
@@ -3909,6 +4329,71 @@ static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
}
+MYSQL *rpl_connect_master(MYSQL *mysql)
+{
+ THD *thd= current_thd;
+ Master_info *mi= my_pthread_getspecific_ptr(Master_info*, RPL_MASTER_INFO);
+ if (!mi)
+ {
+ sql_print_error("'rpl_connect_master' must be called in slave I/O thread context.");
+ return NULL;
+ }
+
+ bool allocated= false;
+
+ if (!mysql)
+ {
+ if(!(mysql= mysql_init(NULL)))
+ {
+ sql_print_error("rpl_connect_master: failed in mysql_init()");
+ return NULL;
+ }
+ allocated= true;
+ }
+
+ /*
+ XXX: copied from connect_to_master, this function should not
+ change the slave status, so we cannot use connect_to_master
+ directly
+
+ TODO: make this part a seperate function to eliminate duplication
+ */
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
+ mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
+
+#ifdef HAVE_OPENSSL
+ if (mi->ssl)
+ {
+ mysql_ssl_set(mysql,
+ mi->ssl_key[0]?mi->ssl_key:0,
+ mi->ssl_cert[0]?mi->ssl_cert:0,
+ mi->ssl_ca[0]?mi->ssl_ca:0,
+ mi->ssl_capath[0]?mi->ssl_capath:0,
+ mi->ssl_cipher[0]?mi->ssl_cipher:0);
+ mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ &mi->ssl_verify_server_cert);
+ }
+#endif
+
+ mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
+ /* This one is not strictly needed but we have it here for completeness */
+ mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
+
+ if (io_slave_killed(thd, mi)
+ || !mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
+ mi->port, 0, 0))
+ {
+ if (!io_slave_killed(thd, mi))
+ sql_print_error("rpl_connect_master: error connecting to master: %s (server_error: %d)",
+ mysql_error(mysql), mysql_errno(mysql));
+
+ if (allocated)
+ mysql_close(mysql); // this will free the object
+ return NULL;
+ }
+ return mysql;
+}
+
/*
Store the file and position where the execute-slave thread are in the
relay log.
@@ -3962,7 +4447,14 @@ bool flush_relay_log_info(Relay_log_info* rli)
error=1;
if (flush_io_cache(file))
error=1;
-
+ if (sync_relayloginfo_period &&
+ !error &&
+ ++(rli->sync_counter) >= sync_relayloginfo_period)
+ {
+ if (my_sync(rli->info_fd, MYF(MY_WME)))
+ error=1;
+ rli->sync_counter= 0;
+ }
/* Flushing the relay log is done by the slave I/O thread */
DBUG_RETURN(error);
}
@@ -4211,8 +4703,8 @@ static Log_event* next_event(Relay_log_info* rli)
*/
pthread_mutex_unlock(&rli->log_space_lock);
pthread_cond_broadcast(&rli->log_space_cond);
- // Note that wait_for_update unlocks lock_log !
- rli->relay_log.wait_for_update(rli->sql_thd, 1);
+ // Note that wait_for_update_relay_log unlocks lock_log !
+ rli->relay_log.wait_for_update_relay_log(rli->sql_thd);
// re-acquire data lock since we released it earlier
pthread_mutex_lock(&rli->data_lock);
rli->last_master_timestamp= save_timestamp;
@@ -4369,6 +4861,8 @@ void rotate_relay_log(Master_info* mi)
DBUG_ENTER("rotate_relay_log");
Relay_log_info* rli= &mi->rli;
+ DBUG_EXECUTE_IF("crash_before_rotate_relaylog", abort(););
+
/* We don't lock rli->run_lock. This would lead to deadlocks. */
pthread_mutex_lock(&mi->run_lock);
diff --git a/sql/slave.h b/sql/slave.h
index f356d28b626..eff0fa49f61 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -22,6 +22,17 @@
@file
*/
+
+/**
+ Some of defines are need in parser even though replication is not
+ compiled in (embedded).
+*/
+
+/**
+ The maximum is defined as (ULONG_MAX/1000) with 4 bytes ulong
+*/
+#define SLAVE_MAX_HEARTBEAT_PERIOD 4294967
+
#ifdef HAVE_REPLICATION
#include "log.h"
@@ -33,7 +44,6 @@
#define MAX_SLAVE_ERROR 2000
-
// Forward declarations
class Relay_log_info;
class Master_info;
@@ -134,6 +144,7 @@ extern ulonglong relay_log_space_limit;
#define SLAVE_FORCE_ALL 4
int init_slave();
+int init_recovery(Master_info* mi, const char** errmsg);
void init_slave_skip_errors(const char* arg);
bool flush_relay_log_info(Relay_log_info* rli);
int register_slave_on_master(MYSQL* mysql);
diff --git a/sql/sp.cc b/sql/sp.cc
index d3c5dfb96d0..b5f4aec4a61 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -158,7 +158,7 @@ TABLE_FIELD_TYPE proc_table_fields[MYSQL_PROC_FIELD_COUNT] =
},
{
{ C_STRING_WITH_LEN("comment") },
- { C_STRING_WITH_LEN("char(64)") },
+ { C_STRING_WITH_LEN("text") },
{ C_STRING_WITH_LEN("utf8") }
},
{
@@ -690,16 +690,24 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
struct Silence_deprecated_warning : public Internal_error_handler
{
public:
- virtual bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
};
bool
-Silence_deprecated_warning::handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
+Silence_deprecated_warning::handle_condition(
+ THD *,
+ uint sql_errno,
+ const char*,
+ MYSQL_ERROR::enum_warning_level level,
+ const char*,
+ MYSQL_ERROR ** cond_hdl)
{
+ *cond_hdl= NULL;
if (sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
level == MYSQL_ERROR::WARN_LEVEL_WARN)
return TRUE;
@@ -1504,7 +1512,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any)
&thd->sp_proc_cache, FALSE) != NULL ||
sp_find_routine(thd, TYPE_ENUM_FUNCTION, name,
&thd->sp_func_cache, FALSE) != NULL;
- mysql_reset_errors(thd, TRUE);
+ thd->warning_info->clear_warning_info(thd->query_id);
if (sp_object_found)
{
if (any)
@@ -1660,11 +1668,11 @@ static bool add_used_routine(LEX *lex, Query_arena *arena,
const LEX_STRING *key,
TABLE_LIST *belong_to_view)
{
- hash_init_opt(&lex->sroutines, system_charset_info,
- Query_tables_list::START_SROUTINES_HASH_SIZE,
- 0, 0, sp_sroutine_key, 0, 0);
+ my_hash_init_opt(&lex->sroutines, system_charset_info,
+ Query_tables_list::START_SROUTINES_HASH_SIZE,
+ 0, 0, sp_sroutine_key, 0, 0);
- if (!hash_search(&lex->sroutines, (uchar *)key->str, key->length))
+ if (!my_hash_search(&lex->sroutines, (uchar *)key->str, key->length))
{
Sroutine_hash_entry *rn=
(Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry) +
@@ -1730,7 +1738,7 @@ void sp_remove_not_own_routines(LEX *lex)
but we want to be more future-proof.
*/
next_rt= not_own_rt->next;
- hash_delete(&lex->sroutines, (uchar *)not_own_rt);
+ my_hash_delete(&lex->sroutines, (uchar *)not_own_rt);
}
*(Sroutine_hash_entry **)lex->sroutines_list_own_last= NULL;
@@ -1763,8 +1771,8 @@ bool sp_update_sp_used_routines(HASH *dst, HASH *src)
{
for (uint i=0 ; i < src->records ; i++)
{
- Sroutine_hash_entry *rt= (Sroutine_hash_entry *)hash_element(src, i);
- if (!hash_search(dst, (uchar *)rt->key.str, rt->key.length))
+ Sroutine_hash_entry *rt= (Sroutine_hash_entry *)my_hash_element(src, i);
+ if (!my_hash_search(dst, (uchar *)rt->key.str, rt->key.length))
{
if (my_hash_insert(dst, (uchar *)rt))
return TRUE;
@@ -1794,7 +1802,7 @@ sp_update_stmt_used_routines(THD *thd, LEX *lex, HASH *src,
{
for (uint i=0 ; i < src->records ; i++)
{
- Sroutine_hash_entry *rt= (Sroutine_hash_entry *)hash_element(src, i);
+ Sroutine_hash_entry *rt= (Sroutine_hash_entry *)my_hash_element(src, i);
(void)add_used_routine(lex, thd->stmt_arena, &rt->key, belong_to_view);
}
}
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index b8209a373a2..0da5e44b846 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -50,7 +50,8 @@ public:
inline sp_head *lookup(char *name, uint namelen)
{
- return (sp_head *)hash_search(&m_hashtable, (const uchar *)name, namelen);
+ return (sp_head *) my_hash_search(&m_hashtable, (const uchar *)name,
+ namelen);
}
#ifdef NOT_USED
@@ -261,15 +262,15 @@ sp_cache::sp_cache()
sp_cache::~sp_cache()
{
- hash_free(&m_hashtable);
+ my_hash_free(&m_hashtable);
}
void
sp_cache::init()
{
- hash_init(&m_hashtable, system_charset_info, 0, 0, 0,
- hash_get_key_for_sp_head, hash_free_sp_head, 0);
+ my_hash_init(&m_hashtable, system_charset_info, 0, 0, 0,
+ hash_get_key_for_sp_head, hash_free_sp_head, 0);
version= 0;
}
@@ -277,5 +278,5 @@ sp_cache::init()
void
sp_cache::cleanup()
{
- hash_free(&m_hashtable);
+ my_hash_free(&m_hashtable);
}
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 78539034677..7644cc8e92d 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
+#include "sql_prepare.h"
#include "probes_mysql.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
@@ -175,9 +176,9 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_AUTHORS:
case SQLCOM_SHOW_BINLOGS:
case SQLCOM_SHOW_BINLOG_EVENTS:
+ case SQLCOM_SHOW_RELAYLOG_EVENTS:
case SQLCOM_SHOW_CHARSETS:
case SQLCOM_SHOW_COLLATIONS:
- case SQLCOM_SHOW_COLUMN_TYPES:
case SQLCOM_SHOW_CONTRIBUTORS:
case SQLCOM_SHOW_CREATE:
case SQLCOM_SHOW_CREATE_DB:
@@ -534,8 +535,9 @@ sp_head::sp_head()
m_backpatch.empty();
m_cont_backpatch.empty();
m_lex.empty();
- hash_init(&m_sptabs, system_charset_info, 0, 0, 0, sp_table_key, 0, 0);
- hash_init(&m_sroutines, system_charset_info, 0, 0, 0, sp_sroutine_key, 0, 0);
+ my_hash_init(&m_sptabs, system_charset_info, 0, 0, 0, sp_table_key, 0, 0);
+ my_hash_init(&m_sroutines, system_charset_info, 0, 0, 0, sp_sroutine_key,
+ 0, 0);
m_body_utf8.str= NULL;
m_body_utf8.length= 0;
@@ -784,8 +786,8 @@ sp_head::destroy()
m_thd->lex= lex;
}
- hash_free(&m_sptabs);
- hash_free(&m_sroutines);
+ my_hash_free(&m_sptabs);
+ my_hash_free(&m_sroutines);
DBUG_VOID_RETURN;
}
@@ -1086,6 +1088,7 @@ sp_head::execute(THD *thd)
Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
Object_creation_ctx *saved_creation_ctx;
+ Warning_info *saved_warning_info, warning_info(thd->warning_info->warn_id());
/* Use some extra margin for possible SP recursion and functions */
if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (uchar*)&old_packet))
@@ -1134,6 +1137,11 @@ sp_head::execute(THD *thd)
thd->is_slave_error= 0;
old_arena= thd->stmt_arena;
+ /* Push a new warning information area. */
+ warning_info.append_warning_info(thd, thd->warning_info);
+ saved_warning_info= thd->warning_info;
+ thd->warning_info= &warning_info;
+
/*
Switch query context. This has to be done early as this is sometimes
allocated trough sql_alloc
@@ -1204,7 +1212,7 @@ sp_head::execute(THD *thd)
*/
thd->spcont->callers_arena= &backup_arena;
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
/* Discard the initial part of executing routines. */
thd->profiling.discard_current_query();
#endif
@@ -1213,7 +1221,7 @@ sp_head::execute(THD *thd)
sp_instr *i;
uint hip; // Handler ip
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
/*
Treat each "instr" of a routine as discrete unit that could be profiled.
Profiling only records information for segments of code that set the
@@ -1226,7 +1234,7 @@ sp_head::execute(THD *thd)
i = get_instr(ip); // Returns NULL when we're done.
if (i == NULL)
{
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query();
#endif
break;
@@ -1281,31 +1289,35 @@ sp_head::execute(THD *thd)
*/
if (ctx)
{
- uint hf;
+ uint handler_index;
- switch (ctx->found_handler(&hip, &hf)) {
+ switch (ctx->found_handler(& hip, & handler_index)) {
case SP_HANDLER_NONE:
break;
case SP_HANDLER_CONTINUE:
thd->restore_active_arena(&execute_arena, &backup_arena);
thd->set_n_backup_active_arena(&execute_arena, &backup_arena);
ctx->push_hstack(i->get_cont_dest());
- // Fall through
+ /* Fall through */
default:
+ if (ctx->end_partial_result_set)
+ thd->protocol->end_partial_result_set(thd);
ip= hip;
err_status= FALSE;
ctx->clear_handler();
- ctx->enter_handler(hip);
+ ctx->enter_handler(hip, handler_index);
thd->clear_error();
thd->is_fatal_error= 0;
thd->killed= THD::NOT_KILLED;
thd->mysys_var->abort= 0;
continue;
}
+
+ ctx->end_partial_result_set= FALSE;
}
- } while (!err_status && !thd->killed);
+ } while (!err_status && !thd->killed && !thd->is_fatal_error);
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
thd->profiling.start_new_query("tail end of routine");
#endif
@@ -1337,6 +1349,10 @@ sp_head::execute(THD *thd)
thd->stmt_arena= old_arena;
state= EXECUTED;
+ /* Restore the caller's original warning information area. */
+ saved_warning_info->merge_with_routine_info(thd, thd->warning_info);
+ thd->warning_info= saved_warning_info;
+
done:
DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d",
err_status, thd->killed, thd->is_slave_error,
@@ -1946,15 +1962,19 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
}
}
- /*
- Okay, got values for all arguments. Close tables that might be used by
- arguments evaluation. If arguments evaluation required prelocking mode,
+ /*
+ Okay, got values for all arguments. Close tables that might be used by
+ arguments evaluation. If arguments evaluation required prelocking mode,
we'll leave it here.
*/
if (!thd->in_sub_stmt)
{
thd->lex->unit.cleanup();
- close_thread_tables(thd);
+
+ thd_proc_info(thd, "closing tables");
+ close_thread_tables(thd);
+ thd_proc_info(thd, 0);
+
thd->rollback_item_tree_changes();
}
@@ -2027,6 +2047,16 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
err_status= TRUE;
break;
}
+
+ Send_field *out_param_info= new (thd->mem_root) Send_field();
+ nctx->get_item(i)->make_field(out_param_info);
+ out_param_info->db_name= m_db.str;
+ out_param_info->table_name= m_name.str;
+ out_param_info->org_table_name= m_name.str;
+ out_param_info->col_name= spvar->name.str;
+ out_param_info->org_col_name= spvar->name.str;
+
+ srp->set_out_param_info(out_param_info);
}
}
@@ -2362,7 +2392,8 @@ bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
bzero((char*) &tables,sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
- *full_access= (!check_table_access(thd, SELECT_ACL, &tables, 1, TRUE) ||
+ *full_access= (!check_table_access(thd, SELECT_ACL, &tables, FALSE,
+ 1, TRUE) ||
(!strcmp(sp->m_definer_user.str,
thd->security_ctx->priv_user) &&
!strcmp(sp->m_definer_host.str,
@@ -2445,7 +2476,7 @@ sp_head::show_create_routine(THD *thd, int type)
fields.push_back(new Item_empty_string("Database Collation",
MY_CS_NAME_SIZE));
- if (protocol->send_fields(&fields,
+ if (protocol->send_result_set_metadata(&fields,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
{
DBUG_RETURN(TRUE);
@@ -2537,7 +2568,8 @@ void sp_head::optimize()
else
{
if (src != dst)
- { // Move the instruction and update prev. jumps
+ {
+ /* Move the instruction and update prev. jumps */
sp_instr *ibp;
List_iterator_fast<sp_instr> li(bp);
@@ -2630,8 +2662,8 @@ sp_head::show_routine_code(THD *thd)
field_list.push_back(new Item_uint("Pos", 9));
// 1024 is for not to confuse old clients
field_list.push_back(new Item_empty_string("Instruction",
- max(buffer.length(), 1024)));
- if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
+ max(buffer.length(), 1024)));
+ if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS |
Protocol::SEND_EOF))
DBUG_RETURN(1);
@@ -2807,7 +2839,7 @@ int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables)
Check whenever we have access to tables for this statement
and open and lock them before executing instructions core function.
*/
- if (check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE)
+ if (check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)
|| open_and_lock_tables(thd, tables))
result= -1;
else
@@ -2843,7 +2875,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
query= thd->query();
query_length= thd->query_length();
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
/* This s-p instr is profilable and will be captured. */
thd->profiling.set_query_source(m_query.str, m_query.length);
#endif
@@ -2863,8 +2895,8 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
{
res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this);
- if (thd->main_da.is_eof())
- net_end_statement(thd);
+ if (thd->stmt_da->is_eof())
+ thd->protocol->end_statement();
query_cache_end_of_result(thd);
@@ -2877,7 +2909,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
thd->query_name_consts= 0;
if (!thd->is_error())
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
}
DBUG_RETURN(res || thd->is_error());
}
@@ -3253,7 +3285,7 @@ sp_instr_hpush_jump::execute(THD *thd, uint *nextp)
sp_cond_type_t *p;
while ((p= li++))
- thd->spcont->push_handler(p, m_ip+1, m_type, m_frame);
+ thd->spcont->push_handler(p, m_ip+1, m_type);
*nextp= m_dest;
DBUG_RETURN(0);
@@ -3820,7 +3852,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
for (uint i= 0 ; i < m_sptabs.records ; i++)
{
- tab= (SP_TABLE *)hash_element(&m_sptabs, i);
+ tab= (SP_TABLE*) my_hash_element(&m_sptabs, i);
tab->query_lock_count= 0;
}
@@ -3854,8 +3886,8 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
(and therefore should not be prelocked). Otherwise we will erroneously
treat table with same name but with different alias as non-temporary.
*/
- if ((tab= (SP_TABLE *)hash_search(&m_sptabs, (uchar *)tname, tlen)) ||
- ((tab= (SP_TABLE *)hash_search(&m_sptabs, (uchar *)tname,
+ if ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname, tlen)) ||
+ ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname,
tlen - alen - 1)) &&
tab->temp))
{
@@ -3941,7 +3973,7 @@ sp_head::add_used_tables_to_table_list(THD *thd,
{
char *tab_buff, *key_buff;
TABLE_LIST *table;
- SP_TABLE *stab= (SP_TABLE *)hash_element(&m_sptabs, i);
+ SP_TABLE *stab= (SP_TABLE*) my_hash_element(&m_sptabs, i);
if (stab->temp)
continue;
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 302faf3f681..31c307ebe74 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -51,7 +51,8 @@ sp_cond_check(LEX_STRING *sqlstate)
(c < 'A' || 'Z' < c))
return FALSE;
}
- if (strcmp(sqlstate->str, "00000") == 0)
+ /* SQLSTATE class '00' : completion condition */
+ if (strncmp(sqlstate->str, "00", 2) == 0)
return FALSE;
return TRUE;
}
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 3145ba2fea4..75e55880e60 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -71,7 +71,7 @@ typedef struct sp_label
typedef struct sp_cond_type
{
enum { number, state, warning, notfound, exception } type;
- char sqlstate[6];
+ char sqlstate[SQLSTATE_LENGTH+1];
uint mysqlerr;
} sp_cond_type_t;
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index be8f705a53e..d966de03b4e 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -32,7 +32,8 @@
sp_rcontext::sp_rcontext(sp_pcontext *root_parsing_ctx,
Field *return_value_fld,
sp_rcontext *prev_runtime_ctx)
- :m_root_parsing_ctx(root_parsing_ctx),
+ :end_partial_result_set(FALSE),
+ m_root_parsing_ctx(root_parsing_ctx),
m_var_table(0),
m_var_items(0),
m_return_value_fld(return_value_fld),
@@ -68,21 +69,28 @@ sp_rcontext::~sp_rcontext()
bool sp_rcontext::init(THD *thd)
{
+ uint handler_count= m_root_parsing_ctx->max_handler_index();
+ uint i;
+
in_sub_stmt= thd->in_sub_stmt;
if (init_var_table(thd) || init_var_items())
return TRUE;
+ if (!(m_raised_conditions= new (thd->mem_root) MYSQL_ERROR[handler_count]))
+ return TRUE;
+
+ for (i= 0; i<handler_count; i++)
+ m_raised_conditions[i].init(thd->mem_root);
+
return
!(m_handler=
- (sp_handler_t*)thd->alloc(m_root_parsing_ctx->max_handler_index() *
- sizeof(sp_handler_t))) ||
+ (sp_handler_t*)thd->alloc(handler_count * sizeof(sp_handler_t))) ||
!(m_hstack=
- (uint*)thd->alloc(m_root_parsing_ctx->max_handler_index() *
- sizeof(uint))) ||
+ (uint*)thd->alloc(handler_count * sizeof(uint))) ||
!(m_in_handler=
- (uint*)thd->alloc(m_root_parsing_ctx->max_handler_index() *
- sizeof(uint))) ||
+ (sp_active_handler_t*)thd->alloc(handler_count *
+ sizeof(sp_active_handler_t))) ||
!(m_cstack=
(sp_cursor**)thd->alloc(m_root_parsing_ctx->max_cursor_index() *
sizeof(sp_cursor*))) ||
@@ -194,13 +202,19 @@ sp_rcontext::set_return_value(THD *thd, Item **return_value_item)
*/
bool
-sp_rcontext::find_handler(THD *thd, uint sql_errno,
- MYSQL_ERROR::enum_warning_level level)
+sp_rcontext::find_handler(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
{
if (m_hfound >= 0)
- return 1; // Already got one
+ {
+ *cond_hdl= NULL;
+ return TRUE; // Already got one
+ }
- const char *sqlstate= mysql_errno_to_sqlstate(sql_errno);
int i= m_hcount, found= -1;
/*
@@ -220,7 +234,7 @@ sp_rcontext::find_handler(THD *thd, uint sql_errno,
/* Check active handlers, to avoid invoking one recursively */
while (j--)
- if (m_in_handler[j] == m_handler[i].handler)
+ if (m_in_handler[j].ip == m_handler[i].handler)
break;
if (j >= 0)
continue; // Already executing this handler
@@ -264,10 +278,26 @@ sp_rcontext::find_handler(THD *thd, uint sql_errno,
*/
if (m_prev_runtime_ctx && IS_EXCEPTION_CONDITION(sqlstate) &&
level == MYSQL_ERROR::WARN_LEVEL_ERROR)
- return m_prev_runtime_ctx->find_handler(thd, sql_errno, level);
+ return m_prev_runtime_ctx->find_handler(thd,
+ sql_errno,
+ sqlstate,
+ level,
+ msg,
+ cond_hdl);
+ *cond_hdl= NULL;
return FALSE;
}
+
m_hfound= found;
+
+ MYSQL_ERROR *raised= NULL;
+ DBUG_ASSERT(m_hfound >= 0);
+ DBUG_ASSERT((uint) m_hfound < m_root_parsing_ctx->max_handler_index());
+ raised= & m_raised_conditions[m_hfound];
+ raised->clear();
+ raised->set(sql_errno, sqlstate, level, msg);
+
+ *cond_hdl= raised;
return TRUE;
}
@@ -293,9 +323,12 @@ sp_rcontext::find_handler(THD *thd, uint sql_errno,
FALSE if no handler was found.
*/
bool
-sp_rcontext::handle_error(uint sql_errno,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
+sp_rcontext::handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
{
MYSQL_ERROR::enum_warning_level elevated_level= level;
@@ -308,7 +341,7 @@ sp_rcontext::handle_error(uint sql_errno,
elevated_level= MYSQL_ERROR::WARN_LEVEL_ERROR;
}
- return find_handler(thd, sql_errno, elevated_level);
+ return find_handler(thd, sql_errno, sqlstate, elevated_level, msg, cond_hdl);
}
void
@@ -335,7 +368,7 @@ sp_rcontext::pop_cursors(uint count)
}
void
-sp_rcontext::push_handler(struct sp_cond_type *cond, uint h, int type, uint f)
+sp_rcontext::push_handler(struct sp_cond_type *cond, uint h, int type)
{
DBUG_ENTER("sp_rcontext::push_handler");
DBUG_ASSERT(m_hcount < m_root_parsing_ctx->max_handler_index());
@@ -343,7 +376,6 @@ sp_rcontext::push_handler(struct sp_cond_type *cond, uint h, int type, uint f)
m_handler[m_hcount].cond= cond;
m_handler[m_hcount].handler= h;
m_handler[m_hcount].type= type;
- m_handler[m_hcount].foffset= f;
m_hcount+= 1;
DBUG_PRINT("info", ("m_hcount: %d", m_hcount));
@@ -382,11 +414,13 @@ sp_rcontext::pop_hstack()
}
void
-sp_rcontext::enter_handler(int hid)
+sp_rcontext::enter_handler(uint hip, uint hindex)
{
DBUG_ENTER("sp_rcontext::enter_handler");
DBUG_ASSERT(m_ihsp < m_root_parsing_ctx->max_handler_index());
- m_in_handler[m_ihsp++]= hid;
+ m_in_handler[m_ihsp].ip= hip;
+ m_in_handler[m_ihsp].index= hindex;
+ m_ihsp++;
DBUG_PRINT("info", ("m_ihsp: %d", m_ihsp));
DBUG_VOID_RETURN;
}
@@ -396,11 +430,29 @@ sp_rcontext::exit_handler()
{
DBUG_ENTER("sp_rcontext::exit_handler");
DBUG_ASSERT(m_ihsp);
+ uint hindex= m_in_handler[m_ihsp-1].index;
+ m_raised_conditions[hindex].clear();
m_ihsp-= 1;
DBUG_PRINT("info", ("m_ihsp: %d", m_ihsp));
DBUG_VOID_RETURN;
}
+MYSQL_ERROR*
+sp_rcontext::raised_condition() const
+{
+ if (m_ihsp > 0)
+ {
+ uint hindex= m_in_handler[m_ihsp - 1].index;
+ MYSQL_ERROR *raised= & m_raised_conditions[hindex];
+ return raised;
+ }
+
+ if (m_prev_runtime_ctx)
+ return m_prev_runtime_ctx->raised_condition();
+
+ return NULL;
+}
+
int
sp_rcontext::set_variable(THD *thd, uint var_idx, Item **value)
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 368a017da21..2af96cf64dd 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -34,12 +34,21 @@ class sp_instr_cpush;
typedef struct
{
+ /** Condition caught by this HANDLER. */
struct sp_cond_type *cond;
- uint handler; // Location of handler
+ /** Location (instruction pointer) of the handler code. */
+ uint handler;
+ /** Handler type (EXIT, CONTINUE). */
int type;
- uint foffset; // Frame offset for the handlers declare level
} sp_handler_t;
+typedef struct
+{
+ /** Instruction pointer of the active handler. */
+ uint ip;
+ /** Handler index of the active handler. */
+ uint index;
+} sp_active_handler_t;
/*
This class is a runtime context of a Stored Routine. It is used in an
@@ -75,6 +84,13 @@ class sp_rcontext : public Sql_alloc
*/
Query_arena *callers_arena;
+ /*
+ End a open result set before start executing a continue/exit
+ handler if one is found as otherwise the client will hang
+ due to a violation of the client/server protocol.
+ */
+ bool end_partial_result_set;
+
#ifndef DBUG_OFF
/*
The routine for which this runtime context is created. Used for checking
@@ -107,31 +123,41 @@ class sp_rcontext : public Sql_alloc
return m_return_value_set;
}
- void push_handler(struct sp_cond_type *cond, uint h, int type, uint f);
+ void push_handler(struct sp_cond_type *cond, uint h, int type);
void pop_handlers(uint count);
// Returns 1 if a handler was found, 0 otherwise.
bool
- find_handler(THD *thd, uint sql_errno,MYSQL_ERROR::enum_warning_level level);
+ find_handler(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
// If there is an error handler for this error, handle it and return TRUE.
bool
- handle_error(uint sql_errno,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
// Returns handler type and sets *ip to location if one was found
inline int
- found_handler(uint *ip, uint *fp)
+ found_handler(uint *ip, uint *index)
{
if (m_hfound < 0)
return SP_HANDLER_NONE;
*ip= m_handler[m_hfound].handler;
- *fp= m_handler[m_hfound].foffset;
+ *index= m_hfound;
return m_handler[m_hfound].type;
}
+ MYSQL_ERROR* raised_condition() const;
+
// Returns true if we found a handler in this context
inline bool
found_handler_here()
@@ -150,7 +176,12 @@ class sp_rcontext : public Sql_alloc
uint pop_hstack();
- void enter_handler(int hid);
+ /**
+ Enter a SQL exception handler.
+ @param hip the handler instruction pointer
+ @param index the handler index
+ */
+ void enter_handler(uint hip, uint index);
void exit_handler();
@@ -214,10 +245,18 @@ private:
bool in_sub_stmt;
sp_handler_t *m_handler; // Visible handlers
+
+ /**
+ SQL conditions caught by each handler.
+ This is an array indexed by handler index.
+ */
+ MYSQL_ERROR *m_raised_conditions;
+
uint m_hcount; // Stack pointer for m_handler
uint *m_hstack; // Return stack for continue handlers
uint m_hsp; // Stack pointer for m_hstack
- uint *m_in_handler; // Active handler, for recursion check
+ /** Active handler stack. */
+ sp_active_handler_t *m_in_handler;
uint m_ihsp; // Stack pointer for m_in_handler
int m_hfound; // Set by find_handler; -1 if not found
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 77c72066429..8eb429e9ffc 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -262,8 +262,8 @@ my_bool acl_init(bool dont_read_acl_tables)
DBUG_ENTER("acl_init");
acl_cache= new hash_filo(ACL_CACHE_SIZE, 0, 0,
- (hash_get_key) acl_entry_get_key,
- (hash_free_key) free,
+ (my_hash_get_key) acl_entry_get_key,
+ (my_hash_free_key) free,
&my_charset_utf8_bin);
if (dont_read_acl_tables)
{
@@ -638,7 +638,7 @@ void acl_free(bool end)
delete_dynamic(&acl_users);
delete_dynamic(&acl_dbs);
delete_dynamic(&acl_wild_hosts);
- hash_free(&acl_check_hosts);
+ my_hash_free(&acl_check_hosts);
if (!end)
acl_cache->clear(1); /* purecov: inspected */
else
@@ -702,7 +702,7 @@ my_bool acl_reload(THD *thd)
if (simple_open_n_lock_tables(thd, tables))
{
sql_print_error("Fatal error: Can't open and lock privilege tables: %s",
- thd->main_da.message());
+ thd->stmt_da->message());
goto end;
}
@@ -714,7 +714,7 @@ my_bool acl_reload(THD *thd)
old_acl_dbs=acl_dbs;
old_mem=mem;
delete_dynamic(&acl_wild_hosts);
- hash_free(&acl_check_hosts);
+ my_hash_free(&acl_check_hosts);
if ((return_val= acl_load(thd, tables)))
{ // Error. Revert to old list
@@ -1429,8 +1429,8 @@ static void init_check_host(void)
DBUG_ENTER("init_check_host");
VOID(my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip),
acl_users.elements,1));
- VOID(hash_init(&acl_check_hosts,system_charset_info,acl_users.elements,0,0,
- (hash_get_key) check_get_key,0,0));
+ VOID(my_hash_init(&acl_check_hosts,system_charset_info,acl_users.elements,0,0,
+ (my_hash_get_key) check_get_key,0,0));
if (!allow_all_hosts)
{
for (uint i=0 ; i < acl_users.elements ; i++)
@@ -1452,8 +1452,9 @@ static void init_check_host(void)
if (j == acl_wild_hosts.elements) // If new
(void) push_dynamic(&acl_wild_hosts,(uchar*) &acl_user->host);
}
- else if (!hash_search(&acl_check_hosts,(uchar*) acl_user->host.hostname,
- strlen(acl_user->host.hostname)))
+ else if (!my_hash_search(&acl_check_hosts,(uchar*)
+ acl_user->host.hostname,
+ strlen(acl_user->host.hostname)))
{
if (my_hash_insert(&acl_check_hosts,(uchar*) acl_user))
{ // End of memory
@@ -1480,7 +1481,7 @@ static void init_check_host(void)
void rebuild_check_host(void)
{
delete_dynamic(&acl_wild_hosts);
- hash_free(&acl_check_hosts);
+ my_hash_free(&acl_check_hosts);
init_check_host();
}
@@ -1493,8 +1494,8 @@ bool acl_check_host(const char *host, const char *ip)
return 0;
VOID(pthread_mutex_lock(&acl_cache->lock));
- if ((host && hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) ||
- (ip && hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip))))
+ if ((host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) ||
+ (ip && my_hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip))))
{
VOID(pthread_mutex_unlock(&acl_cache->lock));
return 0; // Found host
@@ -1879,7 +1880,7 @@ static bool test_if_create_new_users(THD *thd)
sctx->priv_user, tl.db, 0);
if (!(db_access & INSERT_ACL))
{
- if (check_grant(thd, INSERT_ACL, &tl, 0, UINT_MAX, 1))
+ if (check_grant(thd, INSERT_ACL, &tl, FALSE, UINT_MAX, TRUE))
create_new_users=0;
}
}
@@ -2311,8 +2312,8 @@ GRANT_TABLE::GRANT_TABLE(const char *h, const char *d,const char *u,
const char *t, ulong p, ulong c)
:GRANT_NAME(h,d,u,t,p, FALSE), cols(c)
{
- (void) hash_init2(&hash_columns,4,system_charset_info,
- 0,0,0, (hash_get_key) get_key_column,0,0);
+ (void) my_hash_init2(&hash_columns,4,system_charset_info,
+ 0,0,0, (my_hash_get_key) get_key_column,0,0);
}
@@ -2355,15 +2356,15 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
if (!db || !tname)
{
/* Wrong table row; Ignore it */
- hash_clear(&hash_columns); /* allow for destruction */
+ my_hash_clear(&hash_columns); /* allow for destruction */
cols= 0;
return;
}
cols= (ulong) form->field[7]->val_int();
cols = fix_rights_for_column(cols);
- (void) hash_init2(&hash_columns,4,system_charset_info,
- 0,0,0, (hash_get_key) get_key_column,0,0);
+ (void) my_hash_init2(&hash_columns,4,system_charset_info,
+ 0,0,0, (my_hash_get_key) get_key_column,0,0);
if (cols)
{
uint key_prefix_len;
@@ -2420,7 +2421,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
GRANT_TABLE::~GRANT_TABLE()
{
- hash_free(&hash_columns);
+ my_hash_free(&hash_columns);
}
@@ -2434,7 +2435,7 @@ static uchar* get_grant_table(GRANT_NAME *buff, size_t *length,
void free_grant_table(GRANT_TABLE *grant_table)
{
- hash_free(&grant_table->hash_columns);
+ my_hash_free(&grant_table->hash_columns);
}
@@ -2455,11 +2456,11 @@ static GRANT_NAME *name_hash_search(HASH *name_hash,
len = (uint) (strmov(name_ptr, tname) - helping) + 1;
if (name_tolower)
my_casedn_str(files_charset_info, name_ptr);
- for (grant_name= (GRANT_NAME*) hash_first(name_hash, (uchar*) helping,
- len, &state);
+ for (grant_name= (GRANT_NAME*) my_hash_first(name_hash, (uchar*) helping,
+ len, &state);
grant_name ;
- grant_name= (GRANT_NAME*) hash_next(name_hash,(uchar*) helping,
- len, &state))
+ grant_name= (GRANT_NAME*) my_hash_next(name_hash,(uchar*) helping,
+ len, &state))
{
if (exact)
{
@@ -2503,7 +2504,8 @@ table_hash_search(const char *host, const char *ip, const char *db,
inline GRANT_COLUMN *
column_hash_search(GRANT_TABLE *t, const char *cname, uint length)
{
- return (GRANT_COLUMN*) hash_search(&t->hash_columns, (uchar*) cname,length);
+ return (GRANT_COLUMN*) my_hash_search(&t->hash_columns,
+ (uchar*) cname, length);
}
@@ -2687,7 +2689,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
goto end; /* purecov: deadcode */
}
if (grant_column)
- hash_delete(&g_t->hash_columns,(uchar*) grant_column);
+ my_hash_delete(&g_t->hash_columns,(uchar*) grant_column);
}
}
} while (!table->file->index_next(table->record[0]) &&
@@ -2813,7 +2815,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
}
else
{
- hash_delete(&column_priv_hash,(uchar*) grant_table);
+ my_hash_delete(&column_priv_hash,(uchar*) grant_table);
}
DBUG_RETURN(0);
@@ -2934,7 +2936,8 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
}
else
{
- hash_delete(is_proc ? &proc_priv_hash : &func_priv_hash,(uchar*) grant_name);
+ my_hash_delete(is_proc ? &proc_priv_hash : &func_priv_hash,(uchar*)
+ grant_name);
}
DBUG_RETURN(0);
@@ -3175,8 +3178,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
column_priv= 0;
for (uint idx=0 ; idx < grant_table->hash_columns.records ; idx++)
{
- grant_column= (GRANT_COLUMN*) hash_element(&grant_table->hash_columns,
- idx);
+ grant_column= (GRANT_COLUMN*)
+ my_hash_element(&grant_table->hash_columns, idx);
grant_column->rights&= ~rights; // Fix other columns
column_priv|= grant_column->rights;
}
@@ -3515,9 +3518,9 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
void grant_free(void)
{
DBUG_ENTER("grant_free");
- hash_free(&column_priv_hash);
- hash_free(&proc_priv_hash);
- hash_free(&func_priv_hash);
+ my_hash_free(&column_priv_hash);
+ my_hash_free(&proc_priv_hash);
+ my_hash_free(&func_priv_hash);
free_root(&memex,MYF(0));
DBUG_VOID_RETURN;
}
@@ -3574,12 +3577,12 @@ static my_bool grant_load_procs_priv(TABLE *p_table)
MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**,
THR_MALLOC);
DBUG_ENTER("grant_load_procs_priv");
- (void) hash_init(&proc_priv_hash, &my_charset_utf8_bin,
- 0,0,0, (hash_get_key) get_grant_table,
- 0,0);
- (void) hash_init(&func_priv_hash, &my_charset_utf8_bin,
- 0,0,0, (hash_get_key) get_grant_table,
- 0,0);
+ (void) my_hash_init(&proc_priv_hash, &my_charset_utf8_bin,
+ 0,0,0, (my_hash_get_key) get_grant_table,
+ 0,0);
+ (void) my_hash_init(&func_priv_hash, &my_charset_utf8_bin,
+ 0,0,0, (my_hash_get_key) get_grant_table,
+ 0,0);
p_table->file->ha_index_init(0, 1);
p_table->use_all_columns();
@@ -3675,9 +3678,9 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables)
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
- (void) hash_init(&column_priv_hash, &my_charset_utf8_bin,
- 0,0,0, (hash_get_key) get_grant_table,
- (hash_free_key) free_grant_table,0);
+ (void) my_hash_init(&column_priv_hash, &my_charset_utf8_bin,
+ 0,0,0, (my_hash_get_key) get_grant_table,
+ (my_hash_free_key) free_grant_table,0);
t_table = tables[0].table;
c_table = tables[1].table;
@@ -3780,8 +3783,8 @@ static my_bool grant_reload_procs_priv(THD *thd)
}
else
{
- hash_free(&old_proc_priv_hash);
- hash_free(&old_func_priv_hash);
+ my_hash_free(&old_proc_priv_hash);
+ my_hash_free(&old_func_priv_hash);
}
rw_unlock(&LOCK_grant);
@@ -3850,7 +3853,7 @@ my_bool grant_reload(THD *thd)
}
else
{
- hash_free(&old_column_priv_hash);
+ my_hash_free(&old_column_priv_hash);
free_root(&old_mem,MYF(0));
}
rw_unlock(&LOCK_grant);
@@ -3871,40 +3874,52 @@ end:
DBUG_RETURN(return_val);
}
-/****************************************************************************
- Check table level grants
- SYNOPSIS
- bool check_grant()
- thd Thread handler
- want_access Bits of privileges user needs to have
- tables List of tables to check. The user should have 'want_access'
- to all tables in list.
- show_table <> 0 if we are in show table. In this case it's enough to have
- any privilege for the table
- number Check at most this number of tables.
- no_errors If 0 then we write an error. The error is sent directly to
- the client
+/**
+ @brief Check table level grants
- RETURN
- 0 ok
- 1 Error: User did not have the requested privileges
+ @param thd Thread handler
+ @param want_access Bits of privileges user needs to have.
+ @param tables List of tables to check. The user should have
+ 'want_access' to all tables in list.
+ @param any_combination_will_do TRUE if it's enough to have any privilege for
+ any combination of the table columns.
+ @param number Check at most this number of tables.
+ @param no_errors TRUE if no error should be sent directly to the client.
- NOTE
- This functions assumes that either number of tables to be inspected
+ If table->grant.want_privilege != 0 then the requested privileges where
+ in the set of COL_ACLS but access was not granted on the table level. As
+ a consequence an extra check of column privileges is required.
+
+ Specifically if this function returns FALSE the user has some kind of
+ privilege on a combination of columns in each table.
+
+ This function is usually preceeded by check_access which establish the
+ User-, Db- and Host access rights.
+
+ @see check_access
+ @see check_table_access
+
+ @note This functions assumes that either number of tables to be inspected
by it is limited explicitly (i.e. is is not UINT_MAX) or table list
used and thd->lex->query_tables_own_last value correspond to each
other (the latter should be either 0 or point to next_global member
of one of elements of this table list).
-****************************************************************************/
+
+ @return Access status
+ @retval FALSE Access granted; But column privileges might need to be
+ checked.
+ @retval TRUE The user did not have the requested privileges on any of the
+ tables.
+
+*/
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
- uint show_table, uint number, bool no_errors)
+ bool any_combination_will_do, uint number, bool no_errors)
{
TABLE_LIST *table, *first_not_own_table= thd->lex->first_not_own_table();
Security_context *sctx= thd->security_ctx;
uint i;
- ulong orig_want_access= want_access;
DBUG_ENTER("check_grant");
DBUG_ASSERT(number > 0);
@@ -3922,7 +3937,10 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
i < number && table != first_not_own_table;
table= table->next_global, i++)
{
- /* Remove SHOW_VIEW_ACL, because it will be checked during making view */
+ /*
+ Save a copy of the privileges without the SHOW_VIEW_ACL attribute.
+ It will be checked during making view.
+ */
table->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
}
@@ -3935,7 +3953,6 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
sctx = test(table->security_ctx) ?
table->security_ctx : thd->security_ctx;
- want_access= orig_want_access;
want_access&= ~sctx->master_access;
if (!want_access)
continue; // ok
@@ -3965,8 +3982,13 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
want_access &= ~table->grant.privilege;
goto err; // No grants
}
- if (show_table)
- continue; // We have some priv on this
+
+ /*
+ For SHOW COLUMNS, SHOW INDEX it is enough to have some
+ privileges on any column combination on the table.
+ */
+ if (any_combination_will_do)
+ continue;
table->grant.grant_table=grant_table; // Remember for column test
table->grant.version=grant_version;
@@ -3984,7 +4006,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
}
}
rw_unlock(&LOCK_grant);
- DBUG_RETURN(0);
+ DBUG_RETURN(FALSE);
err:
rw_unlock(&LOCK_grant);
@@ -3998,7 +4020,97 @@ err:
sctx->host_or_ip,
table ? table->get_table_name() : "unknown");
}
- DBUG_RETURN(1);
+ DBUG_RETURN(TRUE);
+}
+
+
+/**
+ Check if all tables in the table list has any of the requested table level
+ privileges matching the current user.
+
+ @param thd A pointer to the thread context.
+ @param required_access Set of privileges to compare against.
+ @param tables[in,out] A list of tables to be checked.
+
+ @note If the table grant hash contains any grant table, this table will be
+ attached to the corresponding TABLE_LIST object in 'tables'.
+
+ @return
+ @retval TRUE There is a privilege on the table level granted to the
+ current user.
+ @retval FALSE There are no privileges on the table level granted to the
+ current user.
+*/
+
+bool has_any_table_level_privileges(THD *thd, ulong required_access,
+ TABLE_LIST *tables)
+{
+
+ Security_context *sctx;
+ GRANT_TABLE *grant_table;
+ TABLE_LIST *table;
+
+ /* For each table in tables */
+ for (table= tables; table; table= table->next_global)
+ {
+ /*
+ If this table is a VIEW, then it will supply its own security context.
+ This is because VIEWs can have a DEFINER or an INVOKER security role.
+ */
+ sctx= table->security_ctx ? table->security_ctx : thd->security_ctx;
+
+ /*
+ Get privileges from table_priv and column_priv tables by searching
+ the cache.
+ */
+ rw_rdlock(&LOCK_grant);
+ grant_table= table_hash_search(sctx->host, sctx->ip,
+ table->db, sctx->priv_user,
+ table->table_name,0);
+ rw_unlock(&LOCK_grant);
+
+ /* Stop if there are no grants for the current user */
+ if (!grant_table)
+ return FALSE;
+
+ /*
+ Save a pointer to the found grant_table in the table object.
+ This pointer can later be used to verify other access requirements
+ without having to look up the grant table in the hash.
+ */
+ table->grant.grant_table= grant_table;
+ table->grant.version= grant_version;
+ table->grant.privilege|= grant_table->privs;
+ /*
+ Save all privileges which might be subject to column privileges
+ but not which aren't yet granted by table level ACLs.
+ This is can later be used for column privilege checks.
+ */
+ table->grant.want_privilege= ((required_access & COL_ACLS)
+ & ~table->grant.privilege);
+
+ /*
+ If the requested privileges share any intersection with the current
+ table privileges we have found at least one common privilege on the
+ table level.
+ */
+ if (grant_table->privs & required_access)
+ continue; /* Check next table */
+
+ /*
+ There are no table level privileges which satisfies any of the
+ requested privileges. There might still be column privileges which
+ does though.
+ */
+ return FALSE;
+ }
+
+ /*
+ All tables in TABLE_LIST satisfy the requirement of having any
+ privilege on the table level.
+ */
+
+ return TRUE;
}
@@ -4245,7 +4357,7 @@ static bool check_grant_db_routine(THD *thd, const char *db, HASH *hash)
for (uint idx= 0; idx < hash->records; ++idx)
{
- GRANT_NAME *item= (GRANT_NAME*) hash_element(hash, idx);
+ GRANT_NAME *item= (GRANT_NAME*) my_hash_element(hash, idx);
if (strcmp(item->user, sctx->priv_user) == 0 &&
strcmp(item->db, db) == 0 &&
@@ -4278,8 +4390,9 @@ bool check_grant_db(THD *thd,const char *db)
for (uint idx=0 ; idx < column_priv_hash.records ; idx++)
{
- GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
- idx);
+ GRANT_TABLE *grant_table= (GRANT_TABLE*)
+ my_hash_element(&column_priv_hash,
+ idx);
if (len < grant_table->key_length &&
!memcmp(grant_table->hash_key,helping,len) &&
compare_hostname(&grant_table->host, sctx->host, sctx->ip))
@@ -4502,13 +4615,13 @@ static const char *command_array[]=
"ALTER", "SHOW DATABASES", "SUPER", "CREATE TEMPORARY TABLES",
"LOCK TABLES", "EXECUTE", "REPLICATION SLAVE", "REPLICATION CLIENT",
"CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE", "ALTER ROUTINE",
- "CREATE USER", "EVENT", "TRIGGER"
+ "CREATE USER", "EVENT", "TRIGGER", "CREATE TABLESPACE"
};
static uint command_lengths[]=
{
6, 6, 6, 6, 6, 4, 6, 8, 7, 4, 5, 10, 5, 5, 14, 5, 23, 11, 7, 17, 18, 11, 9,
- 14, 13, 11, 5, 7
+ 14, 13, 11, 5, 7, 17
};
@@ -4563,7 +4676,7 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
strxmov(buff,"Grants for ",lex_user->user.str,"@",
lex_user->host.str,NullS);
field_list.push_back(field);
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
{
VOID(pthread_mutex_unlock(&acl_cache->lock));
@@ -4751,8 +4864,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
for (index=0 ; index < column_priv_hash.records ; index++)
{
const char *user, *host;
- GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
- index);
+ GRANT_TABLE *grant_table= (GRANT_TABLE*)
+ my_hash_element(&column_priv_hash, index);
if (!(user=grant_table->user))
user= "";
@@ -4805,7 +4918,7 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
col_index++)
{
GRANT_COLUMN *grant_column = (GRANT_COLUMN*)
- hash_element(&grant_table->hash_columns,col_index);
+ my_hash_element(&grant_table->hash_columns,col_index);
if (grant_column->rights & j)
{
if (!found_col)
@@ -4895,7 +5008,7 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash,
for (index=0 ; index < hash->records ; index++)
{
const char *user, *host;
- GRANT_NAME *grant_proc= (GRANT_NAME*) hash_element(hash, index);
+ GRANT_NAME *grant_proc= (GRANT_NAME*) my_hash_element(hash, index);
if (!(user=grant_proc->user))
user= "";
@@ -5408,13 +5521,13 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
- grant_name= (GRANT_NAME*) hash_element(&column_priv_hash, idx);
+ grant_name= (GRANT_NAME*) my_hash_element(&column_priv_hash, idx);
user= grant_name->user;
host= grant_name->host.hostname;
break;
case 3:
- grant_name= (GRANT_NAME*) hash_element(&proc_priv_hash, idx);
+ grant_name= (GRANT_NAME*) my_hash_element(&proc_priv_hash, idx);
user= grant_name->user;
host= grant_name->host.hostname;
break;
@@ -5447,11 +5560,11 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
- hash_delete(&column_priv_hash, (uchar*) grant_name);
+ my_hash_delete(&column_priv_hash, (uchar*) grant_name);
break;
case 3:
- hash_delete(&proc_priv_hash, (uchar*) grant_name);
+ my_hash_delete(&proc_priv_hash, (uchar*) grant_name);
break;
}
elements--;
@@ -5485,8 +5598,8 @@ static int handle_grant_struct(uint struct_no, bool drop,
is renamed, the hash key is changed. Update the hash to
ensure that the position matches the new hash key value
*/
- hash_update(&column_priv_hash, (uchar*) grant_name,
- (uchar*) grant_name->hash_key, grant_name->key_length);
+ my_hash_update(&column_priv_hash, (uchar*) grant_name,
+ (uchar*) grant_name->hash_key, grant_name->key_length);
break;
}
}
@@ -5977,8 +6090,8 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
for (counter= 0, revoked= 0 ; counter < column_priv_hash.records ; )
{
const char *user,*host;
- GRANT_TABLE *grant_table= (GRANT_TABLE*)hash_element(&column_priv_hash,
- counter);
+ GRANT_TABLE *grant_table=
+ (GRANT_TABLE*) my_hash_element(&column_priv_hash, counter);
if (!(user=grant_table->user))
user= "";
if (!(host=grant_table->host.hostname))
@@ -6024,7 +6137,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
for (counter= 0, revoked= 0 ; counter < hash->records ; )
{
const char *user,*host;
- GRANT_NAME *grant_proc= (GRANT_NAME*) hash_element(hash, counter);
+ GRANT_NAME *grant_proc= (GRANT_NAME*) my_hash_element(hash, counter);
if (!(user=grant_proc->user))
user= "";
if (!(host=grant_proc->host.hostname))
@@ -6083,9 +6196,12 @@ public:
virtual ~Silence_routine_definer_errors()
{}
- virtual bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
bool has_errors() { return is_grave; }
@@ -6094,18 +6210,23 @@ private:
};
bool
-Silence_routine_definer_errors::handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
+Silence_routine_definer_errors::handle_condition(
+ THD *thd,
+ uint sql_errno,
+ const char*,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
{
+ *cond_hdl= NULL;
if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
{
switch (sql_errno)
{
case ER_NONEXISTING_PROC_GRANT:
/* Convert the error into a warning. */
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, sql_errno, message);
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ sql_errno, msg);
return TRUE;
default:
is_grave= TRUE;
@@ -6164,7 +6285,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
{
for (counter= 0, revoked= 0 ; counter < hash->records ; )
{
- GRANT_NAME *grant_proc= (GRANT_NAME*) hash_element(hash, counter);
+ GRANT_NAME *grant_proc= (GRANT_NAME*) my_hash_element(hash, counter);
if (!my_strcasecmp(&my_charset_utf8_bin, grant_proc->db, sp_db) &&
!my_strcasecmp(system_charset_info, grant_proc->tname, sp_name))
{
@@ -6374,6 +6495,7 @@ static bool update_schema_privilege(THD *thd, TABLE *table, char *buff,
CHARSET_INFO *cs= system_charset_info;
restore_record(table, s->default_values);
table->field[0]->store(buff, (uint) strlen(buff), cs);
+ table->field[1]->store(STRING_WITH_LEN("def"), cs);
if (db)
table->field[i++]->store(db, (uint) strlen(db), cs);
if (t_name)
@@ -6554,7 +6676,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (index=0 ; index < column_priv_hash.records ; index++)
{
const char *user, *host, *is_grantable= "YES";
- GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
+ GRANT_TABLE *grant_table= (GRANT_TABLE*) my_hash_element(&column_priv_hash,
index);
if (!(user=grant_table->user))
user= "";
@@ -6637,7 +6759,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (index=0 ; index < column_priv_hash.records ; index++)
{
const char *user, *host, *is_grantable= "YES";
- GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
+ GRANT_TABLE *grant_table= (GRANT_TABLE*) my_hash_element(&column_priv_hash,
index);
if (!(user=grant_table->user))
user= "";
@@ -6672,7 +6794,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
col_index++)
{
GRANT_COLUMN *grant_column = (GRANT_COLUMN*)
- hash_element(&grant_table->hash_columns,col_index);
+ my_hash_element(&grant_table->hash_columns,col_index);
if ((grant_column->rights & j) && (table_access & j))
{
if (update_schema_privilege(thd, table, buff, grant_table->db,
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 4c835e2718c..25a4766e58c 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -1,3 +1,6 @@
+#ifndef SQL_ACL_INCLUDED
+#define SQL_ACL_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -43,6 +46,7 @@
#define CREATE_USER_ACL (1L << 25)
#define EVENT_ACL (1L << 26)
#define TRIGGER_ACL (1L << 27)
+#define CREATE_TABLESPACE_ACL (1L << 28)
/*
don't forget to update
1. static struct show_privileges_st sys_privileges[]
@@ -51,7 +55,6 @@
4. acl_init() or whatever - to define behaviour for old privilege tables
5. sql_yacc.yy - for GRANT/REVOKE to work
*/
-#define EXTRA_ACL (1L << 29)
#define NO_ACCESS (1L << 30)
#define DB_ACLS \
(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
@@ -79,11 +82,17 @@
REFERENCES_ACL | INDEX_ACL | ALTER_ACL | SHOW_DB_ACL | SUPER_ACL | \
CREATE_TMP_ACL | LOCK_TABLES_ACL | REPL_SLAVE_ACL | REPL_CLIENT_ACL | \
EXECUTE_ACL | CREATE_VIEW_ACL | SHOW_VIEW_ACL | CREATE_PROC_ACL | \
- ALTER_PROC_ACL | CREATE_USER_ACL | EVENT_ACL | TRIGGER_ACL)
+ ALTER_PROC_ACL | CREATE_USER_ACL | EVENT_ACL | TRIGGER_ACL | \
+ CREATE_TABLESPACE_ACL)
#define DEFAULT_CREATE_PROC_ACLS \
(ALTER_PROC_ACL | EXECUTE_ACL)
+#define SHOW_CREATE_TABLE_ACLS \
+(SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL | \
+ CREATE_ACL | DROP_ACL | ALTER_ACL | INDEX_ACL | \
+ TRIGGER_ACL | REFERENCES_ACL | GRANT_ACL | CREATE_VIEW_ACL | SHOW_VIEW_ACL)
+
/*
Defines to change the above bits to how things are stored in tables
This is needed as the 'host' and 'db' table is missing a few privileges
@@ -237,7 +246,7 @@ my_bool grant_init();
void grant_free(void);
my_bool grant_reload(THD *thd);
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
- uint show_command, uint number, bool dont_print_error);
+ bool any_combination_will_do, uint number, bool no_errors);
bool check_grant_column (THD *thd, GRANT_INFO *grant,
const char *db_name, const char *table_name,
const char *name, uint length, Security_context *sctx);
@@ -268,7 +277,12 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
bool is_proc);
bool is_acl_user(const char *host, const char *user);
+bool has_any_table_level_privileges(THD *thd, ulong required_access,
+ TABLE_LIST *tables);
+
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#define check_grant(A,B,C,D,E,F) 0
#define check_grant_db(A,B) 0
+#define has_any_table_level_privileges(A,B,C) 0
#endif
+#endif /* SQL_ACL_INCLUDED */
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 8807b40857e..8f52b90c874 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -1,3 +1,6 @@
+#ifndef SQL_ANALYSE_INCLUDED
+#define SQL_ANALYSE_INCLUDED
+
/* Copyright (C) 2000-2003, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -355,3 +358,5 @@ public:
select_result *result,
List<Item> &field_list);
};
+
+#endif /* SQL_ANALYSE_INCLUDED */
diff --git a/sql/sql_array.h b/sql/sql_array.h
index e1b22921519..dfaa9b02947 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -1,3 +1,6 @@
+#ifndef SQL_ARRAY_INCLUDED
+#define SQL_ARRAY_INCLUDED
+
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -66,3 +69,4 @@ public:
}
};
+#endif /* SQL_ARRAY_INCLUDED */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index cf8a0b32764..a285f63dcb7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -22,6 +22,7 @@
#include "sp_head.h"
#include "sp.h"
#include "sql_trigger.h"
+#include "sql_prepare.h"
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
@@ -46,9 +47,12 @@ public:
virtual ~Prelock_error_handler() {}
- virtual bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
bool safely_trapped_errors();
@@ -59,11 +63,14 @@ private:
bool
-Prelock_error_handler::handle_error(uint sql_errno,
- const char * /* message */,
- MYSQL_ERROR::enum_warning_level /* level */,
- THD * /* thd */)
+Prelock_error_handler::handle_condition(THD *,
+ uint sql_errno,
+ const char*,
+ MYSQL_ERROR::enum_warning_level,
+ const char*,
+ MYSQL_ERROR ** cond_hdl)
{
+ *cond_hdl= NULL;
if (sql_errno == ER_NO_SUCH_TABLE)
{
m_handled_errors++;
@@ -122,9 +129,9 @@ extern "C" uchar *table_cache_key(const uchar *record, size_t *length,
bool table_cache_init(void)
{
- return hash_init(&open_cache, &my_charset_bin, table_cache_size+16,
- 0, 0, table_cache_key,
- (hash_free_key) free_cache_entry, 0) != 0;
+ return my_hash_init(&open_cache, &my_charset_bin, table_cache_size+16,
+ 0, 0, table_cache_key,
+ (my_hash_free_key) free_cache_entry, 0) != 0;
}
void table_cache_free(void)
@@ -134,7 +141,7 @@ void table_cache_free(void)
{
close_cached_tables(NULL, NULL, FALSE, FALSE, FALSE);
if (!open_cache.records) // Safety first
- hash_free(&open_cache);
+ my_hash_free(&open_cache);
}
DBUG_VOID_RETURN;
}
@@ -169,7 +176,7 @@ static void check_unused(void)
}
for (idx=0 ; idx < open_cache.records ; idx++)
{
- TABLE *entry=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *entry=(TABLE*) my_hash_element(&open_cache,idx);
if (!entry->in_use)
count--;
if (entry->file)
@@ -282,9 +289,9 @@ bool table_def_init(void)
oldest_unused_share= &end_of_unused_share;
end_of_unused_share.prev= &oldest_unused_share;
- return hash_init(&table_def_cache, &my_charset_bin, table_def_size,
- 0, 0, table_def_key,
- (hash_free_key) table_def_free_entry, 0) != 0;
+ return my_hash_init(&table_def_cache, &my_charset_bin, table_def_size,
+ 0, 0, table_def_key,
+ (my_hash_free_key) table_def_free_entry, 0) != 0;
}
@@ -295,7 +302,7 @@ void table_def_free(void)
{
table_def_inited= 0;
pthread_mutex_destroy(&LOCK_table_share);
- hash_free(&table_def_cache);
+ my_hash_free(&table_def_cache);
}
DBUG_VOID_RETURN;
}
@@ -341,8 +348,8 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
*error= 0;
/* Read table definition from cache */
- if ((share= (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key,
- key_length)))
+ if ((share= (TABLE_SHARE*) my_hash_search(&table_def_cache,(uchar*) key,
+ key_length)))
goto found;
if (!(share= alloc_table_share(table_list, key, key_length)))
@@ -379,7 +386,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
if (open_table_def(thd, share, db_flags))
{
*error= share->error;
- (void) hash_delete(&table_def_cache, (uchar*) share);
+ (void) my_hash_delete(&table_def_cache, (uchar*) share);
DBUG_RETURN(0);
}
share->ref_count++; // Mark in use
@@ -431,7 +438,7 @@ found:
oldest_unused_share->next)
{
pthread_mutex_lock(&oldest_unused_share->mutex);
- VOID(hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
+ VOID(my_hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
}
DBUG_PRINT("exit", ("share: 0x%lx ref_count: %u",
@@ -475,7 +482,7 @@ static TABLE_SHARE
@todo Rework alternative ways to deal with ER_NO_SUCH TABLE.
*/
- if (share || (thd->is_error() && thd->main_da.sql_errno() != ER_NO_SUCH_TABLE))
+ if (share || (thd->is_error() && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE))
DBUG_RETURN(share);
@@ -522,7 +529,7 @@ static TABLE_SHARE
DBUG_RETURN(0);
}
/* Table existed in engine. Let's open it */
- mysql_reset_errors(thd, 1); // Clear warnings
+ thd->warning_info->clear_warning_info(thd->query_id);
thd->clear_error(); // Clear error message
DBUG_RETURN(get_table_share(thd, table_list, key, key_length,
db_flags, error));
@@ -586,7 +593,7 @@ void release_table_share(TABLE_SHARE *share, enum release_type type)
if (to_be_deleted)
{
DBUG_PRINT("info", ("Deleting share"));
- hash_delete(&table_def_cache, (uchar*) share);
+ my_hash_delete(&table_def_cache, (uchar*) share);
DBUG_VOID_RETURN;
}
pthread_mutex_unlock(&share->mutex);
@@ -617,7 +624,8 @@ TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name)
table_list.db= (char*) db;
table_list.table_name= (char*) table_name;
key_length= create_table_def_key((THD*) 0, key, &table_list, 0);
- return (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key, key_length);
+ return (TABLE_SHARE*) my_hash_search(&table_def_cache,
+ (uchar*) key, key_length);
}
@@ -714,7 +722,7 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild)
for (uint idx=0 ; result == 0 && idx < open_cache.records; idx++)
{
OPEN_TABLE_LIST *table;
- TABLE *entry=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *entry=(TABLE*) my_hash_element(&open_cache,idx);
TABLE_SHARE *share= entry->s;
if (db && my_strcasecmp(system_charset_info, db, share->db.str))
@@ -727,7 +735,7 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild)
table_list.table_name= share->table_name.str;
table_list.grant.privilege=0;
- if (check_table_access(thd,SELECT_ACL | EXTRA_ACL,&table_list, 1, TRUE))
+ if (check_table_access(thd,SELECT_ACL,&table_list, TRUE, 1, TRUE))
continue;
/* need to check if we haven't already listed it */
for (table= open_list ; table ; table=table->next)
@@ -863,17 +871,17 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock,
while (unused_tables)
{
#ifdef EXTRA_DEBUG
- if (hash_delete(&open_cache,(uchar*) unused_tables))
+ if (my_hash_delete(&open_cache,(uchar*) unused_tables))
printf("Warning: Couldn't delete open table from hash\n");
#else
- VOID(hash_delete(&open_cache,(uchar*) unused_tables));
+ VOID(my_hash_delete(&open_cache,(uchar*) unused_tables));
#endif
}
/* Free table shares */
while (oldest_unused_share->next)
{
pthread_mutex_lock(&oldest_unused_share->mutex);
- VOID(hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
+ VOID(my_hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
}
DBUG_PRINT("tcache", ("incremented global refresh_version to: %lu",
refresh_version));
@@ -918,7 +926,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock,
*/
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
- TABLE *table=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *table=(TABLE*) my_hash_element(&open_cache,idx);
if (table->in_use)
table->in_use->some_tables_deleted= 1;
}
@@ -963,7 +971,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock,
found=0;
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
- TABLE *table=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *table=(TABLE*) my_hash_element(&open_cache,idx);
/* Avoid a self-deadlock. */
if (table->in_use == thd)
continue;
@@ -1045,7 +1053,7 @@ bool close_cached_connection_tables(THD *thd, bool if_wait_for_refresh,
for (idx= 0; idx < table_def_cache.records; idx++)
{
- TABLE_SHARE *share= (TABLE_SHARE *) hash_element(&table_def_cache, idx);
+ TABLE_SHARE *share= (TABLE_SHARE *) my_hash_element(&table_def_cache, idx);
/* Ignore if table is not open or does not have a connect_string */
if (!share->connect_string.length || !share->ref_count)
@@ -1201,7 +1209,7 @@ static void close_open_tables(THD *thd)
/* Free tables to hold down open files */
while (open_cache.records > table_cache_size && unused_tables)
- VOID(hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
+ VOID(my_hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
check_unused();
if (found_old_table)
{
@@ -1284,9 +1292,9 @@ void close_thread_tables(THD *thd)
*/
if (!(thd->state_flags & Open_tables_state::BACKUPS_AVAIL))
{
- thd->main_da.can_overwrite_status= TRUE;
+ thd->stmt_da->can_overwrite_status= TRUE;
ha_autocommit_or_rollback(thd, thd->is_error());
- thd->main_da.can_overwrite_status= FALSE;
+ thd->stmt_da->can_overwrite_status= FALSE;
/*
Reset transaction state, but only if we're not inside a
@@ -1387,7 +1395,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
if (table->needs_reopen_or_name_lock() ||
thd->version != refresh_version || !table->db_stat)
{
- VOID(hash_delete(&open_cache,(uchar*) table));
+ VOID(my_hash_delete(&open_cache,(uchar*) table));
found_old_table=1;
}
else
@@ -2091,7 +2099,7 @@ void unlink_open_table(THD *thd, TABLE *find, bool unlock)
/* Remove table from open_tables list. */
*prev= list->next;
/* Close table. */
- VOID(hash_delete(&open_cache,(uchar*) list)); // Close table
+ VOID(my_hash_delete(&open_cache,(uchar*) list)); // Close table
}
else
{
@@ -2397,7 +2405,7 @@ bool lock_table_name_if_not_cached(THD *thd, const char *db,
key_length= (uint)(strmov(strmov(key, db) + 1, table_name) - key) + 1;
VOID(pthread_mutex_lock(&LOCK_open));
- if (hash_search(&open_cache, (uchar *)key, key_length))
+ if (my_hash_search(&open_cache, (uchar *)key, key_length))
{
VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_PRINT("info", ("Table is cached, name-lock is not obtained"));
@@ -2752,11 +2760,11 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
an implicit "pending locks queue" - see
wait_for_locked_table_names for details.
*/
- for (table= (TABLE*) hash_first(&open_cache, (uchar*) key, key_length,
- &state);
+ for (table= (TABLE*) my_hash_first(&open_cache, (uchar*) key, key_length,
+ &state);
table && table->in_use ;
- table= (TABLE*) hash_next(&open_cache, (uchar*) key, key_length,
- &state))
+ table= (TABLE*) my_hash_next(&open_cache, (uchar*) key, key_length,
+ &state))
{
DBUG_PRINT("tcache", ("in_use table: '%s'.'%s' 0x%lx", table->s->db.str,
table->s->table_name.str, (long) table));
@@ -2868,7 +2876,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
DBUG_PRINT("tcache", ("opening new table"));
/* Free cache if too big */
while (open_cache.records > table_cache_size && unused_tables)
- VOID(hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
+ VOID(my_hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
if (table_list->create)
{
@@ -2926,7 +2934,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
Set 1 as a flag here
*/
if (error < 0)
- table_list->view= (st_lex*)1;
+ table_list->view= (LEX*)1;
my_free((uchar*)table, MYF(0));
VOID(pthread_mutex_unlock(&LOCK_open));
@@ -3331,7 +3339,7 @@ bool reopen_tables(THD *thd, bool get_locks, bool mark_share_as_old)
*/
if (table->child_l || table->parent)
detach_merge_children(table, TRUE);
- VOID(hash_delete(&open_cache,(uchar*) table));
+ VOID(my_hash_delete(&open_cache,(uchar*) table));
error=1;
}
else
@@ -3360,7 +3368,7 @@ bool reopen_tables(THD *thd, bool get_locks, bool mark_share_as_old)
{
while (err_tables)
{
- VOID(hash_delete(&open_cache, (uchar*) err_tables));
+ VOID(my_hash_delete(&open_cache, (uchar*) err_tables));
err_tables= err_tables->next;
}
}
@@ -3512,11 +3520,11 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock)
DBUG_PRINT("loop", ("table_name: %s", table->alias));
HASH_SEARCH_STATE state;
- for (TABLE *search= (TABLE*) hash_first(&open_cache, (uchar*) key,
- key_length, &state);
+ for (TABLE *search= (TABLE*) my_hash_first(&open_cache, (uchar*) key,
+ key_length, &state);
search ;
- search= (TABLE*) hash_next(&open_cache, (uchar*) key,
- key_length, &state))
+ search= (TABLE*) my_hash_next(&open_cache, (uchar*) key,
+ key_length, &state))
{
DBUG_PRINT("info", ("share: 0x%lx "
"open_placeholder: %d locked_by_name: %d "
@@ -3642,7 +3650,7 @@ TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name)
else
{
/* We already have a name lock, remove copy */
- VOID(hash_delete(&open_cache,(uchar*) table));
+ VOID(my_hash_delete(&open_cache,(uchar*) table));
}
}
else
@@ -3957,7 +3965,7 @@ retry:
release_table_share(share, RELEASE_WAIT_FOR_DROP);
if (!thd->killed)
{
- mysql_reset_errors(thd, 1); // Clear warnings
+ thd->warning_info->clear_warning_info(thd->query_id);
thd->clear_error(); // Clear error message
goto retry;
}
@@ -4521,9 +4529,6 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
*/
for (tables= *start; tables ;tables= tables->next_global)
{
- DBUG_PRINT("tcache", ("opening table: '%s'.'%s' item: 0x%lx",
- tables->db, tables->table_name, (long) tables));
-
safe_to_ignore_table= FALSE;
/*
@@ -4560,6 +4565,8 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
}
DBUG_RETURN(-1);
}
+ DBUG_PRINT("tcache", ("opening table: '%s'.'%s' item: 0x%lx",
+ tables->db, tables->table_name, (long) tables));
(*counter)++;
/*
@@ -4616,7 +4623,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
Let us free memory used by 'sroutines' hash here since we never
call destructor for this LEX.
*/
- hash_free(&tables->view->sroutines);
+ my_hash_free(&tables->view->sroutines);
goto process_view_routines;
}
@@ -5893,8 +5900,8 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, uint length,
field_ptr= table->field + cached_field_index;
else if (table->s->name_hash.records)
{
- field_ptr= (Field**) hash_search(&table->s->name_hash, (uchar*) name,
- length);
+ field_ptr= (Field**) my_hash_search(&table->s->name_hash, (uchar*) name,
+ length);
if (field_ptr)
{
/*
@@ -6021,7 +6028,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
table_name && table_name[0] &&
(my_strcasecmp(table_alias_charset, table_list->alias, table_name) ||
(db_name && db_name[0] && table_list->db && table_list->db[0] &&
- strcmp(db_name, table_list->db))))
+ (table_list->schema_table ?
+ my_strcasecmp(system_charset_info, db_name, table_list->db) :
+ strcmp(db_name, table_list->db)))))
DBUG_RETURN(0);
*actual_table= NULL;
@@ -6140,8 +6149,8 @@ Field *find_field_in_table_sef(TABLE *table, const char *name)
Field **field_ptr;
if (table->s->name_hash.records)
{
- field_ptr= (Field**)hash_search(&table->s->name_hash,(uchar*) name,
- strlen(name));
+ field_ptr= (Field**)my_hash_search(&table->s->name_hash,(uchar*) name,
+ strlen(name));
if (field_ptr)
{
/*
@@ -8383,7 +8392,7 @@ void remove_db_from_cache(const char *db)
{
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
- TABLE *table=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *table=(TABLE*) my_hash_element(&open_cache,idx);
if (!strcmp(table->s->db.str, db))
{
table->s->version= 0L; /* Free when thread is ready */
@@ -8392,7 +8401,7 @@ void remove_db_from_cache(const char *db)
}
}
while (unused_tables && !unused_tables->s->version)
- VOID(hash_delete(&open_cache,(uchar*) unused_tables));
+ VOID(my_hash_delete(&open_cache,(uchar*) unused_tables));
}
@@ -8408,7 +8417,7 @@ void flush_tables()
{
(void) pthread_mutex_lock(&LOCK_open);
while (unused_tables)
- hash_delete(&open_cache,(uchar*) unused_tables);
+ my_hash_delete(&open_cache,(uchar*) unused_tables);
(void) pthread_mutex_unlock(&LOCK_open);
}
@@ -8445,11 +8454,11 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
HASH_SEARCH_STATE state;
result= signalled= 0;
- for (table= (TABLE*) hash_first(&open_cache, (uchar*) key, key_length,
- &state);
+ for (table= (TABLE*) my_hash_first(&open_cache, (uchar*) key, key_length,
+ &state);
table;
- table= (TABLE*) hash_next(&open_cache, (uchar*) key, key_length,
- &state))
+ table= (TABLE*) my_hash_next(&open_cache, (uchar*) key, key_length,
+ &state))
{
THD *in_use;
DBUG_PRINT("tcache", ("found table: '%s'.'%s' 0x%lx", table->s->db.str,
@@ -8516,12 +8525,12 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
}
}
while (unused_tables && !unused_tables->s->version)
- VOID(hash_delete(&open_cache,(uchar*) unused_tables));
+ VOID(my_hash_delete(&open_cache,(uchar*) unused_tables));
DBUG_PRINT("info", ("Removing table from table_def_cache"));
/* Remove table from table definition cache if it's not in use */
- if ((share= (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key,
- key_length)))
+ if ((share= (TABLE_SHARE*) my_hash_search(&table_def_cache,(uchar*) key,
+ key_length)))
{
DBUG_PRINT("info", ("share version: %lu ref_count: %u",
share->version, share->ref_count));
@@ -8529,7 +8538,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
if (share->ref_count == 0)
{
pthread_mutex_lock(&share->mutex);
- VOID(hash_delete(&table_def_cache, (uchar*) share));
+ VOID(my_hash_delete(&table_def_cache, (uchar*) share));
}
}
@@ -8777,11 +8786,11 @@ void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table
key_length=(uint) (strmov(strmov(key,lpt->db)+1,lpt->table_name)-key)+1;
VOID(pthread_mutex_lock(&LOCK_open));
HASH_SEARCH_STATE state;
- for (table= (TABLE*) hash_first(&open_cache,(uchar*) key,key_length,
- &state) ;
+ for (table= (TABLE*) my_hash_first(&open_cache,(uchar*) key,key_length,
+ &state) ;
table;
- table= (TABLE*) hash_next(&open_cache,(uchar*) key,key_length,
- &state))
+ table= (TABLE*) my_hash_next(&open_cache,(uchar*) key,key_length,
+ &state))
{
THD *in_use= table->in_use;
table->s->version= 0L;
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index ee51480411b..58c309ef57b 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -61,7 +61,7 @@ void mysql_client_binlog_statement(THD* thd)
rli= thd->rli_fake;
if (!rli)
{
- rli= thd->rli_fake= new Relay_log_info;
+ rli= thd->rli_fake= new Relay_log_info(FALSE);
#ifdef HAVE_purify
rli->is_fake= TRUE;
#endif
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 8114e0221d6..5942696b86c 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -286,6 +286,7 @@ functions:
if (and only if) this query has a registered result set writer
(thd->net.query_cache_query).
4. Query_cache::invalidate
+ Query_cache::invalidate_locked_for_write
- Called from various places to invalidate query cache based on data-
base, table and myisam file name. During an on going invalidation
the query cache is temporarily disabled.
@@ -812,19 +813,20 @@ uchar *query_cache_query_get_key(const uchar *record, size_t *length,
Note on double-check locking (DCL) usage.
Below, in query_cache_insert(), query_cache_abort() and
- query_cache_end_of_result() we use what is called double-check
- locking (DCL) for NET::query_cache_query. I.e. we test it first
- without a lock, and, if positive, test again under the lock.
+ Query_cache::end_of_result() we use what is called double-check
+ locking (DCL) for Query_cache_tls::first_query_block.
+ I.e. we test it first without a lock, and, if positive, test again
+ under the lock.
- This means that if we see 'NET::query_cache_query == 0' without a
+ This means that if we see 'first_query_block == 0' without a
lock we will skip the operation. But this is safe here: when we
started to cache a query, we called Query_cache::store_query(), and
- NET::query_cache_query was set to non-zero in this thread (and the
+ 'first_query_block' was set to non-zero in this thread (and the
thread always sees results of its memory operations, mutex or not).
- If later we see 'NET::query_cache_query == 0' without locking a
+ If later we see 'first_query_block == 0' without locking a
mutex, that may only mean that some other thread have reset it by
invalidating the query. Skipping the operation in this case is the
- right thing to do, as NET::query_cache_query won't get non-zero for
+ right thing to do, as first_query_block won't get non-zero for
this query again.
See also comments in Query_cache::store_query() and
@@ -833,56 +835,71 @@ uchar *query_cache_query_get_key(const uchar *record, size_t *length,
NOTE, however, that double-check locking is not applicable in
'invalidate' functions, as we may erroneously skip invalidation,
because the thread doing invalidation may never see non-zero
- NET::query_cache_query.
+ 'first_query_block'.
*/
-void query_cache_init_query(NET *net)
+/**
+ libmysql convenience wrapper to insert data into query cache.
+*/
+void query_cache_insert(const char *packet, ulong length,
+ unsigned pkt_nr)
{
+ THD *thd= current_thd;
+
/*
- It is safe to initialize 'NET::query_cache_query' without a lock
- here, because before it will be accessed from different threads it
- will be set in this thread under a lock, and access from the same
- thread is always safe.
+ Current_thd can be NULL when a new connection is immediately ended
+ due to "Too many connections". thd->store_globals() has not been
+ called at this time and hence my_pthread_setspecific_ptr(THR_THD,
+ this) has not been called for this thread.
*/
- net->query_cache_query= 0;
+
+ if (!thd)
+ return;
+
+ query_cache.insert(&thd->query_cache_tls,
+ packet, length,
+ pkt_nr);
}
-/*
+/**
Insert the packet into the query cache.
*/
-void query_cache_insert(NET *net, const char *packet, ulong length)
+void
+Query_cache::insert(Query_cache_tls *query_cache_tls,
+ const char *packet, ulong length,
+ unsigned pkt_nr)
{
- DBUG_ENTER("query_cache_insert");
+ DBUG_ENTER("Query_cache::insert");
/* See the comment on double-check locking usage above. */
- if (net->query_cache_query == 0)
+ if (is_disabled() || query_cache_tls->first_query_block == NULL)
DBUG_VOID_RETURN;
DBUG_EXECUTE_IF("wait_in_query_cache_insert",
debug_wait_for_kill("wait_in_query_cache_insert"); );
- if (query_cache.try_lock())
+
+ if (try_lock())
DBUG_VOID_RETURN;
- Query_cache_block *query_block= (Query_cache_block*)net->query_cache_query;
- if (!query_block)
+ Query_cache_block *query_block = query_cache_tls->first_query_block;
+ if (query_block == NULL)
{
/*
We lost the writer and the currently processed query has been
invalidated; there is nothing left to do.
*/
- query_cache.unlock();
+ unlock();
DBUG_VOID_RETURN;
}
-
BLOCK_LOCK_WR(query_block);
Query_cache_query *header= query_block->query();
Query_cache_block *result= header->result();
- DUMP(&query_cache);
+ DUMP(this);
DBUG_PRINT("qcache", ("insert packet %lu bytes long",length));
/*
@@ -890,8 +907,8 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
still need structure_guard_mutex to free the query, and therefore unlock
it later in this function.
*/
- if (!query_cache.append_result_data(&result, length, (uchar*) packet,
- query_block))
+ if (!append_result_data(&result, length, (uchar*) packet,
+ query_block))
{
DBUG_PRINT("warning", ("Can't append data"));
header->result(result);
@@ -900,80 +917,83 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
query_cache.free_query(query_block);
query_cache.refused++;
// append_result_data no success => we need unlock
- query_cache.unlock();
+ unlock();
DBUG_VOID_RETURN;
}
header->result(result);
- header->last_pkt_nr= net->pkt_nr;
+ header->last_pkt_nr= pkt_nr;
BLOCK_UNLOCK_WR(query_block);
- DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0););
+ DBUG_EXECUTE("check_querycache",check_integrity(0););
DBUG_VOID_RETURN;
}
-void query_cache_abort(NET *net)
+void
+Query_cache::abort(Query_cache_tls *query_cache_tls)
{
DBUG_ENTER("query_cache_abort");
THD *thd= current_thd;
/* See the comment on double-check locking usage above. */
- if (net->query_cache_query == 0)
+ if (is_disabled() || query_cache_tls->first_query_block == NULL)
DBUG_VOID_RETURN;
- if (query_cache.try_lock())
+ if (try_lock())
DBUG_VOID_RETURN;
/*
While we were waiting another thread might have changed the status
of the writer. Make sure the writer still exists before continue.
*/
- Query_cache_block *query_block= ((Query_cache_block*)
- net->query_cache_query);
+ Query_cache_block *query_block= query_cache_tls->first_query_block;
if (query_block)
{
thd_proc_info(thd, "storing result in query cache");
- DUMP(&query_cache);
+ DUMP(this);
BLOCK_LOCK_WR(query_block);
// The following call will remove the lock on query_block
- query_cache.free_query(query_block);
- net->query_cache_query= 0;
- DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
+ free_query(query_block);
+ query_cache_tls->first_query_block= NULL;
+ DBUG_EXECUTE("check_querycache", check_integrity(1););
}
- query_cache.unlock();
+ unlock();
+
DBUG_VOID_RETURN;
}
-void query_cache_end_of_result(THD *thd)
+void Query_cache::end_of_result(THD *thd)
{
Query_cache_block *query_block;
- DBUG_ENTER("query_cache_end_of_result");
+ Query_cache_tls *query_cache_tls= &thd->query_cache_tls;
+ ulonglong limit_found_rows= thd->limit_found_rows;
+ DBUG_ENTER("Query_cache::end_of_result");
/* See the comment on double-check locking usage above. */
- if (thd->net.query_cache_query == 0)
+ if (query_cache_tls->first_query_block == NULL)
DBUG_VOID_RETURN;
/* Ensure that only complete results are cached. */
- DBUG_ASSERT(thd->main_da.is_eof());
+ DBUG_ASSERT(thd->stmt_da->is_eof());
if (thd->killed)
{
- query_cache_abort(&thd->net);
+ query_cache_abort(&thd->query_cache_tls);
DBUG_VOID_RETURN;
}
#ifdef EMBEDDED_LIBRARY
- query_cache_insert(&thd->net, (char*)thd,
- emb_count_querycache_size(thd));
+ insert(query_cache_tls, (char*)thd,
+ emb_count_querycache_size(thd), 0);
#endif
- if (query_cache.try_lock())
+ if (try_lock())
DBUG_VOID_RETURN;
- query_block= ((Query_cache_block*) thd->net.query_cache_query);
+ query_block= query_cache_tls->first_query_block;
if (query_block)
{
/*
@@ -982,7 +1002,7 @@ void query_cache_end_of_result(THD *thd)
block, the writer should be dropped.
*/
thd_proc_info(thd, "storing result in query cache");
- DUMP(&query_cache);
+ DUMP(this);
BLOCK_LOCK_WR(query_block);
Query_cache_query *header= query_block->query();
Query_cache_block *last_result_block;
@@ -999,8 +1019,8 @@ void query_cache_end_of_result(THD *thd)
and removed from QC.
*/
DBUG_ASSERT(0);
- query_cache.free_query(query_block);
- query_cache.unlock();
+ free_query(query_block);
+ unlock();
DBUG_VOID_RETURN;
}
last_result_block= header->result()->prev;
@@ -1009,17 +1029,17 @@ void query_cache_end_of_result(THD *thd)
if (last_result_block->length >= query_cache.min_allocation_unit + len)
query_cache.split_block(last_result_block,len);
- header->found_rows(current_thd->limit_found_rows);
+ header->found_rows(limit_found_rows);
header->result()->type= Query_cache_block::RESULT;
/* Drop the writer. */
header->writer(0);
- thd->net.query_cache_query= 0;
+ query_cache_tls->first_query_block= NULL;
BLOCK_UNLOCK_WR(query_block);
- DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
-
+ DBUG_EXECUTE("check_querycache", check_integrity(1););
}
- query_cache.unlock();
+
+ unlock();
DBUG_VOID_RETURN;
}
@@ -1059,7 +1079,7 @@ Query_cache::Query_cache(ulong query_cache_limit_arg,
min_result_data_size(ALIGN_SIZE(min_result_data_size_arg)),
def_query_hash_size(ALIGN_SIZE(def_query_hash_size_arg)),
def_table_hash_size(ALIGN_SIZE(def_table_hash_size_arg)),
- initialized(0)
+ initialized(0), m_query_cache_is_disabled(FALSE)
{
ulong min_needed= (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_block_table)) +
@@ -1097,7 +1117,7 @@ ulong Query_cache::resize(ulong query_cache_size_arg)
Drop the writer; this will cancel any attempts to store
the processed statement associated with this writer.
*/
- query->writer()->query_cache_query= 0;
+ query->writer()->first_query_block= NULL;
query->writer(0);
refused++;
}
@@ -1159,7 +1179,9 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
protocol (COM_EXECUTE) cannot be served to statements asking for results
in the text protocol (COM_QUERY) and vice-versa.
*/
- flags.result_in_binary_protocol= (unsigned int) thd->protocol->type();
+ flags.protocol_type= (unsigned int) thd->protocol->type();
+ /* PROTOCOL_LOCAL results are not cached. */
+ DBUG_ASSERT(flags.protocol_type != (unsigned int) Protocol::PROTOCOL_LOCAL);
flags.more_results_exists= test(thd->server_status &
SERVER_MORE_RESULTS_EXISTS);
flags.in_trans= test(thd->server_status & SERVER_STATUS_IN_TRANS);
@@ -1188,7 +1210,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
- (int)flags.result_in_binary_protocol,
+ (int)flags.protocol_type,
(int)flags.more_results_exists,
flags.pkt_nr,
flags.character_set_client_num,
@@ -1260,7 +1282,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
/* Check if another thread is processing the same query? */
Query_cache_block *competitor = (Query_cache_block *)
- hash_search(&queries, (uchar*) thd->query(), tot_length);
+ my_hash_search(&queries, (uchar*) thd->query(), tot_length);
DBUG_PRINT("qcache", ("competitor 0x%lx", (ulong) competitor));
if (competitor == 0)
{
@@ -1289,7 +1311,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
{
refused++;
DBUG_PRINT("warning", ("tables list including failed"));
- hash_delete(&queries, (uchar *) query_block);
+ my_hash_delete(&queries, (uchar *) query_block);
header->unlock_n_destroy();
free_memory_block(query_block);
unlock();
@@ -1298,8 +1320,8 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
double_linked_list_simple_include(query_block, &queries_blocks);
inserts++;
queries_in_cache++;
- net->query_cache_query= (uchar*) query_block;
- header->writer(net);
+ thd->query_cache_tls.first_query_block= query_block;
+ header->writer(&thd->query_cache_tls);
header->tables_type(tables_type);
unlock();
@@ -1355,7 +1377,10 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
{
ulonglong engine_data;
Query_cache_query *query;
- Query_cache_block *first_result_block, *result_block;
+#ifndef EMBEDDED_LIBRARY
+ Query_cache_block *first_result_block;
+#endif
+ Query_cache_block *result_block;
Query_cache_block_table *block_table, *block_table_end;
ulong tot_length;
Query_cache_query_flags flags;
@@ -1368,8 +1393,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
See also a note on double-check locking usage above.
*/
- if (thd->locked_tables || thd->variables.query_cache_type == 0 ||
- query_cache_size == 0)
+ if (is_disabled() || thd->locked_tables ||
+ thd->variables.query_cache_type == 0 || query_cache_size == 0)
goto err;
if (!thd->lex->safe_to_cache_query)
@@ -1428,12 +1453,6 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
if (query_cache_size == 0)
goto err_unlock;
- /*
- Check that we haven't forgot to reset the query cache variables;
- make sure there are no attached query cache writer to this thread.
- */
- DBUG_ASSERT(thd->net.query_cache_query == 0);
-
Query_cache_block *query_block;
tot_length= query_length + thd->db_length + 1 + QUERY_CACHE_FLAGS_SIZE;
@@ -1455,7 +1474,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG);
flags.client_protocol_41= test(thd->client_capabilities &
CLIENT_PROTOCOL_41);
- flags.result_in_binary_protocol= (unsigned int)thd->protocol->type();
+ flags.protocol_type= (unsigned int) thd->protocol->type();
flags.more_results_exists= test(thd->server_status &
SERVER_MORE_RESULTS_EXISTS);
flags.in_trans= test(thd->server_status & SERVER_STATUS_IN_TRANS);
@@ -1482,7 +1501,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
- (int)flags.result_in_binary_protocol,
+ (int)flags.protocol_type,
(int)flags.more_results_exists,
flags.pkt_nr,
flags.character_set_client_num,
@@ -1499,8 +1518,8 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.autocommit));
memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
(uchar*) &flags, QUERY_CACHE_FLAGS_SIZE);
- query_block = (Query_cache_block *) hash_search(&queries, (uchar*) sql,
- tot_length);
+ query_block = (Query_cache_block *) my_hash_search(&queries, (uchar*) sql,
+ tot_length);
/* Quick abort on unlocked data */
if (query_block == 0 ||
query_block->query()->result() == 0 ||
@@ -1515,7 +1534,10 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
BLOCK_LOCK_RD(query_block);
query = query_block->query();
- result_block= first_result_block= query->result();
+ result_block= query->result();
+#ifndef EMBEDDED_LIBRARY
+ first_result_block= result_block;
+#endif
if (result_block == 0 || result_block->type != Query_cache_block::RESULT)
{
@@ -1577,7 +1599,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
table_list.db = table->db();
table_list.alias= table_list.table_name= table->table();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (check_table_access(thd,SELECT_ACL,&table_list, 1, TRUE))
+ if (check_table_access(thd,SELECT_ACL,&table_list, FALSE, 1,TRUE))
{
DBUG_PRINT("qcache",
("probably no SELECT access to %s.%s => return to normal processing",
@@ -1658,7 +1680,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
thd->limit_found_rows = query->found_rows();
thd->status_var.last_query_cost= 0.0;
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
BLOCK_UNLOCK_RD(query_block);
MYSQL_QUERY_CACHE_HIT(thd->query(), (ulong) thd->limit_found_rows);
@@ -1680,6 +1702,8 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (table list)");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
using_transactions= using_transactions &&
(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
@@ -1710,6 +1734,9 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
{
DBUG_ENTER("Query_cache::invalidate (changed table list)");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+
THD *thd= current_thd;
for (; tables_used; tables_used= tables_used->next)
{
@@ -1735,8 +1762,11 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
*/
void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
{
- THD *thd= current_thd;
DBUG_ENTER("Query_cache::invalidate_locked_for_write");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+
+ THD *thd= current_thd;
for (; tables_used; tables_used= tables_used->next_local)
{
thd_proc_info(thd, "invalidating query cache entries (table)");
@@ -1757,7 +1787,9 @@ void Query_cache::invalidate(THD *thd, TABLE *table,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (table)");
-
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+
using_transactions= using_transactions &&
(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
if (using_transactions &&
@@ -1774,6 +1806,8 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (key)");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
using_transactions= using_transactions &&
(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
@@ -1792,9 +1826,12 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
void Query_cache::invalidate(char *db)
{
- bool restart= FALSE;
+
DBUG_ENTER("Query_cache::invalidate (db)");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+ bool restart= FALSE;
/*
Lock the query cache and queue all invalidation attempts to avoid
the risk of a race between invalidation, cache inserts and flushes.
@@ -1879,6 +1916,9 @@ void Query_cache::invalidate_by_MyISAM_filename(const char *filename)
void Query_cache::flush()
{
DBUG_ENTER("Query_cache::flush");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+
DBUG_EXECUTE_IF("wait_in_query_cache_flush1",
debug_wait_for_kill("wait_in_query_cache_flush1"););
@@ -1910,6 +1950,9 @@ void Query_cache::pack(ulong join_limit, uint iteration_limit)
{
DBUG_ENTER("Query_cache::pack");
+ if (is_disabled())
+ DBUG_VOID_RETURN;
+
/*
If the entire qc is being invalidated we can bail out early
instead of waiting for the lock.
@@ -1967,6 +2010,15 @@ void Query_cache::init()
pthread_cond_init(&COND_cache_status_changed, NULL);
m_cache_lock_status= Query_cache::UNLOCKED;
initialized = 1;
+ /*
+ If we explicitly turn off query cache from the command line query cache will
+ be disabled for the reminder of the server life time. This is because we
+ want to avoid locking the QC specific mutex if query cache isn't going to
+ be used.
+ */
+ if (global_system_variables.query_cache_type == 0)
+ query_cache.disable_query_cache();
+
DBUG_VOID_RETURN;
}
@@ -2105,8 +2157,8 @@ ulong Query_cache::init_cache()
DUMP(this);
- VOID(hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
- query_cache_query_get_key, 0, 0));
+ VOID(my_hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
+ query_cache_query_get_key, 0, 0));
#ifndef FN_NO_CASE_SENCE
/*
If lower_case_table_names!=0 then db and table names are already
@@ -2116,8 +2168,8 @@ ulong Query_cache::init_cache()
lower_case_table_names == 0 then we should distinguish my_table
and MY_TABLE cases and so again can use binary collation.
*/
- VOID(hash_init(&tables, &my_charset_bin, def_table_hash_size, 0, 0,
- query_cache_table_get_key, 0, 0));
+ VOID(my_hash_init(&tables, &my_charset_bin, def_table_hash_size, 0, 0,
+ query_cache_table_get_key, 0, 0));
#else
/*
On windows, OS/2, MacOS X with HFS+ or any other case insensitive
@@ -2127,10 +2179,10 @@ ulong Query_cache::init_cache()
file system) and so should use case insensitive collation for
comparison.
*/
- VOID(hash_init(&tables,
- lower_case_table_names ? &my_charset_bin :
- files_charset_info,
- def_table_hash_size, 0, 0,query_cache_table_get_key, 0, 0));
+ VOID(my_hash_init(&tables,
+ lower_case_table_names ? &my_charset_bin :
+ files_charset_info,
+ def_table_hash_size, 0, 0,query_cache_table_get_key, 0, 0));
#endif
queries_in_cache = 0;
@@ -2180,8 +2232,8 @@ void Query_cache::free_cache()
my_free((uchar*) cache, MYF(MY_ALLOW_ZERO_PTR));
make_disabled();
- hash_free(&queries);
- hash_free(&tables);
+ my_hash_free(&queries);
+ my_hash_free(&tables);
DBUG_VOID_RETURN;
}
@@ -2293,7 +2345,7 @@ void Query_cache::free_query_internal(Query_cache_block *query_block)
if (query->writer() != 0)
{
/* Tell MySQL that this query should not be cached anymore */
- query->writer()->query_cache_query= 0;
+ query->writer()->first_query_block= NULL;
query->writer(0);
}
double_linked_list_exclude(query_block, &queries_blocks);
@@ -2356,7 +2408,7 @@ void Query_cache::free_query(Query_cache_block *query_block)
(ulong) query_block,
query_block->query()->length() ));
- hash_delete(&queries,(uchar *) query_block);
+ my_hash_delete(&queries,(uchar *) query_block);
free_query_internal(query_block);
DBUG_VOID_RETURN;
@@ -2685,7 +2737,7 @@ void
Query_cache::invalidate_table_internal(THD *thd, uchar *key, uint32 key_length)
{
Query_cache_block *table_block=
- (Query_cache_block*)hash_search(&tables, key, key_length);
+ (Query_cache_block*)my_hash_search(&tables, key, key_length);
if (table_block)
{
Query_cache_block_table *list_root= table_block->table(0);
@@ -2883,7 +2935,7 @@ Query_cache::insert_table(uint key_len, char *key,
THD *thd= current_thd;
Query_cache_block *table_block=
- (Query_cache_block *)hash_search(&tables, (uchar*) key, key_len);
+ (Query_cache_block *) my_hash_search(&tables, (uchar*) key, key_len);
if (table_block &&
table_block->table()->engine_data() != engine_data)
@@ -2999,7 +3051,7 @@ void Query_cache::unlink_table(Query_cache_block_table *node)
Query_cache_block *table_block= neighbour->block();
double_linked_list_exclude(table_block,
&tables_blocks);
- hash_delete(&tables,(uchar *) table_block);
+ my_hash_delete(&tables,(uchar *) table_block);
free_memory_block(table_block);
}
DBUG_VOID_RETURN;
@@ -3506,7 +3558,8 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
*/
TABLE_COUNTER_TYPE
-Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex,
+Query_cache::is_cacheable(THD *thd, size_t query_len, const char *query,
+ LEX *lex,
TABLE_LIST *tables_used, uint8 *tables_type)
{
TABLE_COUNTER_TYPE table_count;
@@ -3683,7 +3736,7 @@ my_bool Query_cache::move_by_type(uchar **border,
uchar *key;
size_t key_length;
key=query_cache_table_get_key((uchar*) block, &key_length, 0);
- hash_first(&tables, (uchar*) key, key_length, &record_idx);
+ my_hash_first(&tables, (uchar*) key, key_length, &record_idx);
block->destroy();
new_block->init(len);
@@ -3717,7 +3770,7 @@ my_bool Query_cache::move_by_type(uchar **border,
/* Fix pointer to table name */
new_block->table()->table(new_block->table()->db() + tablename_offset);
/* Fix hash to point at moved block */
- hash_replace(&tables, &record_idx, (uchar*) new_block);
+ my_hash_replace(&tables, &record_idx, (uchar*) new_block);
DBUG_PRINT("qcache", ("moved %lu bytes to 0x%lx, new gap at 0x%lx",
len, (ulong) new_block, (ulong) *border));
@@ -3743,7 +3796,7 @@ my_bool Query_cache::move_by_type(uchar **border,
uchar *key;
size_t key_length;
key=query_cache_query_get_key((uchar*) block, &key_length, 0);
- hash_first(&queries, (uchar*) key, key_length, &record_idx);
+ my_hash_first(&queries, (uchar*) key, key_length, &record_idx);
// Move table of used tables
memmove((char*) new_block->table(0), (char*) block->table(0),
ALIGN_SIZE(n_tables*sizeof(Query_cache_block_table)));
@@ -3805,13 +3858,13 @@ my_bool Query_cache::move_by_type(uchar **border,
If someone is writing to this block, inform the writer that the block
has been moved.
*/
- NET *net = new_block->query()->writer();
- if (net != 0)
+ Query_cache_tls *query_cache_tls= new_block->query()->writer();
+ if (query_cache_tls != NULL)
{
- net->query_cache_query= (uchar*) new_block;
+ query_cache_tls->first_query_block= new_block;
}
/* Fix hash to point at moved block */
- hash_replace(&queries, &record_idx, (uchar*) new_block);
+ my_hash_replace(&queries, &record_idx, (uchar*) new_block);
DBUG_PRINT("qcache", ("moved %lu bytes to 0x%lx, new gap at 0x%lx",
len, (ulong) new_block, (ulong) *border));
break;
@@ -4222,13 +4275,13 @@ my_bool Query_cache::check_integrity(bool locked)
if (!locked)
lock_and_suspend();
- if (hash_check(&queries))
+ if (my_hash_check(&queries))
{
DBUG_PRINT("error", ("queries hash is damaged"));
result = 1;
}
- if (hash_check(&tables))
+ if (my_hash_check(&tables))
{
DBUG_PRINT("error", ("tables hash is damaged"));
result = 1;
@@ -4395,7 +4448,7 @@ my_bool Query_cache::check_integrity(bool locked)
(ulong) block, (uint) block->type));
size_t length;
uchar *key = query_cache_query_get_key((uchar*) block, &length, 0);
- uchar* val = hash_search(&queries, key, length);
+ uchar* val = my_hash_search(&queries, key, length);
if (((uchar*)block) != val)
{
DBUG_PRINT("error", ("block 0x%lx found in queries hash like 0x%lx",
@@ -4430,7 +4483,7 @@ my_bool Query_cache::check_integrity(bool locked)
(ulong) block, (uint) block->type));
size_t length;
uchar *key = query_cache_table_get_key((uchar*) block, &length, 0);
- uchar* val = hash_search(&tables, key, length);
+ uchar* val = my_hash_search(&tables, key, length);
if (((uchar*)block) != val)
{
DBUG_PRINT("error", ("block 0x%lx found in tables hash like 0x%lx",
@@ -4670,3 +4723,4 @@ err2:
#endif /* DBUG_OFF */
#endif /*HAVE_QUERY_CACHE*/
+
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 44fc3123b98..695d6fb4db3 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -64,6 +64,8 @@ struct Query_cache_table;
struct Query_cache_query;
struct Query_cache_result;
class Query_cache;
+struct Query_cache_tls;
+struct LEX;
/**
This class represents a node in the linked chain of queries
@@ -137,7 +139,7 @@ struct Query_cache_query
ulonglong limit_found_rows;
rw_lock_t lock;
Query_cache_block *res;
- NET *wri;
+ Query_cache_tls *wri;
ulong len;
uint8 tbls_type;
unsigned int last_pkt_nr;
@@ -149,8 +151,8 @@ struct Query_cache_query
inline void found_rows(ulonglong rows) { limit_found_rows= rows; }
inline Query_cache_block *result() { return res; }
inline void result(Query_cache_block *p) { res= p; }
- inline NET *writer() { return wri; }
- inline void writer(NET *p) { wri= p; }
+ inline Query_cache_tls *writer() { return wri; }
+ inline void writer(Query_cache_tls *p) { wri= p; }
inline uint8 tables_type() { return tbls_type; }
inline void tables_type(uint8 type) { tbls_type= type; }
inline ulong length() { return len; }
@@ -279,8 +281,11 @@ private:
enum Cache_lock_status { UNLOCKED, LOCKED_NO_WAIT, LOCKED };
Cache_lock_status m_cache_lock_status;
+ bool m_query_cache_is_disabled;
+
void free_query_internal(Query_cache_block *point);
void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length);
+ void disable_query_cache(void) { m_query_cache_is_disabled= TRUE; }
protected:
/*
@@ -407,7 +412,8 @@ protected:
If query is cacheable return number tables in query
(query without tables not cached)
*/
- TABLE_COUNTER_TYPE is_cacheable(THD *thd, uint32 query_len, char *query,
+ TABLE_COUNTER_TYPE is_cacheable(THD *thd, size_t query_len,
+ const char *query,
LEX *lex, TABLE_LIST *tables_used,
uint8 *tables_type);
TABLE_COUNTER_TYPE process_and_count_tables(THD *thd,
@@ -423,6 +429,8 @@ protected:
uint def_query_hash_size = QUERY_CACHE_DEF_QUERY_HASH_SIZE,
uint def_table_hash_size = QUERY_CACHE_DEF_TABLE_HASH_SIZE);
+ bool is_disabled(void) { return m_query_cache_is_disabled; }
+
/* initialize cache (mutex) */
void init();
/* resize query cache (return real query size, 0 if disabled) */
@@ -462,10 +470,13 @@ protected:
void destroy();
- friend void query_cache_init_query(NET *net);
- friend void query_cache_insert(NET *net, const char *packet, ulong length);
- friend void query_cache_end_of_result(THD *thd);
- friend void query_cache_abort(NET *net);
+ void insert(Query_cache_tls *query_cache_tls,
+ const char *packet,
+ ulong length,
+ unsigned pkt_nr);
+
+ void end_of_result(THD *thd);
+ void abort(Query_cache_tls *query_cache_tls);
/*
The following functions are only used when debugging
@@ -493,9 +504,4 @@ protected:
extern Query_cache query_cache;
extern TYPELIB query_cache_type_typelib;
-void query_cache_init_query(NET *net);
-void query_cache_insert(NET *net, const char *packet, ulong length);
-void query_cache_end_of_result(THD *thd);
-void query_cache_abort(NET *net);
-
#endif
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 7b37a3f6e93..d37058d2167 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -91,7 +91,9 @@ extern "C" void free_user_var(user_var_entry *entry)
bool Key_part_spec::operator==(const Key_part_spec& other) const
{
- return length == other.length && !strcmp(field_name, other.field_name);
+ return length == other.length &&
+ !my_strcasecmp(system_charset_info, field_name.str,
+ other.field_name.str);
}
/**
@@ -200,19 +202,6 @@ bool foreign_key_prefix(Key *a, Key *b)
** Thread specific functions
****************************************************************************/
-/** Push an error to the error stack and return TRUE for now. */
-
-bool
-Reprepare_observer::report_error(THD *thd)
-{
- my_error(ER_NEED_REPREPARE, MYF(ME_NO_WARNING_FOR_ERROR|ME_NO_SP_HANDLER));
-
- m_invalidated= TRUE;
-
- return TRUE;
-}
-
-
Open_tables_state::Open_tables_state(ulong version_arg)
:version(version_arg), state_flags(0U)
{
@@ -271,7 +260,7 @@ const char *set_thd_proc_info(THD *thd, const char *info,
const char *old_info= thd->proc_info;
DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line,
(info != NULL) ? info : "(null)"));
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.status_change(info, calling_function, calling_file, calling_line);
#endif
thd->proc_info= info;
@@ -279,6 +268,26 @@ const char *set_thd_proc_info(THD *thd, const char *info,
}
extern "C"
+const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
+ pthread_mutex_t *mutex, const char *msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ return thd->enter_cond(cond, mutex, msg);
+}
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ thd->exit_cond(old_msg);
+ return;
+}
+
+extern "C"
void **thd_ha_data(const THD *thd, const struct handlerton *hton)
{
return (void **) &thd->ha_data[hton->slot].ha_ptr;
@@ -305,7 +314,7 @@ int thd_tx_isolation(const THD *thd)
extern "C"
void thd_inc_row_count(THD *thd)
{
- thd->row_count++;
+ thd->warning_info->inc_current_row_for_warning();
}
@@ -407,7 +416,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
/**
- Implementation of Drop_table_error_handler::handle_error().
+ Implementation of Drop_table_error_handler::handle_condition().
The reason in having this implementation is to silence technical low-level
warnings during DROP TABLE operation. Currently we don't want to expose
the following warnings during DROP TABLE:
@@ -420,150 +429,19 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
@return TRUE if the condition is handled.
*/
-bool Drop_table_error_handler::handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
-{
+bool Drop_table_error_handler::handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
+{
+ *cond_hdl= NULL;
return ((sql_errno == EE_DELETE && my_errno == ENOENT) ||
sql_errno == ER_TRG_NO_DEFINER);
}
-/**
- Clear this diagnostics area.
-
- Normally called at the end of a statement.
-*/
-
-void
-Diagnostics_area::reset_diagnostics_area()
-{
-#ifdef DBUG_OFF
- can_overwrite_status= FALSE;
- /** Don't take chances in production */
- m_message[0]= '\0';
- m_sql_errno= 0;
- m_server_status= 0;
- m_affected_rows= 0;
- m_last_insert_id= 0;
- m_total_warn_count= 0;
-#endif
- is_sent= FALSE;
- /** Tiny reset in debug mode to see garbage right away */
- m_status= DA_EMPTY;
-}
-
-
-/**
- Set OK status -- ends commands that do not return a
- result set, e.g. INSERT/UPDATE/DELETE.
-*/
-
-void
-Diagnostics_area::set_ok_status(THD *thd, ha_rows affected_rows_arg,
- ulonglong last_insert_id_arg,
- const char *message_arg)
-{
- DBUG_ASSERT(! is_set());
-#ifdef DBUG_OFF
- /*
- In production, refuse to overwrite an error or a custom response
- with an OK packet.
- */
- if (is_error() || is_disabled())
- return;
-#endif
- /** Only allowed to report success if has not yet reported an error */
-
- m_server_status= thd->server_status;
- m_total_warn_count= thd->total_warn_count;
- m_affected_rows= affected_rows_arg;
- m_last_insert_id= last_insert_id_arg;
- if (message_arg)
- strmake(m_message, message_arg, sizeof(m_message) - 1);
- else
- m_message[0]= '\0';
- m_status= DA_OK;
-}
-
-
-/**
- Set EOF status.
-*/
-
-void
-Diagnostics_area::set_eof_status(THD *thd)
-{
- /** Only allowed to report eof if has not yet reported an error */
-
- DBUG_ASSERT(! is_set());
-#ifdef DBUG_OFF
- /*
- In production, refuse to overwrite an error or a custom response
- with an EOF packet.
- */
- if (is_error() || is_disabled())
- return;
-#endif
-
- m_server_status= thd->server_status;
- /*
- If inside a stored procedure, do not return the total
- number of warnings, since they are not available to the client
- anyway.
- */
- m_total_warn_count= thd->spcont ? 0 : thd->total_warn_count;
-
- m_status= DA_EOF;
-}
-
-/**
- Set ERROR status.
-*/
-
-void
-Diagnostics_area::set_error_status(THD *thd, uint sql_errno_arg,
- const char *message_arg)
-{
- /*
- Only allowed to report error if has not yet reported a success
- The only exception is when we flush the message to the client,
- an error can happen during the flush.
- */
- DBUG_ASSERT(! is_set() || can_overwrite_status);
-#ifdef DBUG_OFF
- /*
- In production, refuse to overwrite a custom response with an
- ERROR packet.
- */
- if (is_disabled())
- return;
-#endif
-
- m_sql_errno= sql_errno_arg;
- strmake(m_message, message_arg, sizeof(m_message) - 1);
-
- m_status= DA_ERROR;
-}
-
-
-/**
- Mark the diagnostics area as 'DISABLED'.
-
- This is used in rare cases when the COM_ command at hand sends a response
- in a custom format. One example is the query cache, another is
- COM_STMT_PREPARE.
-*/
-
-void
-Diagnostics_area::disable_status()
-{
- DBUG_ASSERT(! is_set());
- m_status= DA_DISABLED;
-}
-
-
THD::THD()
:Statement(&main_lex, &main_mem_root, CONVENTIONAL_EXECUTION,
/* statement id */ 0),
@@ -579,6 +457,8 @@ THD::THD()
first_successful_insert_id_in_cur_stmt(0),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
examined_row_count(0),
+ warning_info(&main_warning_info),
+ stmt_da(&main_da),
global_read_lock(0),
is_fatal_error(0),
transaction_rollback_request(0),
@@ -589,10 +469,11 @@ THD::THD()
bootstrap(0),
derived_tables_processing(FALSE),
spcont(NULL),
- m_parser_state(NULL)
+ m_parser_state(NULL),
#if defined(ENABLED_DEBUG_SYNC)
- , debug_sync_control(0)
+ debug_sync_control(0),
#endif /* defined(ENABLED_DEBUG_SYNC) */
+ main_warning_info(0)
{
ulong tmp;
@@ -613,16 +494,14 @@ THD::THD()
killed= NOT_KILLED;
col_access=0;
is_slave_error= thread_specific_used= FALSE;
- hash_clear(&handler_tables_hash);
+ my_hash_clear(&handler_tables_hash);
tmp_table=0;
used_tables=0;
- cuted_fields= sent_row_count= row_count= 0L;
+ cuted_fields= 0L;
+ sent_row_count= 0L;
limit_found_rows= 0;
row_count_func= -1;
statement_id_counter= 0UL;
-#ifdef ERROR_INJECT_SUPPORT
- error_inject_value= 0UL;
-#endif
// Must be reset to handle error with THD's created for init of mysqld
lex->current_select= 0;
start_time=(time_t) 0;
@@ -636,7 +515,6 @@ THD::THD()
file_id = 0;
query_id= 0;
query_name_consts= 0;
- warn_id= 0;
db_charset= global_system_variables.collation_database;
bzero(ha_data, sizeof(ha_data));
mysys_var=0;
@@ -649,9 +527,6 @@ THD::THD()
net.vio=0;
#endif
client_capabilities= 0; // minimalistic client
-#ifdef HAVE_QUERY_CACHE
- query_cache_init_query(&net); // If error on boot
-#endif
ull=0;
system_thread= NON_SYSTEM_THREAD;
cleanup_done= abort_on_warning= no_warnings_for_error= 0;
@@ -672,15 +547,13 @@ THD::THD()
*scramble= '\0';
init();
- /* Initialize sub structures */
- init_sql_alloc(&warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
profiling.set_thd(this);
#endif
user_connect=(USER_CONN *)0;
- hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
- (hash_get_key) get_var_key,
- (hash_free_key) free_user_var, 0);
+ my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
+ (my_hash_get_key) get_var_key,
+ (my_hash_free_key) free_user_var, 0);
sp_proc_cache= NULL;
sp_func_cache= NULL;
@@ -721,19 +594,27 @@ void THD::push_internal_handler(Internal_error_handler *handler)
}
}
-
-bool THD::handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level)
+bool THD::handle_condition(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
{
if (!m_internal_handler)
+ {
+ *cond_hdl= NULL;
return FALSE;
+ }
for (Internal_error_handler *error_handler= m_internal_handler;
error_handler;
error_handler= m_internal_handler->m_prev_internal_handler)
{
- if (error_handler->handle_error(sql_errno, message, level, this))
- return TRUE;
+ if (error_handler-> handle_condition(this, sql_errno, sqlstate, level, msg,
+ cond_hdl))
+ {
+ return TRUE;
+ }
}
return FALSE;
@@ -746,6 +627,207 @@ void THD::pop_internal_handler()
m_internal_handler= m_internal_handler->m_prev_internal_handler;
}
+
+void THD::raise_error(uint sql_errno)
+{
+ const char* msg= ER(sql_errno);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_ERROR,
+ msg);
+}
+
+void THD::raise_error_printf(uint sql_errno, ...)
+{
+ va_list args;
+ char ebuff[MYSQL_ERRMSG_SIZE];
+ DBUG_ENTER("THD::raise_error_printf");
+ DBUG_PRINT("my", ("nr: %d errno: %d", sql_errno, errno));
+ const char* format= ER(sql_errno);
+ va_start(args, sql_errno);
+ my_vsnprintf(ebuff, sizeof(ebuff), format, args);
+ va_end(args);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ebuff);
+ DBUG_VOID_RETURN;
+}
+
+void THD::raise_warning(uint sql_errno)
+{
+ const char* msg= ER(sql_errno);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ msg);
+}
+
+void THD::raise_warning_printf(uint sql_errno, ...)
+{
+ va_list args;
+ char ebuff[MYSQL_ERRMSG_SIZE];
+ DBUG_ENTER("THD::raise_warning_printf");
+ DBUG_PRINT("enter", ("warning: %u", sql_errno));
+ const char* format= ER(sql_errno);
+ va_start(args, sql_errno);
+ my_vsnprintf(ebuff, sizeof(ebuff), format, args);
+ va_end(args);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ebuff);
+ DBUG_VOID_RETURN;
+}
+
+void THD::raise_note(uint sql_errno)
+{
+ DBUG_ENTER("THD::raise_note");
+ DBUG_PRINT("enter", ("code: %d", sql_errno));
+ if (!(this->options & OPTION_SQL_NOTES))
+ DBUG_VOID_RETURN;
+ const char* msg= ER(sql_errno);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_NOTE,
+ msg);
+ DBUG_VOID_RETURN;
+}
+
+void THD::raise_note_printf(uint sql_errno, ...)
+{
+ va_list args;
+ char ebuff[MYSQL_ERRMSG_SIZE];
+ DBUG_ENTER("THD::raise_note_printf");
+ DBUG_PRINT("enter",("code: %u", sql_errno));
+ if (!(this->options & OPTION_SQL_NOTES))
+ DBUG_VOID_RETURN;
+ const char* format= ER(sql_errno);
+ va_start(args, sql_errno);
+ my_vsnprintf(ebuff, sizeof(ebuff), format, args);
+ va_end(args);
+ (void) raise_condition(sql_errno,
+ NULL,
+ MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ebuff);
+ DBUG_VOID_RETURN;
+}
+
+MYSQL_ERROR* THD::raise_condition(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg)
+{
+ MYSQL_ERROR *cond= NULL;
+ DBUG_ENTER("THD::raise_condition");
+
+ if (!(this->options & OPTION_SQL_NOTES) &&
+ (level == MYSQL_ERROR::WARN_LEVEL_NOTE))
+ DBUG_RETURN(NULL);
+
+ warning_info->opt_clear_warning_info(query_id);
+
+ /*
+ TODO: replace by DBUG_ASSERT(sql_errno != 0) once all bugs similar to
+ Bug#36768 are fixed: a SQL condition must have a real (!=0) error number
+ so that it can be caught by handlers.
+ */
+ if (sql_errno == 0)
+ sql_errno= ER_UNKNOWN_ERROR;
+ if (msg == NULL)
+ msg= ER(sql_errno);
+ if (sqlstate == NULL)
+ sqlstate= mysql_errno_to_sqlstate(sql_errno);
+
+ if ((level == MYSQL_ERROR::WARN_LEVEL_WARN) &&
+ really_abort_on_warning())
+ {
+ /*
+ FIXME:
+ push_warning and strict SQL_MODE case.
+ */
+ level= MYSQL_ERROR::WARN_LEVEL_ERROR;
+ killed= THD::KILL_BAD_DATA;
+ }
+
+ switch (level)
+ {
+ case MYSQL_ERROR::WARN_LEVEL_NOTE:
+ case MYSQL_ERROR::WARN_LEVEL_WARN:
+ got_warning= 1;
+ break;
+ case MYSQL_ERROR::WARN_LEVEL_ERROR:
+ break;
+ default:
+ DBUG_ASSERT(FALSE);
+ }
+
+ if (handle_condition(sql_errno, sqlstate, level, msg, &cond))
+ DBUG_RETURN(cond);
+
+ if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
+ {
+ is_slave_error= 1; // needed to catch query errors during replication
+
+ /*
+ thd->lex->current_select == 0 if lex structure is not inited
+ (not query command (COM_QUERY))
+ */
+ if (lex->current_select &&
+ lex->current_select->no_error && !is_fatal_error)
+ {
+ DBUG_PRINT("error",
+ ("Error converted to warning: current_select: no_error %d "
+ "fatal_error: %d",
+ (lex->current_select ?
+ lex->current_select->no_error : 0),
+ (int) is_fatal_error));
+ }
+ else
+ {
+ if (! stmt_da->is_error())
+ stmt_da->set_error_status(this, sql_errno, msg, sqlstate);
+ }
+ }
+
+ /*
+ If a continue handler is found, the error message will be cleared
+ by the stored procedures code.
+ */
+ if (!is_fatal_error && spcont &&
+ spcont->handle_condition(this, sql_errno, sqlstate, level, msg, &cond))
+ {
+ /*
+ Do not push any warnings, a handled error must be completely
+ silenced.
+ */
+ DBUG_RETURN(cond);
+ }
+
+ /* Un-handled conditions */
+
+ cond= raise_condition_no_handler(sql_errno, sqlstate, level, msg);
+ DBUG_RETURN(cond);
+}
+
+MYSQL_ERROR*
+THD::raise_condition_no_handler(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg)
+{
+ MYSQL_ERROR *cond= NULL;
+ DBUG_ENTER("THD::raise_condition_no_handler");
+
+ query_cache_abort(&query_cache_tls);
+
+ /* FIXME: broken special case */
+ if (no_warnings_for_error && (level == MYSQL_ERROR::WARN_LEVEL_ERROR))
+ DBUG_RETURN(NULL);
+
+ cond= warning_info->push_warning(this, sql_errno, sqlstate, level, msg);
+ DBUG_RETURN(cond);
+}
extern "C"
void *thd_alloc(MYSQL_THD thd, unsigned int size)
{
@@ -834,9 +916,6 @@ void THD::init(void)
TL_WRITE_LOW_PRIORITY :
TL_WRITE);
session_tx_isolation= (enum_tx_isolation) variables.tx_isolation;
- warn_list.empty();
- bzero((char*) warn_count, sizeof(warn_count));
- total_warn_count= 0;
update_charset();
reset_current_stmt_binlog_row_based();
bzero((char *) &status_var, sizeof(status_var));
@@ -894,9 +973,9 @@ void THD::change_user(void)
cleanup_done= 0;
init();
stmt_map.reset();
- hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
- (hash_get_key) get_var_key,
- (hash_free_key) free_user_var, 0);
+ my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
+ (my_hash_get_key) get_var_key,
+ (my_hash_free_key) free_user_var, 0);
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);
}
@@ -933,7 +1012,7 @@ void THD::cleanup(void)
mysql_ha_cleanup(this);
delete_dynamic(&user_var_events);
- hash_free(&user_vars);
+ my_hash_free(&user_vars);
close_temporary_tables(this);
my_free((char*) variables.time_format, MYF(MY_ALLOW_ZERO_PTR));
my_free((char*) variables.date_format, MYF(MY_ALLOW_ZERO_PTR));
@@ -985,7 +1064,6 @@ THD::~THD()
DBUG_PRINT("info", ("freeing security context"));
main_security_ctx.destroy();
safeFree(db);
- free_root(&warn_root,MYF(0));
#ifdef USING_TRANSACTIONS
free_root(&transaction.mem_root,MYF(0));
#endif
@@ -1452,8 +1530,8 @@ int THD::send_explain_fields(select_result *result)
}
item->maybe_null= 1;
field_list.push_back(new Item_empty_string("Extra", 255, cs));
- return (result->send_fields(field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));
+ return (result->send_result_set_metadata(field_list,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));
}
#ifdef SIGNAL_WITH_VIO_CLOSE
@@ -1560,13 +1638,17 @@ bool select_result::check_simple_select() const
static String default_line_term("\n",default_charset_info);
static String default_escaped("\\",default_charset_info);
static String default_field_term("\t",default_charset_info);
+static String default_xml_row_term("<row>", default_charset_info);
-sql_exchange::sql_exchange(char *name,bool flag)
+sql_exchange::sql_exchange(char *name, bool flag,
+ enum enum_filetype filetype_arg)
:file_name(name), opt_enclosed(0), dumpfile(flag), skip_lines(0)
{
+ filetype= filetype_arg;
field_term= &default_field_term;
enclosed= line_start= &my_empty_string;
- line_term= &default_line_term;
+ line_term= filetype == FILETYPE_CSV ?
+ &default_line_term : &default_xml_row_term;
escaped= &default_escaped;
cs= NULL;
}
@@ -1577,10 +1659,10 @@ bool sql_exchange::escaped_given(void)
}
-bool select_send::send_fields(List<Item> &list, uint flags)
+bool select_send::send_result_set_metadata(List<Item> &list, uint flags)
{
bool res;
- if (!(res= thd->protocol->send_fields(&list, flags)))
+ if (!(res= thd->protocol->send_result_set_metadata(&list, flags)))
is_result_set_started= 1;
return res;
}
@@ -1588,21 +1670,19 @@ bool select_send::send_fields(List<Item> &list, uint flags)
void select_send::abort()
{
DBUG_ENTER("select_send::abort");
- if (is_result_set_started && thd->spcont &&
- thd->spcont->find_handler(thd, thd->main_da.sql_errno(),
- MYSQL_ERROR::WARN_LEVEL_ERROR))
+
+ if (is_result_set_started && thd->spcont)
{
/*
We're executing a stored procedure, have an open result
- set, an SQL exception condition and a handler for it.
- In this situation we must abort the current statement,
- silence the error and start executing the continue/exit
- handler.
+ set and an SQL exception condition. In this situation we
+ must abort the current statement, silence the error and
+ start executing the continue/exit handler if one is found.
Before aborting the statement, let's end the open result set, as
otherwise the client will hang due to the violation of the
client/server protocol.
*/
- thd->protocol->end_partial_result_set(thd);
+ thd->spcont->end_partial_result_set= TRUE;
}
DBUG_VOID_RETURN;
}
@@ -1623,10 +1703,13 @@ void select_send::cleanup()
bool select_send::send_data(List<Item> &items)
{
+ Protocol *protocol= thd->protocol;
+ DBUG_ENTER("select_send::send_data");
+
if (unit->offset_limit_cnt)
{ // using limit offset,count
unit->offset_limit_cnt--;
- return 0;
+ DBUG_RETURN(FALSE);
}
/*
@@ -1636,36 +1719,18 @@ bool select_send::send_data(List<Item> &items)
*/
ha_release_temporary_latches(thd);
- List_iterator_fast<Item> li(items);
- Protocol *protocol= thd->protocol;
- char buff[MAX_FIELD_WIDTH];
- String buffer(buff, sizeof(buff), &my_charset_bin);
- DBUG_ENTER("select_send::send_data");
-
protocol->prepare_for_resend();
- Item *item;
- while ((item=li++))
- {
- if (item->send(protocol, &buffer))
- {
- protocol->free(); // Free used buffer
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- break;
- }
- /*
- Reset buffer to its original state, as it may have been altered in
- Item::send().
- */
- buffer.set(buff, sizeof(buff), &my_charset_bin);
- }
- thd->sent_row_count++;
- if (thd->is_error())
+ if (protocol->send_result_set_row(&items))
{
protocol->remove_last_row();
- DBUG_RETURN(1);
+ DBUG_RETURN(TRUE);
}
+
+ thd->sent_row_count++;
+
if (thd->vio_ok())
DBUG_RETURN(protocol->write());
+
DBUG_RETURN(0);
}
@@ -2571,12 +2636,12 @@ Statement_map::Statement_map() :
START_STMT_HASH_SIZE = 16,
START_NAME_HASH_SIZE = 16
};
- hash_init(&st_hash, &my_charset_bin, START_STMT_HASH_SIZE, 0, 0,
- get_statement_id_as_hash_key,
- delete_statement_as_hash_key, MYF(0));
- hash_init(&names_hash, system_charset_info, START_NAME_HASH_SIZE, 0, 0,
- (hash_get_key) get_stmt_name_hash_key,
- NULL,MYF(0));
+ my_hash_init(&st_hash, &my_charset_bin, START_STMT_HASH_SIZE, 0, 0,
+ get_statement_id_as_hash_key,
+ delete_statement_as_hash_key, MYF(0));
+ my_hash_init(&names_hash, system_charset_info, START_NAME_HASH_SIZE, 0, 0,
+ (my_hash_get_key) get_stmt_name_hash_key,
+ NULL,MYF(0));
}
@@ -2641,9 +2706,9 @@ int Statement_map::insert(THD *thd, Statement *statement)
err_max:
if (statement->name.str)
- hash_delete(&names_hash, (uchar*) statement);
+ my_hash_delete(&names_hash, (uchar*) statement);
err_names_hash:
- hash_delete(&st_hash, (uchar*) statement);
+ my_hash_delete(&st_hash, (uchar*) statement);
err_st_hash:
return 1;
}
@@ -2664,9 +2729,9 @@ void Statement_map::erase(Statement *statement)
if (statement == last_found_statement)
last_found_statement= 0;
if (statement->name.str)
- hash_delete(&names_hash, (uchar *) statement);
+ my_hash_delete(&names_hash, (uchar *) statement);
- hash_delete(&st_hash, (uchar *) statement);
+ my_hash_delete(&st_hash, (uchar *) statement);
pthread_mutex_lock(&LOCK_prepared_stmt_count);
DBUG_ASSERT(prepared_stmt_count > 0);
prepared_stmt_count--;
@@ -2696,8 +2761,8 @@ Statement_map::~Statement_map()
prepared_stmt_count-= st_hash.records;
pthread_mutex_unlock(&LOCK_prepared_stmt_count);
- hash_free(&names_hash);
- hash_free(&st_hash);
+ my_hash_free(&names_hash);
+ my_hash_free(&st_hash);
}
bool select_dumpvar::send_data(List<Item> &items)
@@ -3265,15 +3330,15 @@ void xid_free_hash(void *ptr)
bool xid_cache_init()
{
pthread_mutex_init(&LOCK_xid_cache, MY_MUTEX_INIT_FAST);
- return hash_init(&xid_cache, &my_charset_bin, 100, 0, 0,
- xid_get_hash_key, xid_free_hash, 0) != 0;
+ return my_hash_init(&xid_cache, &my_charset_bin, 100, 0, 0,
+ xid_get_hash_key, xid_free_hash, 0) != 0;
}
void xid_cache_free()
{
- if (hash_inited(&xid_cache))
+ if (my_hash_inited(&xid_cache))
{
- hash_free(&xid_cache);
+ my_hash_free(&xid_cache);
pthread_mutex_destroy(&LOCK_xid_cache);
}
}
@@ -3281,7 +3346,8 @@ void xid_cache_free()
XID_STATE *xid_cache_search(XID *xid)
{
pthread_mutex_lock(&LOCK_xid_cache);
- XID_STATE *res=(XID_STATE *)hash_search(&xid_cache, xid->key(), xid->key_length());
+ XID_STATE *res=(XID_STATE *)my_hash_search(&xid_cache, xid->key(),
+ xid->key_length());
pthread_mutex_unlock(&LOCK_xid_cache);
return res;
}
@@ -3292,7 +3358,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state)
XID_STATE *xs;
my_bool res;
pthread_mutex_lock(&LOCK_xid_cache);
- if (hash_search(&xid_cache, xid->key(), xid->key_length()))
+ if (my_hash_search(&xid_cache, xid->key(), xid->key_length()))
res=0;
else if (!(xs=(XID_STATE *)my_malloc(sizeof(*xs), MYF(MY_WME))))
res=1;
@@ -3311,8 +3377,8 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state)
bool xid_cache_insert(XID_STATE *xid_state)
{
pthread_mutex_lock(&LOCK_xid_cache);
- DBUG_ASSERT(hash_search(&xid_cache, xid_state->xid.key(),
- xid_state->xid.key_length())==0);
+ DBUG_ASSERT(my_hash_search(&xid_cache, xid_state->xid.key(),
+ xid_state->xid.key_length())==0);
my_bool res=my_hash_insert(&xid_cache, (uchar*)xid_state);
pthread_mutex_unlock(&LOCK_xid_cache);
return res;
@@ -3322,7 +3388,7 @@ bool xid_cache_insert(XID_STATE *xid_state)
void xid_cache_delete(XID_STATE *xid_state)
{
pthread_mutex_lock(&LOCK_xid_cache);
- hash_delete(&xid_cache, (uchar *)xid_state);
+ my_hash_delete(&xid_cache, (uchar *)xid_state);
pthread_mutex_unlock(&LOCK_xid_cache);
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index f5d56192140..01ac3c12641 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,6 +14,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifndef SQL_CLASS_INCLUDED
+#define SQL_CLASS_INCLUDED
+
/* Classes in mysql */
#ifdef USE_PRAGMA_INTERFACE
@@ -23,51 +26,8 @@
#include "log.h"
#include "rpl_tblmap.h"
-/**
- An interface that is used to take an action when
- the locking module notices that a table version has changed
- since the last execution. "Table" here may refer to any kind of
- table -- a base table, a temporary table, a view or an
- information schema table.
-
- When we open and lock tables for execution of a prepared
- statement, we must verify that they did not change
- since statement prepare. If some table did change, the statement
- parse tree *may* be no longer valid, e.g. in case it contains
- optimizations that depend on table metadata.
-
- This class provides an interface (a method) that is
- invoked when such a situation takes place.
- The implementation of the method simply reports an error, but
- the exact details depend on the nature of the SQL statement.
-
- At most 1 instance of this class is active at a time, in which
- case THD::m_reprepare_observer is not NULL.
-
- @sa check_and_update_table_version() for details of the
- version tracking algorithm
-
- @sa Open_tables_state::m_reprepare_observer for the life cycle
- of metadata observers.
-*/
-
-class Reprepare_observer
-{
-public:
- /**
- Check if a change of metadata is OK. In future
- the signature of this method may be extended to accept the old
- and the new versions, but since currently the check is very
- simple, we only need the THD to report an error.
- */
- bool report_error(THD *thd);
- bool is_invalidated() const { return m_invalidated; }
- void reset_reprepare_observer() { m_invalidated= FALSE; }
-private:
- bool m_invalidated;
-};
-
+class Reprepare_observer;
class Relay_log_info;
class Query_log_event;
@@ -88,6 +48,7 @@ enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT,
SLAVE_EXEC_MODE_LAST_BIT};
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
+enum enum_filetype { FILETYPE_CSV, FILETYPE_XML };
extern char internal_table_name[2];
extern char empty_c_string[1];
@@ -146,9 +107,14 @@ typedef struct st_copy_info {
class Key_part_spec :public Sql_alloc {
public:
- const char *field_name;
+ LEX_STRING field_name;
uint length;
- Key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
+ Key_part_spec(const LEX_STRING &name, uint len)
+ : field_name(name), length(len)
+ {}
+ Key_part_spec(const char *name, const size_t name_len, uint len)
+ : length(len)
+ { field_name.str= (char *)name; field_name.length= name_len; }
bool operator==(const Key_part_spec& other) const;
/**
Construct a copy of this Key_part_spec. field_name is copied
@@ -201,15 +167,24 @@ public:
enum Keytype type;
KEY_CREATE_INFO key_create_info;
List<Key_part_spec> columns;
- const char *name;
+ LEX_STRING name;
bool generated;
- Key(enum Keytype type_par, const char *name_arg,
+ Key(enum Keytype type_par, const LEX_STRING &name_arg,
KEY_CREATE_INFO *key_info_arg,
bool generated_arg, List<Key_part_spec> &cols)
:type(type_par), key_create_info(*key_info_arg), columns(cols),
name(name_arg), generated(generated_arg)
{}
+ Key(enum Keytype type_par, const char *name_arg, size_t name_len_arg,
+ KEY_CREATE_INFO *key_info_arg, bool generated_arg,
+ List<Key_part_spec> &cols)
+ :type(type_par), key_create_info(*key_info_arg), columns(cols),
+ generated(generated_arg)
+ {
+ name.str= (char *)name_arg;
+ name.length= name_len_arg;
+ }
Key(const Key &rhs, MEM_ROOT *mem_root);
virtual ~Key() {}
/* Equality comparison of keys (ignoring name) */
@@ -234,7 +209,7 @@ public:
Table_ident *ref_table;
List<Key_part_spec> ref_columns;
uint delete_opt, update_opt, match_opt;
- Foreign_key(const char *name_arg, List<Key_part_spec> &cols,
+ Foreign_key(const LEX_STRING &name_arg, List<Key_part_spec> &cols,
Table_ident *table, List<Key_part_spec> &ref_cols,
uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg)
:Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols),
@@ -267,6 +242,62 @@ public:
LEX_COLUMN (const String& x,const uint& y ): column (x),rights (y) {}
};
+/**
+ Query_cache_tls -- query cache thread local data.
+*/
+
+struct Query_cache_block;
+
+struct Query_cache_tls
+{
+ /*
+ 'first_query_block' should be accessed only via query cache
+ functions and methods to maintain proper locking.
+ */
+ Query_cache_block *first_query_block;
+ void set_first_query_block(Query_cache_block *first_query_block_arg)
+ {
+ first_query_block= first_query_block_arg;
+ }
+
+ Query_cache_tls() :first_query_block(NULL) {}
+};
+
+/* SIGNAL / RESIGNAL / GET DIAGNOSTICS */
+
+/**
+ This enumeration list all the condition item names of a condition in the
+ SQL condition area.
+*/
+typedef enum enum_diag_condition_item_name
+{
+ /*
+ Conditions that can be set by the user (SIGNAL/RESIGNAL),
+ and by the server implementation.
+ */
+
+ DIAG_CLASS_ORIGIN= 0,
+ FIRST_DIAG_SET_PROPERTY= DIAG_CLASS_ORIGIN,
+ DIAG_SUBCLASS_ORIGIN= 1,
+ DIAG_CONSTRAINT_CATALOG= 2,
+ DIAG_CONSTRAINT_SCHEMA= 3,
+ DIAG_CONSTRAINT_NAME= 4,
+ DIAG_CATALOG_NAME= 5,
+ DIAG_SCHEMA_NAME= 6,
+ DIAG_TABLE_NAME= 7,
+ DIAG_COLUMN_NAME= 8,
+ DIAG_CURSOR_NAME= 9,
+ DIAG_MESSAGE_TEXT= 10,
+ DIAG_MYSQL_ERRNO= 11,
+ LAST_DIAG_SET_PROPERTY= DIAG_MYSQL_ERRNO
+} Diag_condition_item_name;
+
+/**
+ Name of each diagnostic condition item.
+ This array is indexed by Diag_condition_item_name.
+*/
+extern const LEX_STRING Diag_condition_item_names[];
+
#include "sql_lex.h" /* Must be here */
class Delayed_insert;
@@ -390,6 +421,8 @@ struct system_variables
CHARSET_INFO *collation_database;
CHARSET_INFO *collation_connection;
+ /* Error messages */
+ MY_LOCALE *lc_messages;
/* Locale Support */
MY_LOCALE *lc_time_names;
@@ -706,8 +739,8 @@ public:
Statement *find_by_name(LEX_STRING *name)
{
Statement *stmt;
- stmt= (Statement*)hash_search(&names_hash, (uchar*)name->str,
- name->length);
+ stmt= (Statement*)my_hash_search(&names_hash, (uchar*)name->str,
+ name->length);
return stmt;
}
@@ -716,7 +749,7 @@ public:
if (last_found_statement == 0 || id != last_found_statement->id)
{
Statement *stmt;
- stmt= (Statement *) hash_search(&st_hash, (uchar *) &id, sizeof(id));
+ stmt= (Statement *) my_hash_search(&st_hash, (uchar *) &id, sizeof(id));
if (stmt && stmt->name.str)
return NULL;
last_found_statement= stmt;
@@ -1043,12 +1076,12 @@ protected:
public:
/**
- Handle an error condition.
+ Handle a sql condition.
This method can be implemented by a subclass to achieve any of the
following:
- - mask an error internally, prevent exposing it to the user,
- - mask an error and throw another one instead.
- When this method returns true, the error condition is considered
+ - mask a warning/error internally, prevent exposing it to the user,
+ - mask a warning/error and throw another one instead.
+ When this method returns true, the sql condition is considered
'handled', and will not be propagated to upper layers.
It is the responsability of the code installing an internal handler
to then check for trapped conditions, and implement logic to recover
@@ -1062,15 +1095,17 @@ public:
before removing it from the exception stack with
<code>THD::pop_internal_handler()</code>.
- @param sql_errno the error number
- @param level the error level
@param thd the calling thread
- @return true if the error is handled
+ @param cond the condition raised.
+ @return true if the condition is handled
*/
- virtual bool handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd) = 0;
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl) = 0;
+
private:
Internal_error_handler *m_prev_internal_handler;
friend class THD;
@@ -1085,10 +1120,12 @@ private:
class Dummy_error_handler : public Internal_error_handler
{
public:
- bool handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd)
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
{
/* Ignore error */
return TRUE;
@@ -1097,7 +1134,7 @@ public:
/**
- This class is an internal error handler implementation for
+ This class is an internal error handler implementation for
DROP TABLE statements. The thing is that there may be warnings during
execution of these statements, which should not be exposed to the user.
This class is intended to silence such warnings.
@@ -1111,10 +1148,12 @@ public:
{ }
public:
- bool handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
private:
Internal_error_handler *m_err_handler;
@@ -1122,123 +1161,6 @@ private:
/**
- Stores status of the currently executed statement.
- Cleared at the beginning of the statement, and then
- can hold either OK, ERROR, or EOF status.
- Can not be assigned twice per statement.
-*/
-
-class Diagnostics_area
-{
-public:
- enum enum_diagnostics_status
- {
- /** The area is cleared at start of a statement. */
- DA_EMPTY= 0,
- /** Set whenever one calls my_ok(). */
- DA_OK,
- /** Set whenever one calls my_eof(). */
- DA_EOF,
- /** Set whenever one calls my_error() or my_message(). */
- DA_ERROR,
- /** Set in case of a custom response, such as one from COM_STMT_PREPARE. */
- DA_DISABLED
- };
- /** True if status information is sent to the client. */
- bool is_sent;
- /** Set to make set_error_status after set_{ok,eof}_status possible. */
- bool can_overwrite_status;
-
- void set_ok_status(THD *thd, ha_rows affected_rows_arg,
- ulonglong last_insert_id_arg,
- const char *message);
- void set_eof_status(THD *thd);
- void set_error_status(THD *thd, uint sql_errno_arg, const char *message_arg);
-
- void disable_status();
-
- void reset_diagnostics_area();
-
- bool is_set() const { return m_status != DA_EMPTY; }
- bool is_error() const { return m_status == DA_ERROR; }
- bool is_eof() const { return m_status == DA_EOF; }
- bool is_ok() const { return m_status == DA_OK; }
- bool is_disabled() const { return m_status == DA_DISABLED; }
- enum_diagnostics_status status() const { return m_status; }
-
- const char *message() const
- { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK); return m_message; }
-
- uint sql_errno() const
- { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; }
-
- uint server_status() const
- {
- DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
- return m_server_status;
- }
-
- ha_rows affected_rows() const
- { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
-
- ulonglong last_insert_id() const
- { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; }
-
- uint total_warn_count() const
- {
- DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
- return m_total_warn_count;
- }
-
- Diagnostics_area() { reset_diagnostics_area(); }
-
-private:
- /** Message buffer. Can be used by OK or ERROR status. */
- char m_message[MYSQL_ERRMSG_SIZE];
- /**
- SQL error number. One of ER_ codes from share/errmsg.txt.
- Set by set_error_status.
- */
- uint m_sql_errno;
-
- /**
- Copied from thd->server_status when the diagnostics area is assigned.
- We need this member as some places in the code use the following pattern:
- thd->server_status|= ...
- my_eof(thd);
- thd->server_status&= ~...
- Assigned by OK, EOF or ERROR.
- */
- uint m_server_status;
- /**
- The number of rows affected by the last statement. This is
- semantically close to thd->row_count_func, but has a different
- life cycle. thd->row_count_func stores the value returned by
- function ROW_COUNT() and is cleared only by statements that
- update its value, such as INSERT, UPDATE, DELETE and few others.
- This member is cleared at the beginning of the next statement.
-
- We could possibly merge the two, but life cycle of thd->row_count_func
- can not be changed.
- */
- ha_rows m_affected_rows;
- /**
- Similarly to the previous member, this is a replacement of
- thd->first_successful_insert_id_in_prev_stmt, which is used
- to implement LAST_INSERT_ID().
- */
- ulonglong m_last_insert_id;
- /** The total number of warnings. */
- uint m_total_warn_count;
- enum_diagnostics_status m_status;
- /**
- @todo: the following THD members belong here:
- - warn_list, warn_count,
- */
-};
-
-
-/**
Storage engine specific thread local data.
*/
@@ -1264,6 +1186,7 @@ struct Ha_data
Ha_data() :ha_ptr(NULL) {}
};
+extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
/**
@class THD
@@ -1305,8 +1228,10 @@ public:
*/
struct st_mysql_stmt *current_stmt;
#endif
+#ifdef HAVE_QUERY_CACHE
+ Query_cache_tls query_cache_tls;
+#endif
NET net; // client connection descriptor
- MEM_ROOT warn_root; // For warnings and errors
Protocol *protocol; // Current protocol
Protocol_text protocol_text; // Normal protocol
Protocol_binary protocol_binary; // Binary protocol
@@ -1722,17 +1647,9 @@ public:
table_map used_tables;
USER_CONN *user_connect;
CHARSET_INFO *db_charset;
- /*
- FIXME: this, and some other variables like 'count_cuted_fields'
- maybe should be statement/cursor local, that is, moved to Statement
- class. With current implementation warnings produced in each prepared
- statement/cursor settle here.
- */
- List <MYSQL_ERROR> warn_list;
- uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
- uint total_warn_count;
- Diagnostics_area main_da;
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+ Warning_info *warning_info;
+ Diagnostics_area *stmt_da;
+#if defined(ENABLED_PROFILING)
PROFILING profiling;
#endif
@@ -1744,20 +1661,12 @@ public:
from table are necessary for this select, to check if it's necessary to
update auto-updatable fields (like auto_increment and timestamp).
*/
- query_id_t query_id, warn_id;
+ query_id_t query_id;
ulong col_access;
-#ifdef ERROR_INJECT_SUPPORT
- ulong error_inject_value;
-#endif
/* Statement id is thread-wide. This counter is used to generate ids */
ulong statement_id_counter;
ulong rand_saved_seed1, rand_saved_seed2;
- /*
- Row counter, mainly for errors and warnings. Not increased in
- create_sort_index(); may differ from examined_row_count.
- */
- ulong row_count;
pthread_t real_id; /* For debugging */
my_thread_id thread_id;
uint tmp_table, global_read_lock;
@@ -1985,7 +1894,7 @@ public:
inline void exit_cond(const char* old_msg)
{
/*
- Putting the mutex unlock in exit_cond() ensures that
+ Putting the mutex unlock in thd->exit_cond() ensures that
mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
locked (if that would not be the case, you'll get a deadlock if someone
does a THD::awake() on you).
@@ -1996,6 +1905,7 @@ public:
mysys_var->current_cond = 0;
proc_info = old_msg;
pthread_mutex_unlock(&mysys_var->mutex);
+ return;
}
inline time_t query_start() { query_start_used=1; return start_time; }
inline void set_time()
@@ -2066,8 +1976,8 @@ public:
inline void clear_error()
{
DBUG_ENTER("clear_error");
- if (main_da.is_error())
- main_da.reset_diagnostics_area();
+ if (stmt_da->is_error())
+ stmt_da->reset_diagnostics_area();
is_slave_error= 0;
DBUG_VOID_RETURN;
}
@@ -2099,7 +2009,7 @@ public:
To raise this flag, use my_error().
*/
- inline bool is_error() const { return main_da.is_error(); }
+ inline bool is_error() const { return stmt_da->is_error(); }
inline CHARSET_INFO *charset() { return variables.character_set_client; }
void update_charset();
@@ -2299,19 +2209,107 @@ public:
void push_internal_handler(Internal_error_handler *handler);
/**
- Handle an error condition.
- @param sql_errno the error number
- @param level the error level
- @return true if the error is handled
- */
- virtual bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level);
+ Handle a sql condition.
+ @param sql_errno the condition error number
+ @param sqlstate the condition sqlstate
+ @param level the condition level
+ @param msg the condition message text
+ @param[out] cond_hdl the sql condition raised, if any
+ @return true if the condition is handled
+ */
+ virtual bool handle_condition(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
/**
Remove the error handler last pushed.
*/
void pop_internal_handler();
+ /**
+ Raise an exception condition.
+ @param code the MYSQL_ERRNO error code of the error
+ */
+ void raise_error(uint code);
+
+ /**
+ Raise an exception condition, with a formatted message.
+ @param code the MYSQL_ERRNO error code of the error
+ */
+ void raise_error_printf(uint code, ...);
+
+ /**
+ Raise a completion condition (warning).
+ @param code the MYSQL_ERRNO error code of the warning
+ */
+ void raise_warning(uint code);
+
+ /**
+ Raise a completion condition (warning), with a formatted message.
+ @param code the MYSQL_ERRNO error code of the warning
+ */
+ void raise_warning_printf(uint code, ...);
+
+ /**
+ Raise a completion condition (note), with a fixed message.
+ @param code the MYSQL_ERRNO error code of the note
+ */
+ void raise_note(uint code);
+
+ /**
+ Raise an completion condition (note), with a formatted message.
+ @param code the MYSQL_ERRNO error code of the note
+ */
+ void raise_note_printf(uint code, ...);
+
+private:
+ /*
+ Only the implementation of the SIGNAL and RESIGNAL statements
+ is permitted to raise SQL conditions in a generic way,
+ or to raise them by bypassing handlers (RESIGNAL).
+ To raise a SQL condition, the code should use the public
+ raise_error() or raise_warning() methods provided by class THD.
+ */
+ friend class Signal_common;
+ friend class Signal_statement;
+ friend class Resignal_statement;
+ friend void push_warning(THD*, MYSQL_ERROR::enum_warning_level, uint, const char*);
+ friend void my_message_sql(uint, const char *, myf);
+
+ /**
+ Raise a generic SQL condition.
+ @param sql_errno the condition error number
+ @param sqlstate the condition SQLSTATE
+ @param level the condition level
+ @param msg the condition message text
+ @return The condition raised, or NULL
+ */
+ MYSQL_ERROR*
+ raise_condition(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg);
+
+ /**
+ Raise a generic SQL condition, without activation any SQL condition
+ handlers.
+ This method is necessary to support the RESIGNAL statement,
+ which is allowed to bypass SQL exception handlers.
+ @param sql_errno the condition error number
+ @param sqlstate the condition SQLSTATE
+ @param level the condition level
+ @param msg the condition message text
+ @return The condition raised, or NULL
+ */
+ MYSQL_ERROR*
+ raise_condition_no_handler(uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg);
+
+public:
/** Overloaded to guard query/query_length fields */
virtual void set_statement(Statement *stmt);
@@ -2339,25 +2337,27 @@ private:
tree itself is reused between executions and thus is stored elsewhere.
*/
MEM_ROOT main_mem_root;
+ Warning_info main_warning_info;
+ Diagnostics_area main_da;
};
-/** A short cut for thd->main_da.set_ok_status(). */
+/** A short cut for thd->stmt_da->set_ok_status(). */
inline void
-my_ok(THD *thd, ha_rows affected_rows= 0, ulonglong id= 0,
+my_ok(THD *thd, ulonglong affected_rows= 0, ulonglong id= 0,
const char *message= NULL)
{
- thd->main_da.set_ok_status(thd, affected_rows, id, message);
+ thd->stmt_da->set_ok_status(thd, affected_rows, id, message);
}
-/** A short cut for thd->main_da.set_eof_status(). */
+/** A short cut for thd->stmt_da->set_eof_status(). */
inline void
my_eof(THD *thd)
{
- thd->main_da.set_eof_status(thd);
+ thd->stmt_da->set_eof_status(thd);
}
#define tmp_disable_binlog(A) \
@@ -2376,13 +2376,15 @@ my_eof(THD *thd)
class sql_exchange :public Sql_alloc
{
public:
+ enum enum_filetype filetype; /* load XML, Added by Arnold & Erik */
char *file_name;
String *field_term,*enclosed,*line_term,*line_start,*escaped;
bool opt_enclosed;
bool dumpfile;
ulong skip_lines;
CHARSET_INFO *cs;
- sql_exchange(char *name,bool dumpfile_flag);
+ sql_exchange(char *name, bool dumpfile_flag,
+ enum_filetype filetype_arg= FILETYPE_CSV);
bool escaped_given(void);
};
@@ -2415,7 +2417,7 @@ public:
*/
virtual uint field_count(List<Item> &fields) const
{ return fields.elements; }
- virtual bool send_fields(List<Item> &list, uint flags)=0;
+ virtual bool send_result_set_metadata(List<Item> &list, uint flags)=0;
virtual bool send_data(List<Item> &items)=0;
virtual bool initialize_tables (JOIN *join=0) { return 0; }
virtual void send_error(uint errcode,const char *err);
@@ -2460,7 +2462,7 @@ class select_result_interceptor: public select_result
public:
select_result_interceptor() {} /* Remove gcc warning */
uint field_count(List<Item> &fields) const { return 0; }
- bool send_fields(List<Item> &fields, uint flag) { return FALSE; }
+ bool send_result_set_metadata(List<Item> &fields, uint flag) { return FALSE; }
};
@@ -2473,7 +2475,7 @@ class select_send :public select_result {
bool is_result_set_started;
public:
select_send() :is_result_set_started(FALSE) {}
- bool send_fields(List<Item> &list, uint flags);
+ bool send_result_set_metadata(List<Item> &list, uint flags);
bool send_data(List<Item> &items);
bool send_eof();
virtual bool check_simple_select() const { return FALSE; }
@@ -3051,11 +3053,11 @@ public:
/* Bits in sql_command_flags */
-#define CF_CHANGES_DATA 1
-#define CF_HAS_ROW_COUNT 2
-#define CF_STATUS_COMMAND 4
-#define CF_SHOW_TABLE_COMMAND 8
-#define CF_WRITE_LOGS_COMMAND 16
+#define CF_CHANGES_DATA (1U << 0)
+#define CF_HAS_ROW_COUNT (1U << 1)
+#define CF_STATUS_COMMAND (1U << 2)
+#define CF_SHOW_TABLE_COMMAND (1U << 3)
+#define CF_WRITE_LOGS_COMMAND (1U << 4)
/**
Must be set for SQL statements that may contain
Item expressions and/or use joins and tables.
@@ -3069,7 +3071,17 @@ public:
reprepare. Consequently, complex item expressions and
joins are currently prohibited in these statements.
*/
-#define CF_REEXECUTION_FRAGILE 32
+#define CF_REEXECUTION_FRAGILE (1U << 5)
+
+/**
+ Diagnostic statement.
+ Diagnostic statements:
+ - SHOW WARNING
+ - SHOW ERROR
+ - GET DIAGNOSTICS (WL#2111)
+ do not modify the diagnostics area during execution.
+*/
+#define CF_DIAGNOSTIC_STMT (1U << 8)
/* Functions in sql_class.cc */
@@ -3080,3 +3092,4 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
void mark_transaction_to_rollback(THD *thd, bool all);
#endif /* MYSQL_SERVER */
+#endif /* SQL_CLASS_INCLUDED */
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 5bca766114e..959209df412 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -39,10 +39,6 @@
#define MIN_HANDSHAKE_SIZE 6
#endif /* HAVE_OPENSSL */
-#ifdef __WIN__
-extern void win_install_sigabrt_handler();
-#endif
-
/*
Get structure for logging connection data for the current user
*/
@@ -65,7 +61,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
user_len= strlen(user);
temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1;
(void) pthread_mutex_lock(&LOCK_user_conn);
- if (!(uc = (struct user_conn *) hash_search(&hash_user_connections,
+ if (!(uc = (struct user_conn *) my_hash_search(&hash_user_connections,
(uchar*) temp_user, temp_len)))
{
/* First connection for user; Create a user connection object */
@@ -155,7 +151,15 @@ int check_for_max_user_connections(THD *thd, USER_CONN *uc)
end:
if (error)
+ {
uc->connections--; // no need for decrease_user_connections() here
+ /*
+ The thread may returned back to the pool and assigned to a user
+ that doesn't have a limit. Ensure the user is not using resources
+ of someone else.
+ */
+ thd->user_connect= NULL;
+ }
(void) pthread_mutex_unlock(&LOCK_user_conn);
DBUG_RETURN(error);
}
@@ -187,7 +191,7 @@ void decrease_user_connections(USER_CONN *uc)
if (!--uc->connections && !mqh_used)
{
/* Last connection for user; Delete it */
- (void) hash_delete(&hash_user_connections,(uchar*) uc);
+ (void) my_hash_delete(&hash_user_connections,(uchar*) uc);
}
(void) pthread_mutex_unlock(&LOCK_user_conn);
DBUG_VOID_RETURN;
@@ -466,7 +470,10 @@ check_user(THD *thd, enum enum_server_command command,
{
/* mysql_change_db() has pushed the error message. */
if (thd->user_connect)
+ {
decrease_user_connections(thd->user_connect);
+ thd->user_connect= 0;
+ }
DBUG_RETURN(1);
}
}
@@ -490,6 +497,18 @@ check_user(THD *thd, enum enum_server_command command,
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
passwd_len ? ER(ER_YES) : ER(ER_NO));
+ /*
+ log access denied messages to the error log when log-warnings = 2
+ so that the overhead of the general query log is not required to track
+ failed connections
+ */
+ if (global_system_variables.log_warnings > 1)
+ {
+ sql_print_warning(ER(ER_ACCESS_DENIED_ERROR),
+ thd->main_security_ctx.user,
+ thd->main_security_ctx.host_or_ip,
+ passwd_len ? ER(ER_YES) : ER(ER_NO));
+ }
DBUG_RETURN(1);
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
@@ -517,10 +536,10 @@ extern "C" void free_user(struct user_conn *uc)
void init_max_user_conn(void)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- (void) hash_init(&hash_user_connections,system_charset_info,max_connections,
- 0,0,
- (hash_get_key) get_key_conn, (hash_free_key) free_user,
- 0);
+ (void)
+ my_hash_init(&hash_user_connections,system_charset_info,max_connections,
+ 0,0, (my_hash_get_key) get_key_conn,
+ (my_hash_free_key) free_user, 0);
#endif
}
@@ -528,7 +547,7 @@ void init_max_user_conn(void)
void free_max_user_conn(void)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- hash_free(&hash_user_connections);
+ my_hash_free(&hash_user_connections);
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
@@ -546,8 +565,9 @@ void reset_mqh(LEX_USER *lu, bool get_them= 0)
memcpy(temp_user,lu->user.str,lu->user.length);
memcpy(temp_user+lu->user.length+1,lu->host.str,lu->host.length);
temp_user[lu->user.length]='\0'; temp_user[temp_len-1]=0;
- if ((uc = (struct user_conn *) hash_search(&hash_user_connections,
- (uchar*) temp_user, temp_len)))
+ if ((uc = (struct user_conn *) my_hash_search(&hash_user_connections,
+ (uchar*) temp_user,
+ temp_len)))
{
uc->questions=0;
get_mqh(temp_user,&temp_user[lu->user.length+1],uc);
@@ -560,8 +580,8 @@ void reset_mqh(LEX_USER *lu, bool get_them= 0)
/* for FLUSH PRIVILEGES and FLUSH USER_RESOURCES */
for (uint idx=0;idx < hash_user_connections.records; idx++)
{
- USER_CONN *uc=(struct user_conn *) hash_element(&hash_user_connections,
- idx);
+ USER_CONN *uc=(struct user_conn *)
+ my_hash_element(&hash_user_connections, idx);
if (get_them)
get_mqh(uc->user,uc->host,uc);
uc->questions=0;
@@ -612,13 +632,8 @@ void thd_init_client_charset(THD *thd, uint cs_number)
bool init_new_connection_handler_thread()
{
pthread_detach_this_thread();
-#if defined(__WIN__)
- win_install_sigabrt_handler();
-#else
- /* Win32 calls this in pthread_create */
if (my_thread_init())
return 1;
-#endif /* __WIN__ */
return 0;
}
@@ -954,11 +969,11 @@ static bool login_connection(THD *thd)
my_net_set_write_timeout(net, connect_timeout);
error= check_connection(thd);
- net_end_statement(thd);
+ thd->protocol->end_statement();
if (error)
{ // Wrong permissions
-#ifdef __NT__
+#ifdef _WIN32
if (vio_type(net->vio) == VIO_TYPE_NAMEDPIPE)
my_sleep(1000); /* must wait after eof() */
#endif
@@ -984,7 +999,15 @@ static void end_connection(THD *thd)
NET *net= &thd->net;
plugin_thdvar_cleanup(thd);
if (thd->user_connect)
+ {
decrease_user_connections(thd->user_connect);
+ /*
+ The thread may returned back to the pool and assigned to a user
+ that doesn't have a limit. Ensure the user is not using resources
+ of someone else.
+ */
+ thd->user_connect= NULL;
+ }
if (thd->killed || (net->error && net->vio != 0))
{
@@ -1001,7 +1024,7 @@ static void end_connection(THD *thd)
thd->thread_id,(thd->db ? thd->db : "unconnected"),
sctx->user ? sctx->user : "unauthenticated",
sctx->host_or_ip,
- (thd->main_da.is_error() ? thd->main_da.message() :
+ (thd->stmt_da->is_error() ? thd->stmt_da->message() :
ER(ER_UNKNOWN_ERROR)));
}
}
@@ -1046,7 +1069,7 @@ static void prepare_new_connection_state(THD* thd)
thd->thread_id,(thd->db ? thd->db : "unconnected"),
sctx->user ? sctx->user : "unauthenticated",
sctx->host_or_ip, "init_connect command failed");
- sql_print_warning("%s", thd->main_da.message());
+ sql_print_warning("%s", thd->stmt_da->message());
}
thd->proc_info=0;
thd->set_time();
diff --git a/sql/sql_crypt.h b/sql/sql_crypt.h
index a5a6bee8a58..8d5a761cbdf 100644
--- a/sql/sql_crypt.h
+++ b/sql/sql_crypt.h
@@ -1,3 +1,6 @@
+#ifndef SQL_CRYPT_INCLUDED
+#define SQL_CRYPT_INCLUDED
+
/* Copyright (C) 2000-2001, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -35,3 +38,5 @@ class SQL_CRYPT :public Sql_alloc
void encode(char *str, uint length);
void decode(char *str, uint length);
};
+
+#endif /* SQL_CRYPT_INCLUDED */
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 51d5a1cec23..ffc3fafe55f 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -90,7 +90,7 @@ class Materialized_cursor: public Server_side_cursor
public:
Materialized_cursor(select_result *result, TABLE *table);
- int fill_item_list(THD *thd, List<Item> &send_fields);
+ int fill_item_list(THD *thd, List<Item> &send_result_set_metadata);
virtual bool is_open() const { return table != 0; }
virtual int open(JOIN *join __attribute__((unused)));
virtual void fetch(ulong num_rows);
@@ -115,7 +115,7 @@ public:
Materialized_cursor *materialized_cursor;
Select_materialize(select_result *result_arg)
:result(result_arg), materialized_cursor(0) {}
- virtual bool send_fields(List<Item> &list, uint flags);
+ virtual bool send_result_set_metadata(List<Item> &list, uint flags);
};
@@ -376,12 +376,12 @@ Sensitive_cursor::open(JOIN *join_arg)
join->change_result(result);
/*
Send fields description to the client; server_status is sent
- in 'EOF' packet, which follows send_fields().
- We don't simply use SEND_EOF flag of send_fields because we also
+ in 'EOF' packet, which follows send_result_set_metadata().
+ We don't simply use SEND_EOF flag of send_result_set_metadata because we also
want to flush the network buffer, which is done only in a standalone
send_eof().
*/
- result->send_fields(*join->fields, Protocol::SEND_NUM_ROWS);
+ result->send_result_set_metadata(*join->fields, Protocol::SEND_NUM_ROWS);
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
result->send_eof();
thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
@@ -566,14 +566,14 @@ Materialized_cursor::Materialized_cursor(select_result *result_arg,
Preserve the original metadata that would be sent to the client.
@param thd Thread identifier.
- @param send_fields List of fields that would be sent.
+ @param send_result_set_metadata List of fields that would be sent.
*/
-int Materialized_cursor::fill_item_list(THD *thd, List<Item> &send_fields)
+int Materialized_cursor::fill_item_list(THD *thd, List<Item> &send_result_set_metadata)
{
Query_arena backup_arena;
int rc;
- List_iterator_fast<Item> it_org(send_fields);
+ List_iterator_fast<Item> it_org(send_result_set_metadata);
List_iterator_fast<Item> it_dst(item_list);
Item *item_org;
Item *item_dst;
@@ -583,7 +583,7 @@ int Materialized_cursor::fill_item_list(THD *thd, List<Item> &send_fields)
if ((rc= table->fill_item_list(&item_list)))
goto end;
- DBUG_ASSERT(send_fields.elements == item_list.elements);
+ DBUG_ASSERT(send_result_set_metadata.elements == item_list.elements);
/*
Unless we preserve the original metadata, it will be lost,
@@ -623,17 +623,17 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
{
/*
Now send the result set metadata to the client. We need to
- do it here, as in Select_materialize::send_fields the items
- for column types are not yet created (send_fields requires
+ do it here, as in Select_materialize::send_result_set_metadata the items
+ for column types are not yet created (send_result_set_metadata requires
a list of items). The new types may differ from the original
ones sent at prepare if some of them were altered by MySQL
HEAP tables mechanism -- used when create_tmp_field_from_item
may alter the original column type.
- We can't simply supply SEND_EOF flag to send_fields, because
- send_fields doesn't flush the network buffer.
+ We can't simply supply SEND_EOF flag to send_result_set_metadata, because
+ send_result_set_metadata doesn't flush the network buffer.
*/
- rc= result->send_fields(item_list, Protocol::SEND_NUM_ROWS);
+ rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS);
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
result->send_eof();
thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
@@ -717,7 +717,7 @@ Materialized_cursor::~Materialized_cursor()
Select_materialize
****************************************************************************/
-bool Select_materialize::send_fields(List<Item> &list, uint flags)
+bool Select_materialize::send_result_set_metadata(List<Item> &list, uint flags)
{
DBUG_ASSERT(table == 0);
if (create_result_table(unit->thd, unit->get_unit_column_types(),
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index e6ccd9aa594..3198791d5d1 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -105,8 +105,8 @@ static my_bool lock_db_insert(const char *dbname, uint length)
safe_mutex_assert_owner(&LOCK_lock_db);
- if (!(opt= (my_dblock_t*) hash_search(&lock_db_cache,
- (uchar*) dbname, length)))
+ if (!(opt= (my_dblock_t*) my_hash_search(&lock_db_cache,
+ (uchar*) dbname, length)))
{
/* Db is not in the hash, insert it */
char *tmp_name;
@@ -139,9 +139,9 @@ void lock_db_delete(const char *name, uint length)
{
my_dblock_t *opt;
safe_mutex_assert_owner(&LOCK_lock_db);
- if ((opt= (my_dblock_t *)hash_search(&lock_db_cache,
- (const uchar*) name, length)))
- hash_delete(&lock_db_cache, (uchar*) opt);
+ if ((opt= (my_dblock_t *)my_hash_search(&lock_db_cache,
+ (const uchar*) name, length)))
+ my_hash_delete(&lock_db_cache, (uchar*) opt);
}
@@ -221,14 +221,14 @@ bool my_database_names_init(void)
if (!dboptions_init)
{
dboptions_init= 1;
- error= hash_init(&dboptions, lower_case_table_names ?
- &my_charset_bin : system_charset_info,
- 32, 0, 0, (hash_get_key) dboptions_get_key,
- free_dbopt,0) ||
- hash_init(&lock_db_cache, lower_case_table_names ?
- &my_charset_bin : system_charset_info,
- 32, 0, 0, (hash_get_key) lock_db_get_key,
- lock_db_free_element,0);
+ error= my_hash_init(&dboptions, lower_case_table_names ?
+ &my_charset_bin : system_charset_info,
+ 32, 0, 0, (my_hash_get_key) dboptions_get_key,
+ free_dbopt,0) ||
+ my_hash_init(&lock_db_cache, lower_case_table_names ?
+ &my_charset_bin : system_charset_info,
+ 32, 0, 0, (my_hash_get_key) lock_db_get_key,
+ lock_db_free_element,0);
}
return error;
@@ -245,9 +245,9 @@ void my_database_names_free(void)
if (dboptions_init)
{
dboptions_init= 0;
- hash_free(&dboptions);
+ my_hash_free(&dboptions);
(void) rwlock_destroy(&LOCK_dboptions);
- hash_free(&lock_db_cache);
+ my_hash_free(&lock_db_cache);
}
}
@@ -259,11 +259,11 @@ void my_database_names_free(void)
void my_dbopt_cleanup(void)
{
rw_wrlock(&LOCK_dboptions);
- hash_free(&dboptions);
- hash_init(&dboptions, lower_case_table_names ?
- &my_charset_bin : system_charset_info,
- 32, 0, 0, (hash_get_key) dboptions_get_key,
- free_dbopt,0);
+ my_hash_free(&dboptions);
+ my_hash_init(&dboptions, lower_case_table_names ?
+ &my_charset_bin : system_charset_info,
+ 32, 0, 0, (my_hash_get_key) dboptions_get_key,
+ free_dbopt,0);
rw_unlock(&LOCK_dboptions);
}
@@ -289,7 +289,7 @@ static my_bool get_dbopt(const char *dbname, HA_CREATE_INFO *create)
length= (uint) strlen(dbname);
rw_rdlock(&LOCK_dboptions);
- if ((opt= (my_dbopt_t*) hash_search(&dboptions, (uchar*) dbname, length)))
+ if ((opt= (my_dbopt_t*) my_hash_search(&dboptions, (uchar*) dbname, length)))
{
create->default_table_charset= opt->charset;
error= 0;
@@ -321,7 +321,8 @@ static my_bool put_dbopt(const char *dbname, HA_CREATE_INFO *create)
length= (uint) strlen(dbname);
rw_wrlock(&LOCK_dboptions);
- if (!(opt= (my_dbopt_t*) hash_search(&dboptions, (uchar*) dbname, length)))
+ if (!(opt= (my_dbopt_t*) my_hash_search(&dboptions, (uchar*) dbname,
+ length)))
{
/* Options are not in the hash, insert them */
char *tmp_name;
@@ -361,9 +362,9 @@ void del_dbopt(const char *path)
{
my_dbopt_t *opt;
rw_wrlock(&LOCK_dboptions);
- if ((opt= (my_dbopt_t *)hash_search(&dboptions, (const uchar*) path,
- strlen(path))))
- hash_delete(&dboptions, (uchar*) opt);
+ if ((opt= (my_dbopt_t *)my_hash_search(&dboptions, (const uchar*) path,
+ strlen(path))))
+ my_hash_delete(&dboptions, (uchar*) opt);
rw_unlock(&LOCK_dboptions);
}
@@ -1027,7 +1028,7 @@ exit:
SELECT DATABASE() in the future). For this we free() thd->db and set
it to 0.
*/
- if (thd->db && !strcmp(thd->db, db))
+ if (thd->db && !strcmp(thd->db, db) && error == 0)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
start_waiting_global_read_lock(thd);
@@ -1719,8 +1720,8 @@ lock_databases(THD *thd, const char *db1, uint length1,
{
pthread_mutex_lock(&LOCK_lock_db);
while (!thd->killed &&
- (hash_search(&lock_db_cache,(uchar*) db1, length1) ||
- hash_search(&lock_db_cache,(uchar*) db2, length2)))
+ (my_hash_search(&lock_db_cache,(uchar*) db1, length1) ||
+ my_hash_search(&lock_db_cache,(uchar*) db2, length2)))
{
wait_for_condition(thd, &LOCK_lock_db, &COND_refresh);
pthread_mutex_lock(&LOCK_lock_db);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 6b9a83e695b..6d7ece3912b 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1104,6 +1104,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
is_temporary_table= true;
handlerton *table_type= table->s->db_type();
TABLE_SHARE *share= table->s;
+ /* Note that a temporary table cannot be partitioned */
if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE))
goto trunc_by_del;
@@ -1142,8 +1143,22 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table_list->db, table_list->table_name);
DBUG_RETURN(TRUE);
}
- if (!ha_check_storage_engine_flag(ha_resolve_by_legacy_type(thd, table_type),
- HTON_CAN_RECREATE))
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ /*
+ TODO: Add support for TRUNCATE PARTITION for NDB and other engines
+ supporting native partitioning
+ */
+ if (table_type != DB_TYPE_PARTITION_DB &&
+ thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION)
+ {
+ my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+#endif
+ if (!ha_check_storage_engine_flag(ha_resolve_by_legacy_type(thd,
+ table_type),
+ HTON_CAN_RECREATE) ||
+ thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION)
goto trunc_by_del;
if (lock_and_wait_for_table_name(thd, table_list))
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 37adf5c403a..9b747759ece 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -178,9 +178,9 @@ exit:
if (orig_table_list->view)
{
if (thd->is_error() &&
- (thd->main_da.sql_errno() == ER_BAD_FIELD_ERROR ||
- thd->main_da.sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
- thd->main_da.sql_errno() == ER_SP_DOES_NOT_EXIST))
+ (thd->stmt_da->sql_errno() == ER_BAD_FIELD_ERROR ||
+ thd->stmt_da->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
+ thd->stmt_da->sql_errno() == ER_SP_DOES_NOT_EXIST))
{
thd->clear_error();
my_error(ER_VIEW_INVALID, MYF(0), orig_table_list->db,
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 9ea7facbe41..eeefdb99eed 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-2002 MySQL AB
+/* Copyright (C) 1995-2002 MySQL AB,
+ Copyright (C) 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,133 +43,577 @@ This file contains the implementation of error and warnings related
***********************************************************************/
#include "mysql_priv.h"
+#include "sql_error.h"
#include "sp_rcontext.h"
/*
- Store a new message in an error object
-
- This is used to in group_concat() to register how many warnings we actually
- got after the query has been executed.
+ Design notes about MYSQL_ERROR::m_message_text.
+
+ The member MYSQL_ERROR::m_message_text contains the text associated with
+ an error, warning or note (which are all SQL 'conditions')
+
+ Producer of MYSQL_ERROR::m_message_text:
+ ----------------------------------------
+
+ (#1) the server implementation itself, when invoking functions like
+ my_error() or push_warning()
+
+ (#2) user code in stored programs, when using the SIGNAL statement.
+
+ (#3) user code in stored programs, when using the RESIGNAL statement.
+
+ When invoking my_error(), the error number and message is typically
+ provided like this:
+ - my_error(ER_WRONG_DB_NAME, MYF(0), ...);
+ - my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
+
+ In both cases, the message is retrieved from ER(ER_XXX), which in turn
+ is read from the resource file errmsg.sys at server startup.
+ The strings stored in the errmsg.sys file are expressed in the character set
+ that corresponds to the server --language start option
+ (see error_message_charset_info).
+
+ When executing:
+ - a SIGNAL statement,
+ - a RESIGNAL statement,
+ the message text is provided by the user logic, and is expressed in UTF8.
+
+ Storage of MYSQL_ERROR::m_message_text:
+ ---------------------------------------
+
+ (#4) The class MYSQL_ERROR is used to hold the message text member.
+ This class represents a single SQL condition.
+
+ (#5) The class Warning_info represents a SQL condition area, and contains
+ a collection of SQL conditions in the Warning_info::m_warn_list
+
+ Consumer of MYSQL_ERROR::m_message_text:
+ ----------------------------------------
+
+ (#6) The statements SHOW WARNINGS and SHOW ERRORS display the content of
+ the warning list.
+
+ (#7) The GET DIAGNOSTICS statement (planned, not implemented yet) will
+ also read the content of:
+ - the top level statement condition area (when executed in a query),
+ - a sub statement (when executed in a stored program)
+ and return the data stored in a MYSQL_ERROR.
+
+ (#8) The RESIGNAL statement reads the MYSQL_ERROR caught by an exception
+ handler, to raise a new or modified condition (in #3).
+
+ The big picture
+ ---------------
+ --------------
+ | ^
+ V |
+ my_error(#1) SIGNAL(#2) RESIGNAL(#3) |
+ |(#A) |(#B) |(#C) |
+ | | | |
+ ----------------------------|---------------------------- |
+ | |
+ V |
+ MYSQL_ERROR(#4) |
+ | |
+ | |
+ V |
+ Warning_info(#5) |
+ | |
+ ----------------------------------------------------- |
+ | | | |
+ | | | |
+ | | | |
+ V V V |
+ SHOW WARNINGS(#6) GET DIAGNOSTICS(#7) RESIGNAL(#8) |
+ | | | | |
+ | -------- | V |
+ | | | --------------
+ V | |
+ Connectors | |
+ | | |
+ -------------------------
+ |
+ V
+ Client application
+
+ Current implementation status
+ -----------------------------
+
+ (#1) (my_error) produces data in the 'error_message_charset_info' CHARSET
+
+ (#2) and (#3) (SIGNAL, RESIGNAL) produces data internally in UTF8
+
+ (#6) (SHOW WARNINGS) produces data in the 'error_message_charset_info' CHARSET
+
+ (#7) (GET DIAGNOSTICS) is not implemented.
+
+ (#8) (RESIGNAL) produces data internally in UTF8 (see #3)
+
+ As a result, the design choice for (#4) and (#5) is to store data in
+ the 'error_message_charset_info' CHARSET, to minimize impact on the code base.
+ This is implemented by using 'String MYSQL_ERROR::m_message_text'.
+
+ The UTF8 -> error_message_charset_info conversion is implemented in
+ Signal_common::eval_signal_informations() (for path #B and #C).
+
+ Future work
+ -----------
+
+ - Change (#1) (my_error) to generate errors in UTF8.
+ See WL#751 (Recoding of error messages)
+
+ - Change (#4 and #5) to store message text in UTF8 natively.
+ In practice, this means changing the type of the message text to
+ '<UTF8 String 128 class> MYSQL_ERROR::m_message_text', and is a direct
+ consequence of WL#751.
+
+ - Implement (#9) (GET DIAGNOSTICS).
+ See WL#2111 (Stored Procedures: Implement GET DIAGNOSTICS)
*/
-void MYSQL_ERROR::set_msg(THD *thd, const char *msg_arg)
+MYSQL_ERROR::MYSQL_ERROR()
+ : Sql_alloc(),
+ m_class_origin((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_subclass_origin((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_catalog((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_schema((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_catalog_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_schema_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_table_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_column_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_cursor_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_message_text(),
+ m_sql_errno(0),
+ m_level(MYSQL_ERROR::WARN_LEVEL_ERROR),
+ m_mem_root(NULL)
{
- msg= strdup_root(&thd->warn_root, msg_arg);
+ memset(m_returned_sqlstate, 0, sizeof(m_returned_sqlstate));
}
+void MYSQL_ERROR::init(MEM_ROOT *mem_root)
+{
+ DBUG_ASSERT(mem_root != NULL);
+ DBUG_ASSERT(m_mem_root == NULL);
+ m_mem_root= mem_root;
+}
-/*
- Reset all warnings for the thread
-
- SYNOPSIS
- mysql_reset_errors()
- thd Thread handle
- force Reset warnings even if it has been done before
+void MYSQL_ERROR::clear()
+{
+ m_class_origin.length(0);
+ m_subclass_origin.length(0);
+ m_constraint_catalog.length(0);
+ m_constraint_schema.length(0);
+ m_constraint_name.length(0);
+ m_catalog_name.length(0);
+ m_schema_name.length(0);
+ m_table_name.length(0);
+ m_column_name.length(0);
+ m_cursor_name.length(0);
+ m_message_text.length(0);
+ m_sql_errno= 0;
+ m_level= MYSQL_ERROR::WARN_LEVEL_ERROR;
+}
- IMPLEMENTATION
- Don't reset warnings if this has already been called for this query.
- This may happen if one gets a warning during the parsing stage,
- in which case push_warnings() has already called this function.
-*/
+MYSQL_ERROR::MYSQL_ERROR(MEM_ROOT *mem_root)
+ : Sql_alloc(),
+ m_class_origin((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_subclass_origin((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_catalog((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_schema((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_constraint_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_catalog_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_schema_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_table_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_column_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_cursor_name((const char*) NULL, 0, & my_charset_utf8_bin),
+ m_message_text(),
+ m_sql_errno(0),
+ m_level(MYSQL_ERROR::WARN_LEVEL_ERROR),
+ m_mem_root(mem_root)
+{
+ DBUG_ASSERT(mem_root != NULL);
+ memset(m_returned_sqlstate, 0, sizeof(m_returned_sqlstate));
+}
-void mysql_reset_errors(THD *thd, bool force)
+static void copy_string(MEM_ROOT *mem_root, String* dst, const String* src)
{
- DBUG_ENTER("mysql_reset_errors");
- if (thd->query_id != thd->warn_id || force)
+ size_t len= src->length();
+ if (len)
{
- thd->warn_id= thd->query_id;
- free_root(&thd->warn_root,MYF(0));
- bzero((char*) thd->warn_count, sizeof(thd->warn_count));
- if (force)
- thd->total_warn_count= 0;
- thd->warn_list.empty();
- thd->row_count= 1; // by default point to row 1
+ char* copy= (char*) alloc_root(mem_root, len + 1);
+ if (copy)
+ {
+ memcpy(copy, src->ptr(), len);
+ copy[len]= '\0';
+ dst->set(copy, len, src->charset());
+ }
}
+ else
+ dst->length(0);
+}
+
+void
+MYSQL_ERROR::copy_opt_attributes(const MYSQL_ERROR *cond)
+{
+ DBUG_ASSERT(this != cond);
+ copy_string(m_mem_root, & m_class_origin, & cond->m_class_origin);
+ copy_string(m_mem_root, & m_subclass_origin, & cond->m_subclass_origin);
+ copy_string(m_mem_root, & m_constraint_catalog, & cond->m_constraint_catalog);
+ copy_string(m_mem_root, & m_constraint_schema, & cond->m_constraint_schema);
+ copy_string(m_mem_root, & m_constraint_name, & cond->m_constraint_name);
+ copy_string(m_mem_root, & m_catalog_name, & cond->m_catalog_name);
+ copy_string(m_mem_root, & m_schema_name, & cond->m_schema_name);
+ copy_string(m_mem_root, & m_table_name, & cond->m_table_name);
+ copy_string(m_mem_root, & m_column_name, & cond->m_column_name);
+ copy_string(m_mem_root, & m_cursor_name, & cond->m_cursor_name);
+}
+
+void
+MYSQL_ERROR::set(uint sql_errno, const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level, const char* msg)
+{
+ DBUG_ASSERT(sql_errno != 0);
+ DBUG_ASSERT(sqlstate != NULL);
+ DBUG_ASSERT(msg != NULL);
+
+ m_sql_errno= sql_errno;
+ memcpy(m_returned_sqlstate, sqlstate, SQLSTATE_LENGTH);
+ m_returned_sqlstate[SQLSTATE_LENGTH]= '\0';
+
+ set_builtin_message_text(msg);
+ m_level= level;
+}
+
+void
+MYSQL_ERROR::set_builtin_message_text(const char* str)
+{
+ /*
+ See the comments
+ "Design notes about MYSQL_ERROR::m_message_text."
+ */
+ const char* copy;
+
+ copy= strdup_root(m_mem_root, str);
+ m_message_text.set(copy, strlen(copy), error_message_charset_info);
+ DBUG_ASSERT(! m_message_text.is_alloced());
+}
+
+const char*
+MYSQL_ERROR::get_message_text() const
+{
+ return m_message_text.ptr();
+}
+
+int
+MYSQL_ERROR::get_message_octet_length() const
+{
+ return m_message_text.length();
+}
+
+void
+MYSQL_ERROR::set_sqlstate(const char* sqlstate)
+{
+ memcpy(m_returned_sqlstate, sqlstate, SQLSTATE_LENGTH);
+ m_returned_sqlstate[SQLSTATE_LENGTH]= '\0';
+}
+
+/**
+ Clear this diagnostics area.
+
+ Normally called at the end of a statement.
+*/
+
+void
+Diagnostics_area::reset_diagnostics_area()
+{
+ DBUG_ENTER("reset_diagnostics_area");
+#ifdef DBUG_OFF
+ can_overwrite_status= FALSE;
+ /** Don't take chances in production */
+ m_message[0]= '\0';
+ m_sql_errno= 0;
+ m_server_status= 0;
+ m_affected_rows= 0;
+ m_last_insert_id= 0;
+ m_statement_warn_count= 0;
+#endif
+ is_sent= FALSE;
+ /** Tiny reset in debug mode to see garbage right away */
+ m_status= DA_EMPTY;
DBUG_VOID_RETURN;
}
-/*
- Push the warning/error to error list if there is still room in the list
+/**
+ Set OK status -- ends commands that do not return a
+ result set, e.g. INSERT/UPDATE/DELETE.
+*/
- SYNOPSIS
- push_warning()
- thd Thread handle
- level Severity of warning (note, warning, error ...)
- code Error number
- msg Clear error message
-
- RETURN
- pointer on MYSQL_ERROR object
+void
+Diagnostics_area::set_ok_status(THD *thd, ulonglong affected_rows_arg,
+ ulonglong last_insert_id_arg,
+ const char *message_arg)
+{
+ DBUG_ENTER("set_ok_status");
+ DBUG_ASSERT(! is_set());
+ /*
+ In production, refuse to overwrite an error or a custom response
+ with an OK packet.
+ */
+ if (is_error() || is_disabled())
+ return;
+
+ m_server_status= thd->server_status;
+ m_statement_warn_count= thd->warning_info->statement_warn_count();
+ m_affected_rows= affected_rows_arg;
+ m_last_insert_id= last_insert_id_arg;
+ if (message_arg)
+ strmake(m_message, message_arg, sizeof(m_message) - 1);
+ else
+ m_message[0]= '\0';
+ m_status= DA_OK;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ Set EOF status.
*/
-MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
- uint code, const char *msg)
+void
+Diagnostics_area::set_eof_status(THD *thd)
{
- MYSQL_ERROR *err= 0;
- DBUG_ENTER("push_warning");
- DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
+ DBUG_ENTER("set_eof_status");
+ /* Only allowed to report eof if has not yet reported an error */
+ DBUG_ASSERT(! is_set());
+ /*
+ In production, refuse to overwrite an error or a custom response
+ with an EOF packet.
+ */
+ if (is_error() || is_disabled())
+ return;
+
+ m_server_status= thd->server_status;
+ /*
+ If inside a stored procedure, do not return the total
+ number of warnings, since they are not available to the client
+ anyway.
+ */
+ m_statement_warn_count= (thd->spcont ?
+ 0 : thd->warning_info->statement_warn_count());
+
+ m_status= DA_EOF;
+ DBUG_VOID_RETURN;
+}
- DBUG_ASSERT(code != 0);
- DBUG_ASSERT(msg != NULL);
+/**
+ Set ERROR status.
+*/
- if (level == MYSQL_ERROR::WARN_LEVEL_NOTE &&
- !(thd->options & OPTION_SQL_NOTES))
- DBUG_RETURN(0);
+void
+Diagnostics_area::set_error_status(THD *thd, uint sql_errno_arg,
+ const char *message_arg,
+ const char *sqlstate)
+{
+ DBUG_ENTER("set_error_status");
+ /*
+ Only allowed to report error if has not yet reported a success
+ The only exception is when we flush the message to the client,
+ an error can happen during the flush.
+ */
+ DBUG_ASSERT(! is_set() || can_overwrite_status);
+#ifdef DBUG_OFF
+ /*
+ In production, refuse to overwrite a custom response with an
+ ERROR packet.
+ */
+ if (is_disabled())
+ return;
+#endif
+
+ if (sqlstate == NULL)
+ sqlstate= mysql_errno_to_sqlstate(sql_errno_arg);
+
+ m_sql_errno= sql_errno_arg;
+ memcpy(m_sqlstate, sqlstate, SQLSTATE_LENGTH);
+ m_sqlstate[SQLSTATE_LENGTH]= '\0';
+ strmake(m_message, message_arg, sizeof(m_message)-1);
+
+ m_status= DA_ERROR;
+ DBUG_VOID_RETURN;
+}
- if (thd->query_id != thd->warn_id && !thd->spcont)
- mysql_reset_errors(thd, 0);
- thd->got_warning= 1;
- /* Abort if we are using strict mode and we are not using IGNORE */
- if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
- thd->really_abort_on_warning())
- {
- /* Avoid my_message() calling push_warning */
- bool no_warnings_for_error= thd->no_warnings_for_error;
- sp_rcontext *spcont= thd->spcont;
+/**
+ Mark the diagnostics area as 'DISABLED'.
- thd->no_warnings_for_error= 1;
- thd->spcont= NULL;
+ This is used in rare cases when the COM_ command at hand sends a response
+ in a custom format. One example is the query cache, another is
+ COM_STMT_PREPARE.
+*/
- thd->killed= THD::KILL_BAD_DATA;
- my_message(code, msg, MYF(0));
+void
+Diagnostics_area::disable_status()
+{
+ DBUG_ASSERT(! is_set());
+ m_status= DA_DISABLED;
+}
+
+Warning_info::Warning_info(ulonglong warn_id_arg)
+ :m_statement_warn_count(0),
+ m_current_row_for_warning(1),
+ m_warn_id(warn_id_arg),
+ m_read_only(FALSE)
+{
+ /* Initialize sub structures */
+ init_sql_alloc(&m_warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
+ m_warn_list.empty();
+ bzero((char*) m_warn_count, sizeof(m_warn_count));
+}
- thd->spcont= spcont;
- thd->no_warnings_for_error= no_warnings_for_error;
- /* Store error in error list (as my_message() didn't do it) */
- level= MYSQL_ERROR::WARN_LEVEL_ERROR;
- }
- if (thd->handle_error(code, msg, level))
- DBUG_RETURN(NULL);
+Warning_info::~Warning_info()
+{
+ free_root(&m_warn_root,MYF(0));
+}
- if (thd->spcont &&
- thd->spcont->handle_error(code, level, thd))
+
+/**
+ Reset the warning information of this connection.
+*/
+
+void Warning_info::clear_warning_info(ulonglong warn_id_arg)
+{
+ m_warn_id= warn_id_arg;
+ free_root(&m_warn_root, MYF(0));
+ bzero((char*) m_warn_count, sizeof(m_warn_count));
+ m_warn_list.empty();
+ m_statement_warn_count= 0;
+ m_current_row_for_warning= 1; /* Start counting from the first row */
+}
+
+void Warning_info::reserve_space(THD *thd, uint count)
+{
+ /* Make room for count conditions */
+ while ((m_warn_list.elements > 0) &&
+ ((m_warn_list.elements + count) > thd->variables.max_error_count))
+ m_warn_list.pop();
+}
+
+/**
+ Append warnings only if the original contents of the routine
+ warning info was replaced.
+*/
+void Warning_info::merge_with_routine_info(THD *thd, Warning_info *source)
+{
+ /*
+ If a routine body is empty or if a routine did not
+ generate any warnings (thus m_warn_id didn't change),
+ do not duplicate our own contents by appending the
+ contents of the called routine. We know that the called
+ routine did not change its warning info.
+
+ On the other hand, if the routine body is not empty and
+ some statement in the routine generates a warning or
+ uses tables, m_warn_id is guaranteed to have changed.
+ In this case we know that the routine warning info
+ contains only new warnings, and thus we perform a copy.
+ */
+ if (m_warn_id != source->m_warn_id)
{
- DBUG_RETURN(NULL);
+ /*
+ If the invocation of the routine was a standalone statement,
+ rather than a sub-statement, in other words, if it's a CALL
+ of a procedure, rather than invocation of a function or a
+ trigger, we need to clear the current contents of the caller's
+ warning info.
+
+ This is per MySQL rules: if a statement generates a warning,
+ warnings from the previous statement are flushed. Normally
+ it's done in push_warning(). However, here we don't use
+ push_warning() to avoid invocation of condition handlers or
+ escalation of warnings to errors.
+ */
+ opt_clear_warning_info(thd->query_id);
+ append_warning_info(thd, source);
}
- query_cache_abort(&thd->net);
+}
+/**
+ Add a warning to the list of warnings. Increment the respective
+ counters.
+*/
+MYSQL_ERROR *Warning_info::push_warning(THD *thd,
+ uint sql_errno, const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char *msg)
+{
+ MYSQL_ERROR *cond= NULL;
- if (thd->warn_list.elements < thd->variables.max_error_count)
+ if (! m_read_only)
{
- /* We have to use warn_root, as mem_root is freed after each query */
- if ((err= new (&thd->warn_root) MYSQL_ERROR(thd, code, level, msg)))
- thd->warn_list.push_back(err, &thd->warn_root);
+ if (m_warn_list.elements < thd->variables.max_error_count)
+ {
+ cond= new (& m_warn_root) MYSQL_ERROR(& m_warn_root);
+ if (cond)
+ {
+ cond->set(sql_errno, sqlstate, level, msg);
+ m_warn_list.push_back(cond, &m_warn_root);
+ }
+ }
+ m_warn_count[(uint) level]++;
}
- thd->warn_count[(uint) level]++;
- thd->total_warn_count++;
- DBUG_RETURN(err);
+
+ m_statement_warn_count++;
+ return cond;
+}
+
+/*
+ Push the warning to error list if there is still room in the list
+
+ SYNOPSIS
+ push_warning()
+ thd Thread handle
+ level Severity of warning (note, warning)
+ code Error number
+ msg Clear error message
+*/
+
+void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ uint code, const char *msg)
+{
+ DBUG_ENTER("push_warning");
+ DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
+
+ /*
+ Calling push_warning/push_warning_printf with a
+ level of WARN_LEVEL_ERROR *is* a bug.
+ Either use my_error(), or WARN_LEVEL_WARN.
+ Please fix the calling code, and do *NOT*
+ add more work around code in the assert below.
+ */
+ DBUG_ASSERT( (level != MYSQL_ERROR::WARN_LEVEL_ERROR)
+ || (code == ER_CANT_CREATE_TABLE) /* See Bug#47233 */
+ || (code == ER_ILLEGAL_HA_CREATE_OPTION) /* See Bug#47233 */
+ );
+
+ if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
+ level= MYSQL_ERROR::WARN_LEVEL_WARN;
+
+ (void) thd->raise_condition(code, NULL, level, msg);
+
+ DBUG_VOID_RETURN;
}
+
/*
- Push the warning/error to error list if there is still room in the list
+ Push the warning to error list if there is still room in the list
SYNOPSIS
push_warning_printf()
thd Thread handle
- level Severity of warning (note, warning, error ...)
+ level Severity of warning (note, warning)
code Error number
msg Clear error message
*/
@@ -185,7 +630,8 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
DBUG_ASSERT(format != NULL);
va_start(args,format);
- my_vsnprintf(warning, sizeof(warning), format, args);
+ my_vsnprintf_ex(&my_charset_utf8_general_ci, warning,
+ sizeof(warning), format, args);
va_end(args);
push_warning(thd, level, code, warning);
DBUG_VOID_RETURN;
@@ -217,44 +663,196 @@ const LEX_STRING warning_level_names[]=
};
bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
-{
+{
List<Item> field_list;
DBUG_ENTER("mysqld_show_warnings");
+ DBUG_ASSERT(thd->warning_info->is_read_only());
+
field_list.push_back(new Item_empty_string("Level", 7));
field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG));
field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE));
- if (thd->protocol->send_fields(&field_list,
+ if (thd->protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
MYSQL_ERROR *err;
SELECT_LEX *sel= &thd->lex->select_lex;
SELECT_LEX_UNIT *unit= &thd->lex->unit;
- ha_rows idx= 0;
+ ulonglong idx= 0;
Protocol *protocol=thd->protocol;
unit->set_limit(sel);
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
while ((err= it++))
{
/* Skip levels that the user is not interested in */
- if (!(levels_to_show & ((ulong) 1 << err->level)))
+ if (!(levels_to_show & ((ulong) 1 << err->get_level())))
continue;
if (++idx <= unit->offset_limit_cnt)
continue;
if (idx > unit->select_limit_cnt)
break;
protocol->prepare_for_resend();
- protocol->store(warning_level_names[err->level].str,
- warning_level_names[err->level].length, system_charset_info);
- protocol->store((uint32) err->code);
- protocol->store(err->msg, (uint) strlen(err->msg), system_charset_info);
+ protocol->store(warning_level_names[err->get_level()].str,
+ warning_level_names[err->get_level()].length,
+ system_charset_info);
+ protocol->store((uint32) err->get_sql_errno());
+ protocol->store(err->get_message_text(),
+ err->get_message_octet_length(),
+ system_charset_info);
if (protocol->write())
DBUG_RETURN(TRUE);
}
my_eof(thd);
+
+ thd->warning_info->set_read_only(FALSE);
+
DBUG_RETURN(FALSE);
}
+
+
+/**
+ Convert value for dispatch to error message(see WL#751).
+
+ @param to buffer for converted string
+ @param to_length size of the buffer
+ @param from string which should be converted
+ @param from_length string length
+ @param from_cs charset from convert
+
+ @retval
+ result string
+*/
+
+char *err_conv(char *buff, uint to_length, const char *from,
+ uint from_length, CHARSET_INFO *from_cs)
+{
+ char *to= buff;
+ const char *from_start= from;
+ size_t res;
+
+ DBUG_ASSERT(to_length > 0);
+ to_length--;
+ if (from_cs == &my_charset_bin)
+ {
+ uchar char_code;
+ res= 0;
+ while (1)
+ {
+ if ((uint)(from - from_start) >= from_length ||
+ res >= to_length)
+ {
+ *to= 0;
+ break;
+ }
+
+ char_code= ((uchar) *from);
+ if (char_code >= 0x20 && char_code <= 0x7E)
+ {
+ *to++= char_code;
+ from++;
+ res++;
+ }
+ else
+ {
+ if (res + 4 >= to_length)
+ {
+ *to= 0;
+ break;
+ }
+ res+= my_snprintf(to, 5, "\\x%02X", (uint) char_code);
+ to+=4;
+ from++;
+ }
+ }
+ }
+ else
+ {
+ uint errors;
+ res= copy_and_convert(to, to_length, system_charset_info,
+ from, from_length, from_cs, &errors);
+ to[res]= 0;
+ }
+ return buff;
+}
+
+
+/**
+ Convert string for dispatch to client(see WL#751).
+
+ @param to buffer to convert
+ @param to_length buffer length
+ @param to_cs chraset to convert
+ @param from string from convert
+ @param from_length string length
+ @param from_cs charset from convert
+ @param errors count of errors during convertion
+
+ @retval
+ length of converted string
+*/
+
+uint32 convert_error_message(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, uint *errors)
+{
+ int cnvres;
+ my_wc_t wc;
+ const uchar *from_end= (const uchar*) from+from_length;
+ char *to_start= to;
+ uchar *to_end= (uchar*) to+to_length;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb;
+ uint error_count= 0;
+ uint length;
+
+ DBUG_ASSERT(to_length > 0);
+ to_length--;
+
+ if (!to_cs || from_cs == to_cs || to_cs == &my_charset_bin)
+ {
+ length= min(to_length, from_length);
+ memmove(to, from, length);
+ to[length]= 0;
+ return length;
+ }
+
+ wc_mb= to_cs->cset->wc_mb;
+ while (1)
+ {
+ if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from, from_end)) > 0)
+ {
+ if (!wc)
+ break;
+ from+= cnvres;
+ }
+ else if (cnvres == MY_CS_ILSEQ)
+ {
+ wc= (ulong) (uchar) *from;
+ from+=1;
+ }
+ else
+ break;
+
+ if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
+ to+= cnvres;
+ else if (cnvres == MY_CS_ILUNI)
+ {
+ length= (wc <= 0xFFFF) ? 6/* '\1234' format*/ : 9 /* '\+123456' format*/;
+ if ((uchar*)(to + length) >= to_end)
+ break;
+ cnvres= my_snprintf(to, 9,
+ (wc <= 0xFFFF) ? "\\%04X" : "\\+%06X", (uint) wc);
+ to+= cnvres;
+ }
+ else
+ break;
+ }
+
+ *to= 0;
+ *errors= error_count;
+ return (uint32) (to - to_start);
+}
diff --git a/sql/sql_error.h b/sql/sql_error.h
index f98264dce50..ac86ca4770c 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (C) 2000-2003 MySQL AB,
+ Copyright (C) 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,31 +14,548 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-class MYSQL_ERROR: public Sql_alloc
+#ifndef SQL_ERROR_H
+#define SQL_ERROR_H
+
+#include "sql_list.h" /* Sql_alloc, MEM_ROOT */
+#include "m_string.h" /* LEX_STRING */
+#include "mysql_com.h" /* MYSQL_ERRMSG_SIZE */
+
+class THD;
+
+/**
+ Stores status of the currently executed statement.
+ Cleared at the beginning of the statement, and then
+ can hold either OK, ERROR, or EOF status.
+ Can not be assigned twice per statement.
+*/
+
+class Diagnostics_area
+{
+public:
+ enum enum_diagnostics_status
+ {
+ /** The area is cleared at start of a statement. */
+ DA_EMPTY= 0,
+ /** Set whenever one calls my_ok(). */
+ DA_OK,
+ /** Set whenever one calls my_eof(). */
+ DA_EOF,
+ /** Set whenever one calls my_error() or my_message(). */
+ DA_ERROR,
+ /** Set in case of a custom response, such as one from COM_STMT_PREPARE. */
+ DA_DISABLED
+ };
+ /** True if status information is sent to the client. */
+ bool is_sent;
+ /** Set to make set_error_status after set_{ok,eof}_status possible. */
+ bool can_overwrite_status;
+
+ void set_ok_status(THD *thd, ulonglong affected_rows_arg,
+ ulonglong last_insert_id_arg,
+ const char *message);
+ void set_eof_status(THD *thd);
+ void set_error_status(THD *thd, uint sql_errno_arg, const char *message_arg,
+ const char *sqlstate);
+
+ void disable_status();
+
+ void reset_diagnostics_area();
+
+ bool is_set() const { return m_status != DA_EMPTY; }
+ bool is_error() const { return m_status == DA_ERROR; }
+ bool is_eof() const { return m_status == DA_EOF; }
+ bool is_ok() const { return m_status == DA_OK; }
+ bool is_disabled() const { return m_status == DA_DISABLED; }
+ enum_diagnostics_status status() const { return m_status; }
+
+ const char *message() const
+ { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK); return m_message; }
+
+ uint sql_errno() const
+ { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; }
+
+ const char* get_sqlstate() const
+ { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; }
+
+ uint server_status() const
+ {
+ DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
+ return m_server_status;
+ }
+
+ ulonglong affected_rows() const
+ { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
+
+ ulonglong last_insert_id() const
+ { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; }
+
+ uint statement_warn_count() const
+ {
+ DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
+ return m_statement_warn_count;
+ }
+
+ Diagnostics_area() { reset_diagnostics_area(); }
+
+private:
+ /** Message buffer. Can be used by OK or ERROR status. */
+ char m_message[MYSQL_ERRMSG_SIZE];
+ /**
+ SQL error number. One of ER_ codes from share/errmsg.txt.
+ Set by set_error_status.
+ */
+ uint m_sql_errno;
+
+ char m_sqlstate[SQLSTATE_LENGTH+1];
+
+ /**
+ Copied from thd->server_status when the diagnostics area is assigned.
+ We need this member as some places in the code use the following pattern:
+ thd->server_status|= ...
+ my_eof(thd);
+ thd->server_status&= ~...
+ Assigned by OK, EOF or ERROR.
+ */
+ uint m_server_status;
+ /**
+ The number of rows affected by the last statement. This is
+ semantically close to thd->row_count_func, but has a different
+ life cycle. thd->row_count_func stores the value returned by
+ function ROW_COUNT() and is cleared only by statements that
+ update its value, such as INSERT, UPDATE, DELETE and few others.
+ This member is cleared at the beginning of the next statement.
+
+ We could possibly merge the two, but life cycle of thd->row_count_func
+ can not be changed.
+ */
+ ulonglong m_affected_rows;
+ /**
+ Similarly to the previous member, this is a replacement of
+ thd->first_successful_insert_id_in_prev_stmt, which is used
+ to implement LAST_INSERT_ID().
+ */
+ ulonglong m_last_insert_id;
+ /**
+ Number of warnings of this last statement. May differ from
+ the number of warnings returned by SHOW WARNINGS e.g. in case
+ the statement doesn't clear the warnings, and doesn't generate
+ them.
+ */
+ uint m_statement_warn_count;
+ enum_diagnostics_status m_status;
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+/**
+ Representation of a SQL condition.
+ A SQL condition can be a completion condition (note, warning),
+ or an exception condition (error, not found).
+ @note This class is named MYSQL_ERROR instead of SQL_condition for historical reasons,
+ to facilitate merging code with previous releases.
+*/
+class MYSQL_ERROR : public Sql_alloc
{
public:
+ /*
+ Enumeration value describing the severity of the error.
+
+ Note that these enumeration values must correspond to the indices
+ of the sql_print_message_handlers array.
+ */
enum enum_warning_level
{ WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END};
+ /**
+ Get the MESSAGE_TEXT of this condition.
+ @return the message text.
+ */
+ const char* get_message_text() const;
+
+ /**
+ Get the MESSAGE_OCTET_LENGTH of this condition.
+ @return the length in bytes of the message text.
+ */
+ int get_message_octet_length() const;
+
+ /**
+ Get the SQLSTATE of this condition.
+ @return the sql state.
+ */
+ const char* get_sqlstate() const
+ { return m_returned_sqlstate; }
+
+ /**
+ Get the SQL_ERRNO of this condition.
+ @return the sql error number condition item.
+ */
+ uint get_sql_errno() const
+ { return m_sql_errno; }
+
+ /**
+ Get the error level of this condition.
+ @return the error level condition item.
+ */
+ MYSQL_ERROR::enum_warning_level get_level() const
+ { return m_level; }
+
+private:
+ /*
+ The interface of MYSQL_ERROR is mostly private, by design,
+ so that only the following code:
+ - various raise_error() or raise_warning() methods in class THD,
+ - the implementation of SIGNAL / RESIGNAL
+ - catch / re-throw of SQL conditions in stored procedures (sp_rcontext)
+ is allowed to create / modify a SQL condition.
+ Enforcing this policy prevents confusion, since the only public
+ interface available to the rest of the server implementation
+ is the interface offered by the THD methods (THD::raise_error()),
+ which should be used.
+ */
+ friend class THD;
+ friend class Warning_info;
+ friend class Signal_common;
+ friend class Signal_statement;
+ friend class Resignal_statement;
+ friend class sp_rcontext;
+
+ /**
+ Default constructor.
+ This constructor is usefull when allocating arrays.
+ Note that the init() method should be called to complete the MYSQL_ERROR.
+ */
+ MYSQL_ERROR();
+
+ /**
+ Complete the MYSQL_ERROR initialisation.
+ @param mem_root The memory root to use for the condition items
+ of this condition
+ */
+ void init(MEM_ROOT *mem_root);
+
+ /**
+ Constructor.
+ @param mem_root The memory root to use for the condition items
+ of this condition
+ */
+ MYSQL_ERROR(MEM_ROOT *mem_root);
+
+ /** Destructor. */
+ ~MYSQL_ERROR()
+ {}
+
+ /**
+ Copy optional condition items attributes.
+ @param cond the condition to copy.
+ */
+ void copy_opt_attributes(const MYSQL_ERROR *cond);
+
+ /**
+ Set this condition area with a fixed message text.
+ @param thd the current thread.
+ @param code the error number for this condition.
+ @param str the message text for this condition.
+ @param level the error level for this condition.
+ @param MyFlags additional flags.
+ */
+ void set(uint sql_errno, const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg);
+
+ /**
+ Set the condition message test.
+ @param str Message text, expressed in the character set derived from
+ the server --language option
+ */
+ void set_builtin_message_text(const char* str);
+
+ /** Set the SQLSTATE of this condition. */
+ void set_sqlstate(const char* sqlstate);
+
+ /**
+ Clear this SQL condition.
+ */
+ void clear();
+
+private:
+ /** SQL CLASS_ORIGIN condition item. */
+ String m_class_origin;
+
+ /** SQL SUBCLASS_ORIGIN condition item. */
+ String m_subclass_origin;
+
+ /** SQL CONSTRAINT_CATALOG condition item. */
+ String m_constraint_catalog;
+
+ /** SQL CONSTRAINT_SCHEMA condition item. */
+ String m_constraint_schema;
+
+ /** SQL CONSTRAINT_NAME condition item. */
+ String m_constraint_name;
+
+ /** SQL CATALOG_NAME condition item. */
+ String m_catalog_name;
+
+ /** SQL SCHEMA_NAME condition item. */
+ String m_schema_name;
+
+ /** SQL TABLE_NAME condition item. */
+ String m_table_name;
+
+ /** SQL COLUMN_NAME condition item. */
+ String m_column_name;
+
+ /** SQL CURSOR_NAME condition item. */
+ String m_cursor_name;
+
+ /** Message text, expressed in the character set implied by --language. */
+ String m_message_text;
- uint code;
- enum_warning_level level;
- char *msg;
-
- MYSQL_ERROR(THD *thd, uint code_arg, enum_warning_level level_arg,
- const char *msg_arg)
- :code(code_arg), level(level_arg)
+ /** MySQL extension, MYSQL_ERRNO condition item. */
+ uint m_sql_errno;
+
+ /**
+ SQL RETURNED_SQLSTATE condition item.
+ This member is always NUL terminated.
+ */
+ char m_returned_sqlstate[SQLSTATE_LENGTH+1];
+
+ /** Severity (error, warning, note) of this condition. */
+ MYSQL_ERROR::enum_warning_level m_level;
+
+ /** Memory root to use to hold condition item values. */
+ MEM_ROOT *m_mem_root;
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+/**
+ Information about warnings of the current connection.
+*/
+
+class Warning_info
+{
+ /** A memory root to allocate warnings and errors */
+ MEM_ROOT m_warn_root;
+ /** List of warnings of all severities (levels). */
+ List <MYSQL_ERROR> m_warn_list;
+ /** A break down of the number of warnings per severity (level). */
+ uint m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
+ /**
+ The number of warnings of the current statement. Warning_info
+ life cycle differs from statement life cycle -- it may span
+ multiple statements. In that case we get
+ m_statement_warn_count 0, whereas m_warn_list is not empty.
+ */
+ uint m_statement_warn_count;
+ /*
+ Row counter, to print in errors and warnings. Not increased in
+ create_sort_index(); may differ from examined_row_count.
+ */
+ ulong m_current_row_for_warning;
+ /** Used to optionally clear warnings only once per statement. */
+ ulonglong m_warn_id;
+
+private:
+ Warning_info(const Warning_info &rhs); /* Not implemented */
+ Warning_info& operator=(const Warning_info &rhs); /* Not implemented */
+public:
+
+ Warning_info(ulonglong warn_id_arg);
+ ~Warning_info();
+
+ /**
+ Reset the warning information. Clear all warnings,
+ the number of warnings, reset current row counter
+ to point to the first row.
+ */
+ void clear_warning_info(ulonglong warn_id_arg);
+ /**
+ Only clear warning info if haven't yet done that already
+ for the current query. Allows to be issued at any time
+ during the query, without risk of clearing some warnings
+ that have been generated by the current statement.
+
+ @todo: This is a sign of sloppy coding. Instead we need to
+ designate one place in a statement life cycle where we call
+ clear_warning_info().
+ */
+ void opt_clear_warning_info(ulonglong query_id)
+ {
+ if (query_id != m_warn_id)
+ clear_warning_info(query_id);
+ }
+
+ void append_warning_info(THD *thd, Warning_info *source)
+ {
+ append_warnings(thd, & source->warn_list());
+ }
+
+ /**
+ Concatenate the list of warnings.
+ It's considered tolerable to lose a warning.
+ */
+ void append_warnings(THD *thd, List<MYSQL_ERROR> *src)
+ {
+ MYSQL_ERROR *err;
+ MYSQL_ERROR *copy;
+ List_iterator_fast<MYSQL_ERROR> it(*src);
+ /*
+ Don't use ::push_warning() to avoid invocation of condition
+ handlers or escalation of warnings to errors.
+ */
+ while ((err= it++))
+ {
+ copy= Warning_info::push_warning(thd, err->get_sql_errno(), err->get_sqlstate(),
+ err->get_level(), err->get_message_text());
+ if (copy)
+ copy->copy_opt_attributes(err);
+ }
+ }
+
+ /**
+ Conditional merge of related warning information areas.
+ */
+ void merge_with_routine_info(THD *thd, Warning_info *source);
+
+ /**
+ Reset between two COM_ commands. Warnings are preserved
+ between commands, but statement_warn_count indicates
+ the number of warnings of this particular statement only.
+ */
+ void reset_for_next_command() { m_statement_warn_count= 0; }
+
+ /**
+ Used for @@warning_count system variable, which prints
+ the number of rows returned by SHOW WARNINGS.
+ */
+ ulong warn_count() const
+ {
+ /*
+ This may be higher than warn_list.elements if we have
+ had more warnings than thd->variables.max_error_count.
+ */
+ return (m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
+ m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
+ m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
+ }
+
+ /**
+ This is for iteration purposes. We return a non-constant reference
+ since List doesn't have constant iterators.
+ */
+ List<MYSQL_ERROR> &warn_list() { return m_warn_list; }
+
+ /**
+ The number of errors, or number of rows returned by SHOW ERRORS,
+ also the value of session variable @@error_count.
+ */
+ ulong error_count() const
{
- if (msg_arg)
- set_msg(thd, msg_arg);
+ return m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
}
- void set_msg(THD *thd, const char *msg_arg);
+
+ /** Id of the warning information area. */
+ ulonglong warn_id() const { return m_warn_id; }
+
+ /** Do we have any errors and warnings that we can *show*? */
+ bool is_empty() const { return m_warn_list.elements == 0; }
+
+ /** Increment the current row counter to point at the next row. */
+ void inc_current_row_for_warning() { m_current_row_for_warning++; }
+ /** Reset the current row counter. Start counting from the first row. */
+ void reset_current_row_for_warning() { m_current_row_for_warning= 1; }
+ /** Return the current counter value. */
+ ulong current_row_for_warning() const { return m_current_row_for_warning; }
+
+ ulong statement_warn_count() const { return m_statement_warn_count; }
+
+ /**
+ Reserve some space in the condition area.
+ This is a privileged operation, reserved for the RESIGNAL implementation,
+ as only the RESIGNAL statement is allowed to remove conditions from
+ the condition area.
+ For other statements, new conditions are not added to the condition
+ area once the condition area is full.
+ @param thd The current thread
+ @param count The number of slots to reserve
+ */
+ void reserve_space(THD *thd, uint count);
+
+ /** Add a new condition to the current list. */
+ MYSQL_ERROR *push_warning(THD *thd,
+ uint sql_errno, const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg);
+
+ /**
+ Set the read only status for this statement area.
+ This is a privileged operation, reserved for the implementation of
+ diagnostics related statements, to enforce that the statement area is
+ left untouched during execution.
+ The diagnostics statements are:
+ - SHOW WARNINGS
+ - SHOW ERRORS
+ - GET DIAGNOSTICS
+ @param read_only the read only property to set
+ */
+ void set_read_only(bool read_only)
+ { m_read_only= read_only; }
+
+ /**
+ Read only status.
+ @return the read only property
+ */
+ bool is_read_only() const
+ { return m_read_only; }
+
+private:
+ /** Read only status. */
+ bool m_read_only;
+
+ friend class Resignal_statement;
};
-MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
- uint code, const char *msg);
+extern char *err_conv(char *buff, uint to_length, const char *from,
+ uint from_length, CHARSET_INFO *from_cs);
+
+class ErrConvString
+{
+ char err_buffer[MYSQL_ERRMSG_SIZE];
+public:
+
+ ErrConvString(String *str)
+ {
+ (void) err_conv(err_buffer, sizeof(err_buffer), str->ptr(),
+ str->length(), str->charset());
+ }
+
+ ErrConvString(const char *str, CHARSET_INFO* cs)
+ {
+ (void) err_conv(err_buffer, sizeof(err_buffer),
+ str, strlen(str), cs);
+ }
+
+ ErrConvString(const char *str, uint length, CHARSET_INFO* cs)
+ {
+ (void) err_conv(err_buffer, sizeof(err_buffer),
+ str, length, cs);
+ }
+
+ ~ErrConvString() { };
+ char *ptr() { return err_buffer; }
+};
+
+
+void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ uint code, const char *msg);
void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
uint code, const char *format, ...);
-void mysql_reset_errors(THD *thd, bool force);
bool mysqld_show_warnings(THD *thd, ulong levels_to_show);
+uint32 convert_error_message(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, uint *errors);
extern const LEX_STRING warning_level_names[];
+
+#endif // SQL_ERROR_H
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 3bbf4b78d07..ab3f2797405 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -207,21 +207,21 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
DBUG_RETURN(TRUE);
}
- if (! hash_inited(&thd->handler_tables_hash))
+ if (! my_hash_inited(&thd->handler_tables_hash))
{
/*
HASH entries are of type TABLE_LIST.
*/
- if (hash_init(&thd->handler_tables_hash, &my_charset_latin1,
- HANDLER_TABLES_HASH_SIZE, 0, 0,
- (hash_get_key) mysql_ha_hash_get_key,
- (hash_free_key) mysql_ha_hash_free, 0))
+ if (my_hash_init(&thd->handler_tables_hash, &my_charset_latin1,
+ HANDLER_TABLES_HASH_SIZE, 0, 0,
+ (my_hash_get_key) mysql_ha_hash_get_key,
+ (my_hash_free_key) mysql_ha_hash_free, 0))
goto err;
}
else if (! reopen) /* Otherwise we have 'tables' already. */
{
- if (hash_search(&thd->handler_tables_hash, (uchar*) tables->alias,
- strlen(tables->alias) + 1))
+ if (my_hash_search(&thd->handler_tables_hash, (uchar*) tables->alias,
+ strlen(tables->alias) + 1))
{
DBUG_PRINT("info",("duplicate '%s'", tables->alias));
my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias);
@@ -367,12 +367,12 @@ bool mysql_ha_close(THD *thd, TABLE_LIST *tables)
DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
tables->db, tables->table_name, tables->alias));
- if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (uchar*) tables->alias,
- strlen(tables->alias) + 1)))
+ if ((hash_tables= (TABLE_LIST*) my_hash_search(&thd->handler_tables_hash,
+ (uchar*) tables->alias,
+ strlen(tables->alias) + 1)))
{
mysql_ha_close_table(thd, hash_tables, FALSE);
- hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
+ my_hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
}
else
{
@@ -436,9 +436,9 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
it++;
retry:
- if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (uchar*) tables->alias,
- strlen(tables->alias) + 1)))
+ if ((hash_tables= (TABLE_LIST*) my_hash_search(&thd->handler_tables_hash,
+ (uchar*) tables->alias,
+ strlen(tables->alias) + 1)))
{
table= hash_tables->table;
DBUG_PRINT("info-in-hash",("'%s'.'%s' as '%s' table: 0x%lx",
@@ -460,7 +460,7 @@ retry:
hash_tables->db, hash_tables->table_name,
hash_tables->alias, table));
}
-
+ table->pos_in_table_list= tables;
#if MYSQL_VERSION_ID < 40100
if (*tables->db && strcmp(table->table_cache_key, tables->db))
{
@@ -545,7 +545,7 @@ retry:
tables->db, tables->alias, &it, 0))
goto err;
- protocol->send_fields(&list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
+ protocol->send_result_set_metadata(&list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
/*
In ::external_lock InnoDB resets the fields which tell it that
@@ -667,18 +667,11 @@ retry:
continue;
if (num_rows >= offset_limit_cnt)
{
- Item *item;
protocol->prepare_for_resend();
- it.rewind();
- while ((item=it++))
- {
- if (item->send(thd->protocol, &buffer))
- {
- protocol->free(); // Free used
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- goto err;
- }
- }
+
+ if (protocol->send_result_set_row(&list))
+ goto err;
+
protocol->write();
}
num_rows++;
@@ -716,7 +709,7 @@ static TABLE_LIST *mysql_ha_find(THD *thd, TABLE_LIST *tables)
/* search for all handlers with matching table names */
for (uint i= 0; i < thd->handler_tables_hash.records; i++)
{
- hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i);
+ hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i);
for (tables= first; tables; tables= tables->next_local)
{
if ((! *tables->db ||
@@ -760,7 +753,7 @@ void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked)
next= hash_tables->next_local;
if (hash_tables->table)
mysql_ha_close_table(thd, hash_tables, is_locked);
- hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
+ my_hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
hash_tables= next;
}
@@ -786,7 +779,7 @@ void mysql_ha_flush(THD *thd)
for (uint i= 0; i < thd->handler_tables_hash.records; i++)
{
- hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i);
+ hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i);
if (hash_tables->table && hash_tables->table->needs_reopen_or_name_lock())
mysql_ha_close_table(thd, hash_tables, TRUE);
}
@@ -810,12 +803,12 @@ void mysql_ha_cleanup(THD *thd)
for (uint i= 0; i < thd->handler_tables_hash.records; i++)
{
- hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i);
+ hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i);
if (hash_tables->table)
mysql_ha_close_table(thd, hash_tables, FALSE);
- }
+ }
- hash_free(&thd->handler_tables_hash);
+ my_hash_free(&thd->handler_tables_hash);
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 2818aa5082c..003741a7ddc 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -431,7 +431,7 @@ int send_answer_1(Protocol *protocol, String *s1, String *s2, String *s3)
field_list.push_back(new Item_empty_string("description",1000));
field_list.push_back(new Item_empty_string("example",1000));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(1);
@@ -463,7 +463,7 @@ int send_answer_1(Protocol *protocol, String *s1, String *s2, String *s3)
+- -+
RETURN VALUES
- result of protocol->send_fields
+ result of protocol->send_result_set_metadata
*/
int send_header_2(Protocol *protocol, bool for_category)
@@ -474,7 +474,7 @@ int send_header_2(Protocol *protocol, bool for_category)
field_list.push_back(new Item_empty_string("source_category_name",64));
field_list.push_back(new Item_empty_string("name",64));
field_list.push_back(new Item_empty_string("is_it_category",1));
- DBUG_RETURN(protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
+ DBUG_RETURN(protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS |
Protocol::SEND_EOF));
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6281dd8168a..d4306ba0c61 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -107,8 +107,8 @@ static bool check_view_insertability(THD *thd, TABLE_LIST *view);
1 Error
*/
-bool check_view_single_update(List<Item> &fields, TABLE_LIST *view,
- table_map *map)
+bool check_view_single_update(List<Item> &fields, List<Item> *values,
+ TABLE_LIST *view, table_map *map)
{
/* it is join view => we need to find the table for update */
List_iterator_fast<Item> it(fields);
@@ -119,6 +119,17 @@ bool check_view_single_update(List<Item> &fields, TABLE_LIST *view,
while ((item= it++))
tables|= item->used_tables();
+ if (values)
+ {
+ it.init(*values);
+ while ((item= it++))
+ tables|= item->used_tables();
+ }
+
+ /* Convert to real table bits */
+ tables&= ~PSEUDO_TABLE_BITS;
+
+
/* Check found map against provided map */
if (*map)
{
@@ -165,7 +176,9 @@ error:
static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
List<Item> &fields, List<Item> &values,
- bool check_unique, table_map *map)
+ bool check_unique,
+ bool fields_and_values_from_different_maps,
+ table_map *map)
{
TABLE *table= table_list->table;
@@ -238,7 +251,10 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
if (table_list->effective_algorithm == VIEW_ALGORITHM_MERGE)
{
- if (check_view_single_update(fields, table_list, map))
+ if (check_view_single_update(fields,
+ fields_and_values_from_different_maps ?
+ (List<Item>*) 0 : &values,
+ table_list, map))
return -1;
table= table_list->table;
}
@@ -298,7 +314,8 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
*/
static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
- List<Item> &update_fields, table_map *map)
+ List<Item> &update_fields,
+ List<Item> &update_values, table_map *map)
{
TABLE *table= insert_table_list->table;
my_bool timestamp_mark= 0;
@@ -318,7 +335,8 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
return -1;
if (insert_table_list->effective_algorithm == VIEW_ALGORITHM_MERGE &&
- check_view_single_update(update_fields, insert_table_list, map))
+ check_view_single_update(update_fields, &update_values,
+ insert_table_list, map))
return -1;
if (table->timestamp_field)
@@ -826,7 +844,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
error=write_record(thd, table ,&info);
if (error)
break;
- thd->row_count++;
+ thd->warning_info->inc_current_row_for_warning();
}
free_underlaid_joins(thd, &thd->lex->select_lex);
@@ -965,10 +983,12 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (ignore)
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
(lock_type == TL_WRITE_DELAYED) ? (ulong) 0 :
- (ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
+ (ulong) (info.records - info.copied),
+ (ulong) thd->warning_info->statement_warn_count());
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) (info.deleted + updated), (ulong) thd->cuted_fields);
+ (ulong) (info.deleted + updated),
+ (ulong) thd->warning_info->statement_warn_count());
thd->row_count_func= info.copied + info.deleted + updated;
::my_ok(thd, (ulong) thd->row_count_func, id, buff);
}
@@ -1256,9 +1276,9 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
table_list->next_local= 0;
context->resolve_in_table_list_only(table_list);
- res= check_insert_fields(thd, context->table_list, fields, *values,
- !insert_into_view, &map) ||
- setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0);
+ res= (setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0) ||
+ check_insert_fields(thd, context->table_list, fields, *values,
+ !insert_into_view, 0, &map));
if (!res && check_fields)
{
@@ -1271,18 +1291,19 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
thd->abort_on_warning= saved_abort_on_warning;
}
+ if (!res)
+ res= setup_fields(thd, 0, update_values, MARK_COLUMNS_READ, 0, 0);
+
if (!res && duplic == DUP_UPDATE)
{
select_lex->no_wrap_view_item= TRUE;
- res= check_update_fields(thd, context->table_list, update_fields, &map);
+ res= check_update_fields(thd, context->table_list, update_fields,
+ update_values, &map);
select_lex->no_wrap_view_item= FALSE;
}
/* Restore the current context. */
ctx_state.restore_state(context, table_list);
-
- if (!res)
- res= setup_fields(thd, 0, update_values, MARK_COLUMNS_READ, 0, 0);
}
if (res)
@@ -1971,7 +1992,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
main thread. Use of my_message will enable stored
procedures continue handlers.
*/
- my_message(di->thd.main_da.sql_errno(), di->thd.main_da.message(),
+ my_message(di->thd.stmt_da->sql_errno(), di->thd.stmt_da->message(),
MYF(0));
}
di->unlock();
@@ -2048,7 +2069,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
goto error;
if (dead)
{
- my_message(thd.main_da.sql_errno(), thd.main_da.message(), MYF(0));
+ my_message(thd.stmt_da->sql_errno(), thd.stmt_da->message(), MYF(0));
goto error;
}
}
@@ -2297,8 +2318,8 @@ static void handle_delayed_insert_impl(THD *thd, Delayed_insert *di)
if (init_thr_lock() || thd->store_globals())
{
/* Can't use my_error since store_globals has perhaps failed */
- thd->main_da.set_error_status(thd, ER_OUT_OF_RESOURCES,
- ER(ER_OUT_OF_RESOURCES));
+ thd->stmt_da->set_error_status(thd, ER_OUT_OF_RESOURCES,
+ ER(ER_OUT_OF_RESOURCES), NULL);
thd->fatal_error();
goto err;
}
@@ -2512,21 +2533,16 @@ pthread_handler_t handle_delayed_insert(void *arg)
since it does not find one in the list.
*/
pthread_mutex_lock(&di->mutex);
-#if !defined( __WIN__) /* Win32 calls this in pthread_create */
if (my_thread_init())
{
/* Can't use my_error since store_globals has not yet been called */
- thd->main_da.set_error_status(thd, ER_OUT_OF_RESOURCES,
- ER(ER_OUT_OF_RESOURCES));
+ thd->stmt_da->set_error_status(thd, ER_OUT_OF_RESOURCES,
+ ER(ER_OUT_OF_RESOURCES), NULL);
goto end;
}
-#endif
-
handle_delayed_insert_impl(thd, di);
-#ifndef __WIN__
end:
-#endif
/*
di should be unlinked from the thread handler list and have no active
clients
@@ -2748,6 +2764,12 @@ bool Delayed_insert::handle_inserts(void)
thread_safe_increment(delayed_insert_writes,&LOCK_delayed_status);
pthread_mutex_lock(&mutex);
+ /*
+ Reset the table->auto_increment_field_not_null as it is valid for
+ only one row.
+ */
+ table->auto_increment_field_not_null= FALSE;
+
delete row;
/*
Let READ clients do something once in a while
@@ -2769,7 +2791,7 @@ bool Delayed_insert::handle_inserts(void)
{
/* This should never happen */
table->file->print_error(error,MYF(0));
- sql_print_error("%s", thd.main_da.message());
+ sql_print_error("%s", thd.stmt_da->message());
DBUG_PRINT("error", ("HA_EXTRA_NO_CACHE failed in loop"));
goto err;
}
@@ -2811,7 +2833,7 @@ bool Delayed_insert::handle_inserts(void)
if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
{ // This shouldn't happen
table->file->print_error(error,MYF(0));
- sql_print_error("%s", thd.main_da.message());
+ sql_print_error("%s", thd.stmt_da->message());
DBUG_PRINT("error", ("HA_EXTRA_NO_CACHE failed after loop"));
goto err;
}
@@ -2950,9 +2972,9 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
we are fixing fields from insert list.
*/
lex->current_select= &lex->select_lex;
- res= check_insert_fields(thd, table_list, *fields, values,
- !insert_into_view, &map) ||
- setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, 0);
+ res= (setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, 0) ||
+ check_insert_fields(thd, table_list, *fields, values,
+ !insert_into_view, 1, &map));
if (!res && fields->elements)
{
@@ -2979,7 +3001,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
lex->select_lex.no_wrap_view_item= TRUE;
res= res || check_update_fields(thd, context->table_list,
- *info.update_fields, &map);
+ *info.update_fields, *info.update_values,
+ &map);
lex->select_lex.no_wrap_view_item= FALSE;
/*
When we are not using GROUP BY and there are no ungrouped aggregate functions
@@ -3279,10 +3302,12 @@ bool select_insert::send_eof()
char buff[160];
if (info.ignore)
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
+ (ulong) (info.records - info.copied),
+ (ulong) thd->warning_info->statement_warn_count());
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
+ (ulong) (info.deleted+info.updated),
+ (ulong) thd->warning_info->statement_warn_count());
thd->row_count_func= info.copied + info.deleted +
((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
info.touched : info.updated);
@@ -3855,6 +3880,7 @@ void select_create::abort()
{
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
+ table->auto_increment_field_not_null= FALSE;
if (!create_info->table_existed)
drop_open_table(thd, table, create_table->db, create_table->table_name);
table=0; // Safety
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2adbc44eb12..f6dd1fae90a 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -31,7 +31,14 @@
sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
+/**
+ LEX_STRING constant for null-string to be used in parser and other places.
+*/
+const LEX_STRING null_lex_str= {NULL, 0};
+const LEX_STRING empty_lex_str= { (char*) "", 0 };
+
/* Longest standard keyword name */
+
#define TOCK_NAME_LENGTH 24
/*
@@ -134,6 +141,7 @@ Lex_input_stream::Lex_input_stream(THD *thd,
found_semicolon(NULL),
ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)),
stmt_prepare_mode(FALSE),
+ multi_statements(TRUE),
in_comment(NO_COMMENT),
m_underscore_cs(NULL)
{
@@ -1497,7 +1505,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
keys_onoff(rhs.keys_onoff),
tablespace_op(rhs.tablespace_op),
partition_names(rhs.partition_names, mem_root),
- no_parts(rhs.no_parts),
+ num_parts(rhs.num_parts),
change_level(rhs.change_level),
datetime_field(rhs.datetime_field),
error_if_not_empty(rhs.error_if_not_empty)
@@ -2091,7 +2099,7 @@ void st_select_lex::print_limit(THD *thd,
to implement the clean up.
*/
-void st_lex::cleanup_lex_after_parse_error(THD *thd)
+void LEX::cleanup_lex_after_parse_error(THD *thd)
{
/*
Delete sphead for the side effect of restoring of the original
@@ -2150,7 +2158,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
We delay real initialization of hash (and therefore related
memory allocation) until first insertion into this hash.
*/
- hash_clear(&sroutines);
+ my_hash_clear(&sroutines);
}
else if (sroutines.records)
{
@@ -2173,7 +2181,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
void Query_tables_list::destroy_query_tables_list()
{
- hash_free(&sroutines);
+ my_hash_free(&sroutines);
}
@@ -2181,7 +2189,7 @@ void Query_tables_list::destroy_query_tables_list()
Initialize LEX object.
SYNOPSIS
- st_lex::st_lex()
+ LEX::LEX()
NOTE
LEX object initialized with this constructor can be used as part of
@@ -2191,7 +2199,7 @@ void Query_tables_list::destroy_query_tables_list()
for this.
*/
-st_lex::st_lex()
+LEX::LEX()
:result(0),
sql_command(SQLCOM_END), option_type(OPT_DEFAULT), is_lex_started(0)
{
@@ -2208,7 +2216,7 @@ st_lex::st_lex()
Check whether the merging algorithm can be used on this VIEW
SYNOPSIS
- st_lex::can_be_merged()
+ LEX::can_be_merged()
DESCRIPTION
We can apply merge algorithm if it is single SELECT view with
@@ -2222,7 +2230,7 @@ st_lex::st_lex()
TRUE - merge algorithm can be used
*/
-bool st_lex::can_be_merged()
+bool LEX::can_be_merged()
{
// TODO: do not forget implement case when select_lex.table_list.elements==0
@@ -2259,19 +2267,19 @@ bool st_lex::can_be_merged()
check if command can use VIEW with MERGE algorithm (for top VIEWs)
SYNOPSIS
- st_lex::can_use_merged()
+ LEX::can_use_merged()
DESCRIPTION
Only listed here commands can use merge algorithm in top level
SELECT_LEX (for subqueries will be used merge algorithm if
- st_lex::can_not_use_merged() is not TRUE).
+ LEX::can_not_use_merged() is not TRUE).
RETURN
FALSE - command can't use merged VIEWs
TRUE - VIEWs with MERGE algorithms can be used
*/
-bool st_lex::can_use_merged()
+bool LEX::can_use_merged()
{
switch (sql_command)
{
@@ -2296,18 +2304,18 @@ bool st_lex::can_use_merged()
Check if command can't use merged views in any part of command
SYNOPSIS
- st_lex::can_not_use_merged()
+ LEX::can_not_use_merged()
DESCRIPTION
Temporary table algorithm will be used on all SELECT levels for queries
- listed here (see also st_lex::can_use_merged()).
+ listed here (see also LEX::can_use_merged()).
RETURN
FALSE - command can't use merged VIEWs
TRUE - VIEWs with MERGE algorithms can be used
*/
-bool st_lex::can_not_use_merged()
+bool LEX::can_not_use_merged()
{
switch (sql_command)
{
@@ -2336,7 +2344,7 @@ bool st_lex::can_not_use_merged()
FALSE no, we need data
*/
-bool st_lex::only_view_structure()
+bool LEX::only_view_structure()
{
switch (sql_command) {
case SQLCOM_SHOW_CREATE:
@@ -2365,7 +2373,7 @@ bool st_lex::only_view_structure()
*/
-bool st_lex::need_correct_ident()
+bool LEX::need_correct_ident()
{
switch(sql_command)
{
@@ -2395,7 +2403,7 @@ bool st_lex::need_correct_ident()
VIEW_CHECK_CASCADED CHECK OPTION CASCADED
*/
-uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
+uint8 LEX::get_effective_with_check(TABLE_LIST *view)
{
if (view->select_lex->master_unit() == &unit &&
which_check_option_applicable())
@@ -2424,7 +2432,7 @@ uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
*/
bool
-st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
+LEX::copy_db_to(char **p_db, size_t *p_db_length) const
{
if (sphead)
{
@@ -2501,7 +2509,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl)
clause.
*/
-void st_lex::set_trg_event_type_for_tables()
+void LEX::set_trg_event_type_for_tables()
{
uint8 new_trg_event_map= 0;
@@ -2644,7 +2652,7 @@ void st_lex::set_trg_event_type_for_tables()
In this case link_to_local is set.
*/
-TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
+TABLE_LIST *LEX::unlink_first_table(bool *link_to_local)
{
TABLE_LIST *first;
if ((first= query_tables))
@@ -2684,7 +2692,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
table list
SYNOPSYS
- st_lex::first_lists_tables_same()
+ LEX::first_lists_tables_same()
NOTES
In many cases (for example, usual INSERT/DELETE/...) the first table of
@@ -2695,7 +2703,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
the global list first.
*/
-void st_lex::first_lists_tables_same()
+void LEX::first_lists_tables_same()
{
TABLE_LIST *first_table= (TABLE_LIST*) select_lex.table_list.first;
if (query_tables != first_table && first_table != 0)
@@ -2731,7 +2739,7 @@ void st_lex::first_lists_tables_same()
global list
*/
-void st_lex::link_first_table_back(TABLE_LIST *first,
+void LEX::link_first_table_back(TABLE_LIST *first,
bool link_to_local)
{
if (first)
@@ -2758,7 +2766,7 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
cleanup lex for case when we open table by table for processing
SYNOPSIS
- st_lex::cleanup_after_one_table_open()
+ LEX::cleanup_after_one_table_open()
NOTE
This method is mostly responsible for cleaning up of selects lists and
@@ -2766,7 +2774,7 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
to call Query_tables_list::reset_query_tables_list(FALSE).
*/
-void st_lex::cleanup_after_one_table_open()
+void LEX::cleanup_after_one_table_open()
{
/*
thd->lex->derived_tables & additional units may be set if we open
@@ -2801,7 +2809,7 @@ void st_lex::cleanup_after_one_table_open()
backup Pointer to Query_tables_list instance to be used for backup
*/
-void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup)
+void LEX::reset_n_backup_query_tables_list(Query_tables_list *backup)
{
backup->set_query_tables_list(this);
/*
@@ -2820,7 +2828,7 @@ void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup)
backup Pointer to Query_tables_list instance used for backup
*/
-void st_lex::restore_backup_query_tables_list(Query_tables_list *backup)
+void LEX::restore_backup_query_tables_list(Query_tables_list *backup)
{
this->destroy_query_tables_list();
this->set_query_tables_list(backup);
@@ -2831,14 +2839,14 @@ void st_lex::restore_backup_query_tables_list(Query_tables_list *backup)
Checks for usage of routines and/or tables in a parsed statement
SYNOPSIS
- st_lex:table_or_sp_used()
+ LEX:table_or_sp_used()
RETURN
FALSE No routines and tables used
TRUE Either or both routines and tables are used.
*/
-bool st_lex::table_or_sp_used()
+bool LEX::table_or_sp_used()
{
DBUG_ENTER("table_or_sp_used");
@@ -2999,7 +3007,7 @@ bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
@retval FALSE No, not a management partition command
*/
-bool st_lex::is_partition_management() const
+bool LEX::is_partition_management() const
{
return (sql_command == SQLCOM_ALTER_TABLE &&
(alter_info.flags == ALTER_ADD_PARTITION ||
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 4e4794ef2cf..4bf8cd41aee 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -17,6 +17,9 @@
@defgroup Semantic_Analysis Semantic Analysis
*/
+#ifndef SQL_LEX_INCLUDED
+#define SQL_LEX_INCLUDED
+
/* YACC and LEX Definitions */
/* These may not be declared yet */
@@ -94,7 +97,7 @@ enum enum_sql_command {
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
- SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
+ SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
@@ -118,7 +121,8 @@ enum enum_sql_command {
SQLCOM_SHOW_CREATE_TRIGGER,
SQLCOM_ALTER_DB_UPGRADE,
SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
-
+ SQLCOM_SIGNAL, SQLCOM_RESIGNAL,
+ SQLCOM_SHOW_RELAYLOG_EVENTS,
/*
When a command is added here, be sure it's also added in mysqld.cc
in "struct show_var_st status_vars[]= {" ...
@@ -203,17 +207,19 @@ typedef struct st_lex_master_info
{
char *host, *user, *password, *log_file_name;
uint port, connect_retry;
+ float heartbeat_period;
ulonglong pos;
ulong server_id;
/*
Enum is used for making it possible to detect if the user
changed variable or if it should be left at old value
*/
- enum {SSL_UNCHANGED, SSL_DISABLE, SSL_ENABLE}
- ssl, ssl_verify_server_cert;
+ enum {LEX_MI_UNCHANGED, LEX_MI_DISABLE, LEX_MI_ENABLE}
+ ssl, ssl_verify_server_cert, heartbeat_opt, repl_ignore_server_ids_opt;
char *ssl_key, *ssl_cert, *ssl_ca, *ssl_capath, *ssl_cipher;
char *relay_log_name;
ulong relay_log_pos;
+ DYNAMIC_ARRAY repl_ignore_server_ids;
} LEX_MASTER_INFO;
@@ -394,7 +400,7 @@ public:
Base class for st_select_lex (SELECT_LEX) &
st_select_lex_unit (SELECT_LEX_UNIT)
*/
-struct st_lex;
+struct LEX;
class st_select_lex;
class st_select_lex_unit;
class st_select_lex_node {
@@ -464,7 +470,7 @@ public:
virtual void set_lock_for_tables(thr_lock_type lock_type) {}
friend class st_select_lex_unit;
- friend bool mysql_new_select(struct st_lex *lex, bool move_down);
+ friend bool mysql_new_select(LEX *lex, bool move_down);
friend bool mysql_make_view(THD *thd, File_parser *parser,
TABLE_LIST *table, uint flags);
private:
@@ -584,7 +590,7 @@ public:
/* Saved values of the WHERE and HAVING clauses*/
Item::cond_result cond_value, having_value;
/* point on lex in which it was created, used in view subquery detection */
- st_lex *parent_lex;
+ LEX *parent_lex;
enum olap_type olap;
/* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */
SQL_LIST table_list;
@@ -893,7 +899,7 @@ public:
enum enum_enable_or_disable keys_onoff;
enum tablespace_op_type tablespace_op;
List<char> partition_names;
- uint no_parts;
+ uint num_parts;
enum_alter_table_change_level change_level;
Create_field *datetime_field;
bool error_if_not_empty;
@@ -903,7 +909,7 @@ public:
flags(0),
keys_onoff(LEAVE_AS_IS),
tablespace_op(NO_TABLESPACE_OP),
- no_parts(0),
+ num_parts(0),
change_level(ALTER_TABLE_METADATA_ONLY),
datetime_field(NULL),
error_if_not_empty(FALSE)
@@ -918,7 +924,7 @@ public:
flags= 0;
keys_onoff= LEAVE_AS_IS;
tablespace_op= NO_TABLESPACE_OP;
- no_parts= 0;
+ num_parts= 0;
partition_names.empty();
change_level= ALTER_TABLE_METADATA_ONLY;
datetime_field= 0;
@@ -950,6 +956,9 @@ extern sys_var *trg_new_row_fake_var;
enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE,
XA_SUSPEND, XA_FOR_MIGRATE};
+extern const LEX_STRING null_lex_str;
+extern const LEX_STRING empty_lex_str;
+
/*
Class representing list of all tables used by statement.
@@ -958,7 +967,7 @@ enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE,
stored functions/triggers to this list in order to pre-open and lock
them.
- Also used by st_lex::reset_n_backup/restore_backup_query_tables_list()
+ Also used by LEX::reset_n_backup/restore_backup_query_tables_list()
methods to save and restore this information.
*/
@@ -1486,9 +1495,13 @@ public:
/**
TRUE if we're parsing a prepared statement: in this mode
- we should allow placeholders and disallow multi-statements.
+ we should allow placeholders.
*/
bool stmt_prepare_mode;
+ /**
+ TRUE if we should allow multi-statements.
+ */
+ bool multi_statements;
/** State of the lexical analyser for comments. */
enum_comment_state in_comment;
@@ -1518,10 +1531,66 @@ public:
CHARSET_INFO *m_underscore_cs;
};
+/**
+ Abstract representation of a statement.
+ This class is an interface between the parser and the runtime.
+ The parser builds the appropriate sub classes of Sql_statement
+ to represent a SQL statement in the parsed tree.
+ The execute() method in the sub classes contain the runtime implementation.
+ Note that this interface is used for SQL statement recently implemented,
+ the code for older statements tend to load the LEX structure with more
+ attributes instead.
+ The recommended way to implement new statements is to sub-class
+ Sql_statement, as this improves code modularity (see the 'big switch' in
+ dispatch_command()), and decrease the total size of the LEX structure
+ (therefore saving memory in stored programs).
+*/
+class Sql_statement : public Sql_alloc
+{
+public:
+ /**
+ Execute this SQL statement.
+ @param thd the current thread.
+ @return 0 on success.
+ */
+ virtual bool execute(THD *thd) = 0;
+
+protected:
+ /**
+ Constructor.
+ @param lex the LEX structure that represents parts of this statement.
+ */
+ Sql_statement(LEX *lex)
+ : m_lex(lex)
+ {}
+
+ /** Destructor. */
+ virtual ~Sql_statement()
+ {
+ /*
+ Sql_statement objects are allocated in thd->mem_root.
+ In MySQL, the C++ destructor is never called, the underlying MEM_ROOT is
+ simply destroyed instead.
+ Do not rely on the destructor for any cleanup.
+ */
+ DBUG_ASSERT(FALSE);
+ }
+
+protected:
+ /**
+ The legacy LEX structure for this statement.
+ The LEX structure contains the existing properties of the parsed tree.
+ TODO: with time, attributes from LEX should move to sub classes of
+ Sql_statement, so that the parser only builds Sql_statement objects
+ with the minimum set of attributes, instead of a LEX structure that
+ contains the collection of every possible attribute.
+ */
+ LEX *m_lex;
+};
/* The state of the lex parsing. This is saved in the THD struct */
-typedef struct st_lex : public Query_tables_list
+struct LEX: public Query_tables_list
{
SELECT_LEX_UNIT unit; /* most upper unit */
SELECT_LEX select_lex; /* first SELECT_LEX */
@@ -1619,6 +1688,9 @@ typedef struct st_lex : public Query_tables_list
*/
nesting_map allow_sum_func;
enum_sql_command sql_command;
+
+ Sql_statement *m_stmt;
+
/*
Usually `expr` rule of yacc is quite reused but some commands better
not support subqueries which comes standard with this rule, like
@@ -1768,9 +1840,9 @@ typedef struct st_lex : public Query_tables_list
*/
bool protect_against_global_read_lock;
- st_lex();
+ LEX();
- virtual ~st_lex()
+ virtual ~LEX()
{
destroy_query_tables_list();
plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
@@ -1812,7 +1884,7 @@ typedef struct st_lex : public Query_tables_list
Is this update command where 'WHITH CHECK OPTION' clause is important
SYNOPSIS
- st_lex::which_check_option_applicable()
+ LEX::which_check_option_applicable()
RETURN
TRUE have to take 'WHITH CHECK OPTION' clause into account
@@ -1884,7 +1956,37 @@ typedef struct st_lex : public Query_tables_list
}
return FALSE;
}
-} LEX;
+};
+
+
+/**
+ Set_signal_information is a container used in the parsed tree to represent
+ the collection of assignments to condition items in the SIGNAL and RESIGNAL
+ statements.
+*/
+class Set_signal_information
+{
+public:
+ /** Constructor. */
+ Set_signal_information();
+
+ /** Copy constructor. */
+ Set_signal_information(const Set_signal_information& set);
+
+ /** Destructor. */
+ ~Set_signal_information()
+ {}
+
+ /** Clear all items. */
+ void clear();
+
+ /**
+ For each contition item assignment, m_item[] contains the parsed tree
+ that represents the expression assigned, if any.
+ m_item[] is an array indexed by Diag_condition_item_name.
+ */
+ Item *m_item[LAST_DIAG_SET_PROPERTY+1];
+};
/**
@@ -1913,6 +2015,12 @@ public:
*/
uchar *yacc_yyvs;
+ /**
+ Fragments of parsed tree,
+ used during the parsing of SIGNAL and RESIGNAL.
+ */
+ Set_signal_information m_set_signal_info;
+
/*
TODO: move more attributes from the LEX structure here.
*/
@@ -1939,7 +2047,7 @@ public:
};
-struct st_lex_local: public st_lex
+struct st_lex_local: public LEX
{
static void *operator new(size_t size) throw()
{
@@ -1969,6 +2077,7 @@ extern bool is_lex_native_function(const LEX_STRING *name);
@} (End of group Semantic_Analysis)
*/
-int my_missing_function_error(const LEX_STRING &token, const char *name);
+void my_missing_function_error(const LEX_STRING &token, const char *name);
#endif /* MYSQL_SERVER */
+#endif /* SQL_LEX_INCLUDED */
diff --git a/sql/sql_list.cc b/sql/sql_list.cc
index 49b649133d0..a256212471d 100644
--- a/sql/sql_list.cc
+++ b/sql/sql_list.cc
@@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "mysql_priv.h"
+#include "sql_list.h"
list_node end_of_list;
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 22df77afeb3..74f4cc0ec0d 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -15,11 +15,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include "my_global.h"
+#include "my_sys.h"
+#include "m_string.h" /* for TRASH */
+
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
+void *sql_alloc(size_t);
+
/* mysql standard class memory allocator */
class Sql_alloc
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 8109ca4313e..263fd8e8a08 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -15,6 +15,8 @@
/* Copy data from a textfile to table */
+/* 2006-12 Erik Wetterberg : LOAD XML added */
+
#include "mysql_priv.h"
#include <my_dir.h>
#include <m_ctype.h>
@@ -23,6 +25,23 @@
#include "sp_head.h"
#include "sql_trigger.h"
+class XML_TAG {
+public:
+ int level;
+ String field;
+ String value;
+ XML_TAG(int l, String f, String v);
+};
+
+
+XML_TAG::XML_TAG(int l, String f, String v)
+{
+ level= l;
+ field.append(f);
+ value.append(v);
+}
+
+
class READ_INFO {
File file;
uchar *buffer, /* Buffer for read text */
@@ -37,6 +56,7 @@ class READ_INFO {
bool need_end_io_cache;
IO_CACHE cache;
NET *io_net;
+ int level; /* for load xml */
public:
bool error,line_cuted,found_null,enclosed;
@@ -54,6 +74,12 @@ public:
char unescape(char chr);
int terminator(char *ptr,uint length);
bool find_start_of_fields();
+ /* load xml */
+ List<XML_TAG> taglist;
+ int read_value(int delim, String *val);
+ int read_xml();
+ int clear_level(int level);
+
/*
We need to force cache close before destructor is invoked to log
the last read block
@@ -82,6 +108,13 @@ static int read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
List<Item> &set_values, READ_INFO &read_info,
String &enclosed, ulong skip_lines,
bool ignore_check_option_errors);
+
+static int read_xml_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
+ List<Item> &fields_vars, List<Item> &set_fields,
+ List<Item> &set_values, READ_INFO &read_info,
+ String &enclosed, ulong skip_lines,
+ bool ignore_check_option_errors);
+
#ifndef EMBEDDED_LIBRARY
static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
const char* db_arg, /* table's database */
@@ -398,7 +431,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
thd->count_cuted_fields= CHECK_FIELD_WARN; /* calc cuted fields */
thd->cuted_fields=0L;
/* Skip lines if there is a line terminator */
- if (ex->line_term->length())
+ if (ex->line_term->length() && ex->filetype != FILETYPE_XML)
{
/* ex->skip_lines needs to be preserved for logging */
while (skip_lines > 0)
@@ -429,7 +462,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
- if (!field_term->length() && !enclosed->length())
+ if (ex->filetype == FILETYPE_XML) /* load xml */
+ error= read_xml_field(thd, info, table_list, fields_vars,
+ set_fields, set_values, read_info,
+ *(ex->line_term), skip_lines, ignore);
+ else if (!field_term->length() && !enclosed->length())
error= read_fixed_length(thd, info, table_list, fields_vars,
set_fields, set_values, read_info,
skip_lines, ignore);
@@ -525,7 +562,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
goto err;
}
sprintf(name, ER(ER_LOAD_INFO), (ulong) info.records, (ulong) info.deleted,
- (ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
+ (ulong) (info.records - info.copied),
+ (ulong) thd->warning_info->statement_warn_count());
if (thd->transaction.stmt.modified_non_trans_table)
thd->transaction.all.modified_non_trans_table= TRUE;
@@ -757,9 +795,10 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (pos == read_info.row_end)
{
thd->cuted_fields++; /* Not enough fields */
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_TOO_FEW_RECORDS,
- ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_TOO_FEW_RECORDS,
+ ER(ER_WARN_TOO_FEW_RECORDS),
+ thd->warning_info->current_row_for_warning());
if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
((Field_timestamp*) field)->set_time();
}
@@ -780,9 +819,10 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (pos != read_info.row_end)
{
thd->cuted_fields++; /* To long row */
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_TOO_MANY_RECORDS,
- ER(ER_WARN_TOO_MANY_RECORDS), thd->row_count);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_TOO_MANY_RECORDS,
+ ER(ER_WARN_TOO_MANY_RECORDS),
+ thd->warning_info->current_row_for_warning());
}
if (thd->killed ||
@@ -815,11 +855,12 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (read_info.line_cuted)
{
thd->cuted_fields++; /* To long row */
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_TOO_MANY_RECORDS,
- ER(ER_WARN_TOO_MANY_RECORDS), thd->row_count);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_TOO_MANY_RECORDS,
+ ER(ER_WARN_TOO_MANY_RECORDS),
+ thd->warning_info->current_row_for_warning());
}
- thd->row_count++;
+ thd->warning_info->inc_current_row_for_warning();
continue_loop:;
}
DBUG_RETURN(test(read_info.error));
@@ -885,7 +926,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (field->reset())
{
my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0), field->field_name,
- thd->row_count);
+ thd->warning_info->current_row_for_warning());
DBUG_RETURN(1);
}
field->set_null();
@@ -953,7 +994,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (field->reset())
{
my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0),field->field_name,
- thd->row_count);
+ thd->warning_info->current_row_for_warning());
DBUG_RETURN(1);
}
if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
@@ -967,7 +1008,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
thd->cuted_fields++;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_TOO_FEW_RECORDS,
- ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
+ ER(ER_WARN_TOO_FEW_RECORDS),
+ thd->warning_info->current_row_for_warning());
}
else if (item->type() == Item::STRING_ITEM)
{
@@ -1011,19 +1053,184 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (read_info.line_cuted)
{
thd->cuted_fields++; /* To long row */
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_TOO_MANY_RECORDS, ER(ER_WARN_TOO_MANY_RECORDS),
- thd->row_count);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_TOO_MANY_RECORDS, ER(ER_WARN_TOO_MANY_RECORDS),
+ thd->warning_info->current_row_for_warning());
if (thd->killed)
DBUG_RETURN(1);
}
- thd->row_count++;
+ thd->warning_info->inc_current_row_for_warning();
continue_loop:;
}
DBUG_RETURN(test(read_info.error));
}
+/****************************************************************************
+** Read rows in xml format
+****************************************************************************/
+static int
+read_xml_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
+ List<Item> &fields_vars, List<Item> &set_fields,
+ List<Item> &set_values, READ_INFO &read_info,
+ String &row_tag, ulong skip_lines,
+ bool ignore_check_option_errors)
+{
+ List_iterator_fast<Item> it(fields_vars);
+ Item *item;
+ TABLE *table= table_list->table;
+ bool no_trans_update_stmt;
+ CHARSET_INFO *cs= read_info.read_charset;
+ DBUG_ENTER("read_xml_field");
+
+ no_trans_update_stmt= !table->file->has_transactions();
+
+ for ( ; ; it.rewind())
+ {
+ if (thd->killed)
+ {
+ thd->send_kill_message();
+ DBUG_RETURN(1);
+ }
+
+ // read row tag and save values into tag list
+ if (read_info.read_xml())
+ break;
+
+ List_iterator_fast<XML_TAG> xmlit(read_info.taglist);
+ xmlit.rewind();
+ XML_TAG *tag= NULL;
+
+#ifndef DBUG_OFF
+ DBUG_PRINT("read_xml_field", ("skip_lines=%d", (int) skip_lines));
+ while ((tag= xmlit++))
+ {
+ DBUG_PRINT("read_xml_field", ("got tag:%i '%s' '%s'",
+ tag->level, tag->field.c_ptr(),
+ tag->value.c_ptr()));
+ }
+#endif
+
+ restore_record(table, s->default_values);
+
+ while ((item= it++))
+ {
+ /* If this line is to be skipped we don't want to fill field or var */
+ if (skip_lines)
+ continue;
+
+ /* find field in tag list */
+ xmlit.rewind();
+ tag= xmlit++;
+
+ while(tag && strcmp(tag->field.c_ptr(), item->name) != 0)
+ tag= xmlit++;
+
+ if (!tag) // found null
+ {
+ if (item->type() == Item::FIELD_ITEM)
+ {
+ Field *field= ((Item_field *) item)->field;
+ field->reset();
+ field->set_null();
+ if (field == table->next_number_field)
+ table->auto_increment_field_not_null= TRUE;
+ if (!field->maybe_null())
+ {
+ if (field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp *) field)->set_time();
+ else if (field != table->next_number_field)
+ field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_NULL_TO_NOTNULL, 1);
+ }
+ }
+ else
+ ((Item_user_var_as_out_param *) item)->set_null_value(cs);
+ continue;
+ }
+
+ if (item->type() == Item::FIELD_ITEM)
+ {
+
+ Field *field= ((Item_field *)item)->field;
+ field->set_notnull();
+ if (field == table->next_number_field)
+ table->auto_increment_field_not_null= TRUE;
+ field->store((char *) tag->value.ptr(), tag->value.length(), cs);
+ }
+ else
+ ((Item_user_var_as_out_param *) item)->set_value(
+ (char *) tag->value.ptr(),
+ tag->value.length(), cs);
+ }
+
+ if (read_info.error)
+ break;
+
+ if (skip_lines)
+ {
+ skip_lines--;
+ continue;
+ }
+
+ if (item)
+ {
+ /* Have not read any field, thus input file is simply ended */
+ if (item == fields_vars.head())
+ break;
+
+ for ( ; item; item= it++)
+ {
+ if (item->type() == Item::FIELD_ITEM)
+ {
+ /*
+ QQ: We probably should not throw warning for each field.
+ But how about intention to always have the same number
+ of warnings in THD::cuted_fields (and get rid of cuted_fields
+ in the end ?)
+ */
+ thd->cuted_fields++;
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_TOO_FEW_RECORDS,
+ ER(ER_WARN_TOO_FEW_RECORDS),
+ thd->warning_info->current_row_for_warning());
+ }
+ else
+ ((Item_user_var_as_out_param *)item)->set_null_value(cs);
+ }
+ }
+
+ if (thd->killed ||
+ fill_record_n_invoke_before_triggers(thd, set_fields, set_values,
+ ignore_check_option_errors,
+ table->triggers,
+ TRG_EVENT_INSERT))
+ DBUG_RETURN(1);
+
+ switch (table_list->view_check_option(thd,
+ ignore_check_option_errors)) {
+ case VIEW_CHECK_SKIP:
+ read_info.next_line();
+ goto continue_loop;
+ case VIEW_CHECK_ERROR:
+ DBUG_RETURN(-1);
+ }
+
+ if (write_record(thd, table, &info))
+ DBUG_RETURN(1);
+
+ /*
+ We don't need to reset auto-increment field since we are restoring
+ its default value at the beginning of each loop iteration.
+ */
+ thd->transaction.stmt.modified_non_trans_table= no_trans_update_stmt;
+ thd->warning_info->inc_current_row_for_warning();
+ continue_loop:;
+ }
+ DBUG_RETURN(test(read_info.error) || thd->is_error());
+} /* load xml end */
+
+
/* Unescape all escape characters, mark \N as null */
char
@@ -1062,6 +1269,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
field_term_length= field_term.length();
line_term_ptr=(char*) line_term.ptr();
line_term_length= line_term.length();
+ level= 0; /* for load xml */
if (line_start.length() == 0)
{
line_start_ptr=0;
@@ -1137,6 +1345,10 @@ READ_INFO::~READ_INFO()
my_free((uchar*) buffer,MYF(0));
error=1;
}
+ List_iterator<XML_TAG> xmlit(taglist);
+ XML_TAG *t;
+ while ((t= xmlit++))
+ delete(t);
}
@@ -1469,3 +1681,319 @@ bool READ_INFO::find_start_of_fields()
}
return 0;
}
+
+
+/*
+ Clear taglist from tags with a specified level
+*/
+int READ_INFO::clear_level(int level)
+{
+ DBUG_ENTER("READ_INFO::read_xml clear_level");
+ List_iterator<XML_TAG> xmlit(taglist);
+ xmlit.rewind();
+ XML_TAG *tag;
+
+ while ((tag= xmlit++))
+ {
+ if(tag->level >= level)
+ {
+ xmlit.remove();
+ delete tag;
+ }
+ }
+ DBUG_RETURN(0);
+}
+
+
+/*
+ Convert an XML entity to Unicode value.
+ Return -1 on error;
+*/
+static int
+my_xml_entity_to_char(const char *name, uint length)
+{
+ if (length == 2)
+ {
+ if (!memcmp(name, "gt", length))
+ return '>';
+ if (!memcmp(name, "lt", length))
+ return '<';
+ }
+ else if (length == 3)
+ {
+ if (!memcmp(name, "amp", length))
+ return '&';
+ }
+ else if (length == 4)
+ {
+ if (!memcmp(name, "quot", length))
+ return '"';
+ if (!memcmp(name, "apos", length))
+ return '\'';
+ }
+ return -1;
+}
+
+
+/**
+ @brief Convert newline, linefeed, tab to space
+
+ @param chr character
+
+ @details According to the "XML 1.0" standard,
+ only space (#x20) characters, carriage returns,
+ line feeds or tabs are considered as spaces.
+ Convert all of them to space (#x20) for parsing simplicity.
+*/
+static int
+my_tospace(int chr)
+{
+ return (chr == '\t' || chr == '\r' || chr == '\n') ? ' ' : chr;
+}
+
+
+/*
+ Read an xml value: handle multibyte and xml escape
+*/
+int READ_INFO::read_value(int delim, String *val)
+{
+ int chr;
+ String tmp;
+
+ for (chr= GET; my_tospace(chr) != delim && chr != my_b_EOF;)
+ {
+#ifdef USE_MB
+ if (my_mbcharlen(read_charset, chr) > 1)
+ {
+ DBUG_PRINT("read_xml",("multi byte"));
+ int i, ml= my_mbcharlen(read_charset, chr);
+ for (i= 1; i < ml; i++)
+ {
+ val->append(chr);
+ /*
+ Don't use my_tospace() in the middle of a multi-byte character
+ TODO: check that the multi-byte sequence is valid.
+ */
+ chr= GET;
+ if (chr == my_b_EOF)
+ return chr;
+ }
+ }
+#endif
+ if(chr == '&')
+ {
+ tmp.length(0);
+ for (chr= my_tospace(GET) ; chr != ';' ; chr= my_tospace(GET))
+ {
+ if (chr == my_b_EOF)
+ return chr;
+ tmp.append(chr);
+ }
+ if ((chr= my_xml_entity_to_char(tmp.ptr(), tmp.length())) >= 0)
+ val->append(chr);
+ else
+ {
+ val->append('&');
+ val->append(tmp);
+ val->append(';');
+ }
+ }
+ else
+ val->append(chr);
+ chr= GET;
+ }
+ return my_tospace(chr);
+}
+
+
+/*
+ Read a record in xml format
+ tags and attributes are stored in taglist
+ when tag set in ROWS IDENTIFIED BY is closed, we are ready and return
+*/
+int READ_INFO::read_xml()
+{
+ DBUG_ENTER("READ_INFO::read_xml");
+ int chr, chr2, chr3;
+ int delim= 0;
+ String tag, attribute, value;
+ bool in_tag= false;
+
+ tag.length(0);
+ attribute.length(0);
+ value.length(0);
+
+ for (chr= my_tospace(GET); chr != my_b_EOF ; )
+ {
+ switch(chr){
+ case '<': /* read tag */
+ /* TODO: check if this is a comment <!-- comment --> */
+ chr= my_tospace(GET);
+ if(chr == '!')
+ {
+ chr2= GET;
+ chr3= GET;
+
+ if(chr2 == '-' && chr3 == '-')
+ {
+ chr2= 0;
+ chr3= 0;
+ chr= my_tospace(GET);
+
+ while(chr != '>' || chr2 != '-' || chr3 != '-')
+ {
+ if(chr == '-')
+ {
+ chr3= chr2;
+ chr2= chr;
+ }
+ else if (chr2 == '-')
+ {
+ chr2= 0;
+ chr3= 0;
+ }
+ chr= my_tospace(GET);
+ if (chr == my_b_EOF)
+ goto found_eof;
+ }
+ break;
+ }
+ }
+
+ tag.length(0);
+ while(chr != '>' && chr != ' ' && chr != '/' && chr != my_b_EOF)
+ {
+ if(chr != delim) /* fix for the '<field name =' format */
+ tag.append(chr);
+ chr= my_tospace(GET);
+ }
+
+ // row tag should be in ROWS IDENTIFIED BY '<row>' - stored in line_term
+ if((tag.length() == line_term_length -2) &&
+ (strncmp(tag.c_ptr_safe(), line_term_ptr + 1, tag.length()) == 0))
+ {
+ DBUG_PRINT("read_xml", ("start-of-row: %i %s %s",
+ level,tag.c_ptr_safe(), line_term_ptr));
+ }
+
+ if(chr == ' ' || chr == '>')
+ {
+ level++;
+ clear_level(level + 1);
+ }
+
+ if (chr == ' ')
+ in_tag= true;
+ else
+ in_tag= false;
+ break;
+
+ case ' ': /* read attribute */
+ while(chr == ' ') /* skip blanks */
+ chr= my_tospace(GET);
+
+ if(!in_tag)
+ break;
+
+ while(chr != '=' && chr != '/' && chr != '>' && chr != my_b_EOF)
+ {
+ attribute.append(chr);
+ chr= my_tospace(GET);
+ }
+ break;
+
+ case '>': /* end tag - read tag value */
+ in_tag= false;
+ chr= read_value('<', &value);
+ if(chr == my_b_EOF)
+ goto found_eof;
+
+ /* save value to list */
+ if(tag.length() > 0 && value.length() > 0)
+ {
+ DBUG_PRINT("read_xml", ("lev:%i tag:%s val:%s",
+ level,tag.c_ptr_safe(), value.c_ptr_safe()));
+ taglist.push_front( new XML_TAG(level, tag, value));
+ }
+ tag.length(0);
+ value.length(0);
+ attribute.length(0);
+ break;
+
+ case '/': /* close tag */
+ level--;
+ chr= my_tospace(GET);
+ if(chr != '>') /* if this is an empty tag <tag /> */
+ tag.length(0); /* we should keep tag value */
+ while(chr != '>' && chr != my_b_EOF)
+ {
+ tag.append(chr);
+ chr= my_tospace(GET);
+ }
+
+ if((tag.length() == line_term_length -2) &&
+ (strncmp(tag.c_ptr_safe(), line_term_ptr + 1, tag.length()) == 0))
+ {
+ DBUG_PRINT("read_xml", ("found end-of-row %i %s",
+ level, tag.c_ptr_safe()));
+ DBUG_RETURN(0); //normal return
+ }
+ chr= my_tospace(GET);
+ break;
+
+ case '=': /* attribute name end - read the value */
+ //check for tag field and attribute name
+ if(!memcmp(tag.c_ptr_safe(), STRING_WITH_LEN("field")) &&
+ !memcmp(attribute.c_ptr_safe(), STRING_WITH_LEN("name")))
+ {
+ /*
+ this is format <field name="xx">xx</field>
+ where actual fieldname is in attribute
+ */
+ delim= my_tospace(GET);
+ tag.length(0);
+ attribute.length(0);
+ chr= '<'; /* we pretend that it is a tag */
+ level--;
+ break;
+ }
+
+ //check for " or '
+ chr= GET;
+ if (chr == my_b_EOF)
+ goto found_eof;
+ if(chr == '"' || chr == '\'')
+ {
+ delim= chr;
+ }
+ else
+ {
+ delim= ' '; /* no delimiter, use space */
+ PUSH(chr);
+ }
+
+ chr= read_value(delim, &value);
+ if(attribute.length() > 0 && value.length() > 0)
+ {
+ DBUG_PRINT("read_xml", ("lev:%i att:%s val:%s\n",
+ level + 1,
+ attribute.c_ptr_safe(),
+ value.c_ptr_safe()));
+ taglist.push_front(new XML_TAG(level + 1, attribute, value));
+ }
+ attribute.length(0);
+ value.length(0);
+ if (chr != ' ')
+ chr= my_tospace(GET);
+ break;
+
+ default:
+ chr= my_tospace(GET);
+ } /* end switch */
+ } /* end while */
+
+found_eof:
+ DBUG_PRINT("read_xml",("Found eof"));
+ eof= 1;
+ DBUG_RETURN(1);
+}
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index 5ddf65cd1b7..9b1bb67ca06 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -23,6 +23,43 @@
#include "mysql_priv.h"
+enum err_msgs_index
+{
+ en_US= 0, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT,
+ ja_JP, ko_KR, no_NO, nn_NO, pl_PL, pt_PT, ro_RO, ru_RU, sr_RS, sk_SK,
+ es_ES, sv_SE, uk_UA
+} ERR_MSGS_INDEX;
+
+
+MY_LOCALE_ERRMSGS global_errmsgs[]=
+{
+ {"english", NULL},
+ {"czech", NULL},
+ {"danish", NULL},
+ {"dutch", NULL},
+ {"estonian", NULL},
+ {"french", NULL},
+ {"german", NULL},
+ {"greek", NULL},
+ {"hungarian", NULL},
+ {"italian", NULL},
+ {"japanese", NULL},
+ {"korean", NULL},
+ {"norwegian", NULL},
+ {"norwegian-ny", NULL},
+ {"polish", NULL},
+ {"portuguese", NULL},
+ {"romanian", NULL},
+ {"russian", NULL},
+ {"serbian", NULL},
+ {"slovak", NULL},
+ {"spanish", NULL},
+ {"swedish", NULL},
+ {"ukrainian", NULL},
+ {NULL, NULL}
+};
+
+
/***** LOCALE BEGIN ar_AE: Arabic - United Arab Emirates *****/
static const char *my_locale_month_names_ar_AE[13] =
{"يناير","Ùبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوÙمبر","ديسمبر", NullS };
@@ -51,7 +88,11 @@ MY_LOCALE my_locale_ar_AE
&my_locale_typelib_day_names_ar_AE,
&my_locale_typelib_ab_day_names_ar_AE,
6,
- 8
+ 8,
+ '.', /* decimal point ar_AE */
+ ',', /* thousands_sep ar_AE */
+ "\x03", /* grouping ar_AE */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_AE *****/
@@ -83,7 +124,11 @@ MY_LOCALE my_locale_ar_BH
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_BH */
+ ',', /* thousands_sep ar_BH */
+ "\x03", /* grouping ar_BH */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_BH *****/
@@ -115,7 +160,11 @@ MY_LOCALE my_locale_ar_JO
&my_locale_typelib_day_names_ar_JO,
&my_locale_typelib_ab_day_names_ar_JO,
12,
- 8
+ 8,
+ '.', /* decimal point ar_JO */
+ ',', /* thousands_sep ar_JO */
+ "\x03", /* grouping ar_JO */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_JO *****/
@@ -147,7 +196,11 @@ MY_LOCALE my_locale_ar_SA
&my_locale_typelib_day_names_ar_SA,
&my_locale_typelib_ab_day_names_ar_SA,
12,
- 8
+ 8,
+ '.', /* decimal point ar_SA */
+ '\0', /* thousands_sep ar_SA */
+ "\x80", /* grouping ar_SA */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_SA *****/
@@ -179,7 +232,11 @@ MY_LOCALE my_locale_ar_SY
&my_locale_typelib_day_names_ar_SY,
&my_locale_typelib_ab_day_names_ar_SY,
12,
- 8
+ 8,
+ '.', /* decimal point ar_SY */
+ ',', /* thousands_sep ar_SY */
+ "\x03", /* grouping ar_SY */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_SY *****/
@@ -211,7 +268,11 @@ MY_LOCALE my_locale_be_BY
&my_locale_typelib_day_names_be_BY,
&my_locale_typelib_ab_day_names_be_BY,
10,
- 10
+ 10,
+ ',', /* decimal point be_BY */
+ '.', /* thousands_sep be_BY */
+ "\x03\x03", /* grouping be_BY */
+ &global_errmsgs[en_US]
);
/***** LOCALE END be_BY *****/
@@ -243,7 +304,11 @@ MY_LOCALE my_locale_bg_BG
&my_locale_typelib_day_names_bg_BG,
&my_locale_typelib_ab_day_names_bg_BG,
9,
- 10
+ 10,
+ ',', /* decimal point bg_BG */
+ '\0', /* thousands_sep bg_BG */
+ "\x03\x03", /* grouping bg_BG */
+ &global_errmsgs[en_US]
);
/***** LOCALE END bg_BG *****/
@@ -275,7 +340,11 @@ MY_LOCALE my_locale_ca_ES
&my_locale_typelib_day_names_ca_ES,
&my_locale_typelib_ab_day_names_ca_ES,
8,
- 9
+ 9,
+ ',', /* decimal point ca_ES */
+ '\0', /* thousands_sep ca_ES */
+ "\x80\x80", /* grouping ca_ES */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ca_ES *****/
@@ -307,7 +376,11 @@ MY_LOCALE my_locale_cs_CZ
&my_locale_typelib_day_names_cs_CZ,
&my_locale_typelib_ab_day_names_cs_CZ,
8,
- 7
+ 7,
+ ',', /* decimal point cs_CZ */
+ ' ', /* thousands_sep cs_CZ */
+ "\x03\x03", /* grouping cs_CZ */
+ &global_errmsgs[cs_CZ]
);
/***** LOCALE END cs_CZ *****/
@@ -339,7 +412,11 @@ MY_LOCALE my_locale_da_DK
&my_locale_typelib_day_names_da_DK,
&my_locale_typelib_ab_day_names_da_DK,
9,
- 7
+ 7,
+ ',', /* decimal point da_DK */
+ '.', /* thousands_sep da_DK */
+ "\x03\x03", /* grouping da_DK */
+ &global_errmsgs[da_DK]
);
/***** LOCALE END da_DK *****/
@@ -371,7 +448,11 @@ MY_LOCALE my_locale_de_AT
&my_locale_typelib_day_names_de_AT,
&my_locale_typelib_ab_day_names_de_AT,
9,
- 10
+ 10,
+ ',', /* decimal point de_AT */
+ '\0', /* thousands_sep de_AT */
+ "\x80\x80", /* grouping de_AT */
+ &global_errmsgs[de_DE]
);
/***** LOCALE END de_AT *****/
@@ -403,7 +484,11 @@ MY_LOCALE my_locale_de_DE
&my_locale_typelib_day_names_de_DE,
&my_locale_typelib_ab_day_names_de_DE,
9,
- 10
+ 10,
+ ',', /* decimal point de_DE */
+ '.', /* thousands_sep de_DE */
+ "\x03\x03", /* grouping de_DE */
+ &global_errmsgs[de_DE]
);
/***** LOCALE END de_DE *****/
@@ -435,7 +520,11 @@ MY_LOCALE my_locale_en_US
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_US */
+ ',', /* thousands_sep en_US */
+ "\x03\x03", /* grouping en_US */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_US *****/
@@ -467,7 +556,11 @@ MY_LOCALE my_locale_es_ES
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_ES */
+ '\0', /* thousands_sep es_ES */
+ "\x80\x80", /* grouping es_ES */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_ES *****/
@@ -499,7 +592,11 @@ MY_LOCALE my_locale_et_EE
&my_locale_typelib_day_names_et_EE,
&my_locale_typelib_ab_day_names_et_EE,
9,
- 9
+ 9,
+ ',', /* decimal point et_EE */
+ ' ', /* thousands_sep et_EE */
+ "\x03\x03", /* grouping et_EE */
+ &global_errmsgs[et_EE]
);
/***** LOCALE END et_EE *****/
@@ -531,7 +628,11 @@ MY_LOCALE my_locale_eu_ES
&my_locale_typelib_day_names_eu_ES,
&my_locale_typelib_ab_day_names_eu_ES,
9,
- 10
+ 10,
+ ',', /* decimal point eu_ES */
+ '\0', /* thousands_sep eu_ES */
+ "\x80\x80", /* grouping eu_ES */
+ &global_errmsgs[en_US]
);
/***** LOCALE END eu_ES *****/
@@ -563,7 +664,11 @@ MY_LOCALE my_locale_fi_FI
&my_locale_typelib_day_names_fi_FI,
&my_locale_typelib_ab_day_names_fi_FI,
9,
- 11
+ 11,
+ ',', /* decimal point fi_FI */
+ ' ', /* thousands_sep fi_FI */
+ "\x03\x03", /* grouping fi_FI */
+ &global_errmsgs[en_US]
);
/***** LOCALE END fi_FI *****/
@@ -595,7 +700,11 @@ MY_LOCALE my_locale_fo_FO
&my_locale_typelib_day_names_fo_FO,
&my_locale_typelib_ab_day_names_fo_FO,
9,
- 12
+ 12,
+ ',', /* decimal point fo_FO */
+ '.', /* thousands_sep fo_FO */
+ "\x03\x03", /* grouping fo_FO */
+ &global_errmsgs[en_US]
);
/***** LOCALE END fo_FO *****/
@@ -627,7 +736,11 @@ MY_LOCALE my_locale_fr_FR
&my_locale_typelib_day_names_fr_FR,
&my_locale_typelib_ab_day_names_fr_FR,
9,
- 8
+ 8,
+ ',', /* decimal point fr_FR */
+ '\0', /* thousands_sep fr_FR */
+ "\x80\x80", /* grouping fr_FR */
+ &global_errmsgs[fr_FR]
);
/***** LOCALE END fr_FR *****/
@@ -659,7 +772,11 @@ MY_LOCALE my_locale_gl_ES
&my_locale_typelib_day_names_gl_ES,
&my_locale_typelib_ab_day_names_gl_ES,
8,
- 8
+ 8,
+ ',', /* decimal point gl_ES */
+ '\0', /* thousands_sep gl_ES */
+ "\x80\x80", /* grouping gl_ES */
+ &global_errmsgs[en_US]
);
/***** LOCALE END gl_ES *****/
@@ -691,7 +808,11 @@ MY_LOCALE my_locale_gu_IN
&my_locale_typelib_day_names_gu_IN,
&my_locale_typelib_ab_day_names_gu_IN,
10,
- 8
+ 8,
+ '.', /* decimal point gu_IN */
+ ',', /* thousands_sep gu_IN */
+ "\x03", /* grouping gu_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END gu_IN *****/
@@ -723,7 +844,11 @@ MY_LOCALE my_locale_he_IL
&my_locale_typelib_day_names_he_IL,
&my_locale_typelib_ab_day_names_he_IL,
7,
- 5
+ 5,
+ '.', /* decimal point he_IL */
+ ',', /* thousands_sep he_IL */
+ "\x03\x03", /* grouping he_IL */
+ &global_errmsgs[en_US]
);
/***** LOCALE END he_IL *****/
@@ -755,7 +880,11 @@ MY_LOCALE my_locale_hi_IN
&my_locale_typelib_day_names_hi_IN,
&my_locale_typelib_ab_day_names_hi_IN,
7,
- 9
+ 9,
+ '.', /* decimal point hi_IN */
+ ',', /* thousands_sep hi_IN */
+ "\x03", /* grouping hi_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END hi_IN *****/
@@ -787,7 +916,11 @@ MY_LOCALE my_locale_hr_HR
&my_locale_typelib_day_names_hr_HR,
&my_locale_typelib_ab_day_names_hr_HR,
8,
- 11
+ 11,
+ ',', /* decimal point hr_HR */
+ '\0', /* thousands_sep hr_HR */
+ "\x80\x80", /* grouping hr_HR */
+ &global_errmsgs[en_US]
);
/***** LOCALE END hr_HR *****/
@@ -819,7 +952,11 @@ MY_LOCALE my_locale_hu_HU
&my_locale_typelib_day_names_hu_HU,
&my_locale_typelib_ab_day_names_hu_HU,
10,
- 9
+ 9,
+ ',', /* decimal point hu_HU */
+ '.', /* thousands_sep hu_HU */
+ "\x03\x03", /* grouping hu_HU */
+ &global_errmsgs[hu_HU]
);
/***** LOCALE END hu_HU *****/
@@ -851,7 +988,11 @@ MY_LOCALE my_locale_id_ID
&my_locale_typelib_day_names_id_ID,
&my_locale_typelib_ab_day_names_id_ID,
9,
- 6
+ 6,
+ ',', /* decimal point id_ID */
+ '.', /* thousands_sep id_ID */
+ "\x03\x03", /* grouping id_ID */
+ &global_errmsgs[en_US]
);
/***** LOCALE END id_ID *****/
@@ -883,7 +1024,11 @@ MY_LOCALE my_locale_is_IS
&my_locale_typelib_day_names_is_IS,
&my_locale_typelib_ab_day_names_is_IS,
9,
- 12
+ 12,
+ ',', /* decimal point is_IS */
+ '.', /* thousands_sep is_IS */
+ "\x03\x03", /* grouping is_IS */
+ &global_errmsgs[en_US]
);
/***** LOCALE END is_IS *****/
@@ -915,7 +1060,11 @@ MY_LOCALE my_locale_it_CH
&my_locale_typelib_day_names_it_CH,
&my_locale_typelib_ab_day_names_it_CH,
9,
- 9
+ 9,
+ ',', /* decimal point it_CH */
+ '\'', /* thousands_sep it_CH */
+ "\x03\x03", /* grouping it_CH */
+ &global_errmsgs[it_IT]
);
/***** LOCALE END it_CH *****/
@@ -947,7 +1096,11 @@ MY_LOCALE my_locale_ja_JP
&my_locale_typelib_day_names_ja_JP,
&my_locale_typelib_ab_day_names_ja_JP,
3,
- 3
+ 3,
+ '.', /* decimal point ja_JP */
+ ',', /* thousands_sep ja_JP */
+ "\x03", /* grouping ja_JP */
+ &global_errmsgs[ja_JP]
);
/***** LOCALE END ja_JP *****/
@@ -979,7 +1132,11 @@ MY_LOCALE my_locale_ko_KR
&my_locale_typelib_day_names_ko_KR,
&my_locale_typelib_ab_day_names_ko_KR,
3,
- 3
+ 3,
+ '.', /* decimal point ko_KR */
+ ',', /* thousands_sep ko_KR */
+ "\x03\x03", /* grouping ko_KR */
+ &global_errmsgs[ko_KR]
);
/***** LOCALE END ko_KR *****/
@@ -1011,7 +1168,11 @@ MY_LOCALE my_locale_lt_LT
&my_locale_typelib_day_names_lt_LT,
&my_locale_typelib_ab_day_names_lt_LT,
9,
- 14
+ 14,
+ ',', /* decimal point lt_LT */
+ '.', /* thousands_sep lt_LT */
+ "\x03\x03", /* grouping lt_LT */
+ &global_errmsgs[en_US]
);
/***** LOCALE END lt_LT *****/
@@ -1043,7 +1204,11 @@ MY_LOCALE my_locale_lv_LV
&my_locale_typelib_day_names_lv_LV,
&my_locale_typelib_ab_day_names_lv_LV,
10,
- 11
+ 11,
+ ',', /* decimal point lv_LV */
+ ' ', /* thousands_sep lv_LV */
+ "\x03\x03", /* grouping lv_LV */
+ &global_errmsgs[en_US]
);
/***** LOCALE END lv_LV *****/
@@ -1075,7 +1240,11 @@ MY_LOCALE my_locale_mk_MK
&my_locale_typelib_day_names_mk_MK,
&my_locale_typelib_ab_day_names_mk_MK,
9,
- 10
+ 10,
+ ',', /* decimal point mk_MK */
+ ' ', /* thousands_sep mk_MK */
+ "\x03\x03", /* grouping mk_MK */
+ &global_errmsgs[en_US]
);
/***** LOCALE END mk_MK *****/
@@ -1107,7 +1276,11 @@ MY_LOCALE my_locale_mn_MN
&my_locale_typelib_day_names_mn_MN,
&my_locale_typelib_ab_day_names_mn_MN,
18,
- 6
+ 6,
+ ',', /* decimal point mn_MN */
+ '.', /* thousands_sep mn_MN */
+ "\x03\x03", /* grouping mn_MN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END mn_MN *****/
@@ -1139,7 +1312,11 @@ MY_LOCALE my_locale_ms_MY
&my_locale_typelib_day_names_ms_MY,
&my_locale_typelib_ab_day_names_ms_MY,
9,
- 6
+ 6,
+ '.', /* decimal point ms_MY */
+ ',', /* thousands_sep ms_MY */
+ "\x03", /* grouping ms_MY */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ms_MY *****/
@@ -1171,7 +1348,11 @@ MY_LOCALE my_locale_nb_NO
&my_locale_typelib_day_names_nb_NO,
&my_locale_typelib_ab_day_names_nb_NO,
9,
- 7
+ 7,
+ ',', /* decimal point nb_NO */
+ '.', /* thousands_sep nb_NO */
+ "\x03\x03", /* grouping nb_NO */
+ &global_errmsgs[no_NO]
);
/***** LOCALE END nb_NO *****/
@@ -1203,7 +1384,11 @@ MY_LOCALE my_locale_nl_NL
&my_locale_typelib_day_names_nl_NL,
&my_locale_typelib_ab_day_names_nl_NL,
9,
- 9
+ 9,
+ ',', /* decimal point nl_NL */
+ '\0', /* thousands_sep nl_NL */
+ "\x80\x80", /* grouping nl_NL */
+ &global_errmsgs[nl_NL]
);
/***** LOCALE END nl_NL *****/
@@ -1235,7 +1420,11 @@ MY_LOCALE my_locale_pl_PL
&my_locale_typelib_day_names_pl_PL,
&my_locale_typelib_ab_day_names_pl_PL,
11,
- 12
+ 12,
+ ',', /* decimal point pl_PL */
+ '\0', /* thousands_sep pl_PL */
+ "\x80\x80", /* grouping pl_PL */
+ &global_errmsgs[pl_PL]
);
/***** LOCALE END pl_PL *****/
@@ -1267,7 +1456,11 @@ MY_LOCALE my_locale_pt_BR
&my_locale_typelib_day_names_pt_BR,
&my_locale_typelib_ab_day_names_pt_BR,
9,
- 7
+ 7,
+ ',', /* decimal point pt_BR */
+ '\0', /* thousands_sep pt_BR */
+ "\x80\x80", /* grouping pt_BR */
+ &global_errmsgs[pt_PT]
);
/***** LOCALE END pt_BR *****/
@@ -1299,7 +1492,11 @@ MY_LOCALE my_locale_pt_PT
&my_locale_typelib_day_names_pt_PT,
&my_locale_typelib_ab_day_names_pt_PT,
9,
- 7
+ 7,
+ ',', /* decimal point pt_PT */
+ '\0', /* thousands_sep pt_PT */
+ "\x80\x80", /* grouping pt_PT */
+ &global_errmsgs[pt_PT]
);
/***** LOCALE END pt_PT *****/
@@ -1331,7 +1528,11 @@ MY_LOCALE my_locale_ro_RO
&my_locale_typelib_day_names_ro_RO,
&my_locale_typelib_ab_day_names_ro_RO,
10,
- 8
+ 8,
+ ',', /* decimal point ro_RO */
+ '.', /* thousands_sep ro_RO */
+ "\x03\x03", /* grouping ro_RO */
+ &global_errmsgs[ro_RO]
);
/***** LOCALE END ro_RO *****/
@@ -1363,7 +1564,11 @@ MY_LOCALE my_locale_ru_RU
&my_locale_typelib_day_names_ru_RU,
&my_locale_typelib_ab_day_names_ru_RU,
8,
- 11
+ 11,
+ ',', /* decimal point ru_RU */
+ ' ', /* thousands_sep ru_RU */
+ "\x03\x03", /* grouping ru_RU */
+ &global_errmsgs[ru_RU]
);
/***** LOCALE END ru_RU *****/
@@ -1395,7 +1600,11 @@ MY_LOCALE my_locale_ru_UA
&my_locale_typelib_day_names_ru_UA,
&my_locale_typelib_ab_day_names_ru_UA,
8,
- 11
+ 11,
+ ',', /* decimal point ru_UA */
+ '.', /* thousands_sep ru_UA */
+ "\x03\x03", /* grouping ru_UA */
+ &global_errmsgs[ru_RU]
);
/***** LOCALE END ru_UA *****/
@@ -1427,7 +1636,11 @@ MY_LOCALE my_locale_sk_SK
&my_locale_typelib_day_names_sk_SK,
&my_locale_typelib_ab_day_names_sk_SK,
9,
- 8
+ 8,
+ ',', /* decimal point sk_SK */
+ ' ', /* thousands_sep sk_SK */
+ "\x03\x03", /* grouping sk_SK */
+ &global_errmsgs[sk_SK]
);
/***** LOCALE END sk_SK *****/
@@ -1459,7 +1672,11 @@ MY_LOCALE my_locale_sl_SI
&my_locale_typelib_day_names_sl_SI,
&my_locale_typelib_ab_day_names_sl_SI,
9,
- 10
+ 10,
+ ',', /* decimal point sl_SI */
+ ' ', /* thousands_sep sl_SI */
+ "\x80\x80", /* grouping sl_SI */
+ &global_errmsgs[en_US]
);
/***** LOCALE END sl_SI *****/
@@ -1491,41 +1708,67 @@ MY_LOCALE my_locale_sq_AL
&my_locale_typelib_day_names_sq_AL,
&my_locale_typelib_ab_day_names_sq_AL,
7,
- 10
+ 10,
+ ',', /* decimal point sq_AL */
+ '.', /* thousands_sep sq_AL */
+ "\x03", /* grouping sq_AL */
+ &global_errmsgs[en_US]
);
/***** LOCALE END sq_AL *****/
-/***** LOCALE BEGIN sr_YU: Servian - Yugoslavia *****/
-static const char *my_locale_month_names_sr_YU[13] =
+/***** LOCALE BEGIN sr_RS: Serbian - Serbia *****/
+static const char *my_locale_month_names_sr_RS[13] =
{"januar","februar","mart","april","maj","juni","juli","avgust","septembar","oktobar","novembar","decembar", NullS };
-static const char *my_locale_ab_month_names_sr_YU[13] =
+static const char *my_locale_ab_month_names_sr_RS[13] =
{"jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec", NullS };
-static const char *my_locale_day_names_sr_YU[8] =
+static const char *my_locale_day_names_sr_RS[8] =
{"ponedeljak","utorak","sreda","Äetvrtak","petak","subota","nedelja", NullS };
-static const char *my_locale_ab_day_names_sr_YU[8] =
+static const char *my_locale_ab_day_names_sr_RS[8] =
{"pon","uto","sre","Äet","pet","sub","ned", NullS };
-static TYPELIB my_locale_typelib_month_names_sr_YU =
- { array_elements(my_locale_month_names_sr_YU)-1, "", my_locale_month_names_sr_YU, NULL };
-static TYPELIB my_locale_typelib_ab_month_names_sr_YU =
- { array_elements(my_locale_ab_month_names_sr_YU)-1, "", my_locale_ab_month_names_sr_YU, NULL };
-static TYPELIB my_locale_typelib_day_names_sr_YU =
- { array_elements(my_locale_day_names_sr_YU)-1, "", my_locale_day_names_sr_YU, NULL };
-static TYPELIB my_locale_typelib_ab_day_names_sr_YU =
- { array_elements(my_locale_ab_day_names_sr_YU)-1, "", my_locale_ab_day_names_sr_YU, NULL };
-MY_LOCALE my_locale_sr_YU
+static TYPELIB my_locale_typelib_month_names_sr_RS =
+ { array_elements(my_locale_month_names_sr_RS)-1, "", my_locale_month_names_sr_RS, NULL };
+static TYPELIB my_locale_typelib_ab_month_names_sr_RS =
+ { array_elements(my_locale_ab_month_names_sr_RS)-1, "", my_locale_ab_month_names_sr_RS, NULL };
+static TYPELIB my_locale_typelib_day_names_sr_RS =
+ { array_elements(my_locale_day_names_sr_RS)-1, "", my_locale_day_names_sr_RS, NULL };
+static TYPELIB my_locale_typelib_ab_day_names_sr_RS =
+ { array_elements(my_locale_ab_day_names_sr_RS)-1, "", my_locale_ab_day_names_sr_RS, NULL };
+MY_LOCALE my_locale_sr_YU /* Deprecated, use sr_RS instead */
(
48,
"sr_YU",
- "Servian - Yugoslavia",
+ "Serbian - Yugoslavia",
FALSE,
- &my_locale_typelib_month_names_sr_YU,
- &my_locale_typelib_ab_month_names_sr_YU,
- &my_locale_typelib_day_names_sr_YU,
- &my_locale_typelib_ab_day_names_sr_YU,
+ &my_locale_typelib_month_names_sr_RS,
+ &my_locale_typelib_ab_month_names_sr_RS,
+ &my_locale_typelib_day_names_sr_RS,
+ &my_locale_typelib_ab_day_names_sr_RS,
9,
- 10
+ 10,
+ '.', /* decimal point sr_RS */
+ '\0', /* thousands_sep sr_RS */
+ "\x80", /* grouping sr_RS */
+ &global_errmsgs[sr_RS]
);
-/***** LOCALE END sr_YU *****/
+
+MY_LOCALE my_locale_sr_RS
+(
+ 48,
+ "sr_RS",
+ "Serbian - Serbia",
+ FALSE,
+ &my_locale_typelib_month_names_sr_RS,
+ &my_locale_typelib_ab_month_names_sr_RS,
+ &my_locale_typelib_day_names_sr_RS,
+ &my_locale_typelib_ab_day_names_sr_RS,
+ 9,
+ 10,
+ '.', /* decimal point sr_RS */
+ '\0', /* thousands_sep sr_RS */
+ "\x80", /* grouping sr_RS */
+ &global_errmsgs[sr_RS]
+);
+/***** LOCALE END sr_RS *****/
/***** LOCALE BEGIN sv_SE: Swedish - Sweden *****/
static const char *my_locale_month_names_sv_SE[13] =
@@ -1555,7 +1798,11 @@ MY_LOCALE my_locale_sv_SE
&my_locale_typelib_day_names_sv_SE,
&my_locale_typelib_ab_day_names_sv_SE,
9,
- 7
+ 7,
+ ',', /* decimal point sv_SE */
+ ' ', /* thousands_sep sv_SE */
+ "\x03\x03", /* grouping sv_SE */
+ &global_errmsgs[sv_SE]
);
/***** LOCALE END sv_SE *****/
@@ -1587,7 +1834,11 @@ MY_LOCALE my_locale_ta_IN
&my_locale_typelib_day_names_ta_IN,
&my_locale_typelib_ab_day_names_ta_IN,
10,
- 8
+ 8,
+ '.', /* decimal point ta_IN */
+ ',', /* thousands_sep ta_IN */
+ "\x03\x02", /* grouping ta_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ta_IN *****/
@@ -1619,7 +1870,11 @@ MY_LOCALE my_locale_te_IN
&my_locale_typelib_day_names_te_IN,
&my_locale_typelib_ab_day_names_te_IN,
10,
- 9
+ 9,
+ '.', /* decimal point te_IN */
+ ',', /* thousands_sep te_IN */
+ "\x03\x02", /* grouping te_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END te_IN *****/
@@ -1651,7 +1906,11 @@ MY_LOCALE my_locale_th_TH
&my_locale_typelib_day_names_th_TH,
&my_locale_typelib_ab_day_names_th_TH,
10,
- 8
+ 8,
+ '.', /* decimal point th_TH */
+ ',', /* thousands_sep th_TH */
+ "\x03", /* grouping th_TH */
+ &global_errmsgs[en_US]
);
/***** LOCALE END th_TH *****/
@@ -1683,7 +1942,11 @@ MY_LOCALE my_locale_tr_TR
&my_locale_typelib_day_names_tr_TR,
&my_locale_typelib_ab_day_names_tr_TR,
7,
- 9
+ 9,
+ ',', /* decimal point tr_TR */
+ '.', /* thousands_sep tr_TR */
+ "\x03\x03", /* grouping tr_TR */
+ &global_errmsgs[en_US]
);
/***** LOCALE END tr_TR *****/
@@ -1715,7 +1978,11 @@ MY_LOCALE my_locale_uk_UA
&my_locale_typelib_day_names_uk_UA,
&my_locale_typelib_ab_day_names_uk_UA,
8,
- 9
+ 9,
+ ',', /* decimal point uk_UA */
+ '.', /* thousands_sep uk_UA */
+ "\x03\x03", /* grouping uk_UA */
+ &global_errmsgs[uk_UA]
);
/***** LOCALE END uk_UA *****/
@@ -1747,7 +2014,11 @@ MY_LOCALE my_locale_ur_PK
&my_locale_typelib_day_names_ur_PK,
&my_locale_typelib_ab_day_names_ur_PK,
6,
- 6
+ 6,
+ '.', /* decimal point ur_PK */
+ ',', /* thousands_sep ur_PK */
+ "\x03\x03", /* grouping ur_PK */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ur_PK *****/
@@ -1779,7 +2050,11 @@ MY_LOCALE my_locale_vi_VN
&my_locale_typelib_day_names_vi_VN,
&my_locale_typelib_ab_day_names_vi_VN,
16,
- 11
+ 11,
+ ',', /* decimal point vi_VN */
+ '.', /* thousands_sep vi_VN */
+ "\x03\x03", /* grouping vi_VN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END vi_VN *****/
@@ -1811,7 +2086,11 @@ MY_LOCALE my_locale_zh_CN
&my_locale_typelib_day_names_zh_CN,
&my_locale_typelib_ab_day_names_zh_CN,
3,
- 3
+ 3,
+ '.', /* decimal point zh_CN */
+ ',', /* thousands_sep zh_CN */
+ "\x03", /* grouping zh_CN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END zh_CN *****/
@@ -1843,7 +2122,11 @@ MY_LOCALE my_locale_zh_TW
&my_locale_typelib_day_names_zh_TW,
&my_locale_typelib_ab_day_names_zh_TW,
3,
- 2
+ 2,
+ '.', /* decimal point zh_TW */
+ ',', /* thousands_sep zh_TW */
+ "\x03", /* grouping zh_TW */
+ &global_errmsgs[en_US]
);
/***** LOCALE END zh_TW *****/
@@ -1859,7 +2142,11 @@ MY_LOCALE my_locale_ar_DZ
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_DZ */
+ ',', /* thousands_sep ar_DZ */
+ "\x03", /* grouping ar_DZ */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_DZ *****/
@@ -1875,7 +2162,11 @@ MY_LOCALE my_locale_ar_EG
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_EG */
+ ',', /* thousands_sep ar_EG */
+ "\x03", /* grouping ar_EG */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_EG *****/
@@ -1891,7 +2182,11 @@ MY_LOCALE my_locale_ar_IN
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_IN */
+ ',', /* thousands_sep ar_IN */
+ "\x03", /* grouping ar_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_IN *****/
@@ -1907,7 +2202,11 @@ MY_LOCALE my_locale_ar_IQ
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_IQ */
+ ',', /* thousands_sep ar_IQ */
+ "\x03", /* grouping ar_IQ */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_IQ *****/
@@ -1923,7 +2222,11 @@ MY_LOCALE my_locale_ar_KW
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_KW */
+ ',', /* thousands_sep ar_KW */
+ "\x03", /* grouping ar_KW */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_KW *****/
@@ -1939,7 +2242,11 @@ MY_LOCALE my_locale_ar_LB
&my_locale_typelib_day_names_ar_JO,
&my_locale_typelib_ab_day_names_ar_JO,
12,
- 8
+ 8,
+ '.', /* decimal point ar_LB */
+ ',', /* thousands_sep ar_LB */
+ "\x03", /* grouping ar_LB */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_LB *****/
@@ -1955,7 +2262,11 @@ MY_LOCALE my_locale_ar_LY
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_LY */
+ ',', /* thousands_sep ar_LY */
+ "\x03", /* grouping ar_LY */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_LY *****/
@@ -1971,7 +2282,11 @@ MY_LOCALE my_locale_ar_MA
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_MA */
+ ',', /* thousands_sep ar_MA */
+ "\x03", /* grouping ar_MA */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_MA *****/
@@ -1987,7 +2302,11 @@ MY_LOCALE my_locale_ar_OM
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_OM */
+ ',', /* thousands_sep ar_OM */
+ "\x03", /* grouping ar_OM */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_OM *****/
@@ -2003,7 +2322,11 @@ MY_LOCALE my_locale_ar_QA
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_QA */
+ ',', /* thousands_sep ar_QA */
+ "\x03", /* grouping ar_QA */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_QA *****/
@@ -2019,7 +2342,11 @@ MY_LOCALE my_locale_ar_SD
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_SD */
+ ',', /* thousands_sep ar_SD */
+ "\x03", /* grouping ar_SD */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_SD *****/
@@ -2035,7 +2362,11 @@ MY_LOCALE my_locale_ar_TN
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_TN */
+ ',', /* thousands_sep ar_TN */
+ "\x03", /* grouping ar_TN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_TN *****/
@@ -2051,7 +2382,11 @@ MY_LOCALE my_locale_ar_YE
&my_locale_typelib_day_names_ar_BH,
&my_locale_typelib_ab_day_names_ar_BH,
6,
- 8
+ 8,
+ '.', /* decimal point ar_YE */
+ ',', /* thousands_sep ar_YE */
+ "\x03", /* grouping ar_YE */
+ &global_errmsgs[en_US]
);
/***** LOCALE END ar_YE *****/
@@ -2067,7 +2402,11 @@ MY_LOCALE my_locale_de_BE
&my_locale_typelib_day_names_de_DE,
&my_locale_typelib_ab_day_names_de_DE,
9,
- 10
+ 10,
+ ',', /* decimal point de_BE */
+ '.', /* thousands_sep de_BE */
+ "\x03\x03", /* grouping de_BE */
+ &global_errmsgs[de_DE]
);
/***** LOCALE END de_BE *****/
@@ -2083,7 +2422,11 @@ MY_LOCALE my_locale_de_CH
&my_locale_typelib_day_names_de_DE,
&my_locale_typelib_ab_day_names_de_DE,
9,
- 10
+ 10,
+ '.', /* decimal point de_CH */
+ '\'', /* thousands_sep de_CH */
+ "\x03\x03", /* grouping de_CH */
+ &global_errmsgs[de_DE]
);
/***** LOCALE END de_CH *****/
@@ -2099,7 +2442,11 @@ MY_LOCALE my_locale_de_LU
&my_locale_typelib_day_names_de_DE,
&my_locale_typelib_ab_day_names_de_DE,
9,
- 10
+ 10,
+ ',', /* decimal point de_LU */
+ '.', /* thousands_sep de_LU */
+ "\x03\x03", /* grouping de_LU */
+ &global_errmsgs[de_DE]
);
/***** LOCALE END de_LU *****/
@@ -2115,7 +2462,11 @@ MY_LOCALE my_locale_en_AU
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_AU */
+ ',', /* thousands_sep en_AU */
+ "\x03\x03", /* grouping en_AU */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_AU *****/
@@ -2131,7 +2482,11 @@ MY_LOCALE my_locale_en_CA
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_CA */
+ ',', /* thousands_sep en_CA */
+ "\x03\x03", /* grouping en_CA */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_CA *****/
@@ -2147,7 +2502,11 @@ MY_LOCALE my_locale_en_GB
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_GB */
+ ',', /* thousands_sep en_GB */
+ "\x03\x03", /* grouping en_GB */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_GB *****/
@@ -2163,7 +2522,11 @@ MY_LOCALE my_locale_en_IN
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_IN */
+ ',', /* thousands_sep en_IN */
+ "\x03\x02", /* grouping en_IN */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_IN *****/
@@ -2179,7 +2542,11 @@ MY_LOCALE my_locale_en_NZ
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_NZ */
+ ',', /* thousands_sep en_NZ */
+ "\x03\x03", /* grouping en_NZ */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_NZ *****/
@@ -2195,7 +2562,11 @@ MY_LOCALE my_locale_en_PH
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_PH */
+ ',', /* thousands_sep en_PH */
+ "\x03", /* grouping en_PH */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_PH *****/
@@ -2211,7 +2582,11 @@ MY_LOCALE my_locale_en_ZA
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_ZA */
+ ',', /* thousands_sep en_ZA */
+ "\x03\x03", /* grouping en_ZA */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_ZA *****/
@@ -2227,7 +2602,11 @@ MY_LOCALE my_locale_en_ZW
&my_locale_typelib_day_names_en_US,
&my_locale_typelib_ab_day_names_en_US,
9,
- 9
+ 9,
+ '.', /* decimal point en_ZW */
+ ',', /* thousands_sep en_ZW */
+ "\x03\x03", /* grouping en_ZW */
+ &global_errmsgs[en_US]
);
/***** LOCALE END en_ZW *****/
@@ -2243,7 +2622,11 @@ MY_LOCALE my_locale_es_AR
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_AR */
+ '.', /* thousands_sep es_AR */
+ "\x03\x03", /* grouping es_AR */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_AR *****/
@@ -2259,7 +2642,11 @@ MY_LOCALE my_locale_es_BO
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_BO */
+ '\0', /* thousands_sep es_BO */
+ "\x80\x80", /* grouping es_BO */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_BO *****/
@@ -2275,7 +2662,11 @@ MY_LOCALE my_locale_es_CL
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_CL */
+ '\0', /* thousands_sep es_CL */
+ "\x80\x80", /* grouping es_CL */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_CL *****/
@@ -2291,7 +2682,11 @@ MY_LOCALE my_locale_es_CO
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_CO */
+ '\0', /* thousands_sep es_CO */
+ "\x80\x80", /* grouping es_CO */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_CO *****/
@@ -2307,7 +2702,11 @@ MY_LOCALE my_locale_es_CR
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_CR */
+ '\0', /* thousands_sep es_CR */
+ "\x80\x80", /* grouping es_CR */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_CR *****/
@@ -2323,7 +2722,11 @@ MY_LOCALE my_locale_es_DO
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_DO */
+ '\0', /* thousands_sep es_DO */
+ "\x80\x80", /* grouping es_DO */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_DO *****/
@@ -2339,7 +2742,11 @@ MY_LOCALE my_locale_es_EC
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_EC */
+ '\0', /* thousands_sep es_EC */
+ "\x80\x80", /* grouping es_EC */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_EC *****/
@@ -2355,7 +2762,11 @@ MY_LOCALE my_locale_es_GT
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_GT */
+ '\0', /* thousands_sep es_GT */
+ "\x80\x80", /* grouping es_GT */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_GT *****/
@@ -2371,7 +2782,11 @@ MY_LOCALE my_locale_es_HN
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_HN */
+ '\0', /* thousands_sep es_HN */
+ "\x80\x80", /* grouping es_HN */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_HN *****/
@@ -2387,7 +2802,11 @@ MY_LOCALE my_locale_es_MX
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_MX */
+ '\0', /* thousands_sep es_MX */
+ "\x80\x80", /* grouping es_MX */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_MX *****/
@@ -2403,7 +2822,11 @@ MY_LOCALE my_locale_es_NI
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_NI */
+ '\0', /* thousands_sep es_NI */
+ "\x80\x80", /* grouping es_NI */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_NI *****/
@@ -2419,7 +2842,11 @@ MY_LOCALE my_locale_es_PA
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_PA */
+ '\0', /* thousands_sep es_PA */
+ "\x80\x80", /* grouping es_PA */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_PA *****/
@@ -2435,7 +2862,11 @@ MY_LOCALE my_locale_es_PE
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_PE */
+ '\0', /* thousands_sep es_PE */
+ "\x80\x80", /* grouping es_PE */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_PE *****/
@@ -2451,7 +2882,11 @@ MY_LOCALE my_locale_es_PR
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_PR */
+ '\0', /* thousands_sep es_PR */
+ "\x80\x80", /* grouping es_PR */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_PR *****/
@@ -2467,7 +2902,11 @@ MY_LOCALE my_locale_es_PY
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_PY */
+ '\0', /* thousands_sep es_PY */
+ "\x80\x80", /* grouping es_PY */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_PY *****/
@@ -2483,7 +2922,11 @@ MY_LOCALE my_locale_es_SV
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_SV */
+ '\0', /* thousands_sep es_SV */
+ "\x80\x80", /* grouping es_SV */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_SV *****/
@@ -2499,7 +2942,11 @@ MY_LOCALE my_locale_es_US
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ '.', /* decimal point es_US */
+ ',', /* thousands_sep es_US */
+ "\x03\x03", /* grouping es_US */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_US *****/
@@ -2515,7 +2962,11 @@ MY_LOCALE my_locale_es_UY
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_UY */
+ '\0', /* thousands_sep es_UY */
+ "\x80\x80", /* grouping es_UY */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_UY *****/
@@ -2531,7 +2982,11 @@ MY_LOCALE my_locale_es_VE
&my_locale_typelib_day_names_es_ES,
&my_locale_typelib_ab_day_names_es_ES,
10,
- 9
+ 9,
+ ',', /* decimal point es_VE */
+ '\0', /* thousands_sep es_VE */
+ "\x80\x80", /* grouping es_VE */
+ &global_errmsgs[es_ES]
);
/***** LOCALE END es_VE *****/
@@ -2547,7 +3002,11 @@ MY_LOCALE my_locale_fr_BE
&my_locale_typelib_day_names_fr_FR,
&my_locale_typelib_ab_day_names_fr_FR,
9,
- 8
+ 8,
+ ',', /* decimal point fr_BE */
+ '.', /* thousands_sep fr_BE */
+ "\x80\x80", /* grouping fr_BE */
+ &global_errmsgs[fr_FR]
);
/***** LOCALE END fr_BE *****/
@@ -2563,7 +3022,11 @@ MY_LOCALE my_locale_fr_CA
&my_locale_typelib_day_names_fr_FR,
&my_locale_typelib_ab_day_names_fr_FR,
9,
- 8
+ 8,
+ ',', /* decimal point fr_CA */
+ ' ', /* thousands_sep fr_CA */
+ "\x80\x80", /* grouping fr_CA */
+ &global_errmsgs[fr_FR]
);
/***** LOCALE END fr_CA *****/
@@ -2579,7 +3042,11 @@ MY_LOCALE my_locale_fr_CH
&my_locale_typelib_day_names_fr_FR,
&my_locale_typelib_ab_day_names_fr_FR,
9,
- 8
+ 8,
+ ',', /* decimal point fr_CH */
+ '\0', /* thousands_sep fr_CH */
+ "\x80\x80", /* grouping fr_CH */
+ &global_errmsgs[fr_FR]
);
/***** LOCALE END fr_CH *****/
@@ -2595,7 +3062,11 @@ MY_LOCALE my_locale_fr_LU
&my_locale_typelib_day_names_fr_FR,
&my_locale_typelib_ab_day_names_fr_FR,
9,
- 8
+ 8,
+ ',', /* decimal point fr_LU */
+ '\0', /* thousands_sep fr_LU */
+ "\x80\x80", /* grouping fr_LU */
+ &global_errmsgs[fr_FR]
);
/***** LOCALE END fr_LU *****/
@@ -2611,7 +3082,11 @@ MY_LOCALE my_locale_it_IT
&my_locale_typelib_day_names_it_CH,
&my_locale_typelib_ab_day_names_it_CH,
9,
- 9
+ 9,
+ ',', /* decimal point it_IT */
+ '\0', /* thousands_sep it_IT */
+ "\x80\x80", /* grouping it_IT */
+ &global_errmsgs[it_IT]
);
/***** LOCALE END it_IT *****/
@@ -2627,7 +3102,11 @@ MY_LOCALE my_locale_nl_BE
&my_locale_typelib_day_names_nl_NL,
&my_locale_typelib_ab_day_names_nl_NL,
9,
- 9
+ 9,
+ ',', /* decimal point nl_BE */
+ '.', /* thousands_sep nl_BE */
+ "\x80\x80", /* grouping nl_BE */
+ &global_errmsgs[nl_NL]
);
/***** LOCALE END nl_BE *****/
@@ -2643,7 +3122,11 @@ MY_LOCALE my_locale_no_NO
&my_locale_typelib_day_names_nb_NO,
&my_locale_typelib_ab_day_names_nb_NO,
9,
- 7
+ 7,
+ ',', /* decimal point no_NO */
+ '.', /* thousands_sep no_NO */
+ "\x03\x03", /* grouping no_NO */
+ &global_errmsgs[no_NO]
);
/***** LOCALE END no_NO *****/
@@ -2659,7 +3142,11 @@ MY_LOCALE my_locale_sv_FI
&my_locale_typelib_day_names_sv_SE,
&my_locale_typelib_ab_day_names_sv_SE,
9,
- 7
+ 7,
+ ',', /* decimal point sv_FI */
+ ' ', /* thousands_sep sv_FI */
+ "\x03\x03", /* grouping sv_FI */
+ &global_errmsgs[sv_SE]
);
/***** LOCALE END sv_FI *****/
@@ -2675,11 +3162,87 @@ MY_LOCALE my_locale_zh_HK
&my_locale_typelib_day_names_zh_CN,
&my_locale_typelib_ab_day_names_zh_CN,
3,
- 3
+ 3,
+ '.', /* decimal point zh_HK */
+ ',', /* thousands_sep zh_HK */
+ "\x03", /* grouping zh_HK */
+ &global_errmsgs[en_US]
);
/***** LOCALE END zh_HK *****/
+/***** LOCALE BEGIN el_GR: Greek - Greece *****/
+static const char *my_locale_month_names_el_GR[13]=
+{
+ "ΙανουάÏιος", "ΦεβÏουάÏιος", "ΜάÏτιος",
+ "ΑπÏίλιος", "Μάιος", "ΙοÏνιος",
+ "ΙοÏλιος", "ΑÏγουστος", "ΣεπτέμβÏιος",
+ "ΟκτώβÏιος", "ÎοέμβÏιος", "ΔεκέμβÏιος", NullS
+};
+
+static const char *my_locale_ab_month_names_el_GR[13]=
+{
+ "Ιαν", "Φεβ", "ΜάÏ",
+ "ΑπÏ", "Μάι", "ΙοÏν",
+ "ΙοÏλ","ΑÏγ", "Σεπ",
+ "Οκτ", "Îοέ", "Δεκ", NullS
+};
+
+static const char *my_locale_day_names_el_GR[8] =
+{
+ "ΔευτέÏα", "ΤÏίτη", "ΤετάÏτη", "Πέμπτη",
+ "ΠαÏασκευή", "Σάββατο", "ΚυÏιακή", NullS
+};
+
+static const char *my_locale_ab_day_names_el_GR[8]=
+{
+ "Δευ", "ΤÏί", "Τετ", "Πέμ",
+ "ΠαÏ", "Σάβ", "ΚυÏ", NullS
+};
+
+static TYPELIB my_locale_typelib_month_names_el_GR=
+{
+ array_elements(my_locale_month_names_el_GR) - 1,
+ "", my_locale_month_names_el_GR, NULL
+};
+
+static TYPELIB my_locale_typelib_ab_month_names_el_GR=
+{
+ array_elements(my_locale_ab_month_names_el_GR)-1,
+ "", my_locale_ab_month_names_el_GR, NULL
+};
+
+static TYPELIB my_locale_typelib_day_names_el_GR=
+{
+ array_elements(my_locale_day_names_el_GR)-1,
+ "", my_locale_day_names_el_GR, NULL
+};
+
+static TYPELIB my_locale_typelib_ab_day_names_el_GR=
+{
+ array_elements(my_locale_ab_day_names_el_GR) - 1,
+ "", my_locale_ab_day_names_el_GR, NULL
+};
+
+MY_LOCALE my_locale_el_GR
+(
+ 109,
+ "el_GR",
+ "Greek - Greece",
+ FALSE,
+ &my_locale_typelib_month_names_el_GR,
+ &my_locale_typelib_ab_month_names_el_GR,
+ &my_locale_typelib_day_names_el_GR,
+ &my_locale_typelib_ab_day_names_el_GR,
+ 11, /* max mon name length */
+ 9, /* max day name length */
+ ',', /* decimal point el_GR */
+ '.', /* thousands_sep el_GR */
+ "\x80", /* grouping el_GR */
+ &global_errmsgs[el_GR]
+);
+/***** LOCALE END el_GR *****/
+
/*
The list of all locales.
Note, locales must be ordered according to their
@@ -2736,7 +3299,7 @@ MY_LOCALE *my_locales[]=
&my_locale_sk_SK,
&my_locale_sl_SI,
&my_locale_sq_AL,
- &my_locale_sr_YU,
+ &my_locale_sr_RS,
&my_locale_ta_IN,
&my_locale_te_IN,
&my_locale_th_TH,
@@ -2797,10 +3360,18 @@ MY_LOCALE *my_locales[]=
&my_locale_no_NO,
&my_locale_sv_FI,
&my_locale_zh_HK,
+ &my_locale_el_GR,
NULL
};
+MY_LOCALE *my_locales_deprecated[]=
+{
+ &my_locale_sr_YU,
+ NULL
+};
+
+
MY_LOCALE *my_locale_by_number(uint number)
{
MY_LOCALE *locale;
@@ -2813,17 +3384,60 @@ MY_LOCALE *my_locale_by_number(uint number)
}
-MY_LOCALE *my_locale_by_name(const char *name)
+static MY_LOCALE*
+my_locale_by_name(MY_LOCALE** locales, const char *name)
{
MY_LOCALE **locale;
- for (locale= my_locales; *locale != NULL; locale++)
+ for (locale= locales; *locale != NULL; locale++)
{
if (!my_strcasecmp(&my_charset_latin1, (*locale)->name, name))
- {
- // Check that locale is on its correct position in the array
- DBUG_ASSERT((*locale) == my_locales[(*locale)->number]);
return *locale;
- }
}
return NULL;
}
+
+
+MY_LOCALE *my_locale_by_name(const char *name)
+{
+ MY_LOCALE *locale;
+
+ if ((locale= my_locale_by_name(my_locales, name)))
+ {
+ // Check that locale is on its correct position in the array
+ DBUG_ASSERT(locale == my_locales[locale->number]);
+ return locale;
+ }
+ else if ((locale= my_locale_by_name(my_locales_deprecated, name)))
+ {
+ THD *thd= current_thd;
+ /*
+ Replace the deprecated locale to the corresponding
+ 'fresh' locale with the same ID.
+ */
+ locale= my_locales[locale->number];
+ if (thd)
+ {
+ // Send a warning to the client
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX),
+ name, locale->name);
+ }
+ else
+ {
+ // Send a warning to mysqld error log
+ sql_print_warning("The syntax '%s' is deprecated and will be removed. "
+ "Please use %s instead.",
+ name, locale->name);
+ }
+ }
+ return locale;
+}
+
+
+void cleanup_errmsgs()
+{
+ for (MY_LOCALE_ERRMSGS *msgs= global_errmsgs; msgs->language; msgs++)
+ {
+ my_free(msgs->errmsgs, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+ }
+}
diff --git a/sql/sql_map.h b/sql/sql_map.h
index a1efba0da6f..5ae260841e0 100644
--- a/sql/sql_map.h
+++ b/sql/sql_map.h
@@ -1,3 +1,6 @@
+#ifndef SQL_MAP_INCLUDED
+#define SQL_MAP_INCLUDED
+
/* Copyright (C) 2000-2001, 2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -60,3 +63,5 @@ public:
return file->map;
}
};
+
+#endif /* SQL_MAP_INCLUDED */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index de106918178..3244467b19c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -21,12 +21,14 @@
#include <m_ctype.h>
#include <myisam.h>
#include <my_dir.h>
+#include "rpl_handler.h"
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
#include "events.h"
#include "sql_trigger.h"
+#include "sql_prepare.h"
#include "probes_mysql.h"
/**
@@ -45,7 +47,6 @@
"FUNCTION" : "PROCEDURE")
static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
-static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
const char *any_db="*any*"; // Special symbol for check_access
@@ -307,13 +308,12 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_SLAVE_HOSTS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_BINLOG_EVENTS]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_COLUMN_TYPES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_STORAGE_ENGINES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_CONTRIBUTORS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_PRIVILEGES]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_WARNS]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_ERRORS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_WARNS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
+ sql_command_flags[SQLCOM_SHOW_ERRORS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
sql_command_flags[SQLCOM_SHOW_ENGINE_STATUS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_ENGINE_MUTEX]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_ENGINE_LOGS]= CF_STATUS_COMMAND;
@@ -382,7 +382,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
Vio* save_vio;
ulong save_client_capabilities;
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
thd->profiling.set_query_source(init_command_var->value,
init_command_var->value_length);
@@ -410,7 +410,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
thd->client_capabilities= save_client_capabilities;
thd->net.vio= save_vio;
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
}
@@ -460,7 +460,7 @@ static void handle_bootstrap_impl(THD *thd)
/* purecov: begin tested */
if (net_realloc(&(thd->net), 2 * thd->net.max_packet))
{
- net_end_statement(thd);
+ thd->protocol->end_statement();
bootstrap_error= 1;
break;
}
@@ -485,8 +485,8 @@ static void handle_bootstrap_impl(THD *thd)
thd->db_length + 1 +
QUERY_CACHE_FLAGS_SIZE);
thd->set_query(query, length);
- DBUG_PRINT("query",("%-.4096s", thd->query()));
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+ DBUG_PRINT("query",("%-.4096s",thd->query()));
+#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
thd->profiling.set_query_source(thd->query(), length);
#endif
@@ -501,9 +501,9 @@ static void handle_bootstrap_impl(THD *thd)
close_thread_tables(thd); // Free tables
bootstrap_error= thd->is_error();
- net_end_statement(thd);
+ thd->protocol->end_statement();
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
@@ -596,7 +596,7 @@ static bool check_merge_table_access(THD *thd, char *db,
tlist->db= db; /* purecov: inspected */
}
error= check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
- table_list, UINT_MAX, FALSE);
+ table_list, FALSE, UINT_MAX, FALSE);
}
return error;
}
@@ -808,12 +808,12 @@ bool do_command(THD *thd)
Consider moving to init_connect() instead.
*/
thd->clear_error(); // Clear error message
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
net_new_transaction(net);
packet_length= my_net_read(net);
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
#endif
if (packet_length == packet_error)
@@ -826,7 +826,7 @@ bool do_command(THD *thd)
/* The error must be set. */
DBUG_ASSERT(thd->is_error());
- net_end_statement(thd);
+ thd->protocol->end_statement();
if (net->error != 3)
{
@@ -873,7 +873,7 @@ bool do_command(THD *thd)
return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
out:
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
DBUG_RETURN(return_value);
@@ -1071,7 +1071,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
tbl_name= strmake(db.str, packet + 1, db_len)+1;
strmake(tbl_name, packet + db_len + 2, tbl_len);
if (mysql_table_dump(thd, &db, tbl_name) == 0)
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
break;
}
case COM_CHANGE_USER:
@@ -1230,7 +1230,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
general_log_write(thd, command, thd->query(), thd->query_length());
DBUG_PRINT("query",("%-.4096s",thd->query()));
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(thd->query(), thd->query_length());
#endif
@@ -1243,7 +1243,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
char *beginning_of_next_stmt= (char*) end_of_stmt;
- net_end_statement(thd);
+ thd->protocol->end_statement();
query_cache_end_of_result(thd);
/*
Multiple queries exits, execute them individually
@@ -1265,7 +1265,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
MYSQL_QUERY_DONE(thd->is_error());
}
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
thd->profiling.start_new_query("continuing");
thd->profiling.set_query_source(beginning_of_next_stmt, length);
@@ -1341,7 +1341,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (check_access(thd,SELECT_ACL,table_list.db,&table_list.grant.privilege,
0, 0, test(table_list.schema_table)))
break;
- if (check_grant(thd, SELECT_ACL, &table_list, 2, UINT_MAX, 0))
+ if (check_grant(thd, SELECT_ACL, &table_list, TRUE, UINT_MAX, FALSE))
break;
/* init structures for VIEW processing */
table_list.select_lex= &(thd->lex->select_lex);
@@ -1366,7 +1366,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* We don't calculate statistics for this command */
general_log_print(thd, command, NullS);
net->error=0; // Don't give 'abort' message
- thd->main_da.disable_status(); // Don't send anything back
+ thd->stmt_da->disable_status(); // Don't send anything back
error=TRUE; // End server
break;
@@ -1555,7 +1555,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#ifndef EMBEDDED_LIBRARY
VOID(my_net_write(net, (uchar*) buff, length));
VOID(net_flush(net));
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
#endif
break;
}
@@ -1621,7 +1621,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* report error issued during command execution */
if (thd->killed_errno())
{
- if (! thd->main_da.is_set())
+ if (! thd->stmt_da->is_set())
thd->send_kill_message();
}
if (thd->killed == THD::KILL_QUERY || thd->killed == THD::KILL_BAD_DATA)
@@ -1631,13 +1631,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
/* If commit fails, we should be able to reset the OK status. */
- thd->main_da.can_overwrite_status= TRUE;
+ thd->stmt_da->can_overwrite_status= TRUE;
ha_autocommit_or_rollback(thd, thd->is_error());
- thd->main_da.can_overwrite_status= FALSE;
+ thd->stmt_da->can_overwrite_status= FALSE;
thd->transaction.stmt.reset();
- net_end_statement(thd);
+ thd->protocol->end_statement();
query_cache_end_of_result(thd);
thd->proc_info= "closing tables";
@@ -1684,9 +1684,9 @@ void log_slow_statement(THD *thd)
/*
Do not log administrative statements unless the appropriate option is
- set; do not log into slow log if reading from backup.
+ set.
*/
- if (thd->enable_slow_log && !thd->user_time)
+ if (thd->enable_slow_log)
{
ulonglong end_utime_of_query= thd->current_utime();
thd_proc_info(thd, "logging slow query");
@@ -1807,7 +1807,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
Mark this current profiling record to be discarded. We don't
wish to have SHOW commands show up in profiling.
*/
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query();
#endif
break;
@@ -2075,8 +2075,14 @@ mysql_execute_command(THD *thd)
variables, but for now this is probably good enough.
Don't reset warnings when executing a stored routine.
*/
- if ((all_tables || !lex->is_single_level_stmt()) && !thd->spcont)
- mysql_reset_errors(thd, 0);
+ if ((sql_command_flags[lex->sql_command] & CF_DIAGNOSTIC_STMT) != 0)
+ thd->warning_info->set_read_only(TRUE);
+ else
+ {
+ thd->warning_info->set_read_only(FALSE);
+ if (all_tables)
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
+ }
#ifdef HAVE_REPLICATION
if (unlikely(thd->slave_thread))
@@ -2216,14 +2222,16 @@ mysql_execute_command(THD *thd)
#endif
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
- if (!(res= check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE)))
+ if (!(res= check_table_access(thd, SELECT_ACL, all_tables, FALSE,
+ UINT_MAX, FALSE)))
res= execute_sqlcom_select(thd, all_tables);
break;
case SQLCOM_SHOW_STATUS:
{
system_status_var old_status_var= thd->status_var;
thd->initial_status_var= &old_status_var;
- if (!(res= check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE)))
+ if (!(res= check_table_access(thd, SELECT_ACL, all_tables, FALSE,
+ UINT_MAX, FALSE)))
res= execute_sqlcom_select(thd, all_tables);
/* Don't log SHOW STATUS commands to slow query log */
thd->server_status&= ~(SERVER_QUERY_NO_INDEX_USED |
@@ -2253,18 +2261,22 @@ mysql_execute_command(THD *thd)
case SQLCOM_SHOW_STORAGE_ENGINES:
case SQLCOM_SHOW_PROFILE:
case SQLCOM_SELECT:
+ {
thd->status_var.last_query_cost= 0.0;
+
+ /*
+ lex->exchange != NULL implies SELECT .. INTO OUTFILE and this
+ requires FILE_ACL access.
+ */
+ ulong privileges_requested= lex->exchange ? SELECT_ACL | FILE_ACL :
+ SELECT_ACL;
+
if (all_tables)
- {
res= check_table_access(thd,
- lex->exchange ? SELECT_ACL | FILE_ACL :
- SELECT_ACL,
- all_tables, UINT_MAX, FALSE);
- }
+ privileges_requested,
+ all_tables, FALSE, UINT_MAX, FALSE);
else
- res= check_access(thd,
- lex->exchange ? SELECT_ACL | FILE_ACL : SELECT_ACL,
- any_db, 0, 0, 0, 0);
+ res= check_access(thd, privileges_requested, any_db, 0, 0, 0, UINT_MAX);
if (res)
break;
@@ -2275,7 +2287,8 @@ mysql_execute_command(THD *thd)
res= execute_sqlcom_select(thd, all_tables);
break;
- case SQLCOM_PREPARE:
+ }
+case SQLCOM_PREPARE:
{
mysql_sql_stmt_prepare(thd);
break;
@@ -2291,8 +2304,8 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_DO:
- if (check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE) ||
- open_and_lock_tables(thd, all_tables))
+ if (check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
+ || open_and_lock_tables(thd, all_tables))
goto error;
res= mysql_do(thd, *lex->insert_list);
@@ -2356,7 +2369,7 @@ mysql_execute_command(THD *thd)
}
case SQLCOM_SHOW_PROFILES:
{
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query();
res= thd->profiling.show_profiles();
if (res)
@@ -2389,6 +2402,7 @@ mysql_execute_command(THD *thd)
res = show_slave_hosts(thd);
break;
}
+ case SQLCOM_SHOW_RELAYLOG_EVENTS: /* fall through */
case SQLCOM_SHOW_BINLOG_EVENTS:
{
if (check_global_access(thd, REPL_SLAVE_ACL))
@@ -2401,8 +2415,8 @@ mysql_execute_command(THD *thd)
case SQLCOM_BACKUP_TABLE:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE) ||
- check_global_access(thd, FILE_ACL))
+ if (check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
+ || check_global_access(thd, FILE_ACL))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_backup_table(thd, first_table);
@@ -2413,8 +2427,8 @@ mysql_execute_command(THD *thd)
case SQLCOM_RESTORE_TABLE:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_table_access(thd, INSERT_ACL, all_tables, UINT_MAX, FALSE) ||
- check_global_access(thd, FILE_ACL))
+ if (check_table_access(thd, INSERT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
+ || check_global_access(thd, FILE_ACL))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_restore_table(thd, first_table);
@@ -2513,7 +2527,7 @@ mysql_execute_command(THD *thd)
test(first_table->schema_table)))
goto error; /* purecov: inspected */
/* Check that the first table has CREATE privilege */
- if (check_grant(thd, CREATE_ACL, all_tables, 0, 1, 0))
+ if (check_grant(thd, CREATE_ACL, all_tables, FALSE, 1, FALSE))
goto error;
pthread_mutex_lock(&LOCK_active_mi);
@@ -2883,7 +2897,7 @@ end_with_restore_list:
(TABLE_LIST *)
create_info.merge_list.first))
goto error; /* purecov: inspected */
- if (check_grant(thd, priv_needed, all_tables, 0, UINT_MAX, 0))
+ if (check_grant(thd, priv_needed, all_tables, FALSE, UINT_MAX, FALSE))
goto error;
if (lex->name.str && !test_all_bits(priv,INSERT_ACL | CREATE_ACL))
{ // Rename of table
@@ -2892,8 +2906,8 @@ end_with_restore_list:
tmp_table.table_name= lex->name.str;
tmp_table.db=select_lex->db;
tmp_table.grant.privilege=priv;
- if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, 0,
- UINT_MAX, 0))
+ if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, FALSE,
+ UINT_MAX, FALSE))
goto error;
}
@@ -2947,10 +2961,11 @@ end_with_restore_list:
*/
old_list= table[0];
new_list= table->next_local[0];
- if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, 1, 0) ||
+ if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, FALSE, 1, FALSE) ||
(!test_all_bits(table->next_local->grant.privilege,
INSERT_ACL | CREATE_ACL) &&
- check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0)))
+ check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, FALSE, 1,
+ FALSE)))
goto error;
}
@@ -2981,11 +2996,75 @@ end_with_restore_list:
goto error;
#else
{
- /* Ignore temporary tables if this is "SHOW CREATE VIEW" */
+ /*
+ Access check:
+ SHOW CREATE TABLE require any privileges on the table level (ie
+ effecting all columns in the table).
+ SHOW CREATE VIEW require the SHOW_VIEW and SELECT ACLs on the table
+ level.
+ NOTE: SHOW_VIEW ACL is checked when the view is created.
+ */
+
if (lex->only_view)
+ {
+ if (check_table_access(thd, SELECT_ACL, first_table, FALSE, 1, FALSE))
+ {
+ my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
+ "SHOW", thd->security_ctx->priv_user,
+ thd->security_ctx->host_or_ip, first_table->alias);
+ goto error;
+ }
+
+ /* Ignore temporary tables if this is "SHOW CREATE VIEW" */
first_table->skip_temporary= 1;
- if (check_show_create_table_access(thd, first_table))
- goto error;
+ }
+ else
+ {
+ ulong save_priv;
+
+ /*
+ If it is an INFORMATION_SCHEMA table, SELECT_ACL privilege is the
+ only privilege allowed. For any other privilege check_access()
+ reports an error. That's how internal implementation protects
+ INFORMATION_SCHEMA from updates.
+
+ For ordinary tables any privilege from the SHOW_CREATE_TABLE_ACLS
+ set is sufficient.
+ */
+
+ ulong check_privs= test(first_table->schema_table) ?
+ SELECT_ACL : SHOW_CREATE_TABLE_ACLS;
+
+ if (check_access(thd, check_privs, first_table->db,
+ &save_priv, FALSE, FALSE,
+ test(first_table->schema_table)))
+ goto error;
+
+ /*
+ save_priv contains any privileges actually granted by check_access
+ (i.e. save_priv contains global (user- and database-level)
+ privileges).
+
+ The fact that check_access() returned FALSE does not mean that
+ access is granted. We need to check if save_priv contains any
+ table-specific privilege. If not, we need to check table-level
+ privileges.
+
+ If there are no global privileges and no table-level privileges,
+ access is denied.
+ */
+
+ if (!(save_priv & (SHOW_CREATE_TABLE_ACLS)) &&
+ !has_any_table_level_privileges(thd, SHOW_CREATE_TABLE_ACLS, first_table))
+ {
+ my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
+ "SHOW", thd->security_ctx->priv_user,
+ thd->security_ctx->host_or_ip, first_table->alias);
+ goto error;
+ }
+ }
+
+ /* Access is granted. Execute the command. */
res= mysqld_show_create(thd, first_table);
break;
}
@@ -2993,8 +3072,8 @@ end_with_restore_list:
case SQLCOM_CHECKSUM:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_table_access(thd, SELECT_ACL | EXTRA_ACL, all_tables,
- UINT_MAX, FALSE))
+ if (check_table_access(thd, SELECT_ACL, all_tables,
+ FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
res = mysql_checksum_table(thd, first_table, &lex->check_opt);
break;
@@ -3003,7 +3082,7 @@ end_with_restore_list:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables,
- UINT_MAX, FALSE))
+ FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res= mysql_repair_table(thd, first_table, &lex->check_opt);
@@ -3022,8 +3101,8 @@ end_with_restore_list:
case SQLCOM_CHECK:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_table_access(thd, SELECT_ACL | EXTRA_ACL , all_tables,
- UINT_MAX, FALSE))
+ if (check_table_access(thd, SELECT_ACL, all_tables,
+ TRUE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_check_table(thd, first_table, &lex->check_opt);
@@ -3035,7 +3114,7 @@ end_with_restore_list:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables,
- UINT_MAX, FALSE))
+ FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res= mysql_analyze_table(thd, first_table, &lex->check_opt);
@@ -3056,7 +3135,7 @@ end_with_restore_list:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables,
- UINT_MAX, FALSE))
+ FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
@@ -3429,7 +3508,7 @@ end_with_restore_list:
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (!lex->drop_temporary)
{
- if (check_table_access(thd, DROP_ACL, all_tables, UINT_MAX, FALSE))
+ if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
if (end_active_trans(thd))
goto error;
@@ -3474,9 +3553,6 @@ end_with_restore_list:
case SQLCOM_SHOW_PRIVILEGES:
res= mysqld_show_privileges(thd);
break;
- case SQLCOM_SHOW_COLUMN_TYPES:
- res= mysqld_show_column_types(thd);
- break;
case SQLCOM_SHOW_ENGINE_LOGS:
#ifdef DONT_ALLOW_SHOW_COMMANDS
my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND),
@@ -3537,8 +3613,8 @@ end_with_restore_list:
if (lex->autocommit && end_active_trans(thd))
goto error;
- if ((check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE) ||
- open_and_lock_tables(thd, all_tables)))
+ if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
+ || open_and_lock_tables(thd, all_tables)))
goto error;
if (lex->one_shot_set && not_all_support_one_shot(lex_var_list))
{
@@ -3592,7 +3668,7 @@ end_with_restore_list:
if (end_active_trans(thd))
goto error;
if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables,
- UINT_MAX, FALSE))
+ FALSE, UINT_MAX, FALSE))
goto error;
if (lex->protect_against_global_read_lock &&
!(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1)))
@@ -3988,7 +4064,7 @@ end_with_restore_list:
else
{
if (check_grant(thd,(lex->grant | lex->grant_tot_col | GRANT_ACL),
- all_tables, 0, UINT_MAX, 0))
+ all_tables, FALSE, UINT_MAX, FALSE))
goto error;
/* Conditionally writes to binlog */
res= mysql_table_grant(thd, all_tables, lex->users_list,
@@ -4097,7 +4173,7 @@ end_with_restore_list:
#endif
case SQLCOM_HA_OPEN:
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE))
+ if (check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE))
goto error;
res= mysql_ha_open(thd, first_table, 0);
break;
@@ -4383,7 +4459,8 @@ create_sp_error:
This will cache all SP and SF and open and lock all tables
required for execution.
*/
- if (check_table_access(thd, SELECT_ACL, all_tables, UINT_MAX, FALSE) ||
+ if (check_table_access(thd, SELECT_ACL, all_tables, FALSE,
+ UINT_MAX, FALSE) ||
open_and_lock_tables(thd, all_tables))
goto error;
@@ -4453,12 +4530,6 @@ create_sp_error:
So just execute the statement.
*/
res= sp->execute_procedure(thd, &lex->value_list);
- /*
- If warnings have been cleared, we have to clear total_warn_count
- too, otherwise the clients get confused.
- */
- if (thd->warn_list.is_empty())
- thd->total_warn_count= 0;
thd->variables.select_limit= select_limit;
@@ -4489,7 +4560,7 @@ create_sp_error:
else
sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, lex->spname,
&thd->sp_func_cache, FALSE);
- mysql_reset_errors(thd, 0);
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
if (! sp)
{
if (lex->spname->m_db.str)
@@ -4564,7 +4635,7 @@ create_sp_error:
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
sp_result= sp_routine_exists_in_table(thd, type, lex->spname);
- mysql_reset_errors(thd, 0);
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
if (sp_result == SP_OK)
{
char *db= lex->spname->m_db.str;
@@ -4668,10 +4739,10 @@ create_sp_error:
}
break;
}
-#ifndef DBUG_OFF
case SQLCOM_SHOW_PROC_CODE:
case SQLCOM_SHOW_FUNC_CODE:
{
+#ifndef DBUG_OFF
sp_head *sp;
if (lex->sql_command == SQLCOM_SHOW_PROC_CODE)
@@ -4688,8 +4759,12 @@ create_sp_error:
goto error;
}
break;
- }
+#else
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ "SHOW PROCEDURE|FUNCTION CODE", "--with-debug");
+ goto error;
#endif // ifndef DBUG_OFF
+ }
case SQLCOM_SHOW_CREATE_TRIGGER:
{
if (lex->spname->m_name.length > NAME_LEN)
@@ -4717,8 +4792,8 @@ create_sp_error:
}
case SQLCOM_DROP_VIEW:
{
- if (check_table_access(thd, DROP_ACL, all_tables, UINT_MAX, FALSE) ||
- end_active_trans(thd))
+ if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE)
+ || end_active_trans(thd))
goto error;
/* Conditionally writes to binlog. */
res= mysql_drop_view(thd, first_table, thd->lex->drop_mode);
@@ -4928,7 +5003,7 @@ create_sp_error:
res= mysql_xa_recover(thd);
break;
case SQLCOM_ALTER_TABLESPACE:
- if (check_access(thd, ALTER_ACL, thd->db, 0, 1, 0, thd->db ? is_schema_db(thd->db) : 0))
+ if (check_global_access(thd, CREATE_TABLESPACE_ACL))
break;
if (!(res= mysql_alter_tablespace(thd, lex->alter_tablespace_info)))
my_ok(thd);
@@ -5015,6 +5090,11 @@ create_sp_error:
my_ok(thd, 1);
break;
}
+ case SQLCOM_SIGNAL:
+ case SQLCOM_RESIGNAL:
+ DBUG_ASSERT(lex->m_stmt != NULL);
+ res= lex->m_stmt->execute(thd);
+ break;
default:
#ifndef EMBEDDED_LIBRARY
DBUG_ASSERT(0); /* Impossible */
@@ -5160,7 +5240,7 @@ bool check_single_table_access(THD *thd, ulong privilege,
/* Show only 1 table for check_grant */
if (!(all_tables->belong_to_view &&
(thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) &&
- check_grant(thd, privilege, all_tables, 0, 1, no_errors))
+ check_grant(thd, privilege, all_tables, FALSE, 1, no_errors))
goto deny;
thd->security_ctx= backup_ctx;
@@ -5205,7 +5285,8 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
subselects_tables= subselects_tables->next_global;
}
if (subselects_tables &&
- (check_table_access(thd, SELECT_ACL, subselects_tables, UINT_MAX, FALSE)))
+ (check_table_access(thd, SELECT_ACL, subselects_tables, FALSE,
+ UINT_MAX, FALSE)))
return 1;
}
return 0;
@@ -5213,46 +5294,54 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
/**
- Get the user (global) and database privileges for all used tables.
-
- @param save_priv In this we store global and db level grants for the
- table. Note that we don't store db level grants if the
- global grants is enough to satisfy the request and the
- global grants contains a SELECT grant.
-
- @note
- The idea of EXTRA_ACL is that one will be granted access to the table if
- one has the asked privilege on any column combination of the table; For
- example to be able to check a table one needs to have SELECT privilege on
- any column of the table.
-
- @retval
- 0 ok
- @retval
- 1 If we can't get the privileges and we don't use table/column
- grants.
+ @brief Compare requested privileges with the privileges acquired from the
+ User- and Db-tables.
+ @param thd Thread handler
+ @param want_access The requested access privileges.
+ @param db A pointer to the Db name.
+ @param[out] save_priv A pointer to the granted privileges will be stored.
+ @param dont_check_global_grants True if no global grants are checked.
+ @param no_error True if no errors should be sent to the client.
+ @param schema_db True if the db specified belongs to the meta data tables.
+
+ 'save_priv' is used to save the User-table (global) and Db-table grants for
+ the supplied db name. Note that we don't store db level grants if the global
+ grants is enough to satisfy the request AND the global grants contains a
+ SELECT grant.
+
+ A meta data table (from INFORMATION_SCHEMA) can always be accessed with
+ a SELECT_ACL.
+
+ @see check_grant
+
+ @return Status of denial of access by exclusive ACLs.
+ @retval FALSE Access can't exclusively be denied by Db- and User-table
+ access unless Column- and Table-grants are checked too.
+ @retval TRUE Access denied.
*/
+
bool
check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool dont_check_global_grants, bool no_errors, bool schema_db)
{
Security_context *sctx= thd->security_ctx;
ulong db_access;
+
/*
GRANT command:
In case of database level grant the database name may be a pattern,
in case of table|column level grant the database name can not be a pattern.
We use 'dont_check_global_grants' as a flag to determine
- if it's database level grant command
+ if it's database level grant command
(see SQLCOM_GRANT case, mysql_execute_command() function) and
set db_is_pattern according to 'dont_check_global_grants' value.
*/
- bool db_is_pattern= (test(want_access & GRANT_ACL) &&
- dont_check_global_grants);
+ bool db_is_pattern= ((want_access & GRANT_ACL) && dont_check_global_grants);
ulong dummy;
DBUG_ENTER("check_access");
DBUG_PRINT("enter",("db: %s want_access: %lu master_access: %lu",
db ? db : "", want_access, sctx->master_access));
+
if (save_priv)
*save_priv=0;
else
@@ -5270,8 +5359,12 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if (schema_db)
{
- if ((!(sctx->master_access & FILE_ACL) && (want_access & FILE_ACL)) ||
- (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
+ /*
+ We don't allow any simple privileges but SELECT_ACL or CREATE_VIEW_ACL
+ on the information_schema database.
+ */
+ want_access &= ~SELECT_ACL;
+ if (want_access & DB_ACLS)
{
if (!no_errors)
{
@@ -5279,10 +5372,15 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->priv_host, db_name);
}
+ /*
+ Access denied;
+ [out] *save_privileges= 0
+ */
DBUG_RETURN(TRUE);
}
else
{
+ /* Access granted */
*save_priv= SELECT_ACL;
DBUG_RETURN(FALSE);
}
@@ -5290,20 +5388,27 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if ((sctx->master_access & want_access) == want_access)
{
+ /* get access for current db */
+ db_access= sctx->db_access;
/*
- If we don't have a global SELECT privilege, we have to get the database
- specific access rights to be able to handle queries of type
+ 1. If we don't have a global SELECT privilege, we have to get the
+ database specific access rights to be able to handle queries of type
UPDATE t1 SET a=1 WHERE b > 0
+ 2. Change db access if it isn't current db which is being addressed
*/
- db_access= sctx->db_access;
if (!(sctx->master_access & SELECT_ACL) &&
(db && (!thd->db || db_is_pattern || strcmp(db,thd->db))))
db_access=acl_get(sctx->host, sctx->ip, sctx->priv_user, db,
db_is_pattern);
+
+ /*
+ The effective privileges are the union of the global privileges
+ and the the intersection of db- and host-privileges.
+ */
*save_priv=sctx->master_access | db_access;
DBUG_RETURN(FALSE);
}
- if (((want_access & ~sctx->master_access) & ~(DB_ACLS | EXTRA_ACL)) ||
+ if (((want_access & ~sctx->master_access) & ~DB_ACLS) ||
(! db && dont_check_global_grants))
{ // We can never grant this
DBUG_PRINT("error",("No possible access"));
@@ -5318,33 +5423,66 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
}
if (db == any_db)
- DBUG_RETURN(FALSE); // Allow select on anything
+ {
+ /*
+ Access granted; Allow select on *any* db.
+ [out] *save_privileges= 0
+ */
+ DBUG_RETURN(FALSE);
+ }
if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))
db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db,
db_is_pattern);
else
db_access= sctx->db_access;
- DBUG_PRINT("info",("db_access: %lu", db_access));
- /* Remove SHOW attribute and access rights we already have */
- want_access &= ~(sctx->master_access | EXTRA_ACL);
DBUG_PRINT("info",("db_access: %lu want_access: %lu",
db_access, want_access));
- db_access= ((*save_priv=(db_access | sctx->master_access)) & want_access);
- if (db_access == want_access ||
+ /*
+ Save the union of User-table and the intersection between Db-table and
+ Host-table privileges.
+ */
+ db_access= (db_access | sctx->master_access);
+ *save_priv= db_access;
+
+ /*
+ We need to investigate column- and table access if all requested privileges
+ belongs to the bit set of .
+ */
+ bool need_table_or_column_check=
+ (want_access & (TABLE_ACLS | PROC_ACLS | db_access)) == want_access;
+
+ /*
+ Grant access if the requested access is in the intersection of
+ host- and db-privileges (as retrieved from the acl cache),
+ also grant access if all the requested privileges are in the union of
+ TABLES_ACLS and PROC_ACLS; see check_grant.
+ */
+ if ( (db_access & want_access) == want_access ||
(!dont_check_global_grants &&
- !(want_access & ~(db_access | TABLE_ACLS | PROC_ACLS))))
- DBUG_RETURN(FALSE); /* Ok */
+ need_table_or_column_check))
+ {
+ /*
+ Ok; but need to check table- and column privileges.
+ [out] *save_privileges is (User-priv | (Db-priv & Host-priv))
+ */
+ DBUG_RETURN(FALSE);
+ }
+ /*
+ Access is denied;
+ [out] *save_privileges is (User-priv | (Db-priv & Host-priv))
+ */
DBUG_PRINT("error",("Access denied"));
if (!no_errors)
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->priv_host,
(db ? db : (thd->db ?
thd->db :
- "unknown"))); /* purecov: tested */
- DBUG_RETURN(TRUE); /* purecov: tested */
+ "unknown")));
+ DBUG_RETURN(TRUE);
+
}
@@ -5390,14 +5528,20 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
DBUG_ASSERT(dst_table);
- if (check_access(thd, SELECT_ACL | EXTRA_ACL,
- dst_table->db,
- &dst_table->grant.privilege,
- FALSE, FALSE,
+ if (check_access(thd, SELECT_ACL, dst_table->db,
+ &dst_table->grant.privilege, FALSE, FALSE,
test(dst_table->schema_table)))
- return FALSE;
+ return TRUE; /* Access denied */
+
+ /*
+ Check_grant will grant access if there is any column privileges on
+ all of the tables thanks to the fourth parameter (bool show_table).
+ */
+ if (check_grant(thd, SELECT_ACL, dst_table, TRUE, UINT_MAX, FALSE))
+ return TRUE; /* Access denied */
- return (check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE));
+ /* Access granted */
+ return FALSE;
}
default:
break;
@@ -5407,30 +5551,46 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
}
-/**
- Check the privilege for all used tables.
- @param thd Thread context
- @param want_access Privileges requested
- @param tables List of tables to be checked
- @param number Check at most this number of tables.
- @param no_errors FALSE/TRUE - report/don't report error to
- the client (using my_error() call).
+/**
+ @brief Check if the requested privileges exists in either User-, Host- or
+ Db-tables.
+ @param thd Thread context
+ @param want_access Privileges requested
+ @param tables List of tables to be compared against
+ @param no_errors Don't report error to the client (using my_error() call).
+ @param any_combination_of_privileges_will_do TRUE if any privileges on any
+ column combination is enough.
+ @param number Only the first 'number' tables in the linked list are
+ relevant.
+
+ The suppled table list contains cached privileges. This functions calls the
+ help functions check_access and check_grant to verify the first three steps
+ in the privileges check queue:
+ 1. Global privileges
+ 2. OR (db privileges AND host privileges)
+ 3. OR table privileges
+ 4. OR column privileges (not checked by this function!)
+ 5. OR routine privileges (not checked by this function!)
+
+ @see check_access
+ @see check_grant
+
+ @note This functions assumes that table list used and
+ thd->lex->query_tables_own_last value correspond to each other
+ (the latter should be either 0 or point to next_global member
+ of one of elements of this table list).
- @note
- Table privileges are cached in the table list for GRANT checking.
- This functions assumes that table list used and
- thd->lex->query_tables_own_last value correspond to each other
- (the latter should be either 0 or point to next_global member
- of one of elements of this table list).
-
- @retval FALSE OK
- @retval TRUE Access denied
+ @return
+ @retval FALSE OK
+ @retval TRUE Access denied; But column or routine privileges might need to
+ be checked also.
*/
bool
-check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
- uint number, bool no_errors)
+check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
+ bool any_combination_of_privileges_will_do,
+ uint number, bool no_errors)
{
TABLE_LIST *org_tables= tables;
TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
@@ -5441,22 +5601,31 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
the given table list refers to the list for prelocking (contains tables
of other queries). For simple queries first_not_own_table is 0.
*/
- for (; i < number && tables != first_not_own_table;
+ for (; i < number && tables != first_not_own_table && tables;
tables= tables->next_global, i++)
{
+ ulong want_access= requirements;
if (tables->security_ctx)
sctx= tables->security_ctx;
else
sctx= backup_ctx;
- if (tables->schema_table &&
- (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
+ /*
+ Always allow SELECT on schema tables. This is done by removing the
+ required SELECT_ACL privilege in the want_access parameter.
+ Disallow any other DDL or DML operation on any schema table.
+ */
+ if (tables->schema_table)
{
- if (!no_errors)
- my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
- sctx->priv_user, sctx->priv_host,
- INFORMATION_SCHEMA_NAME.str);
- return TRUE;
+ want_access &= ~SELECT_ACL;
+ if (want_access & DB_ACLS)
+ {
+ if (!no_errors)
+ my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
+ sctx->priv_user, sctx->priv_host,
+ INFORMATION_SCHEMA_NAME.str);
+ goto deny;
+ }
}
/*
Register access for view underlying table.
@@ -5468,33 +5637,34 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
{
if (check_show_access(thd, tables))
goto deny;
-
continue;
}
+ DBUG_PRINT("info", ("derived: %d view: %d", tables->derived != 0,
+ tables->view != 0));
if (tables->is_anonymous_derived_table() ||
- (tables->table && (int)tables->table->s->tmp_table))
+ (tables->table && tables->table->s &&
+ (int)tables->table->s->tmp_table))
continue;
thd->security_ctx= sctx;
- if ((sctx->master_access & want_access) ==
- (want_access & ~EXTRA_ACL) &&
- thd->db)
+ if ((sctx->master_access & want_access) == want_access &&
+ thd->db)
tables->grant.privilege= want_access;
else if (tables->db && thd->db && strcmp(tables->db, thd->db) == 0)
{
if (check_access(thd, want_access, tables->get_db_name(),
- &tables->grant.privilege, 0, no_errors,
+ &tables->grant.privilege, 0, no_errors,
test(tables->schema_table)))
goto deny; // Access denied
}
else if (check_access(thd, want_access, tables->get_db_name(),
- &tables->grant.privilege, 0, no_errors,
- test(tables->schema_table)))
+ &tables->grant.privilege, 0, no_errors, 0))
goto deny;
}
thd->security_ctx= backup_ctx;
- return check_grant(thd,want_access & ~EXTRA_ACL,org_tables,
- test(want_access & EXTRA_ACL), number, no_errors);
+ return check_grant(thd,requirements,org_tables,
+ any_combination_of_privileges_will_do,
+ number, no_errors);
deny:
thd->security_ctx= backup_ctx;
return TRUE;
@@ -5582,7 +5752,7 @@ bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
if (!check_access(thd, access, table->db,
&table->grant.privilege, 0, 1,
test(table->schema_table)) &&
- !check_grant(thd, access, table, 0, 1, 1))
+ !check_grant(thd, access, table, FALSE, 1, TRUE))
DBUG_RETURN(0);
}
}
@@ -5762,8 +5932,8 @@ void mysql_reset_thd_for_next_command(THD *thd)
thd->user_var_events_alloc= thd->mem_root;
}
thd->clear_error();
- thd->main_da.reset_diagnostics_area();
- thd->total_warn_count=0; // Warnings for this query
+ thd->stmt_da->reset_diagnostics_area();
+ thd->warning_info->reset_for_next_command();
thd->rand_used= 0;
thd->sent_row_count= thd->examined_row_count= 0;
@@ -6049,7 +6219,7 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
thd->is_fatal_error));
- query_cache_abort(&thd->net);
+ query_cache_abort(&thd->query_cache_tls);
}
if (thd->lex->sphead)
{
@@ -6133,8 +6303,8 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & PRI_KEY_FLAG)
{
Key *key;
- lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
- key= new Key(Key::PRIMARY, NullS,
+ lex->col_list.push_back(new Key_part_spec(*field_name, 0));
+ key= new Key(Key::PRIMARY, null_lex_str,
&default_key_create_info,
0, lex->col_list);
lex->alter_info.key_list.push_back(key);
@@ -6143,8 +6313,8 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
Key *key;
- lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
- key= new Key(Key::UNIQUE, NullS,
+ lex->col_list.push_back(new Key_part_spec(*field_name, 0));
+ key= new Key(Key::UNIQUE, null_lex_str,
&default_key_create_info, 0,
lex->col_list);
lex->alter_info.key_list.push_back(key);
@@ -6344,7 +6514,19 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
if (!ptr->derived && !my_strcasecmp(system_charset_info, ptr->db,
INFORMATION_SCHEMA_NAME.str))
{
- ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
+ ST_SCHEMA_TABLE *schema_table;
+ if (ptr->updating &&
+ /* Special cases which are processed by commands itself */
+ lex->sql_command != SQLCOM_CHECK &&
+ lex->sql_command != SQLCOM_CHECKSUM)
+ {
+ my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
+ thd->security_ctx->priv_user,
+ thd->security_ctx->priv_host,
+ INFORMATION_SCHEMA_NAME.str);
+ DBUG_RETURN(0);
+ }
+ schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table ||
(schema_table->hidden &&
((sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0 ||
@@ -7277,11 +7459,11 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables)
else if ((check_access(thd, UPDATE_ACL, table->db,
&table->grant.privilege, 0, 1,
test(table->schema_table)) ||
- check_grant(thd, UPDATE_ACL, table, 0, 1, 1)) &&
+ check_grant(thd, UPDATE_ACL, table, FALSE, 1, TRUE)) &&
(check_access(thd, SELECT_ACL, table->db,
&table->grant.privilege, 0, 0,
test(table->schema_table)) ||
- check_grant(thd, SELECT_ACL, table, 0, 1, 0)))
+ check_grant(thd, SELECT_ACL, table, FALSE, 1, FALSE)))
DBUG_RETURN(TRUE);
table->table_in_first_from_clause= 1;
@@ -7299,7 +7481,7 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables)
if (check_access(thd, SELECT_ACL, table->db,
&table->grant.privilege, 0, 0,
test(table->schema_table)) ||
- check_grant(thd, SELECT_ACL, table, 0, 1, 0))
+ check_grant(thd, SELECT_ACL, table, FALSE, 1, FALSE))
DBUG_RETURN(TRUE);
}
}
@@ -7339,7 +7521,7 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables)
/* sql_yacc guarantees that tables and aux_tables are not zero */
DBUG_ASSERT(aux_tables != 0);
- if (check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE))
+ if (check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE))
DBUG_RETURN(TRUE);
/*
@@ -7348,7 +7530,7 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables)
call check_table_access() safely.
*/
thd->lex->query_tables_own_last= 0;
- if (check_table_access(thd, DELETE_ACL, aux_tables, UINT_MAX, FALSE))
+ if (check_table_access(thd, DELETE_ACL, aux_tables, FALSE, UINT_MAX, FALSE))
{
thd->lex->query_tables_own_last= save_query_tables_own_last;
DBUG_RETURN(TRUE);
@@ -7502,25 +7684,6 @@ bool insert_precheck(THD *thd, TABLE_LIST *tables)
/**
- @brief Check privileges for SHOW CREATE TABLE statement.
-
- @param thd Thread context
- @param table Target table
-
- @retval TRUE Failure
- @retval FALSE Success
-*/
-
-static bool check_show_create_table_access(THD *thd, TABLE_LIST *table)
-{
- return check_access(thd, SELECT_ACL | EXTRA_ACL, table->db,
- &table->grant.privilege, 0, 0,
- test(table->schema_table)) ||
- check_grant(thd, SELECT_ACL, table, 2, UINT_MAX, 0);
-}
-
-
-/**
CREATE TABLE query pre-check.
@param thd Thread handler
@@ -7559,7 +7722,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
lex->create_info.merge_list.first))
goto err;
if (want_priv != CREATE_TMP_ACL &&
- check_grant(thd, want_priv, create_table, 0, 1, 0))
+ check_grant(thd, want_priv, create_table, FALSE, 1, FALSE))
goto err;
if (select_lex->item_list.elements)
@@ -7587,12 +7750,13 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
}
}
#endif
- if (tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE))
+ if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
+ UINT_MAX, FALSE))
goto err;
}
else if (lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
{
- if (check_show_create_table_access(thd, tables))
+ if (check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE))
goto err;
}
error= FALSE;
@@ -7790,7 +7954,10 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg,
return FALSE;
if (!no_error)
- my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_char_length);
+ {
+ ErrConvString err(str->str, str->length, cs);
+ my_error(ER_WRONG_STRING_LENGTH, MYF(0), err.ptr(), err_msg, max_char_length);
+ }
return TRUE;
}
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 0decd3e1a91..c0961f84feb 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,16 +18,29 @@
to partitioning introduced in MySQL version 5.1. It contains functionality
used by all handlers that support partitioning, such as
the partitioning handler itself and the NDB handler.
+ (Much of the code in this file has been split into partition_info.cc and
+ the header files partition_info.h + partition_element.h + sql_partition.h)
- The first version was written by Mikael Ronstrom.
+ The first version was written by Mikael Ronstrom 2004-2006.
+ Various parts of the optimizer code was written by Sergey Petrunia.
+ Code have been maintained by Mattias Jonsson.
+ The second version was written by Mikael Ronstrom 2006-2007 with some
+ final fixes for partition pruning in 2008-2009 with assistance from Sergey
+ Petrunia and Mattias Jonsson.
- This version supports RANGE partitioning, LIST partitioning, HASH
+ The first version supports RANGE partitioning, LIST partitioning, HASH
partitioning and composite partitioning (hereafter called subpartitioning)
where each RANGE/LIST partitioning is HASH partitioned. The hash function
can either be supplied by the user or by only a list of fields (also
called KEY partitioning), where the MySQL server will use an internal
hash function.
There are quite a few defaults that can be used as well.
+
+ The second version introduces a new variant of RANGE and LIST partitioning
+ which is often referred to as column lists in the code variables. This
+ enables a user to specify a set of columns and their concatenated value
+ as the partition value. By comparing the concatenation of these values
+ the proper partition can be choosen.
*/
/* Some general useful functions */
@@ -40,6 +53,10 @@
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
+
+#define ERROR_INJECT_CRASH(code) \
+ DBUG_EVALUATE_IF(code, (abort(), 0), 0)
+
/*
Partition related functions declarations and some static constants;
*/
@@ -50,9 +67,11 @@ const LEX_STRING partition_keywords[]=
{ C_STRING_WITH_LEN("LIST") },
{ C_STRING_WITH_LEN("KEY") },
{ C_STRING_WITH_LEN("MAXVALUE") },
- { C_STRING_WITH_LEN("LINEAR ") }
+ { C_STRING_WITH_LEN("LINEAR ") },
+ { C_STRING_WITH_LEN(" COLUMNS") }
};
static const char *part_str= "PARTITION";
+static const char *subpart_str= "SUBPARTITION";
static const char *sub_str= "SUB";
static const char *by_str= "BY";
static const char *space_str= " ";
@@ -61,26 +80,23 @@ static const char *end_paren_str= ")";
static const char *begin_paren_str= "(";
static const char *comma_str= ",";
-static int get_part_id_charset_func_all(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-static int get_part_id_charset_func_part(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-static int get_part_id_charset_func_subpart(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-static int get_part_part_id_charset_func(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-static int get_subpart_id_charset_func(partition_info *part_info,
- uint32 *part_id);
+int get_partition_id_list_col(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value);
int get_partition_id_list(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
+int get_partition_id_range_col(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value);
int get_partition_id_range(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
+static int get_part_id_charset_func_part(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value);
+static int get_part_id_charset_func_subpart(partition_info *part_info,
+ uint32 *part_id);
int get_partition_id_hash_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
@@ -93,30 +109,9 @@ int get_partition_id_linear_hash_nosub(partition_info *part_info,
int get_partition_id_linear_key_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value);
-int get_partition_id_range_sub_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_range_sub_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_range_sub_linear_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_range_sub_linear_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_list_sub_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_list_sub_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_list_sub_linear_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
-int get_partition_id_list_sub_linear_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value);
+int get_partition_id_with_sub(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value);
int get_partition_id_hash_sub(partition_info *part_info,
uint32 *part_id);
int get_partition_id_key_sub(partition_info *part_info,
@@ -134,17 +129,64 @@ uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter);
uint32 get_next_partition_id_list(PARTITION_ITERATOR* part_iter);
int get_part_iter_for_interval_via_mapping(partition_info *part_info,
bool is_subpart,
+ uint32 *store_length_array,
uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len,
uint flags,
PARTITION_ITERATOR *part_iter);
+int get_part_iter_for_interval_cols_via_map(partition_info *part_info,
+ bool is_subpart,
+ uint32 *store_length_array,
+ uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len,
+ uint flags,
+ PARTITION_ITERATOR *part_iter);
int get_part_iter_for_interval_via_walking(partition_info *part_info,
bool is_subpart,
+ uint32 *store_length_array,
uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len,
uint flags,
PARTITION_ITERATOR *part_iter);
+static int cmp_rec_and_tuple(part_column_list_val *val, uint32 nvals_in_rec);
+static int cmp_rec_and_tuple_prune(part_column_list_val *val,
+ uint32 n_vals_in_rec,
+ bool tail_is_min);
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
+ Convert constants in VALUES definition to the character set the
+ corresponding field uses.
+
+ SYNOPSIS
+ convert_charset_partition_constant()
+ item Item to convert
+ cs Character set to convert to
+
+ RETURN VALUE
+ NULL Error
+ item New converted item
+*/
+
+Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs)
+{
+ THD *thd= current_thd;
+ Name_resolution_context *context= &thd->lex->current_select->context;
+ TABLE_LIST *save_list= context->table_list;
+ const char *save_where= thd->where;
+
+ item= item->safe_charset_converter(cs);
+ context->table_list= NULL;
+ thd->where= "convert character set partition constant";
+ if (!item || item->fix_fields(thd, (Item**)NULL))
+ item= NULL;
+ thd->where= save_where;
+ context->table_list= save_list;
+ return item;
+}
+
+
+/*
A support function to check if a name is in a list of strings
SYNOPSIS
@@ -161,7 +203,7 @@ bool is_name_in_list(char *name,
List<char> list_names)
{
List_iterator<char> names_it(list_names);
- uint no_names= list_names.elements;
+ uint num_names= list_names.elements;
uint i= 0;
do
@@ -169,7 +211,7 @@ bool is_name_in_list(char *name,
char *list_name= names_it++;
if (!(my_strcasecmp(system_charset_info, name, list_name)))
return TRUE;
- } while (++i < no_names);
+ } while (++i < num_names);
return FALSE;
}
@@ -198,24 +240,24 @@ bool partition_default_handling(TABLE *table, partition_info *part_info,
if (!is_create_table_ind)
{
- if (part_info->use_default_no_partitions)
+ if (part_info->use_default_num_partitions)
{
- if (table->file->get_no_parts(normalized_path, &part_info->no_parts))
+ if (table->file->get_no_parts(normalized_path, &part_info->num_parts))
{
DBUG_RETURN(TRUE);
}
}
else if (part_info->is_sub_partitioned() &&
- part_info->use_default_no_subpartitions)
+ part_info->use_default_num_subpartitions)
{
- uint no_parts;
- if (table->file->get_no_parts(normalized_path, &no_parts))
+ uint num_parts;
+ if (table->file->get_no_parts(normalized_path, &num_parts))
{
DBUG_RETURN(TRUE);
}
- DBUG_ASSERT(part_info->no_parts > 0);
- DBUG_ASSERT((no_parts % part_info->no_parts) == 0);
- part_info->no_subparts= no_parts / part_info->no_parts;
+ DBUG_ASSERT(part_info->num_parts > 0);
+ DBUG_ASSERT((num_parts % part_info->num_parts) == 0);
+ part_info->num_subparts= num_parts / part_info->num_parts;
}
}
part_info->set_up_defaults_for_partitioning(table->file,
@@ -249,8 +291,8 @@ bool check_reorganise_list(partition_info *new_part_info,
List<char> list_part_names)
{
uint new_count, old_count;
- uint no_new_parts= new_part_info->partitions.elements;
- uint no_old_parts= old_part_info->partitions.elements;
+ uint num_new_parts= new_part_info->partitions.elements;
+ uint num_old_parts= old_part_info->partitions.elements;
List_iterator<partition_element> new_parts_it(new_part_info->partitions);
bool same_part_info= (new_part_info == old_part_info);
DBUG_ENTER("check_reorganise_list");
@@ -273,8 +315,8 @@ bool check_reorganise_list(partition_info *new_part_info,
if (!is_name_in_list(old_name, list_part_names))
DBUG_RETURN(TRUE);
}
- } while (old_count < no_old_parts);
- } while (new_count < no_new_parts);
+ } while (old_count < num_old_parts);
+ } while (new_count < num_new_parts);
DBUG_RETURN(FALSE);
}
@@ -449,9 +491,10 @@ static bool set_up_field_array(TABLE *table,
bool is_sub_part)
{
Field **ptr, *field, **field_array;
- uint no_fields= 0;
+ uint num_fields= 0;
uint size_field_array;
uint i= 0;
+ uint inx;
partition_info *part_info= table->part_info;
int result= FALSE;
DBUG_ENTER("set_up_field_array");
@@ -460,9 +503,19 @@ static bool set_up_field_array(TABLE *table,
while ((field= *(ptr++)))
{
if (field->flags & GET_FIXED_FIELDS_FLAG)
- no_fields++;
+ num_fields++;
+ }
+ if (num_fields > MAX_REF_PARTS)
+ {
+ char *ptr;
+ if (is_sub_part)
+ ptr= (char*)"subpartition function";
+ else
+ ptr= (char*)"partition function";
+ my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), ptr);
+ DBUG_RETURN(TRUE);
}
- if (no_fields == 0)
+ if (num_fields == 0)
{
/*
We are using hidden key as partitioning field
@@ -470,8 +523,8 @@ static bool set_up_field_array(TABLE *table,
DBUG_ASSERT(!is_sub_part);
DBUG_RETURN(result);
}
- size_field_array= (no_fields+1)*sizeof(Field*);
- field_array= (Field**)sql_alloc(size_field_array);
+ size_field_array= (num_fields+1)*sizeof(Field*);
+ field_array= (Field**)sql_calloc(size_field_array);
if (unlikely(!field_array))
{
mem_alloc_error(size_field_array);
@@ -486,7 +539,32 @@ static bool set_up_field_array(TABLE *table,
field->flags|= FIELD_IN_PART_FUNC_FLAG;
if (likely(!result))
{
- field_array[i++]= field;
+ if (!is_sub_part && part_info->column_list)
+ {
+ List_iterator<char> it(part_info->part_field_list);
+ char *field_name;
+
+ DBUG_ASSERT(num_fields == part_info->part_field_list.elements);
+ inx= 0;
+ do
+ {
+ field_name= it++;
+ if (!my_strcasecmp(system_charset_info,
+ field_name,
+ field->field_name))
+ break;
+ } while (++inx < num_fields);
+ if (inx == num_fields)
+ {
+ mem_alloc_error(1);
+ result= TRUE;
+ continue;
+ }
+ }
+ else
+ inx= i;
+ field_array[inx]= field;
+ i++;
/*
We check that the fields are proper. It is required for each
@@ -504,16 +582,16 @@ static bool set_up_field_array(TABLE *table,
}
}
}
- field_array[no_fields]= 0;
+ field_array[num_fields]= 0;
if (!is_sub_part)
{
part_info->part_field_array= field_array;
- part_info->no_part_fields= no_fields;
+ part_info->num_part_fields= num_fields;
}
else
{
part_info->subpart_field_array= field_array;
- part_info->no_subpart_fields= no_fields;
+ part_info->num_subpart_fields= num_fields;
}
DBUG_RETURN(result);
}
@@ -552,36 +630,36 @@ static bool create_full_part_field_array(THD *thd, TABLE *table,
if (!part_info->is_sub_partitioned())
{
part_info->full_part_field_array= part_info->part_field_array;
- part_info->no_full_part_fields= part_info->no_part_fields;
+ part_info->num_full_part_fields= part_info->num_part_fields;
}
else
{
Field *field, **field_array;
- uint no_part_fields=0, size_field_array;
+ uint num_part_fields=0, size_field_array;
ptr= table->field;
while ((field= *(ptr++)))
{
if (field->flags & FIELD_IN_PART_FUNC_FLAG)
- no_part_fields++;
+ num_part_fields++;
}
- size_field_array= (no_part_fields+1)*sizeof(Field*);
- field_array= (Field**)sql_alloc(size_field_array);
+ size_field_array= (num_part_fields+1)*sizeof(Field*);
+ field_array= (Field**)sql_calloc(size_field_array);
if (unlikely(!field_array))
{
mem_alloc_error(size_field_array);
result= TRUE;
goto end;
}
- no_part_fields= 0;
+ num_part_fields= 0;
ptr= table->field;
while ((field= *(ptr++)))
{
if (field->flags & FIELD_IN_PART_FUNC_FLAG)
- field_array[no_part_fields++]= field;
+ field_array[num_part_fields++]= field;
}
- field_array[no_part_fields]=0;
+ field_array[num_part_fields]=0;
part_info->full_part_field_array= field_array;
- part_info->no_full_part_fields= no_part_fields;
+ part_info->num_full_part_fields= num_part_fields;
}
/*
@@ -777,16 +855,16 @@ static bool handle_list_of_fields(List_iterator<char> it,
goto end;
}
}
- if (is_list_empty)
+ if (is_list_empty && part_info->part_type == HASH_PARTITION)
{
uint primary_key= table->s->primary_key;
if (primary_key != MAX_KEY)
{
- uint no_key_parts= table->key_info[primary_key].key_parts, i;
+ uint num_key_parts= table->key_info[primary_key].key_parts, i;
/*
In the case of an empty list we use primary key as partition key.
*/
- for (i= 0; i < no_key_parts; i++)
+ for (i= 0; i < num_key_parts; i++)
{
Field *field= table->key_info[primary_key].key_part[i].field;
field->flags|= GET_FIXED_FIELDS_FLAG;
@@ -850,7 +928,7 @@ int check_signed_flag(partition_info *part_info)
error= ER_PARTITION_CONST_DOMAIN_ERROR;
break;
}
- } while (++i < part_info->no_parts);
+ } while (++i < part_info->num_parts);
}
return error;
}
@@ -869,7 +947,6 @@ int check_signed_flag(partition_info *part_info)
table The table object
part_info Reference to partitioning data structure
is_sub_part Is the table subpartitioned as well
- is_field_to_be_setup Flag if we are to set-up field arrays
RETURN VALUE
TRUE An error occurred, something was wrong with the
@@ -892,8 +969,8 @@ int check_signed_flag(partition_info *part_info)
on the field object.
*/
-bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
- bool is_sub_part, bool is_field_to_be_setup)
+static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
+ bool is_sub_part)
{
partition_info *part_info= table->part_info;
uint dir_length, home_dir_length;
@@ -910,13 +987,6 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
nesting_map saved_allow_sum_func;
DBUG_ENTER("fix_fields_part_func");
- if (part_info->fixed)
- {
- if (!(is_sub_part || (error= check_signed_flag(part_info))))
- result= FALSE;
- goto end;
- }
-
/*
Set-up the TABLE_LIST object to be a list with a single table
Set the object to zero to create NULL pointers and set alias
@@ -998,8 +1068,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
if (unlikely(error))
{
DBUG_PRINT("info", ("Field in partition function not part of table"));
- if (is_field_to_be_setup)
- clear_field_flag(table);
+ clear_field_flag(table);
goto end;
}
thd->where= save_where;
@@ -1011,11 +1080,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
}
if ((!is_sub_part) && (error= check_signed_flag(part_info)))
goto end;
- result= FALSE;
- if (is_field_to_be_setup)
- result= set_up_field_array(table, is_sub_part);
- if (!is_sub_part)
- part_info->fixed= TRUE;
+ result= set_up_field_array(table, is_sub_part);
end:
table->get_fields_in_item_tree= FALSE;
table->map= 0; //Restore old value
@@ -1194,9 +1259,9 @@ void check_range_capable_PF(TABLE *table)
static bool set_up_partition_bitmap(THD *thd, partition_info *part_info)
{
uint32 *bitmap_buf;
- uint bitmap_bits= part_info->no_subparts?
- (part_info->no_subparts* part_info->no_parts):
- part_info->no_parts;
+ uint bitmap_bits= part_info->num_subparts?
+ (part_info->num_subparts* part_info->num_parts):
+ part_info->num_parts;
uint bitmap_bytes= bitmap_buffer_size(bitmap_bits);
DBUG_ENTER("set_up_partition_bitmap");
@@ -1296,64 +1361,47 @@ static void set_up_partition_func_pointers(partition_info *part_info)
if (part_info->is_sub_partitioned())
{
+ part_info->get_partition_id= get_partition_id_with_sub;
if (part_info->part_type == RANGE_PARTITION)
{
- part_info->get_part_partition_id= get_partition_id_range;
+ if (part_info->column_list)
+ part_info->get_part_partition_id= get_partition_id_range_col;
+ else
+ part_info->get_part_partition_id= get_partition_id_range;
if (part_info->list_of_subpart_fields)
{
if (part_info->linear_hash_ind)
- {
- part_info->get_partition_id= get_partition_id_range_sub_linear_key;
part_info->get_subpartition_id= get_partition_id_linear_key_sub;
- }
else
- {
- part_info->get_partition_id= get_partition_id_range_sub_key;
part_info->get_subpartition_id= get_partition_id_key_sub;
- }
}
else
{
if (part_info->linear_hash_ind)
- {
- part_info->get_partition_id= get_partition_id_range_sub_linear_hash;
part_info->get_subpartition_id= get_partition_id_linear_hash_sub;
- }
else
- {
- part_info->get_partition_id= get_partition_id_range_sub_hash;
part_info->get_subpartition_id= get_partition_id_hash_sub;
- }
}
}
else /* LIST Partitioning */
{
- part_info->get_part_partition_id= get_partition_id_list;
+ if (part_info->column_list)
+ part_info->get_part_partition_id= get_partition_id_list_col;
+ else
+ part_info->get_part_partition_id= get_partition_id_list;
if (part_info->list_of_subpart_fields)
{
if (part_info->linear_hash_ind)
- {
- part_info->get_partition_id= get_partition_id_list_sub_linear_key;
part_info->get_subpartition_id= get_partition_id_linear_key_sub;
- }
else
- {
- part_info->get_partition_id= get_partition_id_list_sub_key;
part_info->get_subpartition_id= get_partition_id_key_sub;
- }
}
else
{
if (part_info->linear_hash_ind)
- {
- part_info->get_partition_id= get_partition_id_list_sub_linear_hash;
part_info->get_subpartition_id= get_partition_id_linear_hash_sub;
- }
else
- {
- part_info->get_partition_id= get_partition_id_list_sub_hash;
part_info->get_subpartition_id= get_partition_id_hash_sub;
- }
}
}
}
@@ -1362,9 +1410,19 @@ static void set_up_partition_func_pointers(partition_info *part_info)
part_info->get_part_partition_id= NULL;
part_info->get_subpartition_id= NULL;
if (part_info->part_type == RANGE_PARTITION)
- part_info->get_partition_id= get_partition_id_range;
+ {
+ if (part_info->column_list)
+ part_info->get_partition_id= get_partition_id_range_col;
+ else
+ part_info->get_partition_id= get_partition_id_range;
+ }
else if (part_info->part_type == LIST_PARTITION)
- part_info->get_partition_id= get_partition_id_list;
+ {
+ if (part_info->column_list)
+ part_info->get_partition_id= get_partition_id_list_col;
+ else
+ part_info->get_partition_id= get_partition_id_list;
+ }
else /* HASH partitioning */
{
if (part_info->list_of_part_fields)
@@ -1383,32 +1441,43 @@ static void set_up_partition_func_pointers(partition_info *part_info)
}
}
}
- if (part_info->full_part_charset_field_array)
- {
- DBUG_ASSERT(part_info->get_partition_id);
- part_info->get_partition_id_charset= part_info->get_partition_id;
- if (part_info->part_charset_field_array &&
- part_info->subpart_charset_field_array)
- part_info->get_partition_id= get_part_id_charset_func_all;
- else if (part_info->part_charset_field_array)
- part_info->get_partition_id= get_part_id_charset_func_part;
- else
- part_info->get_partition_id= get_part_id_charset_func_subpart;
- }
- if (part_info->part_charset_field_array &&
- part_info->is_sub_partitioned())
+ /*
+ We need special functions to handle character sets since they require copy
+ of field pointers and restore afterwards. For subpartitioned tables we do
+ the copy and restore individually on the part and subpart parts. For non-
+ subpartitioned tables we use the same functions as used for the parts part
+ of subpartioning.
+ Thus for subpartitioned tables the get_partition_id is always
+ get_partition_id_with_sub, even when character sets exists.
+ */
+ if (part_info->part_charset_field_array)
{
- DBUG_ASSERT(part_info->get_part_partition_id);
- part_info->get_part_partition_id_charset=
+ if (part_info->is_sub_partitioned())
+ {
+ DBUG_ASSERT(part_info->get_part_partition_id);
+ if (!part_info->column_list)
+ {
+ part_info->get_part_partition_id_charset=
part_info->get_part_partition_id;
- part_info->get_part_partition_id= get_part_part_id_charset_func;
+ part_info->get_part_partition_id= get_part_id_charset_func_part;
+ }
+ }
+ else
+ {
+ DBUG_ASSERT(part_info->get_partition_id);
+ if (!part_info->column_list)
+ {
+ part_info->get_part_partition_id_charset= part_info->get_partition_id;
+ part_info->get_part_partition_id= get_part_id_charset_func_part;
+ }
+ }
}
if (part_info->subpart_charset_field_array)
{
DBUG_ASSERT(part_info->get_subpartition_id);
part_info->get_subpartition_id_charset=
part_info->get_subpartition_id;
- part_info->get_subpartition_id= get_subpart_id_charset_func;
+ part_info->get_subpartition_id= get_part_id_charset_func_subpart;
}
DBUG_VOID_RETURN;
}
@@ -1416,22 +1485,22 @@ static void set_up_partition_func_pointers(partition_info *part_info)
/*
For linear hashing we need a mask which is on the form 2**n - 1 where
- 2**n >= no_parts. Thus if no_parts is 6 then mask is 2**3 - 1 = 8 - 1 = 7.
+ 2**n >= num_parts. Thus if num_parts is 6 then mask is 2**3 - 1 = 8 - 1 = 7.
SYNOPSIS
set_linear_hash_mask()
part_info Reference to partitioning data structure
- no_parts Number of parts in linear hash partitioning
+ num_parts Number of parts in linear hash partitioning
RETURN VALUE
NONE
*/
-void set_linear_hash_mask(partition_info *part_info, uint no_parts)
+void set_linear_hash_mask(partition_info *part_info, uint num_parts)
{
uint mask;
- for (mask= 1; mask < no_parts; mask<<=1)
+ for (mask= 1; mask < num_parts; mask<<=1)
;
part_info->linear_hash_mask= mask - 1;
}
@@ -1445,7 +1514,7 @@ void set_linear_hash_mask(partition_info *part_info, uint no_parts)
get_part_id_from_linear_hash()
hash_value Hash value calculated by HASH function or KEY function
mask Mask calculated previously by set_linear_hash_mask
- no_parts Number of partitions in HASH partitioned part
+ num_parts Number of partitions in HASH partitioned part
RETURN VALUE
part_id The calculated partition identity (starting at 0)
@@ -1458,11 +1527,11 @@ void set_linear_hash_mask(partition_info *part_info, uint no_parts)
*/
static uint32 get_part_id_from_linear_hash(longlong hash_value, uint mask,
- uint no_parts)
+ uint num_parts)
{
uint32 part_id= (uint32)(hash_value & mask);
- if (part_id >= no_parts)
+ if (part_id >= num_parts)
{
uint new_mask= ((mask + 1) >> 1) - 1;
part_id= (uint32)(hash_value & new_mask);
@@ -1606,7 +1675,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
function is correct.
*/
if (part_info->linear_hash_ind)
- set_linear_hash_mask(part_info, part_info->no_subparts);
+ set_linear_hash_mask(part_info, part_info->num_subparts);
if (part_info->list_of_subpart_fields)
{
List_iterator<char> it(part_info->subpart_field_list);
@@ -1616,12 +1685,12 @@ bool fix_partition_func(THD *thd, TABLE *table,
else
{
if (unlikely(fix_fields_part_func(thd, part_info->subpart_expr,
- table, TRUE, TRUE)))
+ table, TRUE)))
goto end;
if (unlikely(part_info->subpart_expr->result_type() != INT_RESULT))
{
- my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0),
- "SUBPARTITION");
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0),
+ subpart_str);
goto end;
}
}
@@ -1634,7 +1703,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (part_info->part_type == HASH_PARTITION)
{
if (part_info->linear_hash_ind)
- set_linear_hash_mask(part_info, part_info->no_parts);
+ set_linear_hash_mask(part_info, part_info->num_parts);
if (part_info->list_of_part_fields)
{
List_iterator<char> it(part_info->part_field_list);
@@ -1644,32 +1713,43 @@ bool fix_partition_func(THD *thd, TABLE *table,
else
{
if (unlikely(fix_fields_part_func(thd, part_info->part_expr,
- table, FALSE, TRUE)))
+ table, FALSE)))
goto end;
if (unlikely(part_info->part_expr->result_type() != INT_RESULT))
{
- my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0), part_str);
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0), part_str);
goto end;
}
part_info->part_result_type= INT_RESULT;
}
+ part_info->fixed= TRUE;
}
else
{
const char *error_str;
- if (unlikely(fix_fields_part_func(thd, part_info->part_expr,
- table, FALSE, TRUE)))
- goto end;
+ if (part_info->column_list)
+ {
+ List_iterator<char> it(part_info->part_field_list);
+ if (unlikely(handle_list_of_fields(it, table, part_info, FALSE)))
+ goto end;
+ }
+ else
+ {
+ if (unlikely(fix_fields_part_func(thd, part_info->part_expr,
+ table, FALSE)))
+ goto end;
+ }
+ part_info->fixed= TRUE;
if (part_info->part_type == RANGE_PARTITION)
{
error_str= partition_keywords[PKW_RANGE].str;
- if (unlikely(part_info->check_range_constants()))
+ if (unlikely(part_info->check_range_constants(thd)))
goto end;
}
else if (part_info->part_type == LIST_PARTITION)
{
error_str= partition_keywords[PKW_LIST].str;
- if (unlikely(part_info->check_list_constants()))
+ if (unlikely(part_info->check_list_constants(thd)))
goto end;
}
else
@@ -1678,12 +1758,13 @@ bool fix_partition_func(THD *thd, TABLE *table,
my_error(ER_INCONSISTENT_PARTITION_INFO_ERROR, MYF(0));
goto end;
}
- if (unlikely(part_info->no_parts < 1))
+ if (unlikely(part_info->num_parts < 1))
{
my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), error_str);
goto end;
}
- if (unlikely(part_info->part_expr->result_type() != INT_RESULT))
+ if (unlikely(!part_info->column_list &&
+ part_info->part_expr->result_type() != INT_RESULT))
{
my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0), part_str);
goto end;
@@ -1691,7 +1772,8 @@ bool fix_partition_func(THD *thd, TABLE *table,
}
if (((part_info->part_type != HASH_PARTITION ||
part_info->list_of_part_fields == FALSE) &&
- check_part_func_fields(part_info->part_field_array, TRUE)) ||
+ (!part_info->column_list &&
+ check_part_func_fields(part_info->part_field_array, TRUE))) ||
(part_info->list_of_subpart_fields == FALSE &&
part_info->is_sub_partitioned() &&
check_part_func_fields(part_info->subpart_field_array, TRUE)))
@@ -1714,6 +1796,11 @@ bool fix_partition_func(THD *thd, TABLE *table,
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
}
+ if (unlikely(part_info->check_partition_field_length()))
+ {
+ my_error(ER_PARTITION_FIELDS_TOO_LONG, MYF(0));
+ goto end;
+ }
check_range_capable_PF(table);
set_up_partition_key_maps(table, part_info);
set_up_partition_func_pointers(part_info);
@@ -1736,9 +1823,9 @@ end:
static int add_write(File fptr, const char *buf, uint len)
{
- uint len_written= my_write(fptr, (const uchar*)buf, len, MYF(0));
+ uint ret_code= my_write(fptr, (const uchar*)buf, len, MYF(MY_FNABP));
- if (likely(len == len_written))
+ if (likely(ret_code == 0))
return 0;
else
return 1;
@@ -1787,14 +1874,8 @@ static int add_begin_parenthesis(File fptr)
static int add_part_key_word(File fptr, const char *key_string)
{
int err= add_string(fptr, key_string);
-
err+= add_space(fptr);
- return err + add_begin_parenthesis(fptr);
-}
-
-static int add_hash(File fptr)
-{
- return add_part_key_word(fptr, partition_keywords[PKW_HASH].str);
+ return err;
}
static int add_partition(File fptr)
@@ -1825,16 +1906,16 @@ static int add_subpartition_by(File fptr)
return err + add_partition_by(fptr);
}
-static int add_key_partition(File fptr, List<char> field_list)
+static int add_part_field_list(File fptr, List<char> field_list)
{
- uint i, no_fields;
- int err;
+ uint i, num_fields;
+ int err= 0;
List_iterator<char> part_it(field_list);
- err= add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
- no_fields= field_list.elements;
+ num_fields= field_list.elements;
i= 0;
- while (i < no_fields)
+ err+= add_begin_parenthesis(fptr);
+ while (i < num_fields)
{
const char *field_str= part_it++;
String field_string("", 0, system_charset_info);
@@ -1845,10 +1926,11 @@ static int add_key_partition(File fptr, List<char> field_list)
strlen(field_str));
thd->options= save_options;
err+= add_string_object(fptr, &field_string);
- if (i != (no_fields-1))
+ if (i != (num_fields-1))
err+= add_comma(fptr);
i++;
}
+ err+= add_end_parenthesis(fptr);
return err;
}
@@ -1958,37 +2040,269 @@ static int add_partition_options(File fptr, partition_element *p_elem)
return err + add_engine(fptr,p_elem->engine_type);
}
-static int add_partition_values(File fptr, partition_info *part_info, partition_element *p_elem)
+
+/*
+ Check partition fields for result type and if they need
+ to check the character set.
+
+ SYNOPSIS
+ check_part_field()
+ sql_type Type provided by user
+ field_name Name of field, used for error handling
+ result_type Out value: Result type of field
+ need_cs_check Out value: Do we need character set check
+
+ RETURN VALUES
+ TRUE Error
+ FALSE Ok
+*/
+
+static int check_part_field(enum_field_types sql_type,
+ const char *field_name,
+ Item_result *result_type,
+ bool *need_cs_check)
+{
+ if (sql_type >= MYSQL_TYPE_TINY_BLOB &&
+ sql_type <= MYSQL_TYPE_BLOB)
+ {
+ my_error(ER_BLOB_FIELD_IN_PART_FUNC_ERROR, MYF(0));
+ return TRUE;
+ }
+ switch (sql_type)
+ {
+ case MYSQL_TYPE_NEWDECIMAL:
+ case MYSQL_TYPE_DECIMAL:
+ case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_LONGLONG:
+ case MYSQL_TYPE_INT24:
+ *result_type= INT_RESULT;
+ *need_cs_check= FALSE;
+ return FALSE;
+ case MYSQL_TYPE_NEWDATE:
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATETIME:
+ *result_type= STRING_RESULT;
+ *need_cs_check= TRUE;
+ return FALSE;
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_VAR_STRING:
+ *result_type= STRING_RESULT;
+ *need_cs_check= TRUE;
+ return FALSE;
+ case MYSQL_TYPE_TIMESTAMP:
+ case MYSQL_TYPE_NULL:
+ case MYSQL_TYPE_FLOAT:
+ case MYSQL_TYPE_DOUBLE:
+ case MYSQL_TYPE_BIT:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_SET:
+ case MYSQL_TYPE_GEOMETRY:
+ goto error;
+ default:
+ goto error;
+ }
+error:
+ my_error(ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD, MYF(0),
+ field_name);
+ return TRUE;
+}
+
+
+/*
+ Find the given field's Create_field object using name of field
+
+ SYNOPSIS
+ get_sql_field()
+ field_name Field name
+ alter_info Info from ALTER TABLE/CREATE TABLE
+
+ RETURN VALUE
+ sql_field Object filled in by parser about field
+ NULL No field found
+*/
+
+static Create_field* get_sql_field(char *field_name,
+ Alter_info *alter_info)
+{
+ List_iterator<Create_field> it(alter_info->create_list);
+ Create_field *sql_field;
+ DBUG_ENTER("get_sql_field");
+
+ while ((sql_field= it++))
+ {
+ if (!(my_strcasecmp(system_charset_info,
+ sql_field->field_name,
+ field_name)))
+ {
+ DBUG_RETURN(sql_field);
+ }
+ }
+ DBUG_RETURN(NULL);
+}
+
+
+static int add_column_list_values(File fptr, partition_info *part_info,
+ part_elem_value *list_value,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info)
+{
+ int err= 0;
+ uint i;
+ List_iterator<char> it(part_info->part_field_list);
+ uint num_elements= part_info->part_field_list.elements;
+ bool use_parenthesis= (part_info->part_type == LIST_PARTITION &&
+ part_info->num_columns > 1U);
+
+ if (use_parenthesis)
+ err+= add_begin_parenthesis(fptr);
+ for (i= 0; i < num_elements; i++)
+ {
+ part_column_list_val *col_val= &list_value->col_val_array[i];
+ char *field_name= it++;
+ if (col_val->max_value)
+ err+= add_string(fptr, partition_keywords[PKW_MAXVALUE].str);
+ else if (col_val->null_value)
+ err+= add_string(fptr, "NULL");
+ else
+ {
+ char buffer[MAX_KEY_LENGTH];
+ String str(buffer, sizeof(buffer), &my_charset_bin);
+ Item *item_expr= col_val->item_expression;
+ if (item_expr->null_value)
+ err+= add_string(fptr, "NULL");
+ else
+ {
+ String *res;
+ CHARSET_INFO *field_cs;
+ bool need_cs_check= FALSE;
+ Item_result result_type= STRING_RESULT;
+
+ /*
+ This function is called at a very early stage, even before
+ we have prepared the sql_field objects. Thus we have to
+ find the proper sql_field object and get the character set
+ from that object.
+ */
+ if (create_info)
+ {
+ Create_field *sql_field;
+
+ if (!(sql_field= get_sql_field(field_name,
+ alter_info)))
+ {
+ my_error(ER_FIELD_NOT_FOUND_PART_ERROR, MYF(0));
+ return 1;
+ }
+ if (check_part_field(sql_field->sql_type,
+ sql_field->field_name,
+ &result_type,
+ &need_cs_check))
+ return 1;
+ if (need_cs_check)
+ field_cs= get_sql_field_charset(sql_field, create_info);
+ else
+ field_cs= NULL;
+ }
+ else
+ {
+ Field *field= part_info->part_field_array[i];
+ result_type= field->result_type();
+ if (check_part_field(field->real_type(),
+ field->field_name,
+ &result_type,
+ &need_cs_check))
+ return 1;
+ DBUG_ASSERT(result_type == field->result_type());
+ if (need_cs_check)
+ field_cs= field->charset();
+ else
+ field_cs= NULL;
+ }
+ if (result_type != item_expr->result_type())
+ {
+ my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
+ return 1;
+ }
+ if (field_cs && field_cs != item_expr->collation.collation)
+ {
+ if (!(item_expr= convert_charset_partition_constant(item_expr,
+ field_cs)))
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ return 1;
+ }
+ }
+ {
+ String val_conv;
+ val_conv.set_charset(system_charset_info);
+ res= item_expr->val_str(&str);
+ if (get_cs_converted_part_value_from_string(current_thd,
+ item_expr, res,
+ &val_conv, field_cs,
+ (bool)(alter_info != NULL)))
+ return 1;
+ err+= add_string_object(fptr, &val_conv);
+ }
+ }
+ }
+ if (i != (num_elements - 1))
+ err+= add_string(fptr, comma_str);
+ }
+ if (use_parenthesis)
+ err+= add_end_parenthesis(fptr);
+ return err;
+}
+
+static int add_partition_values(File fptr, partition_info *part_info,
+ partition_element *p_elem,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info)
{
int err= 0;
if (part_info->part_type == RANGE_PARTITION)
{
err+= add_string(fptr, " VALUES LESS THAN ");
- if (!p_elem->max_value)
+ if (part_info->column_list)
{
+ List_iterator<part_elem_value> list_val_it(p_elem->list_val_list);
+ part_elem_value *list_value= list_val_it++;
err+= add_begin_parenthesis(fptr);
- if (p_elem->signed_flag)
- err+= add_int(fptr, p_elem->range_value);
- else
- err+= add_uint(fptr, p_elem->range_value);
+ err+= add_column_list_values(fptr, part_info, list_value,
+ create_info, alter_info);
err+= add_end_parenthesis(fptr);
}
else
- err+= add_string(fptr, partition_keywords[PKW_MAXVALUE].str);
+ {
+ if (!p_elem->max_value)
+ {
+ err+= add_begin_parenthesis(fptr);
+ if (p_elem->signed_flag)
+ err+= add_int(fptr, p_elem->range_value);
+ else
+ err+= add_uint(fptr, p_elem->range_value);
+ err+= add_end_parenthesis(fptr);
+ }
+ else
+ err+= add_string(fptr, partition_keywords[PKW_MAXVALUE].str);
+ }
}
else if (part_info->part_type == LIST_PARTITION)
{
uint i;
List_iterator<part_elem_value> list_val_it(p_elem->list_val_list);
err+= add_string(fptr, " VALUES IN ");
- uint no_items= p_elem->list_val_list.elements;
+ uint num_items= p_elem->list_val_list.elements;
err+= add_begin_parenthesis(fptr);
if (p_elem->has_null_value)
{
err+= add_string(fptr, "NULL");
- if (no_items == 0)
+ if (num_items == 0)
{
err+= add_end_parenthesis(fptr);
goto end;
@@ -2000,13 +2314,19 @@ static int add_partition_values(File fptr, partition_info *part_info, partition_
{
part_elem_value *list_value= list_val_it++;
- if (!list_value->unsigned_flag)
- err+= add_int(fptr, list_value->value);
+ if (part_info->column_list)
+ err+= add_column_list_values(fptr, part_info, list_value,
+ create_info, alter_info);
else
- err+= add_uint(fptr, list_value->value);
- if (i != (no_items-1))
+ {
+ if (!list_value->unsigned_flag)
+ err+= add_int(fptr, list_value->value);
+ else
+ err+= add_uint(fptr, list_value->value);
+ }
+ if (i != (num_items-1))
err+= add_comma(fptr);
- } while (++i < no_items);
+ } while (++i < num_items);
err+= add_end_parenthesis(fptr);
}
end:
@@ -2025,6 +2345,8 @@ end:
use_sql_alloc Allocate buffer from sql_alloc if true
otherwise use my_malloc
show_partition_options Should we display partition options
+ create_info Info generated by parser
+ alter_info Info generated by parser
RETURN VALUES
NULL error
@@ -2053,9 +2375,11 @@ end:
char *generate_partition_syntax(partition_info *part_info,
uint *buf_length,
bool use_sql_alloc,
- bool show_partition_options)
+ bool show_partition_options,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info)
{
- uint i,j, tot_no_parts, no_subparts;
+ uint i,j, tot_num_parts, num_subparts;
partition_element *part_elem;
ulonglong buffer_length;
char path[FN_REFLEN];
@@ -2086,9 +2410,12 @@ char *generate_partition_syntax(partition_info *part_info,
if (part_info->linear_hash_ind)
err+= add_string(fptr, partition_keywords[PKW_LINEAR].str);
if (part_info->list_of_part_fields)
- err+= add_key_partition(fptr, part_info->part_field_list);
+ {
+ err+= add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
+ err+= add_part_field_list(fptr, part_info->part_field_list);
+ }
else
- err+= add_hash(fptr);
+ err+= add_part_key_word(fptr, partition_keywords[PKW_HASH].str);
break;
default:
DBUG_ASSERT(0);
@@ -2098,15 +2425,23 @@ char *generate_partition_syntax(partition_info *part_info,
DBUG_RETURN(NULL);
}
if (part_info->part_expr)
+ {
+ err+= add_begin_parenthesis(fptr);
err+= add_string_len(fptr, part_info->part_func_string,
part_info->part_func_len);
- err+= add_end_parenthesis(fptr);
- if ((!part_info->use_default_no_partitions) &&
+ err+= add_end_parenthesis(fptr);
+ }
+ else if (part_info->column_list)
+ {
+ err+= add_string(fptr, partition_keywords[PKW_COLUMNS].str);
+ err+= add_part_field_list(fptr, part_info->part_field_list);
+ }
+ if ((!part_info->use_default_num_partitions) &&
part_info->use_default_partitions)
{
err+= add_string(fptr, "\n");
err+= add_string(fptr, "PARTITIONS ");
- err+= add_int(fptr, part_info->no_parts);
+ err+= add_int(fptr, part_info->num_parts);
}
if (part_info->is_sub_partitioned())
{
@@ -2116,23 +2451,29 @@ char *generate_partition_syntax(partition_info *part_info,
if (part_info->linear_hash_ind)
err+= add_string(fptr, partition_keywords[PKW_LINEAR].str);
if (part_info->list_of_subpart_fields)
- err+= add_key_partition(fptr, part_info->subpart_field_list);
+ {
+ add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
+ add_part_field_list(fptr, part_info->subpart_field_list);
+ }
else
- err+= add_hash(fptr);
+ err+= add_part_key_word(fptr, partition_keywords[PKW_HASH].str);
if (part_info->subpart_expr)
+ {
+ err+= add_begin_parenthesis(fptr);
err+= add_string_len(fptr, part_info->subpart_func_string,
part_info->subpart_func_len);
- err+= add_end_parenthesis(fptr);
- if ((!part_info->use_default_no_subpartitions) &&
+ err+= add_end_parenthesis(fptr);
+ }
+ if ((!part_info->use_default_num_subpartitions) &&
part_info->use_default_subpartitions)
{
err+= add_string(fptr, "\n");
err+= add_string(fptr, "SUBPARTITIONS ");
- err+= add_int(fptr, part_info->no_subparts);
+ err+= add_int(fptr, part_info->num_subparts);
}
}
- tot_no_parts= part_info->partitions.elements;
- no_subparts= part_info->no_subparts;
+ tot_num_parts= part_info->partitions.elements;
+ num_subparts= part_info->num_subparts;
if (!part_info->use_default_partitions)
{
@@ -2155,7 +2496,8 @@ char *generate_partition_syntax(partition_info *part_info,
first= FALSE;
err+= add_partition(fptr);
err+= add_name_string(fptr, part_elem->partition_name);
- err+= add_partition_values(fptr, part_info, part_elem);
+ err+= add_partition_values(fptr, part_info, part_elem,
+ create_info, alter_info);
if (!part_info->is_sub_partitioned() ||
part_info->use_default_subpartitions)
{
@@ -2176,7 +2518,7 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_name_string(fptr, part_elem->partition_name);
if (show_partition_options)
err+= add_partition_options(fptr, part_elem);
- if (j != (no_subparts-1))
+ if (j != (num_subparts-1))
{
err+= add_comma(fptr);
err+= add_string(fptr, "\n");
@@ -2185,12 +2527,12 @@ char *generate_partition_syntax(partition_info *part_info,
}
else
err+= add_end_parenthesis(fptr);
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
}
- if (i == (tot_no_parts-1))
+ if (i == (tot_num_parts-1))
err+= add_end_parenthesis(fptr);
- } while (++i < tot_no_parts);
+ } while (++i < tot_num_parts);
}
if (err)
goto close_file;
@@ -2337,14 +2679,14 @@ static uint32 calculate_key_value(Field **field_array)
get_part_id_for_sub()
loc_part_id Local partition id
sub_part_id Subpartition id
- no_subparts Number of subparts
+ num_subparts Number of subparts
*/
inline
static uint32 get_part_id_for_sub(uint32 loc_part_id, uint32 sub_part_id,
- uint no_subparts)
+ uint num_subparts)
{
- return (uint32)((loc_part_id * no_subparts) + sub_part_id);
+ return (uint32)((loc_part_id * num_subparts) + sub_part_id);
}
@@ -2353,7 +2695,7 @@ static uint32 get_part_id_for_sub(uint32 loc_part_id, uint32 sub_part_id,
SYNOPSIS
get_part_id_hash()
- no_parts Number of hash partitions
+ num_parts Number of hash partitions
part_expr Item tree of hash function
out:part_id The returned partition id
out:func_value Value of hash function
@@ -2363,7 +2705,7 @@ static uint32 get_part_id_for_sub(uint32 loc_part_id, uint32 sub_part_id,
FALSE Success
*/
-static int get_part_id_hash(uint no_parts,
+static int get_part_id_hash(uint num_parts,
Item *part_expr,
uint32 *part_id,
longlong *func_value)
@@ -2374,7 +2716,7 @@ static int get_part_id_hash(uint no_parts,
if (part_val_int(part_expr, func_value))
DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
- int_hash_id= *func_value % no_parts;
+ int_hash_id= *func_value % num_parts;
*part_id= int_hash_id < 0 ? (uint32) -int_hash_id : (uint32) int_hash_id;
DBUG_RETURN(FALSE);
@@ -2388,7 +2730,7 @@ static int get_part_id_hash(uint no_parts,
get_part_id_linear_hash()
part_info A reference to the partition_info struct where all the
desired information is given
- no_parts Number of hash partitions
+ num_parts Number of hash partitions
part_expr Item tree of hash function
out:part_id The returned partition id
out:func_value Value of hash function
@@ -2399,7 +2741,7 @@ static int get_part_id_hash(uint no_parts,
*/
static int get_part_id_linear_hash(partition_info *part_info,
- uint no_parts,
+ uint num_parts,
Item *part_expr,
uint32 *part_id,
longlong *func_value)
@@ -2411,7 +2753,7 @@ static int get_part_id_linear_hash(partition_info *part_info,
*part_id= get_part_id_from_linear_hash(*func_value,
part_info->linear_hash_mask,
- no_parts);
+ num_parts);
DBUG_RETURN(FALSE);
}
@@ -2422,7 +2764,7 @@ static int get_part_id_linear_hash(partition_info *part_info,
SYNOPSIS
get_part_id_key()
field_array Array of fields for PARTTION KEY
- no_parts Number of KEY partitions
+ num_parts Number of KEY partitions
RETURN VALUE
Calculated partition id
@@ -2430,12 +2772,12 @@ static int get_part_id_linear_hash(partition_info *part_info,
inline
static uint32 get_part_id_key(Field **field_array,
- uint no_parts,
+ uint num_parts,
longlong *func_value)
{
DBUG_ENTER("get_part_id_key");
*func_value= calculate_key_value(field_array);
- DBUG_RETURN((uint32) (*func_value % no_parts));
+ DBUG_RETURN((uint32) (*func_value % num_parts));
}
@@ -2447,7 +2789,7 @@ static uint32 get_part_id_key(Field **field_array,
part_info A reference to the partition_info struct where all the
desired information is given
field_array Array of fields for PARTTION KEY
- no_parts Number of KEY partitions
+ num_parts Number of KEY partitions
RETURN VALUE
Calculated partition id
@@ -2456,15 +2798,15 @@ static uint32 get_part_id_key(Field **field_array,
inline
static uint32 get_part_id_linear_key(partition_info *part_info,
Field **field_array,
- uint no_parts,
+ uint num_parts,
longlong *func_value)
{
- DBUG_ENTER("get_partition_id_linear_key");
+ DBUG_ENTER("get_part_id_linear_key");
*func_value= calculate_key_value(field_array);
DBUG_RETURN(get_part_id_from_linear_hash(*func_value,
part_info->linear_hash_mask,
- no_parts));
+ num_parts));
}
/*
@@ -2498,7 +2840,8 @@ static void copy_to_part_field_buffers(Field **ptr,
if (!field->maybe_null() || !field->is_null())
{
CHARSET_INFO *cs= ((Field_str*)field)->charset();
- uint len= field->pack_length();
+ uint max_len= field->pack_length();
+ uint data_len= field->data_length();
uchar *field_buf= *field_bufs;
/*
We only use the field buffer for VARCHAR and CHAR strings
@@ -2510,17 +2853,17 @@ static void copy_to_part_field_buffers(Field **ptr,
if (field->type() == MYSQL_TYPE_VARCHAR)
{
uint len_bytes= ((Field_varstring*)field)->length_bytes;
- my_strnxfrm(cs, field_buf + len_bytes, (len - len_bytes),
- field->ptr + len_bytes, field->field_length);
+ my_strnxfrm(cs, field_buf + len_bytes, max_len,
+ field->ptr + len_bytes, data_len);
if (len_bytes == 1)
- *field_buf= (uchar) field->field_length;
+ *field_buf= (uchar) data_len;
else
- int2store(field_buf, field->field_length);
+ int2store(field_buf, data_len);
}
else
{
- my_strnxfrm(cs, field_buf, len,
- field->ptr, field->field_length);
+ my_strnxfrm(cs, field_buf, max_len,
+ field->ptr, max_len);
}
field->ptr= field_buf;
}
@@ -2550,6 +2893,44 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
return;
}
+/*
+ This function is used to calculate the partition id where all partition
+ fields have been prepared to point to a record where the partition field
+ values are bound.
+
+ SYNOPSIS
+ get_partition_id()
+ part_info A reference to the partition_info struct where all the
+ desired information is given
+ out:part_id The partition id is returned through this pointer
+ out:func_value Value of partition function (longlong)
+
+ RETURN VALUE
+ part_id Partition id of partition that would contain
+ row with given values of PF-fields
+ HA_ERR_NO_PARTITION_FOUND The fields of the partition function didn't
+ fit into any partition and thus the values of
+ the PF-fields are not allowed.
+
+ DESCRIPTION
+ A routine used from write_row, update_row and delete_row from any
+ handler supporting partitioning. It is also a support routine for
+ get_partition_set used to find the set of partitions needed to scan
+ for a certain index scan or full table scan.
+
+ It is actually 9 different variants of this function which are called
+ through a function pointer.
+
+ get_partition_id_list
+ get_partition_id_list_col
+ get_partition_id_range
+ get_partition_id_range_col
+ get_partition_id_hash_nosub
+ get_partition_id_key_nosub
+ get_partition_id_linear_hash_nosub
+ get_partition_id_linear_key_nosub
+ get_partition_id_with_sub
+*/
/*
This function is used to calculate the main partition to use in the case of
@@ -2571,67 +2952,26 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
DESCRIPTION
- It is actually 6 different variants of this function which are called
+ It is actually 8 different variants of this function which are called
through a function pointer.
get_partition_id_list
+ get_partition_id_list_col
get_partition_id_range
+ get_partition_id_range_col
get_partition_id_hash_nosub
get_partition_id_key_nosub
get_partition_id_linear_hash_nosub
get_partition_id_linear_key_nosub
*/
-static int get_part_id_charset_func_subpart(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- int res;
- copy_to_part_field_buffers(part_info->subpart_charset_field_array,
- part_info->subpart_field_buffers,
- part_info->restore_subpart_field_ptrs);
- res= part_info->get_partition_id_charset(part_info, part_id, func_value);
- restore_part_field_pointers(part_info->subpart_charset_field_array,
- part_info->restore_subpart_field_ptrs);
- return res;
-}
-
-
static int get_part_id_charset_func_part(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
int res;
- copy_to_part_field_buffers(part_info->part_charset_field_array,
- part_info->part_field_buffers,
- part_info->restore_part_field_ptrs);
- res= part_info->get_partition_id_charset(part_info, part_id, func_value);
- restore_part_field_pointers(part_info->part_charset_field_array,
- part_info->restore_part_field_ptrs);
- return res;
-}
-
-
-static int get_part_id_charset_func_all(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- int res;
- copy_to_part_field_buffers(part_info->full_part_field_array,
- part_info->full_part_field_buffers,
- part_info->restore_full_part_field_ptrs);
- res= part_info->get_partition_id_charset(part_info, part_id, func_value);
- restore_part_field_pointers(part_info->full_part_field_array,
- part_info->restore_full_part_field_ptrs);
- return res;
-}
-
+ DBUG_ENTER("get_part_id_charset_func_part");
-static int get_part_part_id_charset_func(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- int res;
copy_to_part_field_buffers(part_info->part_charset_field_array,
part_info->part_field_buffers,
part_info->restore_part_field_ptrs);
@@ -2639,21 +2979,58 @@ static int get_part_part_id_charset_func(partition_info *part_info,
part_id, func_value);
restore_part_field_pointers(part_info->part_charset_field_array,
part_info->restore_part_field_ptrs);
- return res;
+ DBUG_RETURN(res);
}
-static int get_subpart_id_charset_func(partition_info *part_info,
- uint32 *part_id)
+static int get_part_id_charset_func_subpart(partition_info *part_info,
+ uint32 *part_id)
{
int res;
+ DBUG_ENTER("get_part_id_charset_func_subpart");
+
copy_to_part_field_buffers(part_info->subpart_charset_field_array,
part_info->subpart_field_buffers,
part_info->restore_subpart_field_ptrs);
res= part_info->get_subpartition_id_charset(part_info, part_id);
restore_part_field_pointers(part_info->subpart_charset_field_array,
part_info->restore_subpart_field_ptrs);
- return res;
+ DBUG_RETURN(res);
+}
+
+int get_partition_id_list_col(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value)
+{
+ part_column_list_val *list_col_array= part_info->list_col_array;
+ uint num_columns= part_info->part_field_list.elements;
+ int list_index, cmp;
+ int min_list_index= 0;
+ int max_list_index= part_info->num_list_values - 1;
+ DBUG_ENTER("get_partition_id_list_col");
+
+ while (max_list_index >= min_list_index)
+ {
+ list_index= (max_list_index + min_list_index) >> 1;
+ cmp= cmp_rec_and_tuple(list_col_array + list_index*num_columns,
+ num_columns);
+ if (cmp > 0)
+ min_list_index= list_index + 1;
+ else if (cmp < 0)
+ {
+ if (!list_index)
+ goto notfound;
+ max_list_index= list_index - 1;
+ }
+ else
+ {
+ *part_id= (uint32)list_col_array[list_index].partition_id;
+ DBUG_RETURN(0);
+ }
+ }
+notfound:
+ *part_id= 0;
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
}
@@ -2664,7 +3041,7 @@ int get_partition_id_list(partition_info *part_info,
LIST_PART_ENTRY *list_array= part_info->list_array;
int list_index;
int min_list_index= 0;
- int max_list_index= part_info->no_list_values - 1;
+ int max_list_index= part_info->num_list_values - 1;
longlong part_func_value;
int error= part_val_int(part_info->part_expr, &part_func_value);
longlong list_value;
@@ -2734,7 +3111,7 @@ notfound:
index idx.
The function returns first number idx, such that
list_array[idx].list_value is NOT contained within the passed interval.
- If all array elements are contained, part_info->no_list_values is
+ If all array elements are contained, part_info->num_list_values is
returned.
NOTE
@@ -2748,6 +3125,44 @@ notfound:
The edge of corresponding sub-array of part_info->list_array
*/
+uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info,
+ bool left_endpoint,
+ bool include_endpoint,
+ uint32 nparts)
+{
+ part_column_list_val *list_col_array= part_info->list_col_array;
+ uint num_columns= part_info->part_field_list.elements;
+ int list_index, cmp;
+ uint min_list_index= 0;
+ uint max_list_index= part_info->num_list_values - 1;
+ bool tailf= !(left_endpoint ^ include_endpoint);
+ DBUG_ENTER("get_partition_id_cols_list_for_endpoint");
+
+ do
+ {
+ list_index= (max_list_index + min_list_index) >> 1;
+ cmp= cmp_rec_and_tuple_prune(list_col_array + list_index*num_columns,
+ nparts, tailf);
+ if (cmp > 0)
+ min_list_index= list_index + 1;
+ else if (cmp < 0)
+ {
+ if (!list_index)
+ goto notfound;
+ max_list_index= list_index - 1;
+ }
+ else
+ {
+ DBUG_RETURN(list_index + test(!tailf));
+ }
+ } while (max_list_index >= min_list_index);
+ if (cmp > 0)
+ list_index++;
+notfound:
+ DBUG_RETURN(list_index);
+}
+
+
uint32 get_list_array_idx_for_endpoint_charset(partition_info *part_info,
bool left_endpoint,
bool include_endpoint)
@@ -2769,7 +3184,7 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
{
LIST_PART_ENTRY *list_array= part_info->list_array;
uint list_index;
- uint min_list_index= 0, max_list_index= part_info->no_list_values - 1;
+ uint min_list_index= 0, max_list_index= part_info->num_list_values - 1;
longlong list_value;
/* Get the partitioning function value for the endpoint */
longlong part_func_value=
@@ -2799,7 +3214,7 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
if (unsigned_flag)
part_func_value-= 0x8000000000000000ULL;
- DBUG_ASSERT(part_info->no_list_values);
+ DBUG_ASSERT(part_info->num_list_values);
do
{
list_index= (max_list_index + min_list_index) >> 1;
@@ -2824,12 +3239,49 @@ notfound:
}
+int get_partition_id_range_col(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value)
+{
+ part_column_list_val *range_col_array= part_info->range_col_array;
+ uint num_columns= part_info->part_field_list.elements;
+ uint max_partition= part_info->num_parts - 1;
+ uint min_part_id= 0;
+ uint max_part_id= max_partition;
+ uint loc_part_id;
+ DBUG_ENTER("get_partition_id_range_col");
+
+ while (max_part_id > min_part_id)
+ {
+ loc_part_id= (max_part_id + min_part_id + 1) >> 1;
+ if (cmp_rec_and_tuple(range_col_array + loc_part_id*num_columns,
+ num_columns) >= 0)
+ min_part_id= loc_part_id + 1;
+ else
+ max_part_id= loc_part_id - 1;
+ }
+ loc_part_id= max_part_id;
+ if (loc_part_id != max_partition)
+ if (cmp_rec_and_tuple(range_col_array + loc_part_id*num_columns,
+ num_columns) >= 0)
+ loc_part_id++;
+ *part_id= (uint32)loc_part_id;
+ if (loc_part_id == max_partition &&
+ (cmp_rec_and_tuple(range_col_array + loc_part_id*num_columns,
+ num_columns) >= 0))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
+ DBUG_PRINT("exit",("partition: %d", *part_id));
+ DBUG_RETURN(0);
+}
+
+
int get_partition_id_range(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
longlong *range_array= part_info->range_int_array;
- uint max_partition= part_info->no_parts - 1;
+ uint max_partition= part_info->num_parts - 1;
uint min_part_id= 0;
uint max_part_id= max_partition;
uint loc_part_id;
@@ -2906,7 +3358,7 @@ int get_partition_id_range(partition_info *part_info,
represented by range_int_array[idx] has EMPTY intersection with the
passed interval.
If the interval represented by the last array element has non-empty
- intersection with the passed interval, part_info->no_parts is
+ intersection with the passed interval, part_info->num_parts is
returned.
RETURN
@@ -2934,7 +3386,7 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
bool include_endpoint)
{
longlong *range_array= part_info->range_int_array;
- uint max_partition= part_info->no_parts - 1;
+ uint max_partition= part_info->num_parts - 1;
uint min_part_id= 0, max_part_id= max_partition, loc_part_id;
/* Get the partitioning function value for the endpoint */
longlong part_func_value=
@@ -3017,7 +3469,7 @@ int get_partition_id_hash_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
- return get_part_id_hash(part_info->no_parts, part_info->part_expr,
+ return get_part_id_hash(part_info->num_parts, part_info->part_expr,
part_id, func_value);
}
@@ -3026,7 +3478,7 @@ int get_partition_id_linear_hash_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
- return get_part_id_linear_hash(part_info, part_info->no_parts,
+ return get_part_id_linear_hash(part_info, part_info->num_parts,
part_info->part_expr, part_id, func_value);
}
@@ -3036,232 +3488,44 @@ int get_partition_id_key_nosub(partition_info *part_info,
longlong *func_value)
{
*part_id= get_part_id_key(part_info->part_field_array,
- part_info->no_parts, func_value);
+ part_info->num_parts, func_value);
return 0;
}
int get_partition_id_linear_key_nosub(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
+ uint32 *part_id,
+ longlong *func_value)
{
*part_id= get_part_id_linear_key(part_info,
part_info->part_field_array,
- part_info->no_parts, func_value);
+ part_info->num_parts, func_value);
return 0;
}
-int get_partition_id_range_sub_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_range_sub_hash");
- LINT_INIT(loc_part_id);
- LINT_INIT(sub_part_id);
-
- if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- if (unlikely((error= get_part_id_hash(no_subparts, part_info->subpart_expr,
- &sub_part_id, &local_func_value))))
- {
- DBUG_RETURN(error);
- }
-
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_range_sub_linear_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_range_sub_linear_hash");
- LINT_INIT(loc_part_id);
- LINT_INIT(sub_part_id);
-
- if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- if (unlikely((error= get_part_id_linear_hash(part_info, no_subparts,
- part_info->subpart_expr,
- &sub_part_id,
- &local_func_value))))
- {
- DBUG_RETURN(error);
- }
-
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_range_sub_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_range_sub_key");
- LINT_INIT(loc_part_id);
-
- if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_key(part_info->subpart_field_array,
- no_subparts, &local_func_value);
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_range_sub_linear_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_range_sub_linear_key");
- LINT_INIT(loc_part_id);
-
- if (unlikely((error= get_partition_id_range(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_linear_key(part_info,
- part_info->subpart_field_array,
- no_subparts, &local_func_value);
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_list_sub_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_list_sub_hash");
- LINT_INIT(sub_part_id);
-
- if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- if (unlikely((error= get_part_id_hash(no_subparts, part_info->subpart_expr,
- &sub_part_id, &local_func_value))))
- {
- DBUG_RETURN(error);
- }
-
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_list_sub_linear_hash(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_list_sub_linear_hash");
- LINT_INIT(sub_part_id);
-
- if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
- func_value))))
- {
- DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- if (unlikely((error= get_part_id_linear_hash(part_info, no_subparts,
- part_info->subpart_expr,
- &sub_part_id,
- &local_func_value))))
- {
- DBUG_RETURN(error);
- }
-
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_list_sub_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
+int get_partition_id_with_sub(partition_info *part_info,
+ uint32 *part_id,
+ longlong *func_value)
{
uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
+ uint num_subparts;
int error;
- DBUG_ENTER("get_partition_id_range_sub_key");
+ DBUG_ENTER("get_partition_id_with_sub");
- if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
- func_value))))
+ if (unlikely((error= part_info->get_part_partition_id(part_info,
+ &loc_part_id,
+ func_value))))
{
DBUG_RETURN(error);
}
- no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_key(part_info->subpart_field_array,
- no_subparts, &local_func_value);
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
- DBUG_RETURN(0);
-}
-
-
-int get_partition_id_list_sub_linear_key(partition_info *part_info,
- uint32 *part_id,
- longlong *func_value)
-{
- uint32 loc_part_id, sub_part_id;
- uint no_subparts;
- longlong local_func_value;
- int error;
- DBUG_ENTER("get_partition_id_list_sub_linear_key");
-
- if (unlikely((error= get_partition_id_list(part_info, &loc_part_id,
- func_value))))
+ num_subparts= part_info->num_subparts;
+ if (unlikely((error= part_info->get_subpartition_id(part_info,
+ &sub_part_id))))
{
DBUG_RETURN(error);
- }
- no_subparts= part_info->no_subparts;
- sub_part_id= get_part_id_linear_key(part_info,
- part_info->subpart_field_array,
- no_subparts, &local_func_value);
- *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, no_subparts);
+ }
+ *part_id= get_part_id_for_sub(loc_part_id, sub_part_id, num_subparts);
DBUG_RETURN(0);
}
@@ -3294,7 +3558,7 @@ int get_partition_id_hash_sub(partition_info *part_info,
uint32 *part_id)
{
longlong func_value;
- return get_part_id_hash(part_info->no_subparts, part_info->subpart_expr,
+ return get_part_id_hash(part_info->num_subparts, part_info->subpart_expr,
part_id, &func_value);
}
@@ -3303,7 +3567,7 @@ int get_partition_id_linear_hash_sub(partition_info *part_info,
uint32 *part_id)
{
longlong func_value;
- return get_part_id_linear_hash(part_info, part_info->no_subparts,
+ return get_part_id_linear_hash(part_info, part_info->num_subparts,
part_info->subpart_expr, part_id,
&func_value);
}
@@ -3314,7 +3578,7 @@ int get_partition_id_key_sub(partition_info *part_info,
{
longlong func_value;
*part_id= get_part_id_key(part_info->subpart_field_array,
- part_info->no_subparts, &func_value);
+ part_info->num_subparts, &func_value);
return FALSE;
}
@@ -3325,7 +3589,7 @@ int get_partition_id_linear_key_sub(partition_info *part_info,
longlong func_value;
*part_id= get_part_id_linear_key(part_info,
part_info->subpart_field_array,
- part_info->no_subparts, &func_value);
+ part_info->num_subparts, &func_value);
return FALSE;
}
@@ -3624,16 +3888,16 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
const key_range *key_spec, part_id_range *part_spec)
{
partition_info *part_info= table->part_info;
- uint no_parts= part_info->get_tot_partitions();
+ uint num_parts= part_info->get_tot_partitions();
uint i, part_id;
- uint sub_part= no_parts;
- uint32 part_part= no_parts;
+ uint sub_part= num_parts;
+ uint32 part_part= num_parts;
KEY *key_info= NULL;
bool found_part_field= FALSE;
DBUG_ENTER("get_partition_set");
part_spec->start_part= 0;
- part_spec->end_part= no_parts - 1;
+ part_spec->end_part= num_parts - 1;
if ((index < MAX_KEY) &&
key_spec->flag == (uint)HA_READ_KEY_EXACT &&
part_info->some_fields_in_PF.is_set(index))
@@ -3670,7 +3934,7 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
{
if (get_sub_part_id_from_key(table, buf, key_info, key_spec, &sub_part))
{
- part_spec->start_part= no_parts;
+ part_spec->start_part= num_parts;
DBUG_VOID_RETURN;
}
}
@@ -3684,7 +3948,7 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
allowed values. Thus it is certain that the result of this
scan will be empty.
*/
- part_spec->start_part= no_parts;
+ part_spec->start_part= num_parts;
DBUG_VOID_RETURN;
}
}
@@ -3722,7 +3986,7 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
{
if (get_sub_part_id_from_key(table, buf, key_info, key_spec, &sub_part))
{
- part_spec->start_part= no_parts;
+ part_spec->start_part= num_parts;
clear_indicator_in_key_fields(key_info);
DBUG_VOID_RETURN;
}
@@ -3731,7 +3995,7 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
{
if (get_part_id_from_key(table,buf,key_info,key_spec,&part_part))
{
- part_spec->start_part= no_parts;
+ part_spec->start_part= num_parts;
clear_indicator_in_key_fields(key_info);
DBUG_VOID_RETURN;
}
@@ -3752,29 +4016,29 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
nothing or we have discovered a range of partitions with possible holes
in it. We need a bitvector to further the work here.
*/
- if (!(part_part == no_parts && sub_part == no_parts))
+ if (!(part_part == num_parts && sub_part == num_parts))
{
/*
We can only arrive here if we are using subpartitioning.
*/
- if (part_part != no_parts)
+ if (part_part != num_parts)
{
/*
We know the top partition and need to scan all underlying
subpartitions. This is a range without holes.
*/
- DBUG_ASSERT(sub_part == no_parts);
- part_spec->start_part= part_part * part_info->no_subparts;
- part_spec->end_part= part_spec->start_part+part_info->no_subparts - 1;
+ DBUG_ASSERT(sub_part == num_parts);
+ part_spec->start_part= part_part * part_info->num_subparts;
+ part_spec->end_part= part_spec->start_part+part_info->num_subparts - 1;
}
else
{
- DBUG_ASSERT(sub_part != no_parts);
+ DBUG_ASSERT(sub_part != num_parts);
part_spec->start_part= sub_part;
part_spec->end_part=sub_part+
- (part_info->no_subparts*(part_info->no_parts-1));
- for (i= 0, part_id= sub_part; i < part_info->no_parts;
- i++, part_id+= part_info->no_subparts)
+ (part_info->num_subparts*(part_info->num_parts-1));
+ for (i= 0, part_id= sub_part; i < part_info->num_parts;
+ i++, part_id+= part_info->num_subparts)
; //Set bit part_id in bit array
}
}
@@ -3893,10 +4157,12 @@ bool mysql_unpack_partition(THD *thd,
mem_alloc_error(sizeof(partition_info));
goto end;
}
- lex.part_info->part_state= part_state;
- lex.part_info->part_state_len= part_state_len;
+ part_info= lex.part_info;
+ part_info->part_state= part_state;
+ part_info->part_state_len= part_state_len;
DBUG_PRINT("info", ("Parse: %s", part_buf));
- if (parse_sql(thd, & parser_state, NULL))
+ if (parse_sql(thd, & parser_state, NULL) ||
+ part_info->fix_parser_data(thd))
{
thd->free_items();
goto end;
@@ -3917,7 +4183,6 @@ bool mysql_unpack_partition(THD *thd,
*/
DBUG_PRINT("info", ("Successful parse"));
- part_info= lex.part_info;
DBUG_PRINT("info", ("default engine = %s, default_db_type = %s",
ha_resolve_storage_engine_name(part_info->default_engine_type),
ha_resolve_storage_engine_name(default_db_type)));
@@ -4038,9 +4303,9 @@ set_engine_all_partitions(partition_info *part_info,
partition_element *sub_elem= sub_it++;
sub_elem->engine_type= engine_type;
- } while (++j < part_info->no_subparts);
+ } while (++j < part_info->num_subparts);
}
- } while (++i < part_info->no_parts);
+ } while (++i < part_info->num_parts);
}
/*
SYNOPSIS
@@ -4185,7 +4450,7 @@ uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
enum partition_state part_state)
{
uint part_count= 0;
- uint no_parts_found= 0;
+ uint num_parts_found= 0;
List_iterator<partition_element> part_it(tab_part_info->partitions);
do
@@ -4198,15 +4463,17 @@ uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
/*
Mark the partition.
I.e mark the partition as a partition to be "changed" by
- analyzing/optimizing/rebuilding/checking/repairing
+ analyzing/optimizing/rebuilding/checking/repairing/...
*/
- no_parts_found++;
+ num_parts_found++;
part_elem->part_state= part_state;
DBUG_PRINT("info", ("Setting part_state to %u for partition %s",
part_state, part_elem->partition_name));
}
- } while (++part_count < tab_part_info->no_parts);
- return no_parts_found;
+ else
+ part_elem->part_state= PART_NORMAL;
+ } while (++part_count < tab_part_info->num_parts);
+ return num_parts_found;
}
@@ -4273,6 +4540,11 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
partition_info *tab_part_info= table->part_info;
partition_info *alt_part_info= thd->work_part_info;
uint flags= 0;
+ bool is_last_partition_reorged;
+ part_elem_value *tab_max_elem_val= NULL;
+ part_elem_value *alt_max_elem_val= NULL;
+ longlong tab_max_range= 0, alt_max_range= 0;
+
if (!tab_part_info)
{
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
@@ -4282,13 +4554,13 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
{
uint new_part_no, curr_part_no;
if (tab_part_info->part_type != HASH_PARTITION ||
- tab_part_info->use_default_no_partitions)
+ tab_part_info->use_default_num_partitions)
{
my_error(ER_REORG_NO_PARAM_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
new_part_no= table->file->get_default_no_partitions(create_info);
- curr_part_no= tab_part_info->no_parts;
+ curr_part_no= tab_part_info->num_parts;
if (new_part_no == curr_part_no)
{
/*
@@ -4306,7 +4578,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
setting the flag for no default number of partitions
*/
alter_info->flags|= ALTER_ADD_PARTITION;
- thd->work_part_info->no_parts= new_part_no - curr_part_no;
+ thd->work_part_info->num_parts= new_part_no - curr_part_no;
}
else
{
@@ -4315,7 +4587,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
without setting the flag for no default number of partitions
*/
alter_info->flags|= ALTER_COALESCE_PARTITION;
- alter_info->no_parts= curr_part_no - new_part_no;
+ alter_info->num_parts= curr_part_no - new_part_no;
}
}
if (!(flags= table->file->alter_table_flags(alter_info->flags)))
@@ -4327,34 +4599,73 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0);
DBUG_PRINT("info", ("*fast_alter_partition: %d flags: 0x%x",
*fast_alter_partition, flags));
- if (((alter_info->flags & ALTER_ADD_PARTITION) ||
- (alter_info->flags & ALTER_REORGANIZE_PARTITION)) &&
- (thd->work_part_info->part_type != tab_part_info->part_type) &&
- (thd->work_part_info->part_type != NOT_A_PARTITION))
+ if ((alter_info->flags & ALTER_ADD_PARTITION) ||
+ (alter_info->flags & ALTER_REORGANIZE_PARTITION))
{
- if (thd->work_part_info->part_type == RANGE_PARTITION)
- {
- my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
- "RANGE", "LESS THAN");
- }
- else if (thd->work_part_info->part_type == LIST_PARTITION)
+ if (thd->work_part_info->part_type != tab_part_info->part_type)
{
- DBUG_ASSERT(thd->work_part_info->part_type == LIST_PARTITION);
- my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
- "LIST", "IN");
+ if (thd->work_part_info->part_type == NOT_A_PARTITION)
+ {
+ if (tab_part_info->part_type == RANGE_PARTITION)
+ {
+ my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), "RANGE");
+ DBUG_RETURN(TRUE);
+ }
+ else if (tab_part_info->part_type == LIST_PARTITION)
+ {
+ my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), "LIST");
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ Hash partitions can be altered without parser finds out about
+ that it is HASH partitioned. So no error here.
+ */
+ }
+ else
+ {
+ if (thd->work_part_info->part_type == RANGE_PARTITION)
+ {
+ my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
+ "RANGE", "LESS THAN");
+ }
+ else if (thd->work_part_info->part_type == LIST_PARTITION)
+ {
+ DBUG_ASSERT(thd->work_part_info->part_type == LIST_PARTITION);
+ my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
+ "LIST", "IN");
+ }
+ else if (tab_part_info->part_type == RANGE_PARTITION)
+ {
+ my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
+ "RANGE", "LESS THAN");
+ }
+ else
+ {
+ DBUG_ASSERT(tab_part_info->part_type == LIST_PARTITION);
+ my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
+ "LIST", "IN");
+ }
+ DBUG_RETURN(TRUE);
+ }
}
- else if (tab_part_info->part_type == RANGE_PARTITION)
+ if ((tab_part_info->column_list &&
+ alt_part_info->num_columns != tab_part_info->num_columns) ||
+ (!tab_part_info->column_list &&
+ (tab_part_info->part_type == RANGE_PARTITION ||
+ tab_part_info->part_type == LIST_PARTITION) &&
+ alt_part_info->num_columns != 1U) ||
+ (!tab_part_info->column_list &&
+ tab_part_info->part_type == HASH_PARTITION &&
+ alt_part_info->num_columns != 0))
{
- my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "RANGE", "LESS THAN");
+ my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
}
- else
+ alt_part_info->column_list= tab_part_info->column_list;
+ if (alt_part_info->fix_parser_data(thd))
{
- DBUG_ASSERT(tab_part_info->part_type == LIST_PARTITION);
- my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "LIST", "IN");
+ DBUG_RETURN(TRUE);
}
- DBUG_RETURN(TRUE);
}
if (alter_info->flags & ALTER_ADD_PARTITION)
{
@@ -4364,9 +4675,9 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
partitioning scheme as currently set-up.
Partitions are always added at the end in ADD PARTITION.
*/
- uint no_new_partitions= alt_part_info->no_parts;
- uint no_orig_partitions= tab_part_info->no_parts;
- uint check_total_partitions= no_new_partitions + no_orig_partitions;
+ uint num_new_partitions= alt_part_info->num_parts;
+ uint num_orig_partitions= tab_part_info->num_parts;
+ uint check_total_partitions= num_new_partitions + num_orig_partitions;
uint new_total_partitions= check_total_partitions;
/*
We allow quite a lot of values to be supplied by defaults, however we
@@ -4383,22 +4694,22 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
my_error(ER_PARTITION_MAXVALUE_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
- if (no_new_partitions == 0)
+ if (num_new_partitions == 0)
{
my_error(ER_ADD_PARTITION_NO_NEW_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
}
if (tab_part_info->is_sub_partitioned())
{
- if (alt_part_info->no_subparts == 0)
- alt_part_info->no_subparts= tab_part_info->no_subparts;
- else if (alt_part_info->no_subparts != tab_part_info->no_subparts)
+ if (alt_part_info->num_subparts == 0)
+ alt_part_info->num_subparts= tab_part_info->num_subparts;
+ else if (alt_part_info->num_subparts != tab_part_info->num_subparts)
{
my_error(ER_ADD_PARTITION_SUBPART_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
check_total_partitions= new_total_partitions*
- alt_part_info->no_subparts;
+ alt_part_info->num_subparts;
}
if (check_total_partitions > MAX_PARTITIONS)
{
@@ -4408,8 +4719,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
if (alt_part_info->set_up_defaults_for_partitioning(table->file,
- ULL(0),
- tab_part_info->no_parts))
+ ULL(0),
+ tab_part_info->num_parts))
{
DBUG_RETURN(TRUE);
}
@@ -4484,7 +4795,7 @@ that are reorganised.
uint lower_2n= upper_2n >> 1;
bool all_parts= TRUE;
if (tab_part_info->linear_hash_ind &&
- no_new_partitions < upper_2n)
+ num_new_partitions < upper_2n)
{
/*
An analysis of which parts needs reorganisation shows that it is
@@ -4493,7 +4804,7 @@ that are reorganised.
onwards it starts again from partition 0 and goes on until
it reaches p(upper_2n - 1). If the last new partition reaches
beyond upper_2n - 1 then the first interval will end with
- p(lower_2n - 1) and start with p(no_orig_partitions - lower_2n).
+ p(lower_2n - 1) and start with p(num_orig_partitions - lower_2n).
If lower_2n partitions are added then p0 to p(lower_2n - 1) will
be reorganised which means that the two interval becomes one
interval at this point. Thus only when adding less than
@@ -4521,7 +4832,7 @@ that are reorganised.
to TRUE. In this case we don't get into this if-part at all.
*/
all_parts= FALSE;
- if (no_new_partitions >= lower_2n)
+ if (num_new_partitions >= lower_2n)
{
/*
In this case there is only one interval since the two intervals
@@ -4537,8 +4848,8 @@ that are reorganised.
Also in this case there is only one interval since we are not
going over a 2**n boundary
*/
- start_part= no_orig_partitions - lower_2n;
- end_part= start_part + (no_new_partitions - 1);
+ start_part= num_orig_partitions - lower_2n;
+ end_part= start_part + (num_new_partitions - 1);
}
else
{
@@ -4547,7 +4858,7 @@ that are reorganised.
new parts that would ensure that the intervals become
overlapping.
*/
- start_part= no_orig_partitions - lower_2n;
+ start_part= num_orig_partitions - lower_2n;
end_part= upper_2n - 1;
start_sec_part= 0;
end_sec_part= new_total_partitions - (upper_2n + 1);
@@ -4564,7 +4875,7 @@ that are reorganised.
{
p_elem->part_state= PART_CHANGED;
}
- } while (++part_no < no_orig_partitions);
+ } while (++part_no < num_orig_partitions);
}
/*
Need to concatenate the lists here to make it possible to check the
@@ -4587,8 +4898,8 @@ that are reorganised.
mem_alloc_error(1);
DBUG_RETURN(TRUE);
}
- } while (++part_count < no_new_partitions);
- tab_part_info->no_parts+= no_new_partitions;
+ } while (++part_count < num_new_partitions);
+ tab_part_info->num_parts+= num_new_partitions;
}
/*
If we specify partitions explicitly we don't use defaults anymore.
@@ -4603,7 +4914,7 @@ that are reorganised.
DBUG_PRINT("info", ("part_info: 0x%lx", (long) tab_part_info));
tab_part_info->use_default_partitions= FALSE;
}
- tab_part_info->use_default_no_partitions= FALSE;
+ tab_part_info->use_default_num_partitions= FALSE;
tab_part_info->is_auto_partitioned= FALSE;
}
}
@@ -4617,8 +4928,8 @@ that are reorganised.
command to drop the partition failed in the middle.
*/
uint part_count= 0;
- uint no_parts_dropped= alter_info->partition_names.elements;
- uint no_parts_found= 0;
+ uint num_parts_dropped= alter_info->partition_names.elements;
+ uint num_parts_found= 0;
List_iterator<partition_element> part_it(tab_part_info->partitions);
tab_part_info->is_auto_partitioned= FALSE;
@@ -4628,7 +4939,7 @@ that are reorganised.
my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), "DROP");
DBUG_RETURN(TRUE);
}
- if (no_parts_dropped >= tab_part_info->no_parts)
+ if (num_parts_dropped >= tab_part_info->num_parts)
{
my_error(ER_DROP_LAST_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
@@ -4642,11 +4953,11 @@ that are reorganised.
/*
Set state to indicate that the partition is to be dropped.
*/
- no_parts_found++;
+ num_parts_found++;
part_elem->part_state= PART_TO_BE_DROPPED;
}
- } while (++part_count < tab_part_info->no_parts);
- if (no_parts_found != no_parts_dropped)
+ } while (++part_count < tab_part_info->num_parts);
+ if (num_parts_found != num_parts_dropped)
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "DROP");
DBUG_RETURN(TRUE);
@@ -4656,14 +4967,14 @@ that are reorganised.
my_error(ER_ROW_IS_REFERENCED, MYF(0));
DBUG_RETURN(TRUE);
}
- tab_part_info->no_parts-= no_parts_dropped;
+ tab_part_info->num_parts-= num_parts_dropped;
}
else if (alter_info->flags & ALTER_REBUILD_PARTITION)
{
- uint no_parts_found;
- uint no_parts_opt= alter_info->partition_names.elements;
- no_parts_found= set_part_state(alter_info, tab_part_info, PART_CHANGED);
- if (no_parts_found != no_parts_opt &&
+ uint num_parts_found;
+ uint num_parts_opt= alter_info->partition_names.elements;
+ num_parts_found= set_part_state(alter_info, tab_part_info, PART_CHANGED);
+ if (num_parts_found != num_parts_opt &&
(!(alter_info->flags & ALTER_ALL_PARTITION)))
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
@@ -4677,20 +4988,20 @@ that are reorganised.
}
else if (alter_info->flags & ALTER_COALESCE_PARTITION)
{
- uint no_parts_coalesced= alter_info->no_parts;
- uint no_parts_remain= tab_part_info->no_parts - no_parts_coalesced;
+ uint num_parts_coalesced= alter_info->num_parts;
+ uint num_parts_remain= tab_part_info->num_parts - num_parts_coalesced;
List_iterator<partition_element> part_it(tab_part_info->partitions);
if (tab_part_info->part_type != HASH_PARTITION)
{
my_error(ER_COALESCE_ONLY_ON_HASH_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
}
- if (no_parts_coalesced == 0)
+ if (num_parts_coalesced == 0)
{
my_error(ER_COALESCE_PARTITION_NO_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
}
- if (no_parts_coalesced >= tab_part_info->no_parts)
+ if (num_parts_coalesced >= tab_part_info->num_parts)
{
my_error(ER_DROP_LAST_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
@@ -4738,21 +5049,21 @@ state of p1.
uint upper_2n= tab_part_info->linear_hash_mask + 1;
uint lower_2n= upper_2n >> 1;
all_parts= FALSE;
- if (no_parts_coalesced >= lower_2n)
+ if (num_parts_coalesced >= lower_2n)
{
all_parts= TRUE;
}
- else if (no_parts_remain >= lower_2n)
+ else if (num_parts_remain >= lower_2n)
{
- end_part= tab_part_info->no_parts - (lower_2n + 1);
- start_part= no_parts_remain - lower_2n;
+ end_part= tab_part_info->num_parts - (lower_2n + 1);
+ start_part= num_parts_remain - lower_2n;
}
else
{
start_part= 0;
- end_part= tab_part_info->no_parts - (lower_2n + 1);
+ end_part= tab_part_info->num_parts - (lower_2n + 1);
end_sec_part= (lower_2n >> 1) - 1;
- start_sec_part= end_sec_part - (lower_2n - (no_parts_remain + 1));
+ start_sec_part= end_sec_part - (lower_2n - (num_parts_remain + 1));
}
}
do
@@ -4763,19 +5074,19 @@ state of p1.
(part_count >= start_part && part_count <= end_part) ||
(part_count >= start_sec_part && part_count <= end_sec_part)))
p_elem->part_state= PART_CHANGED;
- if (++part_count > no_parts_remain)
+ if (++part_count > num_parts_remain)
{
if (*fast_alter_partition)
p_elem->part_state= PART_REORGED_DROPPED;
else
part_it.remove();
}
- } while (part_count < tab_part_info->no_parts);
- tab_part_info->no_parts= no_parts_remain;
+ } while (part_count < tab_part_info->num_parts);
+ tab_part_info->num_parts= num_parts_remain;
}
if (!(alter_info->flags & ALTER_TABLE_REORG))
{
- tab_part_info->use_default_no_partitions= FALSE;
+ tab_part_info->use_default_num_partitions= FALSE;
tab_part_info->is_auto_partitioned= FALSE;
}
}
@@ -4792,33 +5103,32 @@ state of p1.
range as those changed from.
This command can be used on RANGE and LIST partitions.
*/
- uint no_parts_reorged= alter_info->partition_names.elements;
- uint no_parts_new= thd->work_part_info->partitions.elements;
- partition_info *alt_part_info= thd->work_part_info;
+ uint num_parts_reorged= alter_info->partition_names.elements;
+ uint num_parts_new= thd->work_part_info->partitions.elements;
uint check_total_partitions;
tab_part_info->is_auto_partitioned= FALSE;
- if (no_parts_reorged > tab_part_info->no_parts)
+ if (num_parts_reorged > tab_part_info->num_parts)
{
my_error(ER_REORG_PARTITION_NOT_EXIST, MYF(0));
DBUG_RETURN(TRUE);
}
if (!(tab_part_info->part_type == RANGE_PARTITION ||
tab_part_info->part_type == LIST_PARTITION) &&
- (no_parts_new != no_parts_reorged))
+ (num_parts_new != num_parts_reorged))
{
my_error(ER_REORG_HASH_ONLY_ON_SAME_NO, MYF(0));
DBUG_RETURN(TRUE);
}
if (tab_part_info->is_sub_partitioned() &&
- alt_part_info->no_subparts &&
- alt_part_info->no_subparts != tab_part_info->no_subparts)
+ alt_part_info->num_subparts &&
+ alt_part_info->num_subparts != tab_part_info->num_subparts)
{
my_error(ER_PARTITION_WRONG_NO_SUBPART_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
- check_total_partitions= tab_part_info->no_parts + no_parts_new;
- check_total_partitions-= no_parts_reorged;
+ check_total_partitions= tab_part_info->num_parts + num_parts_new;
+ check_total_partitions-= num_parts_reorged;
if (check_total_partitions > MAX_PARTITIONS)
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
@@ -4826,7 +5136,7 @@ state of p1.
}
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
- alt_part_info->no_subparts= tab_part_info->no_subparts;
+ alt_part_info->num_subparts= tab_part_info->num_subparts;
DBUG_ASSERT(!alt_part_info->use_default_partitions);
if (alt_part_info->set_up_defaults_for_partitioning(table->file,
ULL(0),
@@ -4874,9 +5184,7 @@ the generated partition syntax in a correct manner.
uint part_count= 0;
bool found_first= FALSE;
bool found_last= FALSE;
- bool is_last_partition_reorged;
uint drop_count= 0;
- longlong tab_max_range= 0, alt_max_range= 0;
do
{
partition_element *part_elem= tab_it++;
@@ -4886,7 +5194,13 @@ the generated partition syntax in a correct manner.
{
is_last_partition_reorged= TRUE;
drop_count++;
- tab_max_range= part_elem->range_value;
+ if (tab_part_info->column_list)
+ {
+ List_iterator<part_elem_value> p(part_elem->list_val_list);
+ tab_max_elem_val= p++;
+ }
+ else
+ tab_max_range= part_elem->range_value;
if (*fast_alter_partition &&
tab_part_info->temp_partitions.push_back(part_elem))
{
@@ -4898,20 +5212,28 @@ the generated partition syntax in a correct manner.
if (!found_first)
{
uint alt_part_count= 0;
- found_first= TRUE;
+ partition_element *alt_part_elem;
List_iterator<partition_element>
alt_it(alt_part_info->partitions);
+ found_first= TRUE;
do
{
- partition_element *alt_part_elem= alt_it++;
- alt_max_range= alt_part_elem->range_value;
+ alt_part_elem= alt_it++;
+ if (tab_part_info->column_list)
+ {
+ List_iterator<part_elem_value> p(alt_part_elem->list_val_list);
+ alt_max_elem_val= p++;
+ }
+ else
+ alt_max_range= alt_part_elem->range_value;
+
if (*fast_alter_partition)
alt_part_elem->part_state= PART_TO_BE_ADDED;
if (alt_part_count == 0)
tab_it.replace(alt_part_elem);
else
tab_it.after(alt_part_elem);
- } while (++alt_part_count < no_parts_new);
+ } while (++alt_part_count < num_parts_new);
}
else if (found_last)
{
@@ -4926,32 +5248,13 @@ the generated partition syntax in a correct manner.
if (found_first)
found_last= TRUE;
}
- } while (++part_count < tab_part_info->no_parts);
- if (drop_count != no_parts_reorged)
+ } while (++part_count < tab_part_info->num_parts);
+ if (drop_count != num_parts_reorged)
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REORGANIZE");
DBUG_RETURN(TRUE);
}
- if (tab_part_info->part_type == RANGE_PARTITION &&
- ((is_last_partition_reorged &&
- alt_max_range < tab_max_range) ||
- (!is_last_partition_reorged &&
- alt_max_range != tab_max_range)))
- {
- /*
- For range partitioning the total resulting range before and
- after the change must be the same except in one case. This is
- when the last partition is reorganised, in this case it is
- acceptable to increase the total range.
- The reason is that it is not allowed to have "holes" in the
- middle of the ranges and thus we should not allow to reorganise
- to create "holes". Also we should not allow using REORGANIZE
- to drop data.
- */
- my_error(ER_REORG_OUTSIDE_RANGE, MYF(0));
- DBUG_RETURN(TRUE);
- }
- tab_part_info->no_parts= check_total_partitions;
+ tab_part_info->num_parts= check_total_partitions;
}
}
else
@@ -4967,13 +5270,45 @@ the generated partition syntax in a correct manner.
!alt_part_info->use_default_subpartitions)
{
tab_part_info->use_default_subpartitions= FALSE;
- tab_part_info->use_default_no_subpartitions= FALSE;
+ tab_part_info->use_default_num_subpartitions= FALSE;
}
if (tab_part_info->check_partition_info(thd, (handlerton**)NULL,
- table->file, ULL(0), FALSE))
+ table->file, ULL(0), TRUE))
{
DBUG_RETURN(TRUE);
}
+ /*
+ The check below needs to be performed after check_partition_info
+ since this function "fixes" the item trees of the new partitions
+ to reorganize into
+ */
+ if (alter_info->flags == ALTER_REORGANIZE_PARTITION &&
+ tab_part_info->part_type == RANGE_PARTITION &&
+ ((is_last_partition_reorged &&
+ (tab_part_info->column_list ?
+ (tab_part_info->compare_column_values(
+ alt_max_elem_val->col_val_array,
+ tab_max_elem_val->col_val_array) < 0) :
+ alt_max_range < tab_max_range)) ||
+ (!is_last_partition_reorged &&
+ (tab_part_info->column_list ?
+ (tab_part_info->compare_column_values(
+ alt_max_elem_val->col_val_array,
+ tab_max_elem_val->col_val_array) != 0) :
+ alt_max_range != tab_max_range))))
+ {
+ /*
+ For range partitioning the total resulting range before and
+ after the change must be the same except in one case. This is
+ when the last partition is reorganised, in this case it is
+ acceptable to increase the total range.
+ The reason is that it is not allowed to have "holes" in the
+ middle of the ranges and thus we should not allow to reorganise
+ to create "holes".
+ */
+ my_error(ER_REORG_OUTSIDE_RANGE, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
}
}
else
@@ -5087,6 +5422,10 @@ the generated partition syntax in a correct manner.
{
DBUG_PRINT("info", ("partition changed"));
*partition_changed= TRUE;
+ if (thd->work_part_info->fix_parser_data(thd))
+ {
+ DBUG_RETURN(TRUE);
+ }
}
/*
Set up partition default_engine_type either from the create_info
@@ -5247,8 +5586,8 @@ static bool mysql_drop_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
part_it.remove();
remove_count++;
}
- } while (++i < part_info->no_parts);
- part_info->no_parts-= remove_count;
+ } while (++i < part_info->num_parts);
+ part_info->num_parts-= remove_count;
DBUG_RETURN(FALSE);
}
@@ -5370,7 +5709,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
char normal_path[FN_REFLEN];
List_iterator<partition_element> part_it(part_info->partitions);
uint temp_partitions= part_info->temp_partitions.elements;
- uint no_elements= part_info->partitions.elements;
+ uint num_elements= part_info->partitions.elements;
uint i= 0;
DBUG_ENTER("write_log_changed_partitions");
@@ -5383,7 +5722,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
if (part_info->is_sub_partitioned())
{
List_iterator<partition_element> sub_it(part_elem->subpartitions);
- uint no_subparts= part_info->no_subparts;
+ uint num_subparts= part_info->num_subparts;
uint j= 0;
do
{
@@ -5412,7 +5751,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
*next_entry= log_entry->entry_pos;
sub_elem->log_entry= log_entry;
insert_part_info_log_entry_list(part_info, log_entry);
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -5440,7 +5779,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
insert_part_info_log_entry_list(part_info, log_entry);
}
}
- } while (++i < no_elements);
+ } while (++i < num_elements);
DBUG_RETURN(FALSE);
}
@@ -5466,14 +5805,14 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
char tmp_path[FN_LEN];
List_iterator<partition_element> part_it(part_info->partitions);
List_iterator<partition_element> temp_it(part_info->temp_partitions);
- uint no_temp_partitions= part_info->temp_partitions.elements;
- uint no_elements= part_info->partitions.elements;
+ uint num_temp_partitions= part_info->temp_partitions.elements;
+ uint num_elements= part_info->partitions.elements;
DBUG_ENTER("write_log_dropped_partitions");
ddl_log_entry.action_type= DDL_LOG_DELETE_ACTION;
if (temp_list)
- no_elements= no_temp_partitions;
- while (no_elements--)
+ num_elements= num_temp_partitions;
+ while (num_elements--)
{
partition_element *part_elem;
if (temp_list)
@@ -5487,14 +5826,14 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
uint name_variant;
if (part_elem->part_state == PART_CHANGED ||
(part_elem->part_state == PART_TO_BE_ADDED &&
- no_temp_partitions))
+ num_temp_partitions))
name_variant= TEMP_PART_NAME;
else
name_variant= NORMAL_PART_NAME;
if (part_info->is_sub_partitioned())
{
List_iterator<partition_element> sub_it(part_elem->subpartitions);
- uint no_subparts= part_info->no_subparts;
+ uint num_subparts= part_info->num_subparts;
uint j= 0;
do
{
@@ -5514,7 +5853,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
*next_entry= log_entry->entry_pos;
sub_elem->log_entry= log_entry;
insert_part_info_log_entry_list(part_info, log_entry);
- } while (++j < no_subparts);
+ } while (++j < num_subparts);
}
else
{
@@ -6612,16 +6951,19 @@ void make_used_partitions_str(partition_info *part_info, String *parts_str)
IMPLEMENTATION
There are two available interval analyzer functions:
(1) get_part_iter_for_interval_via_mapping
- (2) get_part_iter_for_interval_via_walking
+ (2) get_part_iter_for_interval_cols_via_map
+ (3) get_part_iter_for_interval_via_walking
They both have limited applicability:
(1) is applicable for "PARTITION BY <RANGE|LIST>(func(t.field))", where
func is a monotonic function.
-
- (2) is applicable for
+
+ (2) is applicable for "PARTITION BY <RANGE|LIST> COLUMNS (field_list)
+
+ (3) is applicable for
"[SUB]PARTITION BY <any-partitioning-type>(any_func(t.integer_field))"
- If both are applicable, (1) is preferred over (2).
+ If both (1) and (3) are applicable, (1) is preferred over (3).
This function sets part_info::get_part_iter_for_interval according to
this criteria, and also sets some auxilary fields that the function
@@ -6641,10 +6983,19 @@ static void set_up_range_analysis_info(partition_info *part_info)
switch (part_info->part_type) {
case RANGE_PARTITION:
case LIST_PARTITION:
- if (part_info->part_expr->get_monotonicity_info() != NON_MONOTONIC)
+ if (!part_info->column_list)
+ {
+ if (part_info->part_expr->get_monotonicity_info() != NON_MONOTONIC)
+ {
+ part_info->get_part_iter_for_interval=
+ get_part_iter_for_interval_via_mapping;
+ goto setup_subparts;
+ }
+ }
+ else
{
part_info->get_part_iter_for_interval=
- get_part_iter_for_interval_via_mapping;
+ get_part_iter_for_interval_cols_via_map;
goto setup_subparts;
}
default:
@@ -6655,7 +7006,7 @@ static void set_up_range_analysis_info(partition_info *part_info)
Check if get_part_iter_for_interval_via_walking() can be used for
partitioning
*/
- if (part_info->no_part_fields == 1)
+ if (part_info->num_part_fields == 1)
{
Field *field= part_info->part_field_array[0];
switch (field->type()) {
@@ -6677,7 +7028,7 @@ setup_subparts:
Check if get_part_iter_for_interval_via_walking() can be used for
subpartitioning
*/
- if (part_info->no_subpart_fields == 1)
+ if (part_info->num_subpart_fields == 1)
{
Field *field= part_info->subpart_field_array[0];
switch (field->type()) {
@@ -6695,9 +7046,118 @@ setup_subparts:
}
+/*
+ This function takes a memory of packed fields in opt-range format
+ and stores it in record format. To avoid having to worry about how
+ the length of fields are calculated in opt-range format we send
+ an array of lengths used for each field in store_length_array.
+
+ SYNOPSIS
+ store_tuple_to_record()
+ pfield Field array
+ store_length_array Array of field lengths
+ value Memory where fields are stored
+ value_end End of memory
+
+ RETURN VALUE
+ nparts Number of fields assigned
+*/
+uint32 store_tuple_to_record(Field **pfield,
+ uint32 *store_length_array,
+ uchar *value,
+ uchar *value_end)
+{
+ /* This function is inspired by store_key_image_rec. */
+ uint32 nparts= 0;
+ uchar *loc_value;
+ while (value < value_end)
+ {
+ loc_value= value;
+ if ((*pfield)->real_maybe_null())
+ {
+ if (*loc_value)
+ (*pfield)->set_null();
+ else
+ (*pfield)->set_notnull();
+ loc_value++;
+ }
+ uint len= (*pfield)->pack_length();
+ (*pfield)->set_key_image(loc_value, len);
+ value+= *store_length_array;
+ store_length_array++;
+ nparts++;
+ pfield++;
+ }
+ return nparts;
+}
+
+/*
+ RANGE(columns) partitioning: compare value bound and probe tuple.
+
+ The value bound always is a full tuple (but may include the MAXVALUE
+ special value).
+
+ The probe tuple may be a prefix of partitioning tuple. The tail_is_min
+ parameter specifies whether the suffix components should be assumed to
+ hold MAXVALUE
+*/
+
+static int cmp_rec_and_tuple(part_column_list_val *val, uint32 nvals_in_rec)
+{
+ partition_info *part_info= val->part_info;
+ Field **field= part_info->part_field_array;
+ Field **fields_end= field + nvals_in_rec;
+ int res;
+
+ for (; field != fields_end; field++, val++)
+ {
+ if (val->max_value)
+ return -1;
+ if ((*field)->is_null())
+ {
+ if (val->null_value)
+ continue;
+ return -1;
+ }
+ if (val->null_value)
+ return +1;
+ res= (*field)->cmp((const uchar*)val->column_value);
+ if (res)
+ return res;
+ }
+ return 0;
+}
+
+
+static int cmp_rec_and_tuple_prune(part_column_list_val *val,
+ uint32 n_vals_in_rec,
+ bool tail_is_min)
+{
+ int cmp;
+ Field **field;
+ partition_info *part_info;
+ if ((cmp= cmp_rec_and_tuple(val, n_vals_in_rec)))
+ return cmp;
+ part_info= val->part_info;
+ field= part_info->part_field_array + n_vals_in_rec;
+ for (; *field; field++, val++)
+ {
+ if (tail_is_min)
+ return -1;
+ if (!tail_is_min && !val->max_value)
+ return +1;
+ }
+ return 0;
+}
+
+
typedef uint32 (*get_endpoint_func)(partition_info*, bool left_endpoint,
bool include_endpoint);
+typedef uint32 (*get_col_endpoint_func)(partition_info*, bool left_endpoint,
+ bool include_endpoint,
+ uint32 num_parts);
+
/*
Partitioning Interval Analysis: Initialize the iterator for "mapping" case
@@ -6733,18 +7193,145 @@ typedef uint32 (*get_endpoint_func)(partition_info*, bool left_endpoint,
-1 - All partitions would match (iterator not initialized)
*/
+uint32 get_partition_id_cols_range_for_endpoint(partition_info *part_info,
+ bool left_endpoint,
+ bool include_endpoint,
+ uint32 nparts)
+{
+ uint max_partition= part_info->num_parts - 1;
+ uint min_part_id= 0, max_part_id= max_partition, loc_part_id;
+ part_column_list_val *range_col_array= part_info->range_col_array;
+ uint num_columns= part_info->part_field_list.elements;
+ bool tailf= !(left_endpoint ^ include_endpoint);
+ DBUG_ENTER("get_partition_id_cols_range_for_endpoint");
+
+ /* Get the partitioning function value for the endpoint */
+ while (max_part_id > min_part_id)
+ {
+ loc_part_id= (max_part_id + min_part_id + 1) >> 1;
+ if (cmp_rec_and_tuple_prune(range_col_array + loc_part_id*num_columns,
+ nparts, tailf) >= 0)
+ min_part_id= loc_part_id + 1;
+ else
+ max_part_id= loc_part_id - 1;
+ }
+ loc_part_id= max_part_id;
+ if (loc_part_id < max_partition &&
+ cmp_rec_and_tuple_prune(range_col_array + (loc_part_id+1)*num_columns,
+ nparts, tailf) >= 0
+ )
+ {
+ loc_part_id++;
+ }
+ if (left_endpoint)
+ {
+ if (cmp_rec_and_tuple_prune(range_col_array + loc_part_id*num_columns,
+ nparts, tailf) >= 0)
+ loc_part_id++;
+ }
+ else
+ {
+ if (loc_part_id < max_partition)
+ {
+ int res= cmp_rec_and_tuple_prune(range_col_array +
+ loc_part_id * num_columns,
+ nparts, tailf);
+ if (!res)
+ loc_part_id += test(include_endpoint);
+ else if (res > 0)
+ loc_part_id++;
+ }
+ loc_part_id++;
+ }
+ DBUG_RETURN(loc_part_id);
+}
+
+
+int get_part_iter_for_interval_cols_via_map(partition_info *part_info,
+ bool is_subpart,
+ uint32 *store_length_array,
+ uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len,
+ uint flags,
+ PARTITION_ITERATOR *part_iter)
+{
+ uint32 nparts;
+ get_col_endpoint_func get_col_endpoint;
+ DBUG_ENTER("get_part_iter_for_interval_cols_via_map");
+
+ if (part_info->part_type == RANGE_PARTITION)
+ {
+ get_col_endpoint= get_partition_id_cols_range_for_endpoint;
+ part_iter->get_next= get_next_partition_id_range;
+ }
+ else if (part_info->part_type == LIST_PARTITION)
+ {
+ get_col_endpoint= get_partition_id_cols_list_for_endpoint;
+ part_iter->get_next= get_next_partition_id_list;
+ part_iter->part_info= part_info;
+ DBUG_ASSERT(part_info->num_list_values);
+ }
+ else
+ assert(0);
+
+ if (flags & NO_MIN_RANGE)
+ part_iter->part_nums.start= part_iter->part_nums.cur= 0;
+ else
+ {
+ // Copy from min_value to record
+ nparts= store_tuple_to_record(part_info->part_field_array,
+ store_length_array,
+ min_value,
+ min_value + min_len);
+ part_iter->part_nums.start= part_iter->part_nums.cur=
+ get_col_endpoint(part_info, TRUE, !(flags & NEAR_MIN),
+ nparts);
+ }
+ if (flags & NO_MAX_RANGE)
+ {
+ if (part_info->part_type == RANGE_PARTITION)
+ part_iter->part_nums.end= part_info->num_parts;
+ else /* LIST_PARTITION */
+ {
+ DBUG_ASSERT(part_info->part_type == LIST_PARTITION);
+ part_iter->part_nums.end= part_info->num_list_values;
+ }
+ }
+ else
+ {
+ // Copy from max_value to record
+ nparts= store_tuple_to_record(part_info->part_field_array,
+ store_length_array,
+ max_value,
+ max_value + max_len);
+ part_iter->part_nums.end= get_col_endpoint(part_info, FALSE,
+ !(flags & NEAR_MAX),
+ nparts);
+ }
+ if (part_iter->part_nums.start == part_iter->part_nums.end)
+ DBUG_RETURN(0);
+ DBUG_RETURN(1);
+}
+
+
int get_part_iter_for_interval_via_mapping(partition_info *part_info,
bool is_subpart,
+ uint32 *store_length_array, /* ignored */
uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len, /* ignored */
uint flags,
PARTITION_ITERATOR *part_iter)
{
- DBUG_ASSERT(!is_subpart);
Field *field= part_info->part_field_array[0];
uint32 max_endpoint_val;
get_endpoint_func get_endpoint;
bool can_match_multiple_values; /* is not '=' */
uint field_len= field->pack_length_in_rec();
+ DBUG_ENTER("get_part_iter_for_interval_via_mapping");
+ DBUG_ASSERT(!is_subpart);
+ (void) store_length_array;
+ (void)min_len;
+ (void)max_len;
part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (part_info->part_type == RANGE_PARTITION)
@@ -6753,7 +7340,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
get_endpoint= get_partition_id_range_for_endpoint_charset;
else
get_endpoint= get_partition_id_range_for_endpoint;
- max_endpoint_val= part_info->no_parts;
+ max_endpoint_val= part_info->num_parts;
part_iter->get_next= get_next_partition_id_range;
}
else if (part_info->part_type == LIST_PARTITION)
@@ -6763,7 +7350,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
get_endpoint= get_list_array_idx_for_endpoint_charset;
else
get_endpoint= get_list_array_idx_for_endpoint;
- max_endpoint_val= part_info->no_list_values;
+ max_endpoint_val= part_info->num_list_values;
part_iter->get_next= get_next_partition_id_list;
part_iter->part_info= part_info;
if (max_endpoint_val == 0)
@@ -6776,7 +7363,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
part_iter->part_nums.start= part_iter->part_nums.end= 0;
part_iter->part_nums.cur= 0;
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
- return -1;
+ DBUG_RETURN(-1);
}
}
else
@@ -6808,11 +7395,11 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
{
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
part_iter->part_nums.start= part_iter->part_nums.cur= 0;
- if (*max_value && !(flags & NO_MAX_RANGE))
+ if (!(flags & NO_MAX_RANGE) && *max_value)
{
/* The right bound is X <= NULL, i.e. it is a "X IS NULL" interval */
part_iter->part_nums.end= 0;
- return 1;
+ DBUG_RETURN(1);
}
}
else
@@ -6836,11 +7423,11 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
part_iter->part_nums.cur= part_iter->part_nums.start= 0;
part_iter->part_nums.end= 0;
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
- return 1;
+ DBUG_RETURN(1);
}
part_iter->part_nums.cur= part_iter->part_nums.start;
if (part_iter->part_nums.start == max_endpoint_val)
- return 0; /* No partitions */
+ DBUG_RETURN(0); /* No partitions */
}
}
@@ -6854,14 +7441,14 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
if (part_iter->part_nums.start >= part_iter->part_nums.end &&
!part_iter->ret_null_part)
- return 0; /* No partitions */
+ DBUG_RETURN(0); /* No partitions */
}
- return 1; /* Ok, iterator initialized */
+ DBUG_RETURN(1); /* Ok, iterator initialized */
}
/* See get_part_iter_for_interval_via_walking for definition of what this is */
-#define MAX_RANGE_TO_WALK 10
+#define MAX_RANGE_TO_WALK 32
/*
@@ -6897,16 +7484,6 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
Intervals with +inf/-inf, and [NULL, c1] interval can be processed but
that is more tricky and I don't have time to do it right now.
- Additionally we have these requirements:
- * number of values in the interval must be less then number of
- [sub]partitions, and
- * Number of values in the interval must be less then MAX_RANGE_TO_WALK.
-
- The rationale behind these requirements is that if they are not met
- we're likely to hit most of the partitions and traversing the interval
- will only add overhead. So it's better return "all partitions used" in
- that case.
-
RETURN
0 - No matching partitions, iterator not initialized
1 - Some partitions would match, iterator intialized for traversing them
@@ -6914,25 +7491,32 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
*/
int get_part_iter_for_interval_via_walking(partition_info *part_info,
- bool is_subpart,
- uchar *min_value, uchar *max_value,
- uint flags,
- PARTITION_ITERATOR *part_iter)
+ bool is_subpart,
+ uint32 *store_length_array, /* ignored */
+ uchar *min_value, uchar *max_value,
+ uint min_len, uint max_len, /* ignored */
+ uint flags,
+ PARTITION_ITERATOR *part_iter)
{
Field *field;
uint total_parts;
partition_iter_func get_next_func;
+ DBUG_ENTER("get_part_iter_for_interval_via_walking");
+ (void)store_length_array;
+ (void)min_len;
+ (void)max_len;
+
part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (is_subpart)
{
field= part_info->subpart_field_array[0];
- total_parts= part_info->no_subparts;
+ total_parts= part_info->num_subparts;
get_next_func= get_next_subpartition_via_walking;
}
else
{
field= part_info->part_field_array[0];
- total_parts= part_info->no_parts;
+ total_parts= part_info->num_parts;
get_next_func= get_next_partition_via_walking;
}
@@ -6952,7 +7536,7 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
if (!part_info->get_subpartition_id(part_info, &part_id))
{
init_single_partition_iterator(part_id, part_iter);
- return 1; /* Ok, iterator initialized */
+ DBUG_RETURN(1); /* Ok, iterator initialized */
}
}
else
@@ -6965,10 +7549,10 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
if (!res)
{
init_single_partition_iterator(part_id, part_iter);
- return 1; /* Ok, iterator initialized */
+ DBUG_RETURN(1); /* Ok, iterator initialized */
}
}
- return 0; /* No partitions match */
+ DBUG_RETURN(0); /* No partitions match */
}
if ((field->real_maybe_null() &&
@@ -6976,7 +7560,7 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
(!(flags & NO_MAX_RANGE) && *max_value))) || // X <? NULL
(flags & (NO_MIN_RANGE | NO_MAX_RANGE))) // -inf at any bound
{
- return -1; /* Can't handle this interval, have to use all partitions */
+ DBUG_RETURN(-1); /* Can't handle this interval, have to use all partitions */
}
/* Get integers for left and right interval bound */
@@ -6995,20 +7579,36 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
an empty interval by "wrapping around" a + 4G-1 + 1 = a.
*/
if ((ulonglong)b - (ulonglong)a == ~0ULL)
- return -1;
+ DBUG_RETURN(-1);
a += test(flags & NEAR_MIN);
b += test(!(flags & NEAR_MAX));
ulonglong n_values= b - a;
-
- if (n_values > total_parts || n_values > MAX_RANGE_TO_WALK)
- return -1;
+
+ /*
+ Will it pay off to enumerate all values in the [a..b] range and evaluate
+ the partitioning function for every value? It depends on
+ 1. whether we'll be able to infer that some partitions are not used
+ 2. if time savings from not scanning these partitions will be greater
+ than time spent in enumeration.
+ We will assume that the cost of accessing one extra partition is greater
+ than the cost of evaluating the partitioning function O(#partitions).
+ This means we should jump at any chance to eliminate a partition, which
+ gives us this logic:
+
+ Do the enumeration if
+ - the number of values to enumerate is comparable to the number of
+ partitions, or
+ - there are not many values to enumerate.
+ */
+ if ((n_values > 2*total_parts) && n_values > MAX_RANGE_TO_WALK)
+ DBUG_RETURN(-1);
part_iter->field_vals.start= part_iter->field_vals.cur= a;
part_iter->field_vals.end= b;
part_iter->part_info= part_info;
part_iter->get_next= get_next_func;
- return 1;
+ DBUG_RETURN(1);
}
@@ -7056,8 +7656,9 @@ uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
DESCRIPTION
This implementation of PARTITION_ITERATOR::get_next() is special for
- LIST partitioning: it enumerates partition ids in
- part_info->list_array[i] where i runs over [min_idx, max_idx] interval.
+ LIST partitioning: it enumerates partition ids in
+ part_info->list_array[i] (list_col_array[i] for COLUMNS LIST
+ partitioning) where i runs over [min_idx, max_idx] interval.
The function conforms to partition_iter_func type.
RETURN
@@ -7079,8 +7680,13 @@ uint32 get_next_partition_id_list(PARTITION_ITERATOR *part_iter)
return NOT_A_PARTITION_ID;
}
else
- return part_iter->part_info->list_array[part_iter->
- part_nums.cur++].partition_id;
+ {
+ partition_info *part_info= part_iter->part_info;
+ uint32 num_part= part_iter->part_nums.cur++;
+ return part_info->column_list ?
+ part_info->list_col_array[num_part].partition_id :
+ part_info->list_array[num_part].partition_id;
+ }
}
@@ -7221,5 +7827,17 @@ void create_subpartition_name(char *out, const char *in1,
strxmov(out, in1, "#P#", transl_part_name,
"#SP#", transl_subpart_name, "#REN#", NullS);
}
+
+uint get_partition_field_store_length(Field *field)
+{
+ uint store_length;
+
+ store_length= field->key_length();
+ if (field->real_maybe_null())
+ store_length+= HA_KEY_NULL_LENGTH;
+ if (field->real_type() == MYSQL_TYPE_VARCHAR)
+ store_length+= HA_KEY_BLOB_LENGTH;
+ return store_length;
+}
#endif
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 282e24f1853..6e1bf8b5728 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -1,4 +1,7 @@
-/* Copyright (C) 2006 MySQL AB
+#ifndef SQL_PARTITION_INCLUDED
+#define SQL_PARTITION_INCLUDED
+
+/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -65,15 +68,19 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0,
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
TABLE *table, handler *file, HA_CREATE_INFO *info);
-void set_linear_hash_mask(partition_info *part_info, uint no_parts);
+void set_linear_hash_mask(partition_info *part_info, uint num_parts);
bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind);
-char *generate_partition_syntax(partition_info *part_info,
- uint *buf_length, bool use_sql_alloc,
- bool show_partition_options);
bool partition_key_modified(TABLE *table, const MY_BITMAP *fields);
void get_partition_set(const TABLE *table, uchar *buf, const uint index,
const key_range *key_spec,
part_id_range *part_spec);
+uint get_partition_field_store_length(Field *field);
+int get_cs_converted_part_value_from_string(THD *thd,
+ Item *item,
+ String *input_str,
+ String *output_str,
+ CHARSET_INFO *cs,
+ bool use_hex);
void get_full_part_id_from_key(const TABLE *table, uchar *buf,
KEY *key_info,
const key_range *key_spec,
@@ -96,6 +103,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
bool check_part_func_fields(Field **ptr, bool ok_with_charsets);
bool field_is_partition_charset(Field *field);
+Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs);
/*
A "Get next" function for partition iterator.
@@ -172,13 +180,16 @@ typedef struct st_partition_iter
SYNOPSIS
get_partitions_in_range_iter()
- part_info Partitioning info
- is_subpart
- min_val Left edge, field value in opt_range_key format.
- max_val Right edge, field value in opt_range_key format.
- flags Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
- NO_MAX_RANGE.
- part_iter Iterator structure to be initialized
+ part_info Partitioning info
+ is_subpart
+ store_length_array Length of fields packed in opt_range_key format
+ min_val Left edge, field value in opt_range_key format
+ max_val Right edge, field value in opt_range_key format
+ min_len Length of minimum value
+ max_len Length of maximum value
+ flags Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
+ NO_MAX_RANGE
+ part_iter Iterator structure to be initialized
DESCRIPTION
Functions with this signature are used to perform "Partitioning Interval
@@ -191,8 +202,9 @@ typedef struct st_partition_iter
The set of partitions is returned by initializing an iterator in *part_iter
NOTES
- There are currently two functions of this type:
+ There are currently three functions of this type:
- get_part_iter_for_interval_via_walking
+ - get_part_iter_for_interval_cols_via_map
- get_part_iter_for_interval_via_mapping
RETURN
@@ -203,9 +215,12 @@ typedef struct st_partition_iter
typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
bool is_subpart,
+ uint32 *store_length_array,
uchar *min_val, uchar *max_val,
+ uint min_len, uint max_len,
uint flags,
PARTITION_ITERATOR *part_iter);
#include "partition_info.h"
+#endif /* SQL_PARTITION_INCLUDED */
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index bafc601d142..936c9ae8866 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,14 +19,6 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
-#ifdef DBUG_OFF
-#define plugin_ref_to_int(A) A
-#define plugin_int_to_ref(A) A
-#else
-#define plugin_ref_to_int(A) (A ? A[0] : NULL)
-#define plugin_int_to_ref(A) &(A)
-#endif
-
extern struct st_mysql_plugin *mysqld_builtins[];
/**
@@ -54,7 +46,8 @@ const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]=
{ C_STRING_WITH_LEN("STORAGE ENGINE") },
{ C_STRING_WITH_LEN("FTPARSER") },
{ C_STRING_WITH_LEN("DAEMON") },
- { C_STRING_WITH_LEN("INFORMATION SCHEMA") }
+ { C_STRING_WITH_LEN("INFORMATION SCHEMA") },
+ { C_STRING_WITH_LEN("REPLICATION") },
};
extern int initialize_schema_table(st_plugin_int *plugin);
@@ -93,7 +86,8 @@ static int min_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
MYSQL_HANDLERTON_INTERFACE_VERSION,
MYSQL_FTPARSER_INTERFACE_VERSION,
MYSQL_DAEMON_INTERFACE_VERSION,
- MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
+ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
+ MYSQL_REPLICATION_INTERFACE_VERSION,
};
static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
{
@@ -101,10 +95,13 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
MYSQL_HANDLERTON_INTERFACE_VERSION,
MYSQL_FTPARSER_INTERFACE_VERSION,
MYSQL_DAEMON_INTERFACE_VERSION,
- MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
+ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
+ MYSQL_REPLICATION_INTERFACE_VERSION,
};
-static bool initialized= 0;
+/* support for Services */
+
+#include "sql_plugin_services.h"
/*
A mutex LOCK_plugin must be acquired before accessing the
@@ -118,6 +115,8 @@ static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
static bool reap_needed= false;
static int plugin_array_version=0;
+static bool initialized= 0;
+
/*
write-lock on LOCK_system_variables_hash is required before modifying
the following variables/structures
@@ -230,6 +229,22 @@ extern bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
#endif /* EMBEDDED_LIBRARY */
+static void report_error(int where_to, uint error, ...)
+{
+ va_list args;
+ if (where_to & REPORT_TO_USER)
+ {
+ va_start(args, error);
+ my_printv_error(error, ER(error), MYF(0), args);
+ va_end(args);
+ }
+ if (where_to & REPORT_TO_LOG)
+ {
+ va_start(args, error);
+ error_log_print(ERROR_LEVEL, ER_DEFAULT(error), args);
+ va_end(args);
+ }
+}
/****************************************************************************
Value type thunks, allows the C world to play in the C++ world
@@ -350,7 +365,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
#ifdef HAVE_DLOPEN
char dlpath[FN_REFLEN];
- uint plugin_dir_len, dummy_errors, dlpathlen;
+ uint plugin_dir_len, dummy_errors, dlpathlen, i;
struct st_plugin_dl *tmp, plugin_dl;
void *sym;
DBUG_ENTER("plugin_dl_add");
@@ -365,10 +380,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
system_charset_info, 1) ||
plugin_dir_len + dl->length + 1 >= FN_REFLEN)
{
- if (report & REPORT_TO_USER)
- my_error(ER_UDF_NO_PATHS, MYF(0));
- if (report & REPORT_TO_LOG)
- sql_print_error("%s", ER(ER_UDF_NO_PATHS));
+ report_error(report, ER_UDF_NO_PATHS);
DBUG_RETURN(0);
}
/* If this dll is already loaded just increase ref_count. */
@@ -393,20 +405,14 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (*errmsg == ':') errmsg++;
if (*errmsg == ' ') errmsg++;
}
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, errno, errmsg);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, errno, errmsg);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
DBUG_RETURN(0);
}
/* Determine interface version */
if (!(sym= dlsym(plugin_dl.handle, plugin_interface_version_sym)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_interface_version_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_interface_version_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
DBUG_RETURN(0);
}
plugin_dl.version= *(int *)sym;
@@ -415,28 +421,42 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
(plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, 0,
- "plugin interface version mismatch");
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, 0,
- "plugin interface version mismatch");
+ report_error(report, ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, 0,
+ "plugin interface version mismatch");
DBUG_RETURN(0);
}
+
+ /* link the services in */
+ for (i= 0; i < array_elements(list_of_services); i++)
+ {
+ if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
+ {
+ uint ver= (uint)(intptr)*(void**)sym;
+ if (ver > list_of_services[i].version ||
+ (ver >> 8) < (list_of_services[i].version >> 8))
+ {
+ char buf[MYSQL_ERRMSG_SIZE];
+ my_snprintf(buf, sizeof(buf),
+ "service '%s' interface version mismatch",
+ list_of_services[i].name);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf);
+ DBUG_RETURN(0);
+ }
+ *(void**)sym= list_of_services[i].service;
+ }
+ }
+
/* Find plugin declarations */
if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_declarations_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_declarations_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, MYF(0),
+ plugin_declarations_sym);
DBUG_RETURN(0);
}
if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
{
- int i;
uint sizeof_st_plugin;
struct st_mysql_plugin *old, *cur;
char *ptr= (char *)sym;
@@ -446,11 +466,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
else
{
#ifdef ERROR_ON_NO_SIZEOF_PLUGIN_SYMBOL
- free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), sizeof_st_plugin_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), sizeof_st_plugin_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, sizeof_st_plugin_sym);
DBUG_RETURN(0);
#else
/*
@@ -472,10 +488,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (!cur)
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
DBUG_RETURN(0);
}
/*
@@ -497,10 +510,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
DBUG_RETURN(0);
}
plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
@@ -511,19 +521,13 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(struct st_plugin_dl));
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), sizeof(struct st_plugin_dl));
+ report_error(report, ER_OUTOFMEMORY, sizeof(struct st_plugin_dl));
DBUG_RETURN(0);
}
DBUG_RETURN(tmp);
#else
DBUG_ENTER("plugin_dl_add");
- if (report & REPORT_TO_USER)
- my_error(ER_FEATURE_DISABLED, MYF(0), "plugin", "HAVE_DLOPEN");
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_FEATURE_DISABLED), "plugin", "HAVE_DLOPEN");
+ report_error(report, ER_FEATURE_DISABLED, "plugin", "HAVE_DLOPEN");
DBUG_RETURN(0);
#endif
}
@@ -574,14 +578,15 @@ static struct st_plugin_int *plugin_find_internal(const LEX_STRING *name, int ty
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
struct st_plugin_int *plugin= (st_plugin_int *)
- hash_search(&plugin_hash[i], (const uchar *)name->str, name->length);
+ my_hash_search(&plugin_hash[i], (const uchar *)name->str, name->length);
if (plugin)
DBUG_RETURN(plugin);
}
}
else
DBUG_RETURN((st_plugin_int *)
- hash_search(&plugin_hash[type], (const uchar *)name->str, name->length));
+ my_hash_search(&plugin_hash[type], (const uchar *)name->str,
+ name->length));
DBUG_RETURN(0);
}
@@ -639,7 +644,7 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO)
/*
For debugging, we do an additional malloc which allows the
memory manager and/or valgrind to track locked references and
- double unlocks to aid resolving reference counting.problems.
+ double unlocks to aid resolving reference counting problems.
*/
if (!(plugin= (plugin_ref) my_malloc_ci(sizeof(pi), MYF(MY_WME))))
DBUG_RETURN(NULL);
@@ -722,10 +727,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
DBUG_ENTER("plugin_add");
if (plugin_find_internal(name, MYSQL_ANY_PLUGIN))
{
- if (report & REPORT_TO_USER)
- my_error(ER_UDF_EXISTS, MYF(0), name->str);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_UDF_EXISTS), name->str);
+ report_error(report, ER_UDF_EXISTS, name->str);
DBUG_RETURN(TRUE);
}
/* Clear the whole struct to catch future extensions. */
@@ -752,10 +754,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
strxnmov(buf, sizeof(buf) - 1, "API version for ",
plugin_type_names[plugin->type].str,
" plugin is too different", NullS);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dl->str, 0, buf);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dl->str, 0, buf);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf);
goto err;
}
tmp.plugin= plugin;
@@ -784,10 +783,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
DBUG_RETURN(FALSE);
}
}
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), name->str);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name->str);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, name->str);
err:
plugin_dl_del(dl);
DBUG_RETURN(TRUE);
@@ -858,7 +854,7 @@ static void plugin_del(struct st_plugin_int *plugin)
safe_mutex_assert_owner(&LOCK_plugin);
/* Free allocated strings before deleting the plugin. */
plugin_vars_free_values(plugin->system_vars);
- hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin);
+ my_hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin);
if (plugin->plugin_dl)
plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED;
@@ -1133,8 +1129,8 @@ int plugin_init(int *argc, char **argv, int flags)
init_alloc_root(&plugin_mem_root, 4096, 4096);
init_alloc_root(&tmp_root, 4096, 4096);
- if (hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
- get_bookmark_hash_key, NULL, HASH_UNIQUE))
+ if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
+ get_bookmark_hash_key, NULL, HASH_UNIQUE))
goto err;
@@ -1148,8 +1144,8 @@ int plugin_init(int *argc, char **argv, int flags)
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
- if (hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
- get_plugin_hash_key, NULL, HASH_UNIQUE))
+ if (my_hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
+ get_plugin_hash_key, NULL, HASH_UNIQUE))
goto err;
}
@@ -1627,7 +1623,7 @@ void plugin_shutdown(void)
/* Dispose of the memory */
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
- hash_free(&plugin_hash[i]);
+ my_hash_free(&plugin_hash[i]);
delete_dynamic(&plugin_array);
count= plugin_dl_array.elements;
@@ -1639,7 +1635,7 @@ void plugin_shutdown(void)
my_afree(dl);
delete_dynamic(&plugin_dl_array);
- hash_free(&bookmark_hash);
+ my_hash_free(&bookmark_hash);
free_root(&plugin_mem_root, MYF(0));
global_variables_dynamic_size= 0;
@@ -1660,7 +1656,7 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
bzero(&tables, sizeof(tables));
tables.db= (char *)"mysql";
tables.table_name= tables.alias= (char *)"plugin";
- if (check_table_access(thd, INSERT_ACL, &tables, 1, FALSE))
+ if (check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE))
DBUG_RETURN(TRUE);
/* need to open before acquiring LOCK_plugin or it will deadlock */
@@ -1764,12 +1760,13 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
reap_plugins();
pthread_mutex_unlock(&LOCK_plugin);
+ uchar user_key[MAX_KEY_LENGTH];
table->use_all_columns();
table->field[0]->store(name->str, name->length, system_charset_info);
- if (! table->file->index_read_idx_map(table->record[0], 0,
- (uchar *)table->field[0]->ptr,
- HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ key_copy(user_key, table->record[0], table->key_info,
+ table->key_info->key_length);
+ if (! table->file->index_read_idx_map(table->record[0], 0, user_key,
+ HA_WHOLE_KEY, HA_READ_KEY_EXACT))
{
int error;
/*
@@ -1827,7 +1824,7 @@ bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
HASH *hash= plugin_hash + type;
for (idx= 0; idx < total; idx++)
{
- plugin= (struct st_plugin_int *) hash_element(hash, idx);
+ plugin= (struct st_plugin_int *) my_hash_element(hash, idx);
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
}
}
@@ -2226,8 +2223,8 @@ static st_bookmark *find_bookmark(const char *plugin, const char *name,
varname[0]= flags & PLUGIN_VAR_TYPEMASK;
- result= (st_bookmark*) hash_search(&bookmark_hash,
- (const uchar*) varname, length - 1);
+ result= (st_bookmark*) my_hash_search(&bookmark_hash,
+ (const uchar*) varname, length - 1);
my_afree(varname);
return result;
@@ -2387,7 +2384,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
{
sys_var_pluginvar *pi;
sys_var *var;
- st_bookmark *v= (st_bookmark*) hash_element(&bookmark_hash,idx);
+ st_bookmark *v= (st_bookmark*) my_hash_element(&bookmark_hash,idx);
if (v->version <= thd->variables.dynamic_variables_version ||
!(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
@@ -2481,7 +2478,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars)
rw_rdlock(&LOCK_system_variables_hash);
for (idx= 0; idx < bookmark_hash.records; idx++)
{
- v= (st_bookmark*) hash_element(&bookmark_hash, idx);
+ v= (st_bookmark*) my_hash_element(&bookmark_hash, idx);
if (v->version > vars->dynamic_variables_version ||
!(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
!(pivar= var->cast_pluginvar()) ||
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index 004d0d5abb7..23ce85c994b 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -18,6 +18,14 @@
class sys_var;
+#ifdef DBUG_OFF
+#define plugin_ref_to_int(A) A
+#define plugin_int_to_ref(A) A
+#else
+#define plugin_ref_to_int(A) (A ? A[0] : NULL)
+#define plugin_int_to_ref(A) &(A)
+#endif
+
/*
the following flags are valid for plugin_init()
*/
@@ -27,16 +35,6 @@ class sys_var;
#define INITIAL_LEX_PLUGIN_LIST_SIZE 16
-/*
- the following #define adds server-only members to enum_mysql_show_type,
- that is defined in plugin.h
-*/
-#define SHOW_FUNC SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG, \
- SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE, \
- SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_LONG_NOFLUSH, \
- SHOW_LONGLONG_STATUS
-#include <mysql/plugin.h>
-#undef SHOW_FUNC
typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;
diff --git a/server-tools/instance-manager/parse_output.h b/sql/sql_plugin_services.h
index 41618f643a3..7491ddab79d 100644
--- a/server-tools/instance-manager/parse_output.h
+++ b/sql/sql_plugin_services.h
@@ -1,6 +1,4 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_OUTPUT_H
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_OUTPUT_H
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (C) 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,19 +13,32 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_global.h>
+/* support for Services */
+#include <service_versions.h>
-enum enum_option_type
-{
- GET_VALUE = 1,
- GET_LINE
+struct st_service_ref {
+ const char *name;
+ uint version;
+ void *service;
+};
+
+static struct my_snprintf_service_st my_snprintf_handler = {
+ my_snprintf,
+ my_vsnprintf
};
-bool parse_output_and_get_value(const char *command,
- const char *option_name_str,
- uint option_name_length,
- char *option_value_buf,
- size_t option_value_buf_size,
- enum_option_type option_type);
+static struct thd_alloc_service_st thd_alloc_handler= {
+ thd_alloc,
+ thd_calloc,
+ thd_strdup,
+ thd_strmake,
+ thd_memdup,
+ thd_make_lex_string
+};
+
+static struct st_service_ref list_of_services[]=
+{
+ { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
+ { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler }
+};
-#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_OUTPUT_H */
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 7c902de35b8..168934206e5 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -84,6 +84,7 @@ When one supplies long data for a placeholder:
*/
#include "mysql_priv.h"
+#include "sql_prepare.h"
#include "sql_select.h" // for JOIN
#include "sql_cursor.h"
#include "sp_head.h"
@@ -106,7 +107,7 @@ class Select_fetch_protocol_binary: public select_send
Protocol_binary protocol;
public:
Select_fetch_protocol_binary(THD *thd);
- virtual bool send_fields(List<Item> &list, uint flags);
+ virtual bool send_result_set_metadata(List<Item> &list, uint flags);
virtual bool send_data(List<Item> &items);
virtual bool send_eof();
#ifdef EMBEDDED_LIBRARY
@@ -163,6 +164,7 @@ public:
bool execute_loop(String *expanded_query,
bool open_cursor,
uchar *packet_arg, uchar *packet_end_arg);
+ bool execute_server_runnable(Server_runnable *server_runnable);
/* Destroy this statement */
void deallocate();
private:
@@ -183,6 +185,78 @@ private:
void swap_prepared_statement(Prepared_statement *copy);
};
+/**
+ Execute one SQL statement in an isolated context.
+*/
+
+class Execute_sql_statement: public Server_runnable
+{
+public:
+ Execute_sql_statement(LEX_STRING sql_text);
+ virtual bool execute_server_code(THD *thd);
+private:
+ LEX_STRING m_sql_text;
+};
+
+
+class Ed_connection;
+
+/**
+ Protocol_local: a helper class to intercept the result
+ of the data written to the network.
+*/
+
+class Protocol_local :public Protocol
+{
+public:
+ Protocol_local(THD *thd, Ed_connection *ed_connection);
+ ~Protocol_local() { free_root(&m_rset_root, MYF(0)); }
+protected:
+ virtual void prepare_for_resend();
+ virtual bool write();
+ virtual bool store_null();
+ virtual bool store_tiny(longlong from);
+ virtual bool store_short(longlong from);
+ virtual bool store_long(longlong from);
+ virtual bool store_longlong(longlong from, bool unsigned_flag);
+ virtual bool store_decimal(const my_decimal *);
+ virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
+ virtual bool store(const char *from, size_t length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
+ virtual bool store(MYSQL_TIME *time);
+ virtual bool store_date(MYSQL_TIME *time);
+ virtual bool store_time(MYSQL_TIME *time);
+ virtual bool store(float value, uint32 decimals, String *buffer);
+ virtual bool store(double value, uint32 decimals, String *buffer);
+ virtual bool store(Field *field);
+
+ virtual bool send_result_set_metadata(List<Item> *list, uint flags);
+ virtual bool send_out_parameters(List<Item_param> *sp_params);
+#ifdef EMBEDDED_LIBRARY
+ void remove_last_row();
+#endif
+ virtual enum enum_protocol_type type() { return PROTOCOL_LOCAL; };
+
+ virtual bool send_ok(uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong last_insert_id,
+ const char *message);
+
+ virtual bool send_eof(uint server_status, uint statement_warn_count);
+ virtual bool send_error(uint sql_errno, const char *err_msg, const char* sqlstate);
+private:
+ bool store_string(const char *str, size_t length,
+ CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs);
+
+ bool store_column(const void *data, size_t length);
+ void opt_add_row_to_rset();
+private:
+ Ed_connection *m_connection;
+ MEM_ROOT m_rset_root;
+ List<Ed_row> *m_rset;
+ size_t m_column_count;
+ Ed_column *m_current_row;
+ Ed_column *m_current_column;
+};
/******************************************************************************
Implementation
@@ -250,7 +324,7 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
int2store(buff+5, columns);
int2store(buff+7, stmt->param_count);
buff[9]= 0; // Guard against a 4.1 client
- tmp= min(stmt->thd->total_warn_count, 65535);
+ tmp= min(stmt->thd->warning_info->statement_warn_count(), 65535);
int2store(buff+10, tmp);
/*
@@ -260,12 +334,12 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
error= my_net_write(net, buff, sizeof(buff));
if (stmt->param_count && ! error)
{
- error= thd->protocol_text.send_fields((List<Item> *)
+ error= thd->protocol_text.send_result_set_metadata((List<Item> *)
&stmt->lex->param_list,
Protocol::SEND_EOF);
}
/* Flag that a response has already been sent */
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
DBUG_RETURN(error);
}
#else
@@ -277,7 +351,7 @@ static bool send_prep_stmt(Prepared_statement *stmt,
thd->client_stmt_id= stmt->id;
thd->client_param_count= stmt->param_count;
thd->clear_error();
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
return 0;
}
@@ -1027,9 +1101,9 @@ static bool insert_params_from_vars(Prepared_statement *stmt,
{
Item_param *param= *it;
varname= var_it++;
- entry= (user_var_entry*)hash_search(&stmt->thd->user_vars,
- (uchar*) varname->str,
- varname->length);
+ entry= (user_var_entry*)my_hash_search(&stmt->thd->user_vars,
+ (uchar*) varname->str,
+ varname->length);
if (param->set_from_user_var(stmt->thd, entry) ||
param->convert_str_value(stmt->thd))
DBUG_RETURN(1);
@@ -1074,8 +1148,8 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
Item_param *param= *it;
varname= var_it++;
- entry= (user_var_entry *) hash_search(&thd->user_vars, (uchar*) varname->str,
- varname->length);
+ entry= (user_var_entry *) my_hash_search(&thd->user_vars, (uchar*)
+ varname->str, varname->length);
/*
We have to call the setup_one_conversion_function() here to set
the parameter's members that might be needed further
@@ -1336,7 +1410,7 @@ static int mysql_test_select(Prepared_statement *stmt,
ulong privilege= lex->exchange ? SELECT_ACL | FILE_ACL : SELECT_ACL;
if (tables)
{
- if (check_table_access(thd, privilege, tables, UINT_MAX, FALSE))
+ if (check_table_access(thd, privilege, tables, FALSE, UINT_MAX, FALSE))
goto error;
}
else if (check_access(thd, privilege, any_db,0,0,0,0))
@@ -1374,7 +1448,7 @@ static int mysql_test_select(Prepared_statement *stmt,
unit->prepare call above.
*/
if (send_prep_stmt(stmt, lex->result->field_count(fields)) ||
- lex->result->send_fields(fields, Protocol::SEND_EOF) ||
+ lex->result->send_result_set_metadata(fields, Protocol::SEND_EOF) ||
thd->protocol->flush())
goto error;
DBUG_RETURN(2);
@@ -1405,7 +1479,8 @@ static bool mysql_test_do_fields(Prepared_statement *stmt,
THD *thd= stmt->thd;
DBUG_ENTER("mysql_test_do_fields");
- if (tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE))
+ if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
+ UINT_MAX, FALSE))
DBUG_RETURN(TRUE);
if (open_normal_and_derived_tables(thd, tables, 0))
@@ -1436,8 +1511,9 @@ static bool mysql_test_set_fields(Prepared_statement *stmt,
THD *thd= stmt->thd;
set_var_base *var;
- if ((tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE))
- || open_normal_and_derived_tables(thd, tables, 0))
+ if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
+ UINT_MAX, FALSE)) ||
+ open_normal_and_derived_tables(thd, tables, 0))
goto error;
while ((var= it++))
@@ -1472,7 +1548,8 @@ static bool mysql_test_call_fields(Prepared_statement *stmt,
THD *thd= stmt->thd;
Item *item;
- if ((tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE)) ||
+ if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
+ UINT_MAX, FALSE)) ||
open_normal_and_derived_tables(thd, tables, 0))
goto err;
@@ -1835,6 +1912,10 @@ static bool check_prepared_statement(Prepared_statement *stmt)
lex->select_lex.context.resolve_in_table_list_only(select_lex->
get_table_list());
+ /* Reset warning count for each query that uses tables */
+ if (tables)
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
+
switch (sql_command) {
case SQLCOM_REPLACE:
case SQLCOM_INSERT:
@@ -1916,30 +1997,6 @@ static bool check_prepared_statement(Prepared_statement *stmt)
Note that we don't need to have cases in this list if they are
marked with CF_STATUS_COMMAND in sql_command_flags
*/
- case SQLCOM_SHOW_PROCESSLIST:
- case SQLCOM_SHOW_STORAGE_ENGINES:
- case SQLCOM_SHOW_PRIVILEGES:
- case SQLCOM_SHOW_COLUMN_TYPES:
- case SQLCOM_SHOW_ENGINE_LOGS:
- case SQLCOM_SHOW_ENGINE_STATUS:
- case SQLCOM_SHOW_ENGINE_MUTEX:
- case SQLCOM_SHOW_CREATE_DB:
- case SQLCOM_SHOW_GRANTS:
- case SQLCOM_SHOW_BINLOG_EVENTS:
- case SQLCOM_SHOW_MASTER_STAT:
- case SQLCOM_SHOW_SLAVE_STAT:
- case SQLCOM_SHOW_CREATE_PROC:
- case SQLCOM_SHOW_CREATE_FUNC:
- case SQLCOM_SHOW_CREATE_EVENT:
- case SQLCOM_SHOW_CREATE_TRIGGER:
- case SQLCOM_SHOW_CREATE:
- case SQLCOM_SHOW_PROC_CODE:
- case SQLCOM_SHOW_FUNC_CODE:
- case SQLCOM_SHOW_AUTHORS:
- case SQLCOM_SHOW_CONTRIBUTORS:
- case SQLCOM_SHOW_WARNS:
- case SQLCOM_SHOW_ERRORS:
- case SQLCOM_SHOW_BINLOGS:
case SQLCOM_DROP_TABLE:
case SQLCOM_RENAME_TABLE:
case SQLCOM_ALTER_TABLE:
@@ -2062,7 +2119,6 @@ void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
{
Protocol *save_protocol= thd->protocol;
Prepared_statement *stmt;
- bool error;
DBUG_ENTER("mysqld_stmt_prepare");
DBUG_PRINT("prep_query", ("%s", packet));
@@ -2082,22 +2138,12 @@ void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
DBUG_VOID_RETURN;
}
- /* Reset warnings from previous command */
- mysql_reset_errors(thd, 0);
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
thd->protocol= &thd->protocol_binary;
- if (!(specialflag & SPECIAL_NO_PRIOR))
- my_pthread_setprio(pthread_self(),QUERY_PRIOR);
-
- error= stmt->prepare(packet, packet_length);
-
- if (!(specialflag & SPECIAL_NO_PRIOR))
- my_pthread_setprio(pthread_self(),WAIT_PRIOR);
-
- if (error)
+ if (stmt->prepare(packet, packet_length))
{
/* Statement map deletes statement on erase */
thd->stmt_map.erase(stmt);
@@ -2147,9 +2193,9 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
convert it for error messages to be uniform.
*/
if ((entry=
- (user_var_entry*)hash_search(&thd->user_vars,
- (uchar*)lex->prepared_stmt_code.str,
- lex->prepared_stmt_code.length))
+ (user_var_entry*)my_hash_search(&thd->user_vars,
+ (uchar*)lex->prepared_stmt_code.str,
+ lex->prepared_stmt_code.length))
&& entry->value)
{
my_bool is_var_null;
@@ -2460,7 +2506,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
DBUG_VOID_RETURN;
}
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(stmt->query(), stmt->query_length());
#endif
DBUG_PRINT("exec_query", ("%s", stmt->query()));
@@ -2479,7 +2525,6 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio););
DBUG_VOID_RETURN;
-
}
@@ -2659,7 +2704,7 @@ void mysqld_stmt_close(THD *thd, char *packet)
Prepared_statement *stmt;
DBUG_ENTER("mysqld_stmt_close");
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
if (!(stmt= find_prepared_statement(thd, stmt_id)))
DBUG_VOID_RETURN;
@@ -2734,7 +2779,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
status_var_increment(thd->status_var.com_stmt_send_long_data);
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
#ifndef EMBEDDED_LIBRARY
/* Minimal size of long data packet is 6 bytes */
if (packet_length < MYSQL_LONG_DATA_HEADER)
@@ -2788,19 +2833,19 @@ Select_fetch_protocol_binary::Select_fetch_protocol_binary(THD *thd_arg)
:protocol(thd_arg)
{}
-bool Select_fetch_protocol_binary::send_fields(List<Item> &list, uint flags)
+bool Select_fetch_protocol_binary::send_result_set_metadata(List<Item> &list, uint flags)
{
bool rc;
Protocol *save_protocol= thd->protocol;
/*
- Protocol::send_fields caches the information about column types:
+ Protocol::send_result_set_metadata caches the information about column types:
this information is later used to send data. Therefore, the same
dedicated Protocol object must be used for all operations with
a cursor.
*/
thd->protocol= &protocol;
- rc= select_send::send_fields(list, flags);
+ rc= select_send::send_result_set_metadata(list, flags);
thd->protocol= save_protocol;
return rc;
@@ -2825,6 +2870,94 @@ Select_fetch_protocol_binary::send_data(List<Item> &fields)
return rc;
}
+/*******************************************************************
+* Reprepare_observer
+*******************************************************************/
+/** Push an error to the error stack and return TRUE for now. */
+
+bool
+Reprepare_observer::report_error(THD *thd)
+{
+ /*
+ This 'error' is purely internal to the server:
+ - No exception handler is invoked,
+ - No condition is added in the condition area (warn_list).
+ The diagnostics area is set to an error status to enforce
+ that this thread execution stops and returns to the caller,
+ backtracking all the way to Prepared_statement::execute_loop().
+ */
+ thd->stmt_da->set_error_status(thd, ER_NEED_REPREPARE,
+ ER(ER_NEED_REPREPARE), "HY000");
+ m_invalidated= TRUE;
+
+ return TRUE;
+}
+
+
+/*******************************************************************
+* Server_runnable
+*******************************************************************/
+
+Server_runnable::~Server_runnable()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+Execute_sql_statement::
+Execute_sql_statement(LEX_STRING sql_text)
+ :m_sql_text(sql_text)
+{}
+
+
+/**
+ Parse and execute a statement. Does not prepare the query.
+
+ Allows to execute a statement from within another statement.
+ The main property of the implementation is that it does not
+ affect the environment -- i.e. you can run many
+ executions without having to cleanup/reset THD in between.
+*/
+
+bool
+Execute_sql_statement::execute_server_code(THD *thd)
+{
+ bool error;
+
+ if (alloc_query(thd, m_sql_text.str, m_sql_text.length))
+ return TRUE;
+
+ Parser_state parser_state(thd, thd->query(), thd->query_length());
+
+ parser_state.m_lip.multi_statements= FALSE;
+ lex_start(thd);
+
+ error= parse_sql(thd, &parser_state, NULL) || thd->is_error();
+
+ if (error)
+ goto end;
+
+ thd->lex->set_trg_event_type_for_tables();
+
+ error= mysql_execute_command(thd);
+
+ if (thd->killed_errno())
+ {
+ if (! thd->stmt_da->is_set())
+ thd->send_kill_message();
+ }
+
+ /* report error issued during command execution */
+ if (error == 0 && thd->spcont == NULL)
+ general_log_write(thd, COM_STMT_EXECUTE,
+ thd->query(), thd->query_length());
+
+end:
+ lex_end(thd->lex);
+
+ return error;
+}
+
/***************************************************************************
Prepared_statement
****************************************************************************/
@@ -2922,7 +3055,8 @@ void Prepared_statement::cleanup_stmt()
DBUG_ENTER("Prepared_statement::cleanup_stmt");
DBUG_PRINT("enter",("stmt: 0x%lx", (long) this));
- DBUG_ASSERT(lex->sphead == 0);
+ delete lex->sphead;
+ lex->sphead= 0;
/* The order is important */
lex->unit.cleanup();
cleanup_items(free_list);
@@ -3035,6 +3169,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
Parser_state parser_state(thd, thd->query(), thd->query_length());
parser_state.m_lip.stmt_prepare_mode= TRUE;
+ parser_state.m_lip.multi_statements= FALSE;
lex_start(thd);
error= parse_sql(thd, & parser_state, NULL) ||
@@ -3265,7 +3400,7 @@ reexecute:
reprepare_observer.is_invalidated() &&
reprepare_attempt++ < MAX_REPREPARE_ATTEMPTS)
{
- DBUG_ASSERT(thd->main_da.sql_errno() == ER_NEED_REPREPARE);
+ DBUG_ASSERT(thd->stmt_da->sql_errno() == ER_NEED_REPREPARE);
thd->clear_error();
error= reprepare();
@@ -3279,6 +3414,45 @@ reexecute:
}
+bool
+Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
+{
+ Statement stmt_backup;
+ bool error;
+ Query_arena *save_stmt_arena= thd->stmt_arena;
+ Item_change_list save_change_list;
+ thd->change_list= save_change_list;
+
+ state= CONVENTIONAL_EXECUTION;
+
+ if (!(lex= new (mem_root) st_lex_local))
+ return TRUE;
+
+ thd->set_n_backup_statement(this, &stmt_backup);
+ thd->set_n_backup_active_arena(this, &stmt_backup);
+ thd->stmt_arena= this;
+
+ error= server_runnable->execute_server_code(thd);
+
+ delete lex->sphead;
+ lex->sphead= 0;
+ /* The order is important */
+ lex->unit.cleanup();
+ close_thread_tables(thd);
+ thd->cleanup_after_query();
+
+ thd->restore_active_arena(this, &stmt_backup);
+ thd->restore_backup_statement(this, &stmt_backup);
+ thd->stmt_arena= save_stmt_arena;
+
+ save_change_list= thd->change_list;
+
+ /* Items and memory will freed in destructor */
+
+ return error;
+}
+
+
/**
Reprepare this prepared statement.
@@ -3328,12 +3502,12 @@ Prepared_statement::reprepare()
#endif
/*
Clear possible warnings during reprepare, it has to be completely
- transparent to the user. We use mysql_reset_errors() since
+ transparent to the user. We use clear_warning_info() since
there were no separate query id issued for re-prepare.
Sic: we can't simply silence warnings during reprepare, because if
it's failed, we need to return all the warnings to the user.
*/
- mysql_reset_errors(thd, TRUE);
+ thd->warning_info->clear_warning_info(thd->query_id);
}
return error;
}
@@ -3613,6 +3787,15 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (state == Query_arena::PREPARED)
state= Query_arena::EXECUTED;
+ if (this->lex->sql_command == SQLCOM_CALL)
+ {
+ if (is_sql_prepare())
+ thd->protocol_text.send_out_parameters(&this->lex->param_list);
+ else
+ thd->protocol->send_out_parameters(&this->lex->param_list);
+ }
+
+
/*
Log COM_EXECUTE to the general log. Note, that in case of SQL
prepared statements this causes two records to be output:
@@ -3646,3 +3829,573 @@ void Prepared_statement::deallocate()
/* Statement map calls delete stmt on erase */
thd->stmt_map.erase(this);
}
+
+
+/***************************************************************************
+* Ed_result_set
+***************************************************************************/
+/**
+ Use operator delete to free memory of Ed_result_set.
+ Accessing members of a class after the class has been destroyed
+ is a violation of the C++ standard but is commonly used in the
+ server code.
+*/
+
+void Ed_result_set::operator delete(void *ptr, size_t size) throw ()
+{
+ if (ptr)
+ {
+ /*
+ Make a stack copy, otherwise free_root() will attempt to
+ write to freed memory.
+ */
+ MEM_ROOT own_root= ((Ed_result_set*) ptr)->m_mem_root;
+ free_root(&own_root, MYF(0));
+ }
+}
+
+
+/**
+ Initialize an instance of Ed_result_set.
+
+ Instances of the class, as well as all result set rows, are
+ always allocated in the memory root passed over as the second
+ argument. In the constructor, we take over ownership of the
+ memory root. It will be freed when the class is destroyed.
+
+ sic: Ed_result_est is not designed to be allocated on stack.
+*/
+
+Ed_result_set::Ed_result_set(List<Ed_row> *rows_arg,
+ size_t column_count_arg,
+ MEM_ROOT *mem_root_arg)
+ :m_mem_root(*mem_root_arg),
+ m_column_count(column_count_arg),
+ m_rows(rows_arg),
+ m_next_rset(NULL)
+{
+ /* Take over responsibility for the memory */
+ clear_alloc_root(mem_root_arg);
+}
+
+/***************************************************************************
+* Ed_result_set
+***************************************************************************/
+
+/**
+ Create a new "execute direct" connection.
+*/
+
+Ed_connection::Ed_connection(THD *thd)
+ :m_warning_info(thd->query_id),
+ m_thd(thd),
+ m_rsets(0),
+ m_current_rset(0)
+{
+}
+
+
+/**
+ Free all result sets of the previous statement, if any,
+ and reset warnings and errors.
+
+ Called before execution of the next query.
+*/
+
+void
+Ed_connection::free_old_result()
+{
+ while (m_rsets)
+ {
+ Ed_result_set *rset= m_rsets->m_next_rset;
+ delete m_rsets;
+ m_rsets= rset;
+ }
+ m_current_rset= m_rsets;
+ m_diagnostics_area.reset_diagnostics_area();
+ m_warning_info.clear_warning_info(m_thd->query_id);
+}
+
+
+/**
+ A simple wrapper that uses a helper class to execute SQL statements.
+*/
+
+bool
+Ed_connection::execute_direct(LEX_STRING sql_text)
+{
+ Execute_sql_statement execute_sql_statement(sql_text);
+ DBUG_PRINT("ed_query", ("%s", sql_text.str));
+
+ return execute_direct(&execute_sql_statement);
+}
+
+
+/**
+ Execute a fragment of server functionality without an effect on
+ thd, and store results in memory.
+
+ Conventions:
+ - the code fragment must finish with OK, EOF or ERROR.
+ - the code fragment doesn't have to close thread tables,
+ free memory, commit statement transaction or do any other
+ cleanup that is normally done in the end of dispatch_command().
+
+ @param server_runnable A code fragment to execute.
+*/
+
+bool Ed_connection::execute_direct(Server_runnable *server_runnable)
+{
+ bool rc= FALSE;
+ Protocol_local protocol_local(m_thd, this);
+ Prepared_statement stmt(m_thd);
+ Protocol *save_protocol= m_thd->protocol;
+ Diagnostics_area *save_diagnostics_area= m_thd->stmt_da;
+ Warning_info *save_warning_info= m_thd->warning_info;
+
+ DBUG_ENTER("Ed_connection::execute_direct");
+
+ free_old_result(); /* Delete all data from previous execution, if any */
+
+ m_thd->protocol= &protocol_local;
+ m_thd->stmt_da= &m_diagnostics_area;
+ m_thd->warning_info= &m_warning_info;
+
+ rc= stmt.execute_server_runnable(server_runnable);
+ m_thd->protocol->end_statement();
+
+ m_thd->protocol= save_protocol;
+ m_thd->stmt_da= save_diagnostics_area;
+ m_thd->warning_info= save_warning_info;
+ /*
+ Protocol_local makes use of m_current_rset to keep
+ track of the last result set, while adding result sets to the end.
+ Reset it to point to the first result set instead.
+ */
+ m_current_rset= m_rsets;
+
+ DBUG_RETURN(rc);
+}
+
+
+/**
+ A helper method that is called only during execution.
+
+ Although Ed_connection doesn't support multi-statements,
+ a statement may generate many result sets. All subsequent
+ result sets are appended to the end.
+
+ @pre This is called only by Protocol_local.
+*/
+
+void
+Ed_connection::add_result_set(Ed_result_set *ed_result_set)
+{
+ if (m_rsets)
+ {
+ m_current_rset->m_next_rset= ed_result_set;
+ /* While appending, use m_current_rset as a pointer to the tail. */
+ m_current_rset= ed_result_set;
+ }
+ else
+ m_current_rset= m_rsets= ed_result_set;
+}
+
+
+/**
+ Release ownership of the current result set to the client.
+
+ Since we use a simple linked list for result sets,
+ this method uses a linear search of the previous result
+ set to exclude the released instance from the list.
+
+ @todo Use double-linked list, when this is really used.
+
+ XXX: This has never been tested with more than one result set!
+
+ @pre There must be a result set.
+*/
+
+Ed_result_set *
+Ed_connection::store_result_set()
+{
+ Ed_result_set *ed_result_set;
+
+ DBUG_ASSERT(m_current_rset);
+
+ if (m_current_rset == m_rsets)
+ {
+ /* Assign the return value */
+ ed_result_set= m_current_rset;
+ /* Exclude the return value from the list. */
+ m_current_rset= m_rsets= m_rsets->m_next_rset;
+ }
+ else
+ {
+ Ed_result_set *prev_rset= m_rsets;
+ /* Assign the return value. */
+ ed_result_set= m_current_rset;
+
+ /* Exclude the return value from the list */
+ while (prev_rset->m_next_rset != m_current_rset)
+ prev_rset= ed_result_set->m_next_rset;
+ m_current_rset= prev_rset->m_next_rset= m_current_rset->m_next_rset;
+ }
+ ed_result_set->m_next_rset= NULL; /* safety */
+
+ return ed_result_set;
+}
+
+/*************************************************************************
+* Protocol_local
+**************************************************************************/
+
+Protocol_local::Protocol_local(THD *thd, Ed_connection *ed_connection)
+ :Protocol(thd),
+ m_connection(ed_connection),
+ m_rset(NULL),
+ m_column_count(0),
+ m_current_row(NULL),
+ m_current_column(NULL)
+{
+ clear_alloc_root(&m_rset_root);
+}
+
+/**
+ Called between two result set rows.
+
+ Prepare structures to fill result set rows.
+ Unfortunately, we can't return an error here. If memory allocation
+ fails, we'll have to return an error later. And so is done
+ in methods such as @sa store_column().
+*/
+
+void Protocol_local::prepare_for_resend()
+{
+ DBUG_ASSERT(alloc_root_inited(&m_rset_root));
+
+ opt_add_row_to_rset();
+ /* Start a new row. */
+ m_current_row= (Ed_column *) alloc_root(&m_rset_root,
+ sizeof(Ed_column) * m_column_count);
+ m_current_column= m_current_row;
+}
+
+
+/**
+ In "real" protocols this is called to finish a result set row.
+ Unused in the local implementation.
+*/
+
+bool Protocol_local::write()
+{
+ return FALSE;
+}
+
+/**
+ A helper function to add the current row to the current result
+ set. Called in @sa prepare_for_resend(), when a new row is started,
+ and in send_eof(), when the result set is finished.
+*/
+
+void Protocol_local::opt_add_row_to_rset()
+{
+ if (m_current_row)
+ {
+ /* Add the old row to the result set */
+ Ed_row *ed_row= new (&m_rset_root) Ed_row(m_current_row, m_column_count);
+ if (ed_row)
+ m_rset->push_back(ed_row, &m_rset_root);
+ }
+}
+
+
+/**
+ Add a NULL column to the current row.
+*/
+
+bool Protocol_local::store_null()
+{
+ if (m_current_column == NULL)
+ return TRUE; /* prepare_for_resend() failed to allocate memory. */
+
+ bzero(m_current_column, sizeof(*m_current_column));
+ ++m_current_column;
+ return FALSE;
+}
+
+
+/**
+ A helper method to add any column to the current row
+ in its binary form.
+
+ Allocates memory for the data in the result set memory root.
+*/
+
+bool Protocol_local::store_column(const void *data, size_t length)
+{
+ if (m_current_column == NULL)
+ return TRUE; /* prepare_for_resend() failed to allocate memory. */
+ /*
+ alloc_root() automatically aligns memory, so we don't need to
+ do any extra alignment if we're pointing to, say, an integer.
+ */
+ m_current_column->str= (char*) memdup_root(&m_rset_root,
+ data,
+ length + 1 /* Safety */);
+ if (! m_current_column->str)
+ return TRUE;
+ m_current_column->str[length]= '\0'; /* Safety */
+ m_current_column->length= length;
+ ++m_current_column;
+ return FALSE;
+}
+
+
+/**
+ Store a string value in a result set column, optionally
+ having converted it to character_set_results.
+*/
+
+bool
+Protocol_local::store_string(const char *str, size_t length,
+ CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs)
+{
+ /* Store with conversion */
+ uint error_unused;
+
+ if (dst_cs && !my_charset_same(src_cs, dst_cs) &&
+ src_cs != &my_charset_bin &&
+ dst_cs != &my_charset_bin)
+ {
+ if (convert->copy(str, length, src_cs, dst_cs, &error_unused))
+ return TRUE;
+ str= convert->ptr();
+ length= convert->length();
+ }
+ return store_column(str, length);
+}
+
+
+/** Store a tiny int as is (1 byte) in a result set column. */
+
+bool Protocol_local::store_tiny(longlong value)
+{
+ char v= (char) value;
+ return store_column(&v, 1);
+}
+
+
+/** Store a short as is (2 bytes, host order) in a result set column. */
+
+bool Protocol_local::store_short(longlong value)
+{
+ int16 v= (int16) value;
+ return store_column(&v, 2);
+}
+
+
+/** Store a "long" as is (4 bytes, host order) in a result set column. */
+
+bool Protocol_local::store_long(longlong value)
+{
+ int32 v= (int32) value;
+ return store_column(&v, 4);
+}
+
+
+/** Store a "longlong" as is (8 bytes, host order) in a result set column. */
+
+bool Protocol_local::store_longlong(longlong value, bool unsigned_flag)
+{
+ int64 v= (int64) value;
+ return store_column(&v, 8);
+}
+
+
+/** Store a decimal in string format in a result set column */
+
+bool Protocol_local::store_decimal(const my_decimal *value)
+{
+ char buf[DECIMAL_MAX_STR_LENGTH];
+ String str(buf, sizeof (buf), &my_charset_bin);
+ int rc;
+
+ rc= my_decimal2string(E_DEC_FATAL_ERROR, value, 0, 0, 0, &str);
+
+ if (rc)
+ return TRUE;
+
+ return store_column(str.ptr(), str.length());
+}
+
+
+/** Convert to cs_results and store a string. */
+
+bool Protocol_local::store(const char *str, size_t length,
+ CHARSET_INFO *src_cs)
+{
+ CHARSET_INFO *dst_cs;
+
+ dst_cs= m_connection->m_thd->variables.character_set_results;
+ return store_string(str, length, src_cs, dst_cs);
+}
+
+
+/** Store a string. */
+
+bool Protocol_local::store(const char *str, size_t length,
+ CHARSET_INFO *src_cs, CHARSET_INFO *dst_cs)
+{
+ return store_string(str, length, src_cs, dst_cs);
+}
+
+
+/* Store MYSQL_TIME (in binary format) */
+
+bool Protocol_local::store(MYSQL_TIME *time)
+{
+ return store_column(time, sizeof(MYSQL_TIME));
+}
+
+
+/** Store MYSQL_TIME (in binary format) */
+
+bool Protocol_local::store_date(MYSQL_TIME *time)
+{
+ return store_column(time, sizeof(MYSQL_TIME));
+}
+
+
+/** Store MYSQL_TIME (in binary format) */
+
+bool Protocol_local::store_time(MYSQL_TIME *time)
+{
+ return store_column(time, sizeof(MYSQL_TIME));
+}
+
+
+/* Store a floating point number, as is. */
+
+bool Protocol_local::store(float value, uint32 decimals, String *buffer)
+{
+ return store_column(&value, sizeof(float));
+}
+
+
+/* Store a double precision number, as is. */
+
+bool Protocol_local::store(double value, uint32 decimals, String *buffer)
+{
+ return store_column(&value, sizeof (double));
+}
+
+
+/* Store a Field. */
+
+bool Protocol_local::store(Field *field)
+{
+ if (field->is_null())
+ return store_null();
+ return field->send_binary(this);
+}
+
+
+/** Called to start a new result set. */
+
+bool Protocol_local::send_result_set_metadata(List<Item> *columns, uint)
+{
+ DBUG_ASSERT(m_rset == 0 && !alloc_root_inited(&m_rset_root));
+
+ init_sql_alloc(&m_rset_root, MEM_ROOT_BLOCK_SIZE, 0);
+
+ if (! (m_rset= new (&m_rset_root) List<Ed_row>))
+ return TRUE;
+
+ m_column_count= columns->elements;
+
+ return FALSE;
+}
+
+
+/**
+ Normally this is a separate result set with OUT parameters
+ of stored procedures. Currently unsupported for the local
+ version.
+*/
+
+bool Protocol_local::send_out_parameters(List<Item_param> *sp_params)
+{
+ return FALSE;
+}
+
+
+/** Called for statements that don't have a result set, at statement end. */
+
+bool
+Protocol_local::send_ok(uint server_status, uint statement_warn_count,
+ ulonglong affected_rows, ulonglong last_insert_id,
+ const char *message)
+{
+ /*
+ Just make sure nothing is sent to the client, we have grabbed
+ the status information in the connection diagnostics area.
+ */
+ return FALSE;
+}
+
+
+/**
+ Called at the end of a result set. Append a complete
+ result set to the list in Ed_connection.
+
+ Don't send anything to the client, but instead finish
+ building of the result set at hand.
+*/
+
+bool Protocol_local::send_eof(uint server_status, uint statement_warn_count)
+{
+ Ed_result_set *ed_result_set;
+
+ DBUG_ASSERT(m_rset);
+
+ opt_add_row_to_rset();
+ m_current_row= 0;
+
+ ed_result_set= new (&m_rset_root) Ed_result_set(m_rset, m_column_count,
+ &m_rset_root);
+
+ m_rset= NULL;
+
+ if (! ed_result_set)
+ return TRUE;
+
+ /* In case of successful allocation memory ownership was transferred. */
+ DBUG_ASSERT(!alloc_root_inited(&m_rset_root));
+
+ /*
+ Link the created Ed_result_set instance into the list of connection
+ result sets. Never fails.
+ */
+ m_connection->add_result_set(ed_result_set);
+ return FALSE;
+}
+
+
+/** Called to send an error to the client at the end of a statement. */
+
+bool
+Protocol_local::send_error(uint sql_errno, const char *err_msg, const char*)
+{
+ /*
+ Just make sure that nothing is sent to the client (default
+ implementation).
+ */
+ return FALSE;
+}
+
+
+#ifdef EMBEDDED_LIBRARY
+void Protocol_local::remove_last_row()
+{ }
+#endif
diff --git a/sql/sql_prepare.h b/sql/sql_prepare.h
new file mode 100644
index 00000000000..11017b127b1
--- /dev/null
+++ b/sql/sql_prepare.h
@@ -0,0 +1,367 @@
+#ifndef SQL_PREPARE_H
+#define SQL_PREPARE_H
+/* Copyright (C) 1995-2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "sql_error.h"
+
+class THD;
+struct LEX;
+
+/**
+ An interface that is used to take an action when
+ the locking module notices that a table version has changed
+ since the last execution. "Table" here may refer to any kind of
+ table -- a base table, a temporary table, a view or an
+ information schema table.
+
+ When we open and lock tables for execution of a prepared
+ statement, we must verify that they did not change
+ since statement prepare. If some table did change, the statement
+ parse tree *may* be no longer valid, e.g. in case it contains
+ optimizations that depend on table metadata.
+
+ This class provides an interface (a method) that is
+ invoked when such a situation takes place.
+ The implementation of the method simply reports an error, but
+ the exact details depend on the nature of the SQL statement.
+
+ At most 1 instance of this class is active at a time, in which
+ case THD::m_reprepare_observer is not NULL.
+
+ @sa check_and_update_table_version() for details of the
+ version tracking algorithm
+
+ @sa Open_tables_state::m_reprepare_observer for the life cycle
+ of metadata observers.
+*/
+
+class Reprepare_observer
+{
+public:
+ /**
+ Check if a change of metadata is OK. In future
+ the signature of this method may be extended to accept the old
+ and the new versions, but since currently the check is very
+ simple, we only need the THD to report an error.
+ */
+ bool report_error(THD *thd);
+ bool is_invalidated() const { return m_invalidated; }
+ void reset_reprepare_observer() { m_invalidated= FALSE; }
+private:
+ bool m_invalidated;
+};
+
+
+void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length);
+void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length);
+void mysqld_stmt_close(THD *thd, char *packet);
+void mysql_sql_stmt_prepare(THD *thd);
+void mysql_sql_stmt_execute(THD *thd);
+void mysql_sql_stmt_close(THD *thd);
+void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length);
+void mysqld_stmt_reset(THD *thd, char *packet);
+void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
+void reinit_stmt_before_use(THD *thd, LEX *lex);
+
+/**
+ Execute a fragment of server code in an isolated context, so that
+ it doesn't leave any effect on THD. THD must have no open tables.
+ The code must not leave any open tables around.
+ The result of execution (if any) is stored in Ed_result.
+*/
+
+class Server_runnable
+{
+public:
+ virtual bool execute_server_code(THD *thd)= 0;
+ virtual ~Server_runnable();
+};
+
+
+/**
+ Execute direct interface.
+
+ @todo Implement support for prelocked mode.
+*/
+
+class Ed_row;
+
+/**
+ Ed_result_set -- a container with result set rows.
+ @todo Implement support for result set metadata and
+ automatic type conversion.
+*/
+
+class Ed_result_set: public Sql_alloc
+{
+public:
+ operator List<Ed_row>&() { return *m_rows; }
+ unsigned int size() const { return m_rows->elements; }
+
+ Ed_result_set(List<Ed_row> *rows_arg, size_t column_count,
+ MEM_ROOT *mem_root_arg);
+
+ /** We don't call member destructors, they all are POD types. */
+ ~Ed_result_set() {}
+
+ size_t get_field_count() const { return m_column_count; }
+
+ static void operator delete(void *ptr, size_t size) throw ();
+private:
+ Ed_result_set(const Ed_result_set &); /* not implemented */
+ Ed_result_set &operator=(Ed_result_set &); /* not implemented */
+private:
+ MEM_ROOT m_mem_root;
+ size_t m_column_count;
+ List<Ed_row> *m_rows;
+ Ed_result_set *m_next_rset;
+ friend class Ed_connection;
+};
+
+
+class Ed_connection
+{
+public:
+ /**
+ Construct a new "execute direct" connection.
+
+ The connection can be used to execute SQL statements.
+ If the connection failed to initialize, the error
+ will be returned on the attempt to execute a statement.
+
+ @pre thd must have no open tables
+ while the connection is used. However,
+ Ed_connection works okay in LOCK TABLES mode.
+ Other properties of THD, such as the current warning
+ information, errors, etc. do not matter and are
+ preserved by Ed_connection. One thread may have many
+ Ed_connections created for it.
+ */
+ Ed_connection(THD *thd);
+
+ /**
+ Execute one SQL statement.
+
+ Until this method is executed, no other methods of
+ Ed_connection can be used. Life cycle of Ed_connection is:
+
+ Initialized -> a statement has been executed ->
+ look at result, move to next result ->
+ look at result, move to next result ->
+ ...
+ moved beyond the last result == Initialized.
+
+ This method can be called repeatedly. Once it's invoked,
+ results of the previous execution are lost.
+
+ A result of execute_direct() can be either:
+
+ - success, no result set rows. In this case get_field_count()
+ returns 0. This happens after execution of INSERT, UPDATE,
+ DELETE, DROP and similar statements. Some other methods, such
+ as get_affected_rows() can be used to retrieve additional
+ result information.
+
+ - success, there are some result set rows (maybe 0). E.g.
+ happens after SELECT. In this case get_field_count() returns
+ the number of columns in a result set and store_result()
+ can be used to retrieve a result set..
+
+ - an error, methods to retrieve error information can
+ be used.
+
+ @return execution status
+ @retval FALSE success, use get_field_count()
+ to determine what to do next.
+ @retval TRUE error, use get_last_error()
+ to see the error number.
+ */
+ bool execute_direct(LEX_STRING sql_text);
+
+ /**
+ Same as the previous, but takes an instance of Server_runnable
+ instead of SQL statement text.
+
+ @return execution status
+
+ @retval FALSE success, use get_field_count()
+ if your code fragment is supposed to
+ return a result set
+ @retval TRUE failure
+ */
+ bool execute_direct(Server_runnable *server_runnable);
+
+ /**
+ Get the number of result set fields.
+
+ This method is valid only if we have a result:
+ execute_direct() has been called. Otherwise
+ the returned value is undefined.
+
+ @sa Documentation for C API function
+ mysql_field_count()
+ */
+ ulong get_field_count() const
+ {
+ return m_current_rset ? m_current_rset->get_field_count() : 0;
+ }
+
+ /**
+ Get the number of affected (deleted, updated)
+ rows for the current statement. Can be
+ used for statements with get_field_count() == 0.
+
+ @sa Documentation for C API function
+ mysql_affected_rows().
+ */
+ ulonglong get_affected_rows() const
+ {
+ return m_diagnostics_area.affected_rows();
+ }
+
+ /**
+ Get the last insert id, if any.
+
+ @sa Documentation for mysql_insert_id().
+ */
+ ulonglong get_last_insert_id() const
+ {
+ return m_diagnostics_area.last_insert_id();
+ }
+
+ /**
+ Get the total number of warnings for the last executed
+ statement. Note, that there is only one warning list even
+ if a statement returns multiple results.
+
+ @sa Documentation for C API function
+ mysql_num_warnings().
+ */
+ ulong get_warn_count() const
+ {
+ return m_warning_info.warn_count();
+ }
+ /**
+ Get the server warnings as a result set.
+ The result set has fixed metadata:
+ The first column is the level.
+ The second is a numeric code.
+ The third is warning text.
+ */
+ List<MYSQL_ERROR> *get_warn_list() { return &m_warning_info.warn_list(); }
+ /**
+ The following members are only valid if execute_direct()
+ or move_to_next_result() returned an error.
+ They never fail, but if they are called when there is no
+ result, or no error, the result is not defined.
+ */
+ const char *get_last_error() const { return m_diagnostics_area.message(); }
+ unsigned int get_last_errno() const { return m_diagnostics_area.sql_errno(); }
+ const char *get_last_sqlstate() const { return m_diagnostics_area.get_sqlstate(); }
+
+ /**
+ Provided get_field_count() is not 0, this never fails. You don't
+ need to free the result set, this is done automatically when
+ you advance to the next result set or destroy the connection.
+ Not returning const because of List iterator not accepting
+ Should be used when you would like Ed_connection to manage
+ result set memory for you.
+ */
+ Ed_result_set *use_result_set() { return m_current_rset; }
+ /**
+ Provided get_field_count() is not 0, this never fails. You
+ must free the returned result set. This can be called only
+ once after execute_direct().
+ Should be used when you would like to get the results
+ and destroy the connection.
+ */
+ Ed_result_set *store_result_set();
+
+ /**
+ If the query returns multiple results, this method
+ can be checked if there is another result beyond the next
+ one.
+ Never fails.
+ */
+ bool has_next_result() const { return test(m_current_rset->m_next_rset); }
+ /**
+ Only valid to call if has_next_result() returned true.
+ Otherwise the result is undefined.
+ */
+ bool move_to_next_result()
+ {
+ m_current_rset= m_current_rset->m_next_rset;
+ return test(m_current_rset);
+ }
+
+ ~Ed_connection() { free_old_result(); }
+private:
+ Diagnostics_area m_diagnostics_area;
+ Warning_info m_warning_info;
+ /**
+ Execute direct interface does not support multi-statements, only
+ multi-results. So we never have a situation when we have
+ a mix of result sets and OK or error packets. We either
+ have a single result set, a single error, or a single OK,
+ or we have a series of result sets, followed by an OK or error.
+ */
+ THD *m_thd;
+ Ed_result_set *m_rsets;
+ Ed_result_set *m_current_rset;
+ friend class Protocol_local;
+private:
+ void free_old_result();
+ void add_result_set(Ed_result_set *ed_result_set);
+private:
+ Ed_connection(const Ed_connection &); /* not implemented */
+ Ed_connection &operator=(Ed_connection &); /* not implemented */
+};
+
+
+/** One result set column. */
+
+struct Ed_column: public LEX_STRING
+{
+ /** Implementation note: destructor for this class is never called. */
+};
+
+
+/** One result set record. */
+
+class Ed_row: public Sql_alloc
+{
+public:
+ const Ed_column &operator[](const unsigned int column_index) const
+ {
+ return *get_column(column_index);
+ }
+ const Ed_column *get_column(const unsigned int column_index) const
+ {
+ DBUG_ASSERT(column_index < size());
+ return m_column_array + column_index;
+ }
+ size_t size() const { return m_column_count; }
+
+ Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
+ :m_column_array(column_array_arg),
+ m_column_count(column_count_arg)
+ {}
+private:
+ Ed_column *m_column_array;
+ size_t m_column_count; /* TODO: change to point to metadata */
+};
+
+#endif // SQL_PREPARE_H
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 8c9b147089f..69e5bc3cbb4 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -47,7 +47,7 @@ const char * const _unknown_func_ = "<unknown>";
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables,
Item *cond)
{
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
return(thd->profiling.fill_statistics_info(thd, tables, cond));
#else
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILE", "enable-profiling");
@@ -129,7 +129,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
}
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
#define RUSAGE_USEC(tv) ((tv).tv_sec*1000*1000 + (tv).tv_usec)
#define RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1))-RUSAGE_USEC((tv2)))
@@ -415,7 +415,7 @@ bool PROFILING::show_profiles()
MYSQL_TYPE_DOUBLE));
field_list.push_back(new Item_empty_string("Query", 40));
- if (thd->protocol->send_fields(&field_list,
+ if (thd->protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index 245959e0953..bffe1cb576b 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -41,7 +41,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
#define PROFILE_ALL (uint)(~0)
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+#if defined(ENABLED_PROFILING)
#include "mysql_priv.h"
#ifdef HAVE_SYS_RESOURCE_H
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b8f2e1e39bf..4e5ce08ab5d 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -21,6 +21,7 @@
#include "log_event.h"
#include "rpl_filter.h"
#include <my_dir.h>
+#include "rpl_handler.h"
int max_binlog_dump_events = 0; // unlimited
my_bool opt_sporadic_binlog_dump_fail = 0;
@@ -80,6 +81,32 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
DBUG_RETURN(0);
}
+/*
+ Reset thread transmit packet buffer for event sending
+
+ This function allocates header bytes for event transmission, and
+ should be called before store the event data to the packet buffer.
+*/
+static int reset_transmit_packet(THD *thd, ushort flags,
+ ulong *ev_offset, const char **errmsg)
+{
+ int ret= 0;
+ String *packet= &thd->packet;
+
+ /* reserve and set default header */
+ packet->length(0);
+ packet->set("\0", 1, &my_charset_bin);
+
+ if (RUN_HOOK(binlog_transmit, reserve_header, (thd, flags, packet)))
+ {
+ *errmsg= "Failed to run hook 'reserve_header'";
+ my_errno= ER_UNKNOWN_ERROR;
+ ret= 1;
+ }
+ *ev_offset= packet->length();
+ return ret;
+}
+
static int send_file(THD *thd)
{
NET* net = &thd->net;
@@ -336,6 +363,73 @@ Increase max_allowed_packet on master";
}
+/**
+ An auxiliary function for calling in mysql_binlog_send
+ to initialize the heartbeat timeout in waiting for a binlogged event.
+
+ @param[in] thd THD to access a user variable
+
+ @return heartbeat period an ulonglong of nanoseconds
+ or zero if heartbeat was not demanded by slave
+*/
+static ulonglong get_heartbeat_period(THD * thd)
+{
+ my_bool null_value;
+ LEX_STRING name= { C_STRING_WITH_LEN("master_heartbeat_period")};
+ user_var_entry *entry=
+ (user_var_entry*) my_hash_search(&thd->user_vars, (uchar*) name.str,
+ name.length);
+ return entry? entry->val_int(&null_value) : 0;
+}
+
+/*
+ Function prepares and sends repliation heartbeat event.
+
+ @param net net object of THD
+ @param packet buffer to store the heartbeat instance
+ @param event_coordinates binlog file name and position of the last
+ real event master sent from binlog
+
+ @note
+ Among three essential pieces of heartbeat data Log_event::when
+ is computed locally.
+ The error to send is serious and should force terminating
+ the dump thread.
+*/
+static int send_heartbeat_event(NET* net, String* packet,
+ const struct event_coordinates *coord)
+{
+ DBUG_ENTER("send_heartbeat_event");
+ char header[LOG_EVENT_HEADER_LEN];
+ /*
+ 'when' (the timestamp) is set to 0 so that slave could distinguish between
+ real and fake Rotate events (if necessary)
+ */
+ memset(header, 0, 4); // when
+
+ header[EVENT_TYPE_OFFSET] = HEARTBEAT_LOG_EVENT;
+
+ char* p= coord->file_name + dirname_length(coord->file_name);
+
+ uint ident_len = strlen(p);
+ ulong event_len = ident_len + LOG_EVENT_HEADER_LEN;
+ int4store(header + SERVER_ID_OFFSET, server_id);
+ int4store(header + EVENT_LEN_OFFSET, event_len);
+ int2store(header + FLAGS_OFFSET, 0);
+
+ int4store(header + LOG_POS_OFFSET, coord->pos); // log_pos
+
+ packet->append(header, sizeof(header));
+ packet->append(p, ident_len); // log_file_name
+
+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) ||
+ net_flush(net))
+ {
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(0);
+}
+
/*
TODO: Clean up loop to only have one call to send_file()
*/
@@ -346,6 +440,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
LOG_INFO linfo;
char *log_file_name = linfo.log_file_name;
char search_file_name[FN_REFLEN], *name;
+
+ ulong ev_offset;
+
IO_CACHE log;
File file = -1;
String* packet = &thd->packet;
@@ -361,6 +458,30 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
bzero((char*) &log,sizeof(log));
+ /*
+ heartbeat_period from @master_heartbeat_period user variable
+ */
+ ulonglong heartbeat_period= get_heartbeat_period(thd);
+ struct timespec heartbeat_buf;
+ struct event_coordinates coord_buf;
+ struct timespec *heartbeat_ts= NULL;
+ struct event_coordinates *coord= NULL;
+ if (heartbeat_period != LL(0))
+ {
+ heartbeat_ts= &heartbeat_buf;
+ set_timespec_nsec(*heartbeat_ts, 0);
+ coord= &coord_buf;
+ coord->file_name= log_file_name; // initialization basing on what slave remembers
+ coord->pos= pos;
+ }
+ sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)",
+ thd->server_id, log_ident, (ulong)pos);
+ if (RUN_HOOK(binlog_transmit, transmit_start, (thd, flags, log_ident, pos)))
+ {
+ errmsg= "Failed to run hook 'transmit_start'";
+ my_errno= ER_UNKNOWN_ERROR;
+ goto err;
+ }
#ifndef DBUG_OFF
if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2))
@@ -416,11 +537,9 @@ impossible position";
goto err;
}
- /*
- We need to start a packet with something other than 255
- to distinguish it from error
- */
- packet->set("\0", 1, &my_charset_bin); /* This is the start of a new packet */
+ /* reset transmit packet for the fake rotate event below */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
/*
Tell the client about the log name with a fake Rotate event;
@@ -460,7 +579,7 @@ impossible position";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
- packet->set("\0", 1, &my_charset_bin);
+
/*
Adding MAX_LOG_EVENT_HEADER_LEN, since a binlog event can become
this larger than the corresponding packet (query) sent
@@ -476,6 +595,11 @@ impossible position";
log_lock = mysql_bin_log.get_log_lock();
if (pos > BIN_LOG_HEADER_SIZE)
{
+ /* reset transmit packet for the event read from binary log
+ file */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
+
/*
Try to find a Format_description_log_event at the beginning of
the binlog
@@ -483,29 +607,30 @@ impossible position";
if (!(error = Log_event::read_log_event(&log, packet, log_lock)))
{
/*
- The packet has offsets equal to the normal offsets in a binlog
- event +1 (the first character is \0).
+ The packet has offsets equal to the normal offsets in a
+ binlog event + ev_offset (the first ev_offset characters are
+ the header (default \0)).
*/
DBUG_PRINT("info",
("Looked for a Format_description_log_event, found event type %d",
- (*packet)[EVENT_TYPE_OFFSET+1]));
- if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
+ (*packet)[EVENT_TYPE_OFFSET+ev_offset]));
+ if ((*packet)[EVENT_TYPE_OFFSET+ev_offset] == FORMAT_DESCRIPTION_EVENT)
{
- binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
+ binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+ev_offset] &
LOG_EVENT_BINLOG_IN_USE_F);
- (*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F;
+ (*packet)[FLAGS_OFFSET+ev_offset] &= ~LOG_EVENT_BINLOG_IN_USE_F;
/*
mark that this event with "log_pos=0", so the slave
should not increment master's binlog position
(rli->group_master_log_pos)
*/
- int4store((char*) packet->ptr()+LOG_POS_OFFSET+1, 0);
+ int4store((char*) packet->ptr()+LOG_POS_OFFSET+ev_offset, 0);
/*
if reconnect master sends FD event with `created' as 0
to avoid destroying temp tables.
*/
int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+
- ST_CREATED_OFFSET+1, (ulong) 0);
+ ST_CREATED_OFFSET+ev_offset, (ulong) 0);
/* send it */
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
{
@@ -531,8 +656,6 @@ impossible position";
Format_description_log_event will be found naturally if it is written.
*/
}
- /* reset the packet as we wrote to it in any case */
- packet->set("\0", 1, &my_charset_bin);
} /* end of if (pos > BIN_LOG_HEADER_SIZE); */
else
{
@@ -544,6 +667,12 @@ impossible position";
while (!net->error && net->vio != 0 && !thd->killed)
{
+ Log_event_type event_type= UNKNOWN_EVENT;
+
+ /* reset the transmit packet for the event read from binary log
+ file */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
{
#ifndef DBUG_OFF
@@ -555,16 +684,31 @@ impossible position";
goto err;
}
#endif
+ /*
+ log's filename does not change while it's active
+ */
+ if (coord)
+ coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET);
- if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
+ event_type= (Log_event_type)((*packet)[LOG_EVENT_OFFSET+ev_offset]);
+ if (event_type == FORMAT_DESCRIPTION_EVENT)
{
- binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
+ binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+ev_offset] &
LOG_EVENT_BINLOG_IN_USE_F);
- (*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F;
+ (*packet)[FLAGS_OFFSET+ev_offset] &= ~LOG_EVENT_BINLOG_IN_USE_F;
}
- else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
+ else if (event_type == STOP_EVENT)
binlog_can_be_corrupted= FALSE;
+ pos = my_b_tell(&log);
+ if (RUN_HOOK(binlog_transmit, before_send_event,
+ (thd, flags, packet, log_file_name, pos)))
+ {
+ my_errno= ER_UNKNOWN_ERROR;
+ errmsg= "run 'before_send_event' hook failed";
+ goto err;
+ }
+
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
{
errmsg = "Failed on my_net_write()";
@@ -572,9 +716,8 @@ impossible position";
goto err;
}
- DBUG_PRINT("info", ("log event code %d",
- (*packet)[LOG_EVENT_OFFSET+1] ));
- if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
+ DBUG_PRINT("info", ("log event code %d", event_type));
+ if (event_type == LOAD_EVENT)
{
if (send_file(thd))
{
@@ -583,7 +726,17 @@ impossible position";
goto err;
}
}
- packet->set("\0", 1, &my_charset_bin);
+
+ if (RUN_HOOK(binlog_transmit, after_send_event, (thd, flags, packet)))
+ {
+ errmsg= "Failed to run hook 'after_send_event'";
+ my_errno= ER_UNKNOWN_ERROR;
+ goto err;
+ }
+
+ /* reset transmit packet for next loop */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
}
/*
@@ -634,6 +787,11 @@ impossible position";
}
#endif
+ /* reset the transmit packet for the event read from binary log
+ file */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
+
/*
No one will update the log while we are reading
now, but we'll be quick and just read one record
@@ -650,34 +808,86 @@ impossible position";
/* we read successfully, so we'll need to send it to the slave */
pthread_mutex_unlock(log_lock);
read_packet = 1;
+ if (coord)
+ coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET);
+ event_type= (Log_event_type)((*packet)[LOG_EVENT_OFFSET+ev_offset]);
break;
case LOG_READ_EOF:
+ {
+ int ret;
+ ulong signal_cnt;
DBUG_PRINT("wait",("waiting for data in binary log"));
if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0)
{
pthread_mutex_unlock(log_lock);
goto end;
}
- if (!thd->killed)
- {
- /* Note that the following call unlocks lock_log */
- mysql_bin_log.wait_for_update(thd, 0);
- }
- else
- pthread_mutex_unlock(log_lock);
- DBUG_PRINT("wait",("binary log received update"));
- break;
- default:
+#ifndef DBUG_OFF
+ ulong hb_info_counter= 0;
+#endif
+ signal_cnt= mysql_bin_log.signal_cnt;
+ do
+ {
+ if (coord)
+ {
+ DBUG_ASSERT(heartbeat_ts && heartbeat_period != LL(0));
+ set_timespec_nsec(*heartbeat_ts, heartbeat_period);
+ }
+ ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts);
+ DBUG_ASSERT(ret == 0 || heartbeat_period != LL(0) && coord != NULL);
+ if (ret == ETIMEDOUT || ret == ETIME)
+ {
+#ifndef DBUG_OFF
+ if (hb_info_counter < 3)
+ {
+ sql_print_information("master sends heartbeat message");
+ hb_info_counter++;
+ if (hb_info_counter == 3)
+ sql_print_information("the rest of heartbeat info skipped ...");
+ }
+#endif
+ /* reset transmit packet for the heartbeat event */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
+ if (send_heartbeat_event(net, packet, coord))
+ {
+ errmsg = "Failed on my_net_write()";
+ my_errno= ER_UNKNOWN_ERROR;
+ pthread_mutex_unlock(log_lock);
+ goto err;
+ }
+ }
+ else
+ {
+ DBUG_ASSERT(ret == 0 && signal_cnt != mysql_bin_log.signal_cnt ||
+ thd->killed);
+ DBUG_PRINT("wait",("binary log received update"));
+ }
+ } while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed);
+ pthread_mutex_unlock(log_lock);
+ }
+ break;
+
+ default:
pthread_mutex_unlock(log_lock);
test_for_non_eof_log_read_errors(error, &errmsg);
goto err;
}
if (read_packet)
- {
- thd_proc_info(thd, "Sending binlog event to slave");
+ {
+ thd_proc_info(thd, "Sending binlog event to slave");
+ pos = my_b_tell(&log);
+ if (RUN_HOOK(binlog_transmit, before_send_event,
+ (thd, flags, packet, log_file_name, pos)))
+ {
+ my_errno= ER_UNKNOWN_ERROR;
+ errmsg= "run 'before_send_event' hook failed";
+ goto err;
+ }
+
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
{
errmsg = "Failed on my_net_write()";
@@ -685,7 +895,7 @@ impossible position";
goto err;
}
- if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
+ if (event_type == LOAD_EVENT)
{
if (send_file(thd))
{
@@ -694,11 +904,13 @@ impossible position";
goto err;
}
}
- packet->set("\0", 1, &my_charset_bin);
- /*
- No need to net_flush because we will get to flush later when
- we hit EOF pretty quick
- */
+
+ if (RUN_HOOK(binlog_transmit, after_send_event, (thd, flags, packet)))
+ {
+ my_errno= ER_UNKNOWN_ERROR;
+ errmsg= "Failed to run hook 'after_send_event'";
+ goto err;
+ }
}
log.error=0;
@@ -728,6 +940,10 @@ impossible position";
end_io_cache(&log);
(void) my_close(file, MYF(MY_WME));
+ /* reset transmit packet for the possible fake rotate event */
+ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ goto err;
+
/*
Call fake_rotate_event() in case the previous log (the one which
we have just finished reading) did not contain a Rotate event
@@ -745,8 +961,8 @@ impossible position";
goto err;
}
- packet->length(0);
- packet->append('\0');
+ if (coord)
+ coord->file_name= log_file_name; // reset to the next
}
}
@@ -754,6 +970,7 @@ end:
end_io_cache(&log);
(void)my_close(file, MYF(MY_WME));
+ RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
my_eof(thd);
thd_proc_info(thd, "Waiting to finalize termination");
pthread_mutex_lock(&LOCK_thread_count);
@@ -764,6 +981,7 @@ end:
err:
thd_proc_info(thd, "Waiting to finalize termination");
end_io_cache(&log);
+ RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
/*
Exclude iteration through thread list
this is needed for purge_logs() - it will iterate through
@@ -790,7 +1008,7 @@ err:
@param mi Pointer to Master_info object for the slave's IO thread.
- @param net_report If true, saves the exit status into thd->main_da.
+ @param net_report If true, saves the exit status into thd->stmt_da.
@retval 0 success
@retval 1 error
@@ -928,7 +1146,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
@param mi Pointer to Master_info object for the slave's IO thread.
- @param net_report If true, saves the exit status into thd->main_da.
+ @param net_report If true, saves the exit status into thd->stmt_da.
@retval 0 success
@retval 1 error
@@ -1058,6 +1276,7 @@ int reset_slave(THD *thd, Master_info* mi)
goto err;
}
+ RUN_HOOK(binlog_relay_io, after_reset_slave, (thd, mi));
err:
unlock_slave_threads(mi);
if (error)
@@ -1131,26 +1350,40 @@ bool change_master(THD* thd, Master_info* mi)
int thread_mask;
const char* errmsg= 0;
bool need_relay_log_purge= 1;
+ bool ret= FALSE;
DBUG_ENTER("change_master");
lock_slave_threads(mi);
init_thread_mask(&thread_mask,mi,0 /*not inverse*/);
+ LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
if (thread_mask) // We refuse if any slave thread is running
{
my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
- unlock_slave_threads(mi);
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ goto err;
}
thd_proc_info(thd, "Changing master");
- LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
+ /*
+ We need to check if there is an empty master_host. Otherwise
+ change master succeeds, a master.info file is created containing
+ empty master_host string and when issuing: start slave; an error
+ is thrown stating that the server is not configured as slave.
+ (See BUG#28796).
+ */
+ if(lex_mi->host && !*lex_mi->host)
+ {
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "MASTER_HOST");
+ unlock_slave_threads(mi);
+ DBUG_RETURN(TRUE);
+ }
// TODO: see if needs re-write
if (init_master_info(mi, master_info_file, relay_log_info_file, 0,
thread_mask))
{
my_message(ER_MASTER_INFO, ER(ER_MASTER_INFO), MYF(0));
- unlock_slave_threads(mi);
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ goto err;
}
/*
@@ -1189,13 +1422,46 @@ bool change_master(THD* thd, Master_info* mi)
mi->port = lex_mi->port;
if (lex_mi->connect_retry)
mi->connect_retry = lex_mi->connect_retry;
+ if (lex_mi->heartbeat_opt != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
+ mi->heartbeat_period = lex_mi->heartbeat_period;
+ else
+ mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
+ (slave_net_timeout/2.0));
+ mi->received_heartbeats= LL(0); // counter lives until master is CHANGEd
+ /*
+ reset the last time server_id list if the current CHANGE MASTER
+ is mentioning IGNORE_SERVER_IDS= (...)
+ */
+ if (lex_mi->repl_ignore_server_ids_opt == LEX_MASTER_INFO::LEX_MI_ENABLE)
+ reset_dynamic(&mi->ignore_server_ids);
+ for (uint i= 0; i < lex_mi->repl_ignore_server_ids.elements; i++)
+ {
+ ulong s_id;
+ get_dynamic(&lex_mi->repl_ignore_server_ids, (uchar*) &s_id, i);
+ if (s_id == ::server_id && replicate_same_server_id)
+ {
+ my_error(ER_SLAVE_IGNORE_SERVER_IDS, MYF(0), s_id);
+ ret= TRUE;
+ goto err;
+ }
+ else
+ {
+ if (bsearch((const ulong *) &s_id,
+ mi->ignore_server_ids.buffer,
+ mi->ignore_server_ids.elements, sizeof(ulong),
+ (int (*) (const void*, const void*))
+ change_master_server_id_cmp) == NULL)
+ insert_dynamic(&mi->ignore_server_ids, (uchar*) &s_id);
+ }
+ }
+ sort_dynamic(&mi->ignore_server_ids, (qsort_cmp) change_master_server_id_cmp);
- if (lex_mi->ssl != LEX_MASTER_INFO::SSL_UNCHANGED)
- mi->ssl= (lex_mi->ssl == LEX_MASTER_INFO::SSL_ENABLE);
+ if (lex_mi->ssl != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
+ mi->ssl= (lex_mi->ssl == LEX_MASTER_INFO::LEX_MI_ENABLE);
- if (lex_mi->ssl_verify_server_cert != LEX_MASTER_INFO::SSL_UNCHANGED)
+ if (lex_mi->ssl_verify_server_cert != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
mi->ssl_verify_server_cert=
- (lex_mi->ssl_verify_server_cert == LEX_MASTER_INFO::SSL_ENABLE);
+ (lex_mi->ssl_verify_server_cert == LEX_MASTER_INFO::LEX_MI_ENABLE);
if (lex_mi->ssl_ca)
strmake(mi->ssl_ca, lex_mi->ssl_ca, sizeof(mi->ssl_ca)-1);
@@ -1218,9 +1484,11 @@ bool change_master(THD* thd, Master_info* mi)
if (lex_mi->relay_log_name)
{
need_relay_log_purge= 0;
- strmake(mi->rli.group_relay_log_name,lex_mi->relay_log_name,
+ char relay_log_name[FN_REFLEN];
+ mi->rli.relay_log.make_log_name(relay_log_name, lex_mi->relay_log_name);
+ strmake(mi->rli.group_relay_log_name, relay_log_name,
sizeof(mi->rli.group_relay_log_name)-1);
- strmake(mi->rli.event_relay_log_name,lex_mi->relay_log_name,
+ strmake(mi->rli.event_relay_log_name, relay_log_name,
sizeof(mi->rli.event_relay_log_name)-1);
}
@@ -1267,8 +1535,8 @@ bool change_master(THD* thd, Master_info* mi)
if (flush_master_info(mi, 0))
{
my_error(ER_RELAY_LOG_INIT, MYF(0), "Failed to flush master info file");
- unlock_slave_threads(mi);
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ goto err;
}
if (need_relay_log_purge)
{
@@ -1279,8 +1547,8 @@ bool change_master(THD* thd, Master_info* mi)
&errmsg))
{
my_error(ER_RELAY_LOG_FAIL, MYF(0), errmsg);
- unlock_slave_threads(mi);
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ goto err;
}
}
else
@@ -1295,8 +1563,8 @@ bool change_master(THD* thd, Master_info* mi)
&msg, 0))
{
my_error(ER_RELAY_LOG_INIT, MYF(0), msg);
- unlock_slave_threads(mi);
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ goto err;
}
}
/*
@@ -1333,10 +1601,13 @@ bool change_master(THD* thd, Master_info* mi)
pthread_cond_broadcast(&mi->data_cond);
pthread_mutex_unlock(&mi->rli.data_lock);
+err:
unlock_slave_threads(mi);
thd_proc_info(thd, 0);
- my_ok(thd);
- DBUG_RETURN(FALSE);
+ if (ret == FALSE)
+ my_ok(thd);
+ delete_dynamic(&lex_mi->repl_ignore_server_ids); //freeing of parser-time alloc
+ DBUG_RETURN(ret);
}
@@ -1357,7 +1628,11 @@ int reset_master(THD* thd)
ER(ER_FLUSH_MASTER_BINLOG_CLOSED), MYF(ME_BELL+ME_WAITTANG));
return 1;
}
- return mysql_bin_log.reset_logs(thd);
+
+ if (mysql_bin_log.reset_logs(thd))
+ return 1;
+ RUN_HOOK(binlog_transmit, after_reset_master, (thd, 0 /* flags */));
+ return 0;
}
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
@@ -1395,24 +1670,41 @@ bool mysql_show_binlog_events(THD* thd)
bool ret = TRUE;
IO_CACHE log;
File file = -1;
+ MYSQL_BIN_LOG *binary_log= NULL;
DBUG_ENTER("mysql_show_binlog_events");
Log_event::init_show_field_list(&field_list);
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
Format_description_log_event *description_event= new
Format_description_log_event(3); /* MySQL 4.0 by default */
- /*
- Wait for handlers to insert any pending information
- into the binlog. For e.g. ndb which updates the binlog asynchronously
- this is needed so that the uses sees all its own commands in the binlog
- */
- ha_binlog_wait(thd);
+ DBUG_ASSERT(thd->lex->sql_command == SQLCOM_SHOW_BINLOG_EVENTS ||
+ thd->lex->sql_command == SQLCOM_SHOW_RELAYLOG_EVENTS);
- if (mysql_bin_log.is_open())
+ /* select wich binary log to use: binlog or relay */
+ if ( thd->lex->sql_command == SQLCOM_SHOW_BINLOG_EVENTS )
+ {
+ /*
+ Wait for handlers to insert any pending information
+ into the binlog. For e.g. ndb which updates the binlog asynchronously
+ this is needed so that the uses sees all its own commands in the binlog
+ */
+ ha_binlog_wait(thd);
+
+ binary_log= &mysql_bin_log;
+ }
+ else /* showing relay log contents */
+ {
+ if (!active_mi)
+ DBUG_RETURN(TRUE);
+
+ binary_log= &(active_mi->rli.relay_log);
+ }
+
+ if (binary_log->is_open())
{
LEX_MASTER_INFO *lex_mi= &thd->lex->mi;
SELECT_LEX_UNIT *unit= &thd->lex->unit;
@@ -1420,7 +1712,7 @@ bool mysql_show_binlog_events(THD* thd)
my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly
char search_file_name[FN_REFLEN], *name;
const char *log_file_name = lex_mi->log_file_name;
- pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
+ pthread_mutex_t *log_lock = binary_log->get_log_lock();
LOG_INFO linfo;
Log_event* ev;
@@ -1430,13 +1722,13 @@ bool mysql_show_binlog_events(THD* thd)
name= search_file_name;
if (log_file_name)
- mysql_bin_log.make_log_name(search_file_name, log_file_name);
+ binary_log->make_log_name(search_file_name, log_file_name);
else
name=0; // Find first log
linfo.index_file_offset = 0;
- if (mysql_bin_log.find_log_pos(&linfo, name, 1))
+ if (binary_log->find_log_pos(&linfo, name, 1))
{
errmsg = "Could not find target log";
goto err;
@@ -1557,7 +1849,7 @@ bool show_binlog_info(THD* thd)
field_list.push_back(new Item_empty_string("Binlog_Do_DB",255));
field_list.push_back(new Item_empty_string("Binlog_Ignore_DB",255));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
protocol->prepare_for_resend();
@@ -1603,13 +1895,13 @@ bool show_binlogs(THD* thd)
if (!mysql_bin_log.is_open())
{
my_message(ER_NO_BINARY_LOGGING, ER(ER_NO_BINARY_LOGGING), MYF(0));
- return 1;
+ DBUG_RETURN(TRUE);
}
field_list.push_back(new Item_empty_string("Log_name", 255));
field_list.push_back(new Item_return_int("File_size", 20,
MYSQL_TYPE_LONGLONG));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -1739,6 +2031,26 @@ public:
bool update(THD *thd, set_var *var);
};
+static void fix_slave_net_timeout(THD *thd, enum_var_type type)
+{
+ DBUG_ENTER("fix_slave_net_timeout");
+#ifdef HAVE_REPLICATION
+ pthread_mutex_lock(&LOCK_active_mi);
+ DBUG_PRINT("info",("slave_net_timeout=%lu mi->heartbeat_period=%.3f",
+ slave_net_timeout,
+ (active_mi? active_mi->heartbeat_period : 0.0)));
+ if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
+ "The currect value for master_heartbeat_period"
+ " exceeds the new value of `slave_net_timeout' sec."
+ " A sensible value for the period should be"
+ " less than the timeout.");
+ pthread_mutex_unlock(&LOCK_active_mi);
+#endif
+ DBUG_VOID_RETURN;
+}
+
static sys_var_chain vars = { NULL, NULL };
static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates",
@@ -1755,6 +2067,16 @@ static sys_var_const sys_relay_log_info_file(&vars, "relay_log_info_file",
(uchar*) &relay_log_info_file);
static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge",
&relay_log_purge);
+static sys_var_bool_ptr sys_relay_log_recovery(&vars, "relay_log_recovery",
+ &relay_log_recovery);
+static sys_var_uint_ptr sys_sync_binlog_period(&vars, "sync_binlog",
+ &sync_binlog_period);
+static sys_var_uint_ptr sys_sync_relaylog_period(&vars, "sync_relay_log",
+ &sync_relaylog_period);
+static sys_var_uint_ptr sys_sync_relayloginfo_period(&vars, "sync_relay_log_info",
+ &sync_relayloginfo_period);
+static sys_var_uint_ptr sys_sync_masterinfo_period(&vars, "sync_master_info",
+ &sync_masterinfo_period);
static sys_var_const sys_relay_log_space_limit(&vars,
"relay_log_space_limit",
OPT_GLOBAL, SHOW_LONGLONG,
@@ -1764,13 +2086,13 @@ static sys_var_const sys_slave_load_tmpdir(&vars, "slave_load_tmpdir",
OPT_GLOBAL, SHOW_CHAR_PTR,
(uchar*) &slave_load_tmpdir);
static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout",
- &slave_net_timeout);
+ &slave_net_timeout,
+ fix_slave_net_timeout);
static sys_var_const sys_slave_skip_errors(&vars, "slave_skip_errors",
OPT_GLOBAL, SHOW_CHAR,
(uchar*) slave_skip_error_names);
static sys_var_long_ptr sys_slave_trans_retries(&vars, "slave_transaction_retries",
&slave_trans_retries);
-static sys_var_sync_binlog_period sys_sync_binlog_period(&vars, "sync_binlog", &sync_binlog_period);
static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
@@ -1812,12 +2134,6 @@ bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
}
-bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
-{
- sync_binlog_period= (ulong) var->save_result.ulonglong_value;
- return 0;
-}
-
int init_replication_sys_vars()
{
if (mysql_add_sys_var_chain(vars.first, my_long_options))
@@ -1829,6 +2145,5 @@ int init_replication_sys_vars()
return 0;
}
-#endif /* HAVE_REPLICATION */
-
+#endif /* HAVE_REPLICATION */
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index d5c9040f8dc..aa71ac96ff8 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -13,6 +13,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifndef SQL_REPL_INCLUDED
+#define SQL_REPL_INCLUDED
+
#include "rpl_filter.h"
#ifdef HAVE_REPLICATION
@@ -65,3 +68,4 @@ int init_replication_sys_vars();
#endif /* HAVE_REPLICATION */
+#endif /* SQL_REPL_INCLUDED */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index d9549002121..18c79f6827d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -223,6 +223,7 @@ static void update_tmptable_sum_func(Item_sum **func,TABLE *tmp_table);
static void copy_sum_funcs(Item_sum **func_ptr, Item_sum **end);
static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab);
static bool setup_sum_funcs(THD *thd, Item_sum **func_ptr);
+static bool prepare_sum_aggregators(Item_sum **func_ptr, bool need_distinct);
static bool init_sum_functions(Item_sum **func, Item_sum **end);
static bool update_sum_func(Item_sum **func);
static void select_describe(JOIN *join, bool need_tmp_table,bool need_order,
@@ -1026,13 +1027,13 @@ JOIN::optimize()
}
if (const_tables && !thd->locked_tables &&
!(select_options & SELECT_NO_UNLOCK))
- mysql_unlock_some_tables(thd, table, const_tables);
+ mysql_unlock_some_tables(thd, all_tables, const_tables);
if (!conds && outer_join)
{
/* Handle the case where we have an OUTER JOIN without a WHERE */
conds=new Item_int((longlong) 1,1); // Always true
}
- select= make_select(*table, const_table_map,
+ select= make_select(*all_tables, const_table_map,
const_table_map, conds, 1, &error);
if (error)
{ /* purecov: inspected */
@@ -1269,7 +1270,11 @@ JOIN::optimize()
if (test_if_subpart(group_list, order) ||
(!group_list && tmp_table_param.sum_func_count))
+ {
order=0;
+ if (is_indexed_agg_distinct(this, NULL))
+ sort_and_group= 0;
+ }
// Can't use sort on head table if using join buffering
if (full_join)
@@ -1459,8 +1464,16 @@ JOIN::optimize()
single table queries, thus it is sufficient to test only the first
join_tab element of the plan for its access method.
*/
+ bool need_distinct= TRUE;
if (join_tab->is_using_loose_index_scan())
+ {
tmp_table_param.precomputed_group_by= TRUE;
+ if (join_tab->is_using_agg_loose_index_scan())
+ {
+ need_distinct= FALSE;
+ tmp_table_param.precomputed_group_by= FALSE;
+ }
+ }
/* Create a tmp table if distinct or if the sort is too complicated */
if (need_tmp)
@@ -1521,6 +1534,7 @@ JOIN::optimize()
HA_POS_ERROR, HA_POS_ERROR, FALSE) ||
alloc_group_fields(this, group_list) ||
make_sum_func_list(all_fields, fields_list, 1) ||
+ prepare_sum_aggregators(sum_funcs, need_distinct) ||
setup_sum_funcs(thd, sum_funcs))
{
DBUG_RETURN(1);
@@ -1530,6 +1544,7 @@ JOIN::optimize()
else
{
if (make_sum_func_list(all_fields, fields_list, 0) ||
+ prepare_sum_aggregators(sum_funcs, need_distinct) ||
setup_sum_funcs(thd, sum_funcs))
{
DBUG_RETURN(1);
@@ -1714,8 +1729,8 @@ JOIN::exec()
(zero_result_cause?zero_result_cause:"No tables used"));
else
{
- if (result->send_fields(*columns_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ if (result->send_result_set_metadata(*columns_list,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
{
DBUG_VOID_RETURN;
}
@@ -2002,7 +2017,9 @@ JOIN::exec()
}
}
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
- 1, TRUE))
+ 1, TRUE) ||
+ prepare_sum_aggregators(curr_join->sum_funcs,
+ !curr_join->join_tab->is_using_agg_loose_index_scan()))
DBUG_VOID_RETURN;
curr_join->group_list= 0;
if (!curr_join->sort_and_group &&
@@ -2106,13 +2123,17 @@ JOIN::exec()
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
1, TRUE) ||
+ prepare_sum_aggregators(curr_join->sum_funcs,
+ !curr_join->join_tab ||
+ !curr_join->join_tab->
+ is_using_agg_loose_index_scan()) ||
setup_sum_funcs(curr_join->thd, curr_join->sum_funcs) ||
thd->is_fatal_error)
DBUG_VOID_RETURN;
}
if (curr_join->group_list || curr_join->order)
{
- DBUG_PRINT("info",("Sorting for send_fields"));
+ DBUG_PRINT("info",("Sorting for send_result_set_metadata"));
thd_proc_info(thd, "Sorting result");
/* If we have already done the group, add HAVING to sorted table */
if (curr_join->tmp_having && ! curr_join->group_list &&
@@ -2248,7 +2269,7 @@ JOIN::exec()
{
thd_proc_info(thd, "Sending data");
DBUG_PRINT("info", ("%s", thd->proc_info));
- result->send_fields((procedure ? curr_join->procedure_fields_list :
+ result->send_result_set_metadata((procedure ? curr_join->procedure_fields_list :
*curr_fields_list),
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
error= do_select(curr_join, curr_fields_list, NULL, procedure);
@@ -2695,7 +2716,10 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
goto error; // Fatal error
}
else
+ {
found_const_table_map|= s->table->map;
+ s->table->pos_in_table_list->optimized_away= TRUE;
+ }
}
/* loop until no more const tables are found */
@@ -2932,7 +2956,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
join->join_tab=stat;
join->map2table=stat_ref;
- join->table= join->all_tables=table_vector;
+ join->all_tables= table_vector;
join->const_tables=const_count;
join->found_const_table_map=found_const_table_map;
@@ -3637,16 +3661,16 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
Item_func *arg0=(Item_func *)(func->arguments()[0]),
*arg1=(Item_func *)(func->arguments()[1]);
if (arg1->const_item() &&
- ((functype == Item_func::GE_FUNC && arg1->val_real() > 0) ||
- (functype == Item_func::GT_FUNC && arg1->val_real() >=0)) &&
arg0->type() == Item::FUNC_ITEM &&
- arg0->functype() == Item_func::FT_FUNC)
+ arg0->functype() == Item_func::FT_FUNC &&
+ ((functype == Item_func::GE_FUNC && arg1->val_real() > 0) ||
+ (functype == Item_func::GT_FUNC && arg1->val_real() >=0)))
cond_func=(Item_func_match *) arg0;
else if (arg0->const_item() &&
- ((functype == Item_func::LE_FUNC && arg0->val_real() > 0) ||
- (functype == Item_func::LT_FUNC && arg0->val_real() >=0)) &&
arg1->type() == Item::FUNC_ITEM &&
- arg1->functype() == Item_func::FT_FUNC)
+ arg1->functype() == Item_func::FT_FUNC &&
+ ((functype == Item_func::LE_FUNC && arg0->val_real() > 0) ||
+ (functype == Item_func::LT_FUNC && arg0->val_real() >=0)))
cond_func=(Item_func_match *) arg1;
}
}
@@ -3984,6 +4008,82 @@ static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array)
/**
+ Check for the presence of AGGFN(DISTINCT a) queries that may be subject
+ to loose index scan.
+
+
+ Check if the query is a subject to AGGFN(DISTINCT) using loose index scan
+ (QUICK_GROUP_MIN_MAX_SELECT).
+ Optionally (if out_args is supplied) will push the arguments of
+ AGGFN(DISTINCT) to the list
+
+ @param join the join to check
+ @param[out] out_args list of aggregate function arguments
+ @return does the query qualify for indexed AGGFN(DISTINCT)
+ @retval true it does
+ @retval false AGGFN(DISTINCT) must apply distinct in it.
+*/
+
+bool
+is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args)
+{
+ Item_sum **sum_item_ptr;
+ bool result= false;
+
+ if (join->tables != 1 || /* reference more than 1 table */
+ join->select_distinct || /* or a DISTINCT */
+ join->select_lex->olap == ROLLUP_TYPE) /* Check (B3) for ROLLUP */
+ return false;
+
+ if (join->make_sum_func_list(join->all_fields, join->fields_list, true))
+ return false;
+
+ for (sum_item_ptr= join->sum_funcs; *sum_item_ptr; sum_item_ptr++)
+ {
+ Item_sum *sum_item= *sum_item_ptr;
+ Item *expr;
+ /* aggregate is not AGGFN(DISTINCT) or more than 1 argument to it */
+ switch (sum_item->sum_func())
+ {
+ case Item_sum::MIN_FUNC:
+ case Item_sum::MAX_FUNC:
+ continue;
+ case Item_sum::COUNT_DISTINCT_FUNC:
+ break;
+ case Item_sum::AVG_DISTINCT_FUNC:
+ case Item_sum::SUM_DISTINCT_FUNC:
+ if (sum_item->get_arg_count() == 1)
+ break;
+ /* fall through */
+ default: return false;
+ }
+ /*
+ We arrive here for every COUNT(DISTINCT),AVG(DISTINCT) or SUM(DISTINCT).
+ Collect the arguments of the aggregate functions to a list.
+ We don't worry about duplicates as these will be sorted out later in
+ get_best_group_min_max
+ */
+ for (uint i= 0; i < sum_item->get_arg_count(); i++)
+ {
+ expr= sum_item->get_arg(i);
+ /* The AGGFN(DISTINCT) arg is not an attribute? */
+ if (expr->real_item()->type() != Item::FIELD_ITEM)
+ return false;
+
+ /*
+ If we came to this point the AGGFN(DISTINCT) loose index scan
+ optimization is applicable
+ */
+ if (out_args)
+ out_args->push_back((Item_field *) expr);
+ result= true;
+ }
+ }
+ return result;
+}
+
+
+/**
Discover the indexes that can be used for GROUP BY or DISTINCT queries.
If the query has a GROUP BY clause, find all indexes that contain all
@@ -4025,6 +4125,10 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab)
item->walk(&Item::collect_item_field_processor, 0,
(uchar*) &indexed_fields);
}
+ else if (is_indexed_agg_distinct(join, &indexed_fields))
+ {
+ join->sort_and_group= 1;
+ }
else
return;
@@ -4272,7 +4376,8 @@ best_access_path(JOIN *join,
in ReuseRangeEstimateForRef-3.
*/
if (table->quick_keys.is_set(key) &&
- const_part & (1 << table->quick_key_parts[key]) &&
+ (const_part & ((1 << table->quick_key_parts[key])-1)) ==
+ ((1 << table->quick_key_parts[key])-1) &&
table->quick_n_ranges[key] == 1 &&
records > (double) table->quick_rows[key])
{
@@ -5005,8 +5110,8 @@ greedy_search(JOIN *join,
the interleaving state to the one of the non-extended partial plan
on exit.
*/
- IF_DBUG(bool is_interleave_error= )
- check_interleaving_with_nj (best_table);
+ bool is_interleave_error __attribute__((unused))=
+ check_interleaving_with_nj (best_table);
/* This has been already checked by best_extension_by_limited_search */
DBUG_ASSERT(!is_interleave_error);
@@ -5542,7 +5647,7 @@ get_best_combination(JOIN *join)
{
TABLE *form;
*j= *join->best_positions[tablenr].table;
- form=join->table[tablenr]=j->table;
+ form=join->all_tables[tablenr]=j->table;
used_tables|= form->map;
form->reginfo.join_tab=j;
if (!*j->on_expr_ref)
@@ -5816,7 +5921,7 @@ JOIN::make_simple_join(JOIN *parent, TABLE *tmp_table)
DBUG_RETURN(TRUE); /* purecov: inspected */
join_tab= parent->join_tab_reexec;
- table= &parent->table_reexec[0]; parent->table_reexec[0]= tmp_table;
+ parent->table_reexec[0]= tmp_table;
tables= 1;
const_tables= 0;
const_table_map= 0;
@@ -6873,24 +6978,23 @@ void JOIN::cleanup(bool full)
{
DBUG_ENTER("JOIN::cleanup");
- if (table)
+ if (all_tables)
{
JOIN_TAB *tab,*end;
/*
Only a sorted table may be cached. This sorted table is always the
- first non const table in join->table
+ first non const table in join->all_tables
*/
if (tables > const_tables) // Test for not-const tables
{
- free_io_cache(table[const_tables]);
- filesort_free_buffers(table[const_tables],full);
+ free_io_cache(all_tables[const_tables]);
+ filesort_free_buffers(all_tables[const_tables],full);
}
if (full)
{
for (tab= join_tab, end= tab+tables; tab != end; tab++)
tab->cleanup();
- table= 0;
}
else
{
@@ -7189,7 +7293,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
if (having && having->val_int() == 0)
send_row=0;
}
- if (!(result->send_fields(fields,
+ if (!(result->send_result_set_metadata(fields,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)))
{
bool send_error= FALSE;
@@ -7219,7 +7323,7 @@ static void clear_tables(JOIN *join)
are not re-calculated.
*/
for (uint i=join->const_tables ; i < join->tables ; i++)
- mark_as_null_row(join->table[i]); // All fields are NULL
+ mark_as_null_row(join->all_tables[i]); // All fields are NULL
}
/*****************************************************************************
@@ -9164,7 +9268,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
thd->substitute_null_with_insert_id))
{
#ifdef HAVE_QUERY_CACHE
- query_cache_abort(&thd->net);
+ query_cache_abort(&thd->query_cache_tls);
#endif
COND *new_cond;
if ((new_cond= new Item_func_eq(args[0],
@@ -9714,7 +9818,7 @@ void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps)
Create a temp table according to a field list.
Given field pointers are changed to point at tmp_table for
- send_fields. The table object is self contained: it's
+ send_result_set_metadata. The table object is self contained: it's
allocated in its own memory root, as well as Field objects
created for table columns.
This function will replace Item_sum items in 'fields' list with
@@ -9899,6 +10003,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
share->primary_key= MAX_KEY; // Indicate no primary key
share->keys_for_keyread.init();
share->keys_in_use.init();
+ if (param->schema_table)
+ share->db= INFORMATION_SCHEMA_NAME;
/* Calculate which type of fields we will store in the temporary table */
@@ -10454,6 +10560,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
bzero(share, sizeof(*share));
table->field= field;
table->s= share;
+ table->temp_pool_slot= MY_BIT_NONE;
share->blob_field= blob_field;
share->fields= field_count;
share->blob_ptr_size= portable_sizeof_char_ptr;
@@ -10957,7 +11064,6 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
so we don't touch it here.
*/
join->examined_rows++;
- join->thd->row_count++;
DBUG_ASSERT(join->examined_rows <= 1);
}
else if (join->send_row_on_empty_set())
@@ -10979,26 +11085,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (error == NESTED_LOOP_NO_MORE_ROWS)
error= NESTED_LOOP_OK;
- if (error == NESTED_LOOP_OK)
- {
- /*
- Sic: this branch works even if rc != 0, e.g. when
- send_data above returns an error.
- */
- if (!table) // If sending data to client
- {
- /*
- The following will unlock all cursors if the command wasn't an
- update command
- */
- join->join_free(); // Unlock all cursors
- if (join->result->send_eof())
- rc= 1; // Don't send error
- }
- DBUG_PRINT("info",("%ld records output", (long) join->send_records));
- }
- else
- rc= -1;
+
if (table)
{
int tmp, new_errno= 0;
@@ -11015,6 +11102,29 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (new_errno)
table->file->print_error(new_errno,MYF(0));
}
+ else
+ {
+ /*
+ The following will unlock all cursors if the command wasn't an
+ update command
+ */
+ join->join_free(); // Unlock all cursors
+ }
+ if (error == NESTED_LOOP_OK)
+ {
+ /*
+ Sic: this branch works even if rc != 0, e.g. when
+ send_data above returns an error.
+ */
+ if (!table) // If sending data to client
+ {
+ if (join->result->send_eof())
+ rc= 1; // Don't send error
+ }
+ DBUG_PRINT("info",("%ld records output", (long) join->send_records));
+ }
+ else
+ rc= -1;
#ifndef DBUG_OFF
if (rc)
{
@@ -11211,7 +11321,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
/* Set first_unmatched for the last inner table of this group */
join_tab->last_inner->first_unmatched= join_tab;
}
- join->thd->row_count= 0;
+ join->thd->warning_info->reset_current_row_for_warning();
error= (*join_tab->read_first_record)(join_tab);
rc= evaluate_join_record(join, join_tab, error);
@@ -11332,7 +11442,6 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
(See above join->return_tab= tab).
*/
join->examined_rows++;
- join->thd->row_count++;
DBUG_PRINT("counts", ("join->examined_rows++: %lu",
(ulong) join->examined_rows));
@@ -11341,6 +11450,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
enum enum_nested_loop_state rc;
/* A match from join_tab is found for the current partial join. */
rc= (*join_tab->next_select)(join, join_tab+1, 0);
+ join->thd->warning_info->inc_current_row_for_warning();
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
return rc;
if (join->return_tab < join_tab)
@@ -11354,7 +11464,10 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
return NESTED_LOOP_NO_MORE_ROWS;
}
else
+ {
+ join->thd->warning_info->inc_current_row_for_warning();
join_tab->read_record.unlock_row(join_tab);
+ }
}
else
{
@@ -11363,7 +11476,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
with the beginning coinciding with the current partial join.
*/
join->examined_rows++;
- join->thd->row_count++;
+ join->thd->warning_info->inc_current_row_for_warning();
join_tab->read_record.unlock_row(join_tab);
}
return NESTED_LOOP_OK;
@@ -11907,10 +12020,8 @@ join_init_quick_read_record(JOIN_TAB *tab)
}
-int rr_sequential(READ_RECORD *info);
-int init_read_record_seq(JOIN_TAB *tab)
+int read_first_record_seq(JOIN_TAB *tab)
{
- tab->read_record.read_record= rr_sequential;
if (tab->read_record.file->ha_rnd_init(1))
return 1;
return (*tab->read_record.read_record)(&tab->read_record);
@@ -13922,8 +14033,8 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
extra_length= ALIGN_SIZE(key_length)-key_length;
}
- if (hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0,
- key_length, (hash_get_key) 0, 0, 0))
+ if (my_hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0,
+ key_length, (my_hash_get_key) 0, 0, 0))
{
my_free((char*) key_buffer,MYF(0));
DBUG_RETURN(1);
@@ -13964,7 +14075,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
key_pos+= *field_length++;
}
/* Check if it exists before */
- if (hash_search(&hash, org_key_pos, key_length))
+ if (my_hash_search(&hash, org_key_pos, key_length))
{
/* Duplicated found ; Remove the row */
if ((error=file->ha_delete_row(record)))
@@ -13978,14 +14089,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
key_pos+=extra_length;
}
my_free((char*) key_buffer,MYF(0));
- hash_free(&hash);
+ my_hash_free(&hash);
file->extra(HA_EXTRA_NO_CACHE);
(void) file->ha_rnd_end();
DBUG_RETURN(0);
err:
my_free((char*) key_buffer,MYF(0));
- hash_free(&hash);
+ my_hash_free(&hash);
file->extra(HA_EXTRA_NO_CACHE);
(void) file->ha_rnd_end();
if (error)
@@ -14666,7 +14777,7 @@ setup_new_fields(THD *thd, List<Item> &fields,
optimize away 'order by'.
*/
-static ORDER *
+ORDER *
create_distinct_group(THD *thd, Item **ref_pointer_array,
ORDER *order_list, List<Item> &fields,
List<Item> &all_fields,
@@ -15021,7 +15132,7 @@ test_if_group_changed(List<Cached_item> &list)
Only FIELD_ITEM:s and FUNC_ITEM:s needs to be saved between groups.
Change old item_field to use a new field with points at saved fieldvalue
- This function is only called before use of send_fields.
+ This function is only called before use of send_result_set_metadata.
@param thd THD pointer
@param param temporary table parameters
@@ -15052,7 +15163,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
Item *pos;
List_iterator_fast<Item> li(all_fields);
Copy_field *copy= NULL;
- IF_DBUG(Copy_field *copy_start);
+ Copy_field *copy_start __attribute__((unused));
res_selected_fields.empty();
res_all_fields.empty();
List_iterator_fast<Item> itr(res_all_fields);
@@ -15065,7 +15176,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
goto err2;
param->copy_funcs.empty();
- IF_DBUG(copy_start= copy);
+ copy_start= copy;
for (i= 0; (pos= li++); i++)
{
Field *field;
@@ -15261,7 +15372,7 @@ bool JOIN::alloc_func_list()
Initialize 'sum_funcs' array with all Item_sum objects.
@param field_list All items
- @param send_fields Items in select list
+ @param send_result_set_metadata Items in select list
@param before_group_by Set to 1 if this is called before GROUP BY handling
@param recompute Set to TRUE if sum_funcs must be recomputed
@@ -15271,7 +15382,7 @@ bool JOIN::alloc_func_list()
1 error
*/
-bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
+bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_result_set_metadata,
bool before_group_by, bool recompute)
{
List_iterator_fast<Item> it(field_list);
@@ -15293,7 +15404,7 @@ bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
if (before_group_by && rollup.state == ROLLUP::STATE_INITED)
{
rollup.state= ROLLUP::STATE_READY;
- if (rollup_make_fields(field_list, send_fields, &func))
+ if (rollup_make_fields(field_list, send_result_set_metadata, &func))
DBUG_RETURN(TRUE); // Should never happen
}
else if (rollup.state == ROLLUP::STATE_NONE)
@@ -15468,7 +15579,22 @@ static bool setup_sum_funcs(THD *thd, Item_sum **func_ptr)
DBUG_ENTER("setup_sum_funcs");
while ((func= *(func_ptr++)))
{
- if (func->setup(thd))
+ if (func->aggregator_setup(thd))
+ DBUG_RETURN(TRUE);
+ }
+ DBUG_RETURN(FALSE);
+}
+
+
+static bool prepare_sum_aggregators(Item_sum **func_ptr, bool need_distinct)
+{
+ Item_sum *func;
+ DBUG_ENTER("prepare_sum_aggregators");
+ while ((func= *(func_ptr++)))
+ {
+ if (func->set_aggregator(need_distinct && func->has_with_distinct() ?
+ Aggregator::DISTINCT_AGGREGATOR :
+ Aggregator::SIMPLE_AGGREGATOR))
DBUG_RETURN(TRUE);
}
DBUG_RETURN(FALSE);
@@ -15518,7 +15644,7 @@ init_sum_functions(Item_sum **func_ptr, Item_sum **end_ptr)
/* If rollup, calculate the upper sum levels */
for ( ; *func_ptr ; func_ptr++)
{
- if ((*func_ptr)->add())
+ if ((*func_ptr)->aggregator_add())
return 1;
}
return 0;
@@ -15530,7 +15656,7 @@ update_sum_func(Item_sum **func_ptr)
{
Item_sum *func;
for (; (func= (Item_sum*) *func_ptr) ; func_ptr++)
- if (func->add())
+ if (func->aggregator_add())
return 1;
return 0;
}
@@ -16475,7 +16601,12 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (key_read)
{
if (quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
+ {
+ QUICK_GROUP_MIN_MAX_SELECT *qgs=
+ (QUICK_GROUP_MIN_MAX_SELECT *) tab->select->quick;
extra.append(STRING_WITH_LEN("; Using index for group-by"));
+ qgs->append_loose_scan_type(&extra);
+ }
else
extra.append(STRING_WITH_LEN("; Using index"));
}
@@ -16606,18 +16737,35 @@ static void print_join(THD *thd,
{
/* List is reversed => we should reverse it before using */
List_iterator_fast<TABLE_LIST> ti(*tables);
- TABLE_LIST **table= (TABLE_LIST **)thd->alloc(sizeof(TABLE_LIST*) *
- tables->elements);
- if (table == 0)
+ TABLE_LIST **table;
+ uint non_const_tables= 0;
+
+ for (TABLE_LIST *t= ti++; t ; t= ti++)
+ if (!t->optimized_away)
+ non_const_tables++;
+ if (!non_const_tables)
+ {
+ str->append(STRING_WITH_LEN("dual"));
+ return; // all tables were optimized away
+ }
+ ti.rewind();
+
+ if (!(table= (TABLE_LIST **)thd->alloc(sizeof(TABLE_LIST*) *
+ non_const_tables)))
return; // out of memory
- for (TABLE_LIST **t= table + (tables->elements - 1); t >= table; t--)
- *t= ti++;
+ TABLE_LIST *tmp, **t= table + (non_const_tables - 1);
+ while ((tmp= ti++))
+ {
+ if (tmp->optimized_away)
+ continue;
+ *t--= tmp;
+ }
DBUG_ASSERT(tables->elements >= 1);
(*table)->print(thd, str, query_type);
- TABLE_LIST **end= table + tables->elements;
+ TABLE_LIST **end= table + non_const_tables;
for (TABLE_LIST **tbl= table + 1; tbl < end; tbl++)
{
TABLE_LIST *curr= *tbl;
diff --git a/sql/sql_select.h b/sql/sql_select.h
index c9cd3ecba42..e049e4ed765 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1,3 +1,6 @@
+#ifndef SQL_SELECT_INCLUDED
+#define SQL_SELECT_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -141,7 +144,6 @@ enum enum_nested_loop_state
typedef enum_nested_loop_state
(*Next_select_func)(JOIN *, struct st_join_table *, bool);
-typedef int (*Read_record_func)(struct st_join_table *tab);
Next_select_func setup_end_select_func(JOIN *join);
@@ -169,7 +171,7 @@ typedef struct st_join_table {
*/
uint packed_info;
- Read_record_func read_first_record;
+ READ_RECORD::Setup_func read_first_record;
Next_select_func next_select;
READ_RECORD read_record;
/*
@@ -177,8 +179,8 @@ typedef struct st_join_table {
if it is executed by an alternative full table scan when the left operand of
the subquery predicate is evaluated to NULL.
*/
- Read_record_func save_read_first_record;/* to save read_first_record */
- int (*save_read_record) (READ_RECORD *);/* to save read_record.read_record */
+ READ_RECORD::Setup_func save_read_first_record;/* to save read_first_record */
+ READ_RECORD::Read_func save_read_record;/* to save read_record.read_record */
double worst_seeks;
key_map const_keys; /**< Keys with constant part */
key_map checked_keys; /**< Keys checked in find_best */
@@ -225,6 +227,11 @@ typedef struct st_join_table {
(select->quick->get_type() ==
QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX));
}
+ bool is_using_agg_loose_index_scan ()
+ {
+ return (is_using_loose_index_scan() &&
+ ((QUICK_GROUP_MIN_MAX_SELECT *)select->quick)->is_agg_distinct());
+ }
} JOIN_TAB;
enum_nested_loop_state sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool
@@ -282,7 +289,7 @@ public:
JOIN_TAB *join_tab,**best_ref;
JOIN_TAB **map2table; ///< mapping between table indexes and JOIN_TABs
JOIN_TAB *join_tab_save; ///< saved join_tab for subquery reexecution
- TABLE **table,**all_tables,*sort_by_table;
+ TABLE **all_tables,*sort_by_table;
uint tables,const_tables;
uint send_group_parts;
/**
@@ -438,7 +445,7 @@ public:
select_result *result_arg)
{
join_tab= join_tab_save= 0;
- table= 0;
+ all_tables= 0;
tables= 0;
const_tables= 0;
join_list= 0;
@@ -587,6 +594,8 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
const char *name, TABLE *table,
Item_field *item, uint convert_blob_length);
+bool is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args);
+
/* functions from opt_sum.cc */
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds);
@@ -759,3 +768,4 @@ inline bool optimizer_flag(THD *thd, uint flag)
return (thd->variables.optimizer_switch & flag);
}
+#endif /* SQL_SELECT_INCLUDED */
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index f8a8dea18ff..e8fa3d984a7 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -120,8 +120,8 @@ bool servers_init(bool dont_read_servers_table)
DBUG_RETURN(TRUE);
/* initialise our servers cache */
- if (hash_init(&servers_cache, system_charset_info, 32, 0, 0,
- (hash_get_key) servers_cache_get_key, 0, 0))
+ if (my_hash_init(&servers_cache, system_charset_info, 32, 0, 0,
+ (my_hash_get_key) servers_cache_get_key, 0, 0))
{
return_val= TRUE; /* we failed, out of memory? */
goto end;
@@ -242,7 +242,7 @@ bool servers_reload(THD *thd)
if (simple_open_n_lock_tables(thd, tables))
{
sql_print_error("Can't open and lock privilege tables: %s",
- thd->main_da.message());
+ thd->stmt_da->message());
goto end;
}
@@ -646,9 +646,10 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options)
server_options->server_name_length));
- if (!(server= (FOREIGN_SERVER *) hash_search(&servers_cache,
- (uchar*) server_options->server_name,
- server_options->server_name_length)))
+ if (!(server= (FOREIGN_SERVER *)
+ my_hash_search(&servers_cache,
+ (uchar*) server_options->server_name,
+ server_options->server_name_length)))
{
DBUG_PRINT("info", ("server_name %s length %d not found!",
server_options->server_name,
@@ -663,7 +664,7 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options)
server->server_name,
server->server_name_length));
- VOID(hash_delete(&servers_cache, (uchar*) server));
+ VOID(my_hash_delete(&servers_cache, (uchar*) server));
error= 0;
@@ -770,7 +771,7 @@ int update_server_record_in_cache(FOREIGN_SERVER *existing,
/*
delete the existing server struct from the server cache
*/
- VOID(hash_delete(&servers_cache, (uchar*)existing));
+ VOID(my_hash_delete(&servers_cache, (uchar*)existing));
/*
Insert the altered server struct into the server cache
@@ -965,8 +966,8 @@ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
rw_wrlock(&THR_LOCK_servers);
/* hit the memory first */
- if (hash_search(&servers_cache, (uchar*) server_options->server_name,
- server_options->server_name_length))
+ if (my_hash_search(&servers_cache, (uchar*) server_options->server_name,
+ server_options->server_name_length))
goto end;
@@ -1014,9 +1015,9 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
rw_wrlock(&THR_LOCK_servers);
- if (!(existing= (FOREIGN_SERVER *) hash_search(&servers_cache,
- (uchar*) name.str,
- name.length)))
+ if (!(existing= (FOREIGN_SERVER *) my_hash_search(&servers_cache,
+ (uchar*) name.str,
+ name.length)))
goto end;
altered= (FOREIGN_SERVER *)alloc_root(&mem,
@@ -1195,7 +1196,7 @@ prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options,
void servers_free(bool end)
{
DBUG_ENTER("servers_free");
- if (!hash_inited(&servers_cache))
+ if (!my_hash_inited(&servers_cache))
DBUG_VOID_RETURN;
if (!end)
{
@@ -1205,7 +1206,7 @@ void servers_free(bool end)
}
rwlock_destroy(&THR_LOCK_servers);
free_root(&mem,MYF(0));
- hash_free(&servers_cache);
+ my_hash_free(&servers_cache);
DBUG_VOID_RETURN;
}
@@ -1286,9 +1287,9 @@ FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
DBUG_PRINT("info", ("locking servers_cache"));
rw_rdlock(&THR_LOCK_servers);
- if (!(server= (FOREIGN_SERVER *) hash_search(&servers_cache,
- (uchar*) server_name,
- server_name_length)))
+ if (!(server= (FOREIGN_SERVER *) my_hash_search(&servers_cache,
+ (uchar*) server_name,
+ server_name_length)))
{
DBUG_PRINT("info", ("server_name %s length %u not found!",
server_name, (unsigned) server_name_length));
diff --git a/sql/sql_servers.h b/sql/sql_servers.h
index 63c691893d1..12855f8473c 100644
--- a/sql/sql_servers.h
+++ b/sql/sql_servers.h
@@ -1,3 +1,6 @@
+#ifndef SQL_SERVERS_INCLUDED
+#define SQL_SERVERS_INCLUDED
+
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -41,3 +44,5 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
/* lookup functions */
FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
FOREIGN_SERVER *server_buffer);
+
+#endif /* SQL_SERVERS_INCLUDED */
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 2c1f360104b..b9f5015f8f0 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -25,6 +25,7 @@
#include "sql_trigger.h"
#include "authors.h"
#include "contributors.h"
+#include "sql_partition.h"
#ifdef HAVE_EVENT_SCHEDULER
#include "events.h"
#include "event_data_objects.h"
@@ -77,6 +78,12 @@ static TYPELIB grant_types = { sizeof(grant_names)/sizeof(char **),
static void store_key_options(THD *thd, String *packet, TABLE *table,
KEY *key_info);
+static void get_cs_converted_string_value(THD *thd,
+ String *input_str,
+ String *output_str,
+ CHARSET_INFO *cs,
+ bool use_hex);
+
static void
append_algorithm(TABLE_LIST *table, String *buff);
@@ -216,7 +223,7 @@ bool mysqld_show_authors(THD *thd)
field_list.push_back(new Item_empty_string("Location",40));
field_list.push_back(new Item_empty_string("Comment",80));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -250,7 +257,7 @@ bool mysqld_show_contributors(THD *thd)
field_list.push_back(new Item_empty_string("Location",40));
field_list.push_back(new Item_empty_string("Comment",80));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -310,6 +317,7 @@ static struct show_privileges_st sys_privileges[]=
{"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"},
{NullS, NullS, NullS}
@@ -325,7 +333,7 @@ bool mysqld_show_privileges(THD *thd)
field_list.push_back(new Item_empty_string("Context",15));
field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -344,94 +352,6 @@ bool mysqld_show_privileges(THD *thd)
}
-/***************************************************************************
- List all column types
-***************************************************************************/
-
-struct show_column_type_st
-{
- const char *type;
- uint size;
- const char *min_value;
- const char *max_value;
- uint precision;
- uint scale;
- const char *nullable;
- const char *auto_increment;
- const char *unsigned_attr;
- const char *zerofill;
- const char *searchable;
- const char *case_sensitivity;
- const char *default_value;
- const char *comment;
-};
-
-/* TODO: Add remaning types */
-
-static struct show_column_type_st sys_column_types[]=
-{
- {"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"},
-};
-
-bool mysqld_show_column_types(THD *thd)
-{
- List<Item> field_list;
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("mysqld_show_column_types");
-
- field_list.push_back(new Item_empty_string("Type",30));
- field_list.push_back(new Item_int("Size",(longlong) 1,
- MY_INT64_NUM_DECIMAL_DIGITS));
- field_list.push_back(new Item_empty_string("Min_Value",20));
- field_list.push_back(new Item_empty_string("Max_Value",20));
- field_list.push_back(new Item_return_int("Prec", 4, MYSQL_TYPE_SHORT));
- field_list.push_back(new Item_return_int("Scale", 4, MYSQL_TYPE_SHORT));
- field_list.push_back(new Item_empty_string("Nullable",4));
- field_list.push_back(new Item_empty_string("Auto_Increment",4));
- field_list.push_back(new Item_empty_string("Unsigned",4));
- field_list.push_back(new Item_empty_string("Zerofill",4));
- field_list.push_back(new Item_empty_string("Searchable",4));
- field_list.push_back(new Item_empty_string("Case_Sensitive",4));
- field_list.push_back(new Item_empty_string("Default",NAME_CHAR_LEN));
- field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN));
-
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
-
- /* TODO: Change the loop to not use 'i' */
- for (uint i=0; i < sizeof(sys_column_types)/sizeof(sys_column_types[0]); i++)
- {
- protocol->prepare_for_resend();
- protocol->store(sys_column_types[i].type, system_charset_info);
- protocol->store((ulonglong) sys_column_types[i].size);
- protocol->store(sys_column_types[i].min_value, system_charset_info);
- protocol->store(sys_column_types[i].max_value, system_charset_info);
- protocol->store_short((longlong) sys_column_types[i].precision);
- protocol->store_short((longlong) sys_column_types[i].scale);
- protocol->store(sys_column_types[i].nullable, system_charset_info);
- protocol->store(sys_column_types[i].auto_increment, system_charset_info);
- protocol->store(sys_column_types[i].unsigned_attr, system_charset_info);
- protocol->store(sys_column_types[i].zerofill, system_charset_info);
- protocol->store(sys_column_types[i].searchable, system_charset_info);
- protocol->store(sys_column_types[i].case_sensitivity, system_charset_info);
- protocol->store(sys_column_types[i].default_value, system_charset_info);
- protocol->store(sys_column_types[i].comment, system_charset_info);
- if (protocol->write())
- DBUG_RETURN(TRUE);
- }
- my_eof(thd);
- DBUG_RETURN(FALSE);
-}
-
-
/*
find_files() - find files in a given directory.
@@ -560,7 +480,7 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
table_list.table_name= uname;
table_list.table_name_length= file_name_len;
table_list.grant.privilege=col_access;
- if (check_grant(thd, TABLE_ACLS, &table_list, 1, 1, 1))
+ if (check_grant(thd, TABLE_ACLS, &table_list, TRUE, 1, TRUE))
continue;
}
#endif
@@ -644,8 +564,10 @@ public:
return m_view_access_denied_message_ptr;
}
- bool handle_error(uint sql_errno, const char *message,
- MYSQL_ERROR::enum_warning_level level, THD *thd) {
+ bool handle_condition(THD *thd, uint sql_errno, const char */* sqlstate */,
+ MYSQL_ERROR::enum_warning_level level,
+ const char *message, MYSQL_ERROR **/* cond_hdl */)
+ {
/*
The handler does not handle the errors raised by itself.
At this point we know if top_view is really a view.
@@ -719,7 +641,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
thd->push_internal_handler(&view_error_suppressor);
bool error= open_normal_and_derived_tables(thd, table_list, 0);
thd->pop_internal_handler();
- if (error && thd->main_da.is_error())
+ if (error && thd->is_error())
DBUG_RETURN(TRUE);
}
@@ -761,7 +683,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
max(buffer.length(),1024)));
}
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
protocol->prepare_for_resend();
@@ -846,7 +768,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname,
field_list.push_back(new Item_empty_string("Database",NAME_CHAR_LEN));
field_list.push_back(new Item_empty_string("Create Database",1024));
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -914,7 +836,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
}
restore_record(table, s->default_values); // Get empty record
table->use_all_columns();
- if (thd->protocol->send_fields(&field_list, Protocol::SEND_DEFAULTS))
+ if (thd->protocol->send_result_set_metadata(&field_list, Protocol::SEND_DEFAULTS))
DBUG_VOID_RETURN;
my_eof(thd);
DBUG_VOID_RETURN;
@@ -1572,7 +1494,8 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
((part_syntax= generate_partition_syntax(table->part_info,
&part_syntax_len,
FALSE,
- show_table_options))))
+ show_table_options,
+ NULL, NULL))))
{
packet->append(STRING_WITH_LEN("\n/*!50100"));
packet->append(part_syntax, part_syntax_len);
@@ -1804,7 +1727,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
field->maybe_null=1;
field_list.push_back(field=new Item_empty_string("Info",max_query_length));
field->maybe_null=1;
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_VOID_RETURN;
@@ -3093,7 +3016,7 @@ static int fill_schema_table_names(THD *thd, TABLE *table,
default:
DBUG_ASSERT(0);
}
- if (thd->is_error() && thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)
+ if (thd->is_error() && thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE)
{
thd->clear_error();
return 0;
@@ -3185,12 +3108,31 @@ static int fill_schema_table_from_frm(THD *thd,TABLE *table,
int error;
char key[MAX_DBKEY_LENGTH];
uint key_length;
+ char db_name_buff[NAME_LEN + 1], table_name_buff[NAME_LEN + 1];
bzero((char*) &table_list, sizeof(TABLE_LIST));
bzero((char*) &tbl, sizeof(TABLE));
- table_list.table_name= table_name->str;
- table_list.db= db_name->str;
+ if (lower_case_table_names)
+ {
+ /*
+ In lower_case_table_names > 0 metadata locking and table definition
+ cache subsystems require normalized (lowercased) database and table
+ names as input.
+ */
+ strmov(db_name_buff, db_name->str);
+ strmov(table_name_buff, table_name->str);
+ my_casedn_str(files_charset_info, db_name_buff);
+ my_casedn_str(files_charset_info, table_name_buff);
+ table_list.db= db_name_buff;
+ table_list.table_name= table_name_buff;
+ }
+ else
+ {
+ table_list.table_name= table_name->str;
+ table_list.db= db_name->str;
+ }
+
key_length= create_table_def_key(thd, key, &table_list, 0);
pthread_mutex_lock(&LOCK_open);
share= get_table_share(thd, &table_list, key,
@@ -3228,7 +3170,7 @@ static int fill_schema_table_from_frm(THD *thd,TABLE *table,
{
tbl.s= share;
table_list.table= &tbl;
- table_list.view= (st_lex*) share->is_view;
+ table_list.view= (LEX*) share->is_view;
res= schema_table->process_table(thd, &table_list, table,
res, db_name, table_name);
closefrm(&tbl, true);
@@ -3406,6 +3348,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
(!lookup_field_vals.table_value.length ||
lookup_field_vals.wild_table_value))
{
+ table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
if (schema_table_store_record(thd, table))
goto err; /* Out of space in temporary table */
continue;
@@ -3457,10 +3400,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
can return an error without setting an error message
in THD, which is a hack. This is why we have to
check for res, then for thd->is_error() only then
- for thd->main_da.sql_errno().
+ for thd->stmt_da->sql_errno().
*/
if (res && thd->is_error() &&
- thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)
+ thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE)
{
/*
Hide error for not existing table.
@@ -3517,6 +3460,7 @@ bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name,
CHARSET_INFO *cs)
{
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
table->field[1]->store(db_name->str, db_name->length, system_charset_info);
table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info);
table->field[3]->store(cs->name, strlen(cs->name), system_charset_info);
@@ -3607,6 +3551,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
DBUG_ENTER("get_schema_tables_record");
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(table_name->str, table_name->length, cs);
if (res)
@@ -3614,7 +3559,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
/*
there was errors during opening tables
*/
- const char *error= thd->is_error() ? thd->main_da.message() : "";
+ const char *error= thd->is_error() ? thd->stmt_da->message() : "";
if (tables->view)
table->field[3]->store(STRING_WITH_LEN("VIEW"), cs);
else if (tables->schema_table)
@@ -3820,7 +3765,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
*/
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
res= 0;
}
@@ -3854,8 +3799,9 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access;
- check_access(thd,SELECT_ACL | EXTRA_ACL, db_name->str,
- &tables->grant.privilege, 0, 0, test(tables->schema_table));
+ check_access(thd,SELECT_ACL, db_name->str,
+ &tables->grant.privilege, FALSE, FALSE,
+ test(tables->schema_table));
col_access= get_column_grant(thd, &tables->grant,
db_name->str, table_name->str,
field->field_name) & COL_ACLS;
@@ -3873,6 +3819,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
#endif
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(table_name->str, table_name->length, cs);
table->field[3]->store(field->field_name, strlen(field->field_name),
@@ -4008,7 +3955,9 @@ int fill_schema_charsets(THD *thd, TABLE_LIST *tables, COND *cond)
TABLE *table= tables->table;
CHARSET_INFO *scs= system_charset_info;
- for (cs= all_charsets ; cs < all_charsets+255 ; cs++)
+ for (cs= all_charsets ;
+ cs < all_charsets + array_elements(all_charsets) ;
+ cs++)
{
CHARSET_INFO *tmp_cs= cs[0];
if (tmp_cs && (tmp_cs->state & MY_CS_PRIMARY) &&
@@ -4113,7 +4062,9 @@ int fill_schema_collation(THD *thd, TABLE_LIST *tables, COND *cond)
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
TABLE *table= tables->table;
CHARSET_INFO *scs= system_charset_info;
- for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
+ for (cs= all_charsets ;
+ cs < all_charsets + array_elements(all_charsets) ;
+ cs++ )
{
CHARSET_INFO **cl;
CHARSET_INFO *tmp_cs= cs[0];
@@ -4121,7 +4072,9 @@ int fill_schema_collation(THD *thd, TABLE_LIST *tables, COND *cond)
(tmp_cs->state & MY_CS_HIDDEN) ||
!(tmp_cs->state & MY_CS_PRIMARY))
continue;
- for (cl= all_charsets; cl < all_charsets+255 ;cl ++)
+ for (cl= all_charsets;
+ cl < all_charsets + array_elements(all_charsets) ;
+ cl ++)
{
CHARSET_INFO *tmp_cl= cl[0];
if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||
@@ -4154,17 +4107,22 @@ int fill_schema_coll_charset_app(THD *thd, TABLE_LIST *tables, COND *cond)
CHARSET_INFO **cs;
TABLE *table= tables->table;
CHARSET_INFO *scs= system_charset_info;
- for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
+ for (cs= all_charsets ;
+ cs < all_charsets + array_elements(all_charsets) ;
+ cs++ )
{
CHARSET_INFO **cl;
CHARSET_INFO *tmp_cs= cs[0];
if (!tmp_cs || !(tmp_cs->state & MY_CS_AVAILABLE) ||
!(tmp_cs->state & MY_CS_PRIMARY))
continue;
- for (cl= all_charsets; cl < all_charsets+255 ;cl ++)
+ for (cl= all_charsets;
+ cl < all_charsets + array_elements(all_charsets) ;
+ cl ++)
{
CHARSET_INFO *tmp_cl= cl[0];
- if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||
+ if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||
+ (tmp_cl->state & MY_CS_HIDDEN) ||
!my_charset_same(tmp_cs,tmp_cl))
continue;
restore_record(table, s->default_values);
@@ -4211,6 +4169,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
table->field[3]->store(sp_name.ptr(), sp_name.length(), cs);
get_field(thd->mem_root, proc_table->field[3], &tmp_string);
table->field[0]->store(tmp_string.ptr(), tmp_string.length(), cs);
+ table->field[1]->store(STRING_WITH_LEN("def"), cs);
table->field[2]->store(sp_db.ptr(), sp_db.length(), cs);
get_field(thd->mem_root, proc_table->field[2], &tmp_string);
table->field[4]->store(tmp_string.ptr(), tmp_string.length(), cs);
@@ -4283,7 +4242,8 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond)
proc_tables.table_name= proc_tables.alias= (char*) "proc";
proc_tables.table_name_length= 4;
proc_tables.lock_type= TL_READ;
- full_access= !check_table_access(thd, SELECT_ACL, &proc_tables, 1, TRUE);
+ full_access= !check_table_access(thd, SELECT_ACL, &proc_tables, FALSE,
+ 1, TRUE);
if (!(proc_table= open_proc_table_for_read(thd, &open_tables_state_backup)))
{
DBUG_RETURN(1);
@@ -4332,7 +4292,7 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
*/
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
res= 0;
}
@@ -4353,6 +4313,7 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
{
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(table_name->str, table_name->length, cs);
table->field[3]->store((longlong) ((key_info->flags &
@@ -4469,6 +4430,7 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
tmp_db_name= db_name;
tmp_table_name= table_name;
}
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(tmp_db_name->str, tmp_db_name->length, cs);
table->field[2]->store(tmp_table_name->str, tmp_table_name->length, cs);
if (!only_share)
@@ -4545,7 +4507,7 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
DBUG_RETURN(1);
if (res && thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
}
if (res)
thd->clear_error();
@@ -4559,6 +4521,7 @@ bool store_constraints(THD *thd, TABLE *table, LEX_STRING *db_name,
{
CHARSET_INFO *cs= system_charset_info;
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(key_name, key_len, cs);
table->field[3]->store(db_name->str, db_name->length, cs);
@@ -4578,7 +4541,7 @@ static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
{
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
DBUG_RETURN(0);
}
@@ -4643,10 +4606,12 @@ static bool store_trigger(THD *thd, TABLE *table, LEX_STRING *db_name,
LEX_STRING sql_mode_rep;
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(trigger_name->str, trigger_name->length, cs);
table->field[3]->store(trg_event_type_names[event].str,
trg_event_type_names[event].length, cs);
+ table->field[4]->store(STRING_WITH_LEN("def"), cs);
table->field[5]->store(db_name->str, db_name->length, cs);
table->field[6]->store(table_name->str, table_name->length, cs);
table->field[9]->store(trigger_stmt->str, trigger_stmt->length, cs);
@@ -4683,7 +4648,7 @@ static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables,
{
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
DBUG_RETURN(0);
}
@@ -4692,7 +4657,7 @@ static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables,
Table_triggers_list *triggers= tables->table->triggers;
int event, timing;
- if (check_table_access(thd, TRIGGER_ACL, tables, 1, TRUE))
+ if (check_table_access(thd, TRIGGER_ACL, tables, FALSE, 1, TRUE))
goto ret;
for (event= 0; event < (int)TRG_EVENT_MAX; event++)
@@ -4742,8 +4707,10 @@ void store_key_column_usage(TABLE *table, LEX_STRING *db_name,
longlong idx)
{
CHARSET_INFO *cs= system_charset_info;
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(key_name, key_len, cs);
+ table->field[3]->store(STRING_WITH_LEN("def"), cs);
table->field[4]->store(db_name->str, db_name->length, cs);
table->field[5]->store(table_name->str, table_name->length, cs);
table->field[6]->store(con_type, con_len, cs);
@@ -4762,7 +4729,7 @@ static int get_schema_key_column_usage_record(THD *thd,
{
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
DBUG_RETURN(0);
}
@@ -4856,6 +4823,57 @@ static void collect_partition_expr(List<char> &field_list, String *str)
}
return;
}
+
+
+/*
+ Convert a string in a given character set to a string which can be
+ used for FRM file storage in which case use_hex is TRUE and we store
+ the character constants as hex strings in the character set encoding
+ their field have. In the case of SHOW CREATE TABLE and the
+ PARTITIONS information schema table we instead provide utf8 strings
+ to the user and convert to the utf8 character set.
+
+ SYNOPSIS
+ get_cs_converted_part_value_from_string()
+ item Item from which constant comes
+ input_str String as provided by val_str after
+ conversion to character set
+ output_str Out value: The string created
+ cs Character set string is encoded in
+ NULL for INT_RESULT's here
+ use_hex TRUE => hex string created
+ FALSE => utf8 constant string created
+
+ RETURN VALUES
+ TRUE Error
+ FALSE Ok
+*/
+
+int get_cs_converted_part_value_from_string(THD *thd,
+ Item *item,
+ String *input_str,
+ String *output_str,
+ CHARSET_INFO *cs,
+ bool use_hex)
+{
+ if (item->result_type() == INT_RESULT)
+ {
+ longlong value= item->val_int();
+ output_str->set(value, system_charset_info);
+ return FALSE;
+ }
+ if (!input_str)
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ return TRUE;
+ }
+ get_cs_converted_string_value(thd,
+ input_str,
+ output_str,
+ cs,
+ use_hex);
+ return FALSE;
+}
#endif
@@ -4869,6 +4887,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
PARTITION_INFO stat_info;
MYSQL_TIME time;
file->get_dynamic_partition_info(&stat_info, part_id);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[12]->store((longlong) stat_info.records, TRUE);
table->field[13]->store((longlong) stat_info.mean_rec_length, TRUE);
table->field[14]->store((longlong) stat_info.data_file_length, TRUE);
@@ -4936,6 +4955,51 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
return;
}
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+static int
+get_partition_column_description(THD *thd,
+ partition_info *part_info,
+ part_elem_value *list_value,
+ String &tmp_str)
+{
+ uint num_elements= part_info->part_field_list.elements;
+ uint i;
+ DBUG_ENTER("get_partition_column_description");
+
+ for (i= 0; i < num_elements; i++)
+ {
+ part_column_list_val *col_val= &list_value->col_val_array[i];
+ if (col_val->max_value)
+ tmp_str.append(partition_keywords[PKW_MAXVALUE].str);
+ else if (col_val->null_value)
+ tmp_str.append("NULL");
+ else
+ {
+ char buffer[MAX_KEY_LENGTH];
+ String str(buffer, sizeof(buffer), &my_charset_bin);
+ String val_conv;
+ Item *item= col_val->item_expression;
+
+ if (!(item= part_info->get_column_item(item,
+ part_info->part_field_array[i])))
+ {
+ DBUG_RETURN(1);
+ }
+ String *res= item->val_str(&str);
+ if (get_cs_converted_part_value_from_string(thd, item, res, &val_conv,
+ part_info->part_field_array[i]->charset(),
+ FALSE))
+ {
+ DBUG_RETURN(1);
+ }
+ tmp_str.append(val_conv);
+ }
+ if (i != num_elements - 1)
+ tmp_str.append(",");
+ }
+ DBUG_RETURN(0);
+}
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
@@ -4957,7 +5021,7 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
{
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
DBUG_RETURN(0);
}
@@ -4971,6 +5035,7 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
uint part_pos= 0, part_id= 0;
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(table_name->str, table_name->length, cs);
@@ -4978,12 +5043,18 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
/* Partition method*/
switch (part_info->part_type) {
case RANGE_PARTITION:
- table->field[7]->store(partition_keywords[PKW_RANGE].str,
- partition_keywords[PKW_RANGE].length, cs);
- break;
case LIST_PARTITION:
- table->field[7]->store(partition_keywords[PKW_LIST].str,
- partition_keywords[PKW_LIST].length, cs);
+ tmp_res.length(0);
+ if (part_info->part_type == RANGE_PARTITION)
+ tmp_res.append(partition_keywords[PKW_RANGE].str,
+ partition_keywords[PKW_RANGE].length);
+ else
+ tmp_res.append(partition_keywords[PKW_LIST].str,
+ partition_keywords[PKW_LIST].length);
+ if (part_info->column_list)
+ tmp_res.append(partition_keywords[PKW_COLUMNS].str,
+ partition_keywords[PKW_COLUMNS].length);
+ table->field[7]->store(tmp_res.ptr(), tmp_res.length(), cs);
break;
case HASH_PARTITION:
tmp_res.length(0);
@@ -5061,36 +5132,70 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
/* Partition description */
if (part_info->part_type == RANGE_PARTITION)
{
- if (part_elem->range_value != LONGLONG_MAX)
- table->field[11]->store((longlong) part_elem->range_value, FALSE);
+ if (part_info->column_list)
+ {
+ List_iterator<part_elem_value> list_val_it(part_elem->list_val_list);
+ part_elem_value *list_value= list_val_it++;
+ tmp_str.length(0);
+ if (get_partition_column_description(thd,
+ part_info,
+ list_value,
+ tmp_str))
+ {
+ DBUG_RETURN(1);
+ }
+ table->field[11]->store(tmp_str.ptr(), tmp_str.length(), cs);
+ }
else
- table->field[11]->store(partition_keywords[PKW_MAXVALUE].str,
+ {
+ if (part_elem->range_value != LONGLONG_MAX)
+ table->field[11]->store((longlong) part_elem->range_value, FALSE);
+ else
+ table->field[11]->store(partition_keywords[PKW_MAXVALUE].str,
partition_keywords[PKW_MAXVALUE].length, cs);
+ }
table->field[11]->set_notnull();
}
else if (part_info->part_type == LIST_PARTITION)
{
List_iterator<part_elem_value> list_val_it(part_elem->list_val_list);
part_elem_value *list_value;
- uint no_items= part_elem->list_val_list.elements;
+ uint num_items= part_elem->list_val_list.elements;
tmp_str.length(0);
tmp_res.length(0);
if (part_elem->has_null_value)
{
tmp_str.append("NULL");
- if (no_items > 0)
+ if (num_items > 0)
tmp_str.append(",");
}
while ((list_value= list_val_it++))
{
- if (!list_value->unsigned_flag)
- tmp_res.set(list_value->value, cs);
+ if (part_info->column_list)
+ {
+ if (part_info->part_field_list.elements > 1U)
+ tmp_str.append("(");
+ if (get_partition_column_description(thd,
+ part_info,
+ list_value,
+ tmp_str))
+ {
+ DBUG_RETURN(1);
+ }
+ if (part_info->part_field_list.elements > 1U)
+ tmp_str.append(")");
+ }
else
- tmp_res.set((ulonglong)list_value->value, cs);
- tmp_str.append(tmp_res);
- if (--no_items != 0)
+ {
+ if (!list_value->unsigned_flag)
+ tmp_res.set(list_value->value, cs);
+ else
+ tmp_res.set((ulonglong)list_value->value, cs);
+ tmp_str.append(tmp_res);
+ }
+ if (--num_items != 0)
tmp_str.append(",");
- };
+ }
table->field[11]->store(tmp_str.ptr(), tmp_str.length(), cs);
table->field[11]->set_notnull();
}
@@ -5231,8 +5336,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
is_schema_db(et.dbname.str)))
DBUG_RETURN(0);
- /* ->field[0] is EVENT_CATALOG and is by default NULL */
-
+ sch_table->field[ISE_EVENT_CATALOG]->store(STRING_WITH_LEN("def"), scs);
sch_table->field[ISE_EVENT_SCHEMA]->
store(et.dbname.str, et.dbname.length,scs);
sch_table->field[ISE_EVENT_NAME]->
@@ -5495,7 +5599,7 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
{
if (thd->is_error())
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->main_da.sql_errno(), thd->main_da.message());
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
thd->clear_error();
DBUG_RETURN(0);
}
@@ -5513,10 +5617,12 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
while ((f_key_info= it++))
{
restore_record(table, s->default_values);
+ table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[9]->store(table_name->str, table_name->length, cs);
table->field[2]->store(f_key_info->forein_id->str,
f_key_info->forein_id->length, cs);
+ table->field[3]->store(STRING_WITH_LEN("def"), cs);
table->field[4]->store(f_key_info->referenced_db->str,
f_key_info->referenced_db->length, cs);
table->field[10]->store(f_key_info->referenced_table->str,
@@ -6182,7 +6288,7 @@ int fill_schema_files(THD *thd, TABLE_LIST *tables, COND *cond)
ST_FIELD_INFO schema_fields_info[]=
{
- {"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"SCHEMA_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database",
SKIP_OPEN_TABLE},
{"DEFAULT_CHARACTER_SET_NAME", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
@@ -6196,7 +6302,7 @@ ST_FIELD_INFO schema_fields_info[]=
ST_FIELD_INFO tables_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
SKIP_OPEN_TABLE},
@@ -6235,7 +6341,7 @@ ST_FIELD_INFO tables_fields_info[]=
ST_FIELD_INFO columns_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Field",
@@ -6309,7 +6415,7 @@ ST_FIELD_INFO engines_fields_info[]=
ST_FIELD_INFO events_fields_info[]=
{
- {"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"EVENT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db",
SKIP_OPEN_TABLE},
{"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
@@ -6358,7 +6464,7 @@ ST_FIELD_INFO coll_charset_app_fields_info[]=
ST_FIELD_INFO proc_fields_info[]=
{
{"SPECIFIC_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"ROUTINE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db",
SKIP_OPEN_TABLE},
{"ROUTINE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
@@ -6380,7 +6486,7 @@ ST_FIELD_INFO proc_fields_info[]=
{"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 0, "Created", SKIP_OPEN_TABLE},
{"LAST_ALTERED", 0, MYSQL_TYPE_DATETIME, 0, 0, "Modified", SKIP_OPEN_TABLE},
{"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"ROUTINE_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Comment",
+ {"ROUTINE_COMMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Comment",
SKIP_OPEN_TABLE},
{"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
{"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
@@ -6395,7 +6501,7 @@ ST_FIELD_INFO proc_fields_info[]=
ST_FIELD_INFO stat_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table", OPEN_FRM_ONLY},
{"NON_UNIQUE", 1, MYSQL_TYPE_LONGLONG, 0, 0, "Non_unique", OPEN_FRM_ONLY},
@@ -6419,7 +6525,7 @@ ST_FIELD_INFO stat_fields_info[]=
ST_FIELD_INFO view_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
@@ -6438,7 +6544,7 @@ ST_FIELD_INFO view_fields_info[]=
ST_FIELD_INFO user_privileges_fields_info[]=
{
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
@@ -6448,7 +6554,7 @@ ST_FIELD_INFO user_privileges_fields_info[]=
ST_FIELD_INFO schema_privileges_fields_info[]=
{
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
@@ -6459,7 +6565,7 @@ ST_FIELD_INFO schema_privileges_fields_info[]=
ST_FIELD_INFO table_privileges_fields_info[]=
{
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
@@ -6471,7 +6577,7 @@ ST_FIELD_INFO table_privileges_fields_info[]=
ST_FIELD_INFO column_privileges_fields_info[]=
{
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
@@ -6483,7 +6589,7 @@ ST_FIELD_INFO column_privileges_fields_info[]=
ST_FIELD_INFO table_constraints_fields_info[]=
{
- {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
@@ -6498,12 +6604,12 @@ ST_FIELD_INFO table_constraints_fields_info[]=
ST_FIELD_INFO key_column_usage_fields_info[]=
{
- {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
@@ -6522,7 +6628,7 @@ ST_FIELD_INFO key_column_usage_fields_info[]=
ST_FIELD_INFO table_names_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Tables_in_",
SKIP_OPEN_TABLE},
@@ -6545,12 +6651,12 @@ ST_FIELD_INFO open_tables_fields_info[]=
ST_FIELD_INFO triggers_fields_info[]=
{
- {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TRIGGER_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TRIGGER_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger",
OPEN_FULL_TABLE},
{"EVENT_MANIPULATION", 6, MYSQL_TYPE_STRING, 0, 0, "Event", OPEN_FULL_TABLE},
- {"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ {"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{"EVENT_OBJECT_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
@@ -6583,7 +6689,7 @@ ST_FIELD_INFO triggers_fields_info[]=
ST_FIELD_INFO partitions_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"PARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
@@ -6593,7 +6699,7 @@ ST_FIELD_INFO partitions_fields_info[]=
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FULL_TABLE},
{"SUBPARTITION_ORDINAL_POSITION", 21 , MYSQL_TYPE_LONGLONG, 0,
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FULL_TABLE},
- {"PARTITION_METHOD", 12, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"PARTITION_METHOD", 18, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
{"SUBPARTITION_METHOD", 12, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
{"PARTITION_EXPRESSION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
{"SUBPARTITION_EXPRESSION", 65535, MYSQL_TYPE_STRING, 0, 1, 0,
@@ -6673,7 +6779,7 @@ ST_FIELD_INFO files_fields_info[]=
{"FILE_TYPE", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
SKIP_OPEN_TABLE},
- {"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"LOGFILE_GROUP_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
@@ -6734,12 +6840,12 @@ void init_fill_schema_files_row(TABLE* table)
ST_FIELD_INFO referential_constraints_fields_info[]=
{
- {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
- {"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ {"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
@@ -6792,11 +6898,12 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_variables, make_old_format, 0, 0, -1, 0, 0},
{"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0,
- OPEN_TABLE_ONLY},
+ OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
fill_open_tables, make_old_format, 0, -1, -1, 1, 0},
{"PARTITIONS", partitions_fields_info, create_schema_table,
- get_all_tables, 0, get_schema_partitions_record, 1, 2, 0, OPEN_TABLE_ONLY},
+ get_all_tables, 0, get_schema_partitions_record, 1, 2, 0,
+ OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"PLUGINS", plugin_fields_info, create_schema_table,
fill_plugins, make_old_format, 0, -1, -1, 0, 0},
{"PROCESSLIST", processlist_fields_info, create_schema_table,
@@ -6806,7 +6913,7 @@ ST_SCHEMA_TABLE schema_tables[]=
NULL, -1, -1, false, 0},
{"REFERENTIAL_CONSTRAINTS", referential_constraints_fields_info,
create_schema_table, get_all_tables, 0, get_referential_constraints_record,
- 1, 9, 0, OPEN_TABLE_ONLY},
+ 1, 9, 0, OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"ROUTINES", proc_fields_info, create_schema_table,
fill_schema_proc, make_proc_old_format, 0, -1, -1, 0, 0},
{"SCHEMATA", schema_fields_info, create_schema_table,
@@ -6826,14 +6933,15 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0,
OPTIMIZE_I_S_TABLE},
{"TABLE_CONSTRAINTS", table_constraints_fields_info, create_schema_table,
- get_all_tables, 0, get_schema_constraints_record, 3, 4, 0, OPEN_TABLE_ONLY},
+ get_all_tables, 0, get_schema_constraints_record, 3, 4, 0,
+ OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"TABLE_NAMES", table_names_fields_info, create_schema_table,
get_all_tables, make_table_names_old_format, 0, 1, 2, 1, 0},
{"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
fill_schema_table_privileges, 0, 0, -1, -1, 0, 0},
{"TRIGGERS", triggers_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0,
- OPEN_TABLE_ONLY},
+ OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
fill_schema_user_privileges, 0, 0, -1, -1, 0, 0},
{"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
@@ -6994,7 +7102,7 @@ static bool show_create_trigger_impl(THD *thd,
fields.push_back(new Item_empty_string("Database Collation",
MY_CS_NAME_SIZE));
- if (p->send_fields(&fields, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ if (p->send_result_set_metadata(&fields, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
return TRUE;
/* Send data. */
@@ -7153,7 +7261,7 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
if (!lst)
return TRUE;
- if (check_table_access(thd, TRIGGER_ACL, lst, 1, TRUE))
+ if (check_table_access(thd, TRIGGER_ACL, lst, FALSE, 1, TRUE))
{
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "TRIGGER");
return TRUE;
@@ -7207,3 +7315,95 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
status and client connection will be closed.
*/
}
+
+/*
+ Convert a string in character set in column character set format
+ to utf8 character set if possible, the utf8 character set string
+ will later possibly be converted to character set used by client.
+ Thus we attempt conversion from column character set to both
+ utf8 and to character set client.
+
+ Examples of strings that should fail conversion to utf8 are unassigned
+ characters as e.g. 0x81 in cp1250 (Windows character set for for countries
+ like Czech and Poland). Example of string that should fail conversion to
+ character set on client (e.g. if this is latin1) is 0x2020 (daggger) in
+ ucs2.
+
+ If the conversion fails we will as a fall back convert the string to
+ hex encoded format. The caller of the function can also ask for hex
+ encoded format of output string unconditionally.
+
+ SYNOPSIS
+ get_cs_converted_string_value()
+ thd Thread object
+ input_str Input string in cs character set
+ output_str Output string to be produced in utf8
+ cs Character set of input string
+ use_hex Use hex string unconditionally
+
+
+ RETURN VALUES
+ No return value
+*/
+
+static void get_cs_converted_string_value(THD *thd,
+ String *input_str,
+ String *output_str,
+ CHARSET_INFO *cs,
+ bool use_hex)
+{
+
+ output_str->length(0);
+ if (input_str->length() == 0)
+ {
+ output_str->append("''");
+ return;
+ }
+ if (!use_hex)
+ {
+ String try_val;
+ uint try_conv_error= 0;
+
+ try_val.copy(input_str->ptr(), input_str->length(), cs,
+ thd->variables.character_set_client, &try_conv_error);
+ if (!try_conv_error)
+ {
+ String val;
+ uint conv_error= 0;
+
+ val.copy(input_str->ptr(), input_str->length(), cs,
+ system_charset_info, &conv_error);
+ if (!conv_error)
+ {
+ append_unescaped(output_str, val.ptr(), val.length());
+ return;
+ }
+ }
+ /* We had a conversion error, use hex encoded string for safety */
+ }
+ {
+ const uchar *ptr;
+ uint i, len;
+ char buf[3];
+
+ output_str->append("_");
+ output_str->append(cs->csname);
+ output_str->append(" ");
+ output_str->append("0x");
+ len= input_str->length();
+ ptr= (uchar*)input_str->ptr();
+ for (i= 0; i < len; i++)
+ {
+ uint high, low;
+
+ high= (*ptr) >> 4;
+ low= (*ptr) & 0x0F;
+ buf[0]= _dig_vec_upper[high];
+ buf[1]= _dig_vec_upper[low];
+ buf[2]= 0;
+ output_str->append((const char*)buf);
+ ptr++;
+ }
+ }
+ return;
+}
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
new file mode 100644
index 00000000000..c9ab37272b8
--- /dev/null
+++ b/sql/sql_signal.cc
@@ -0,0 +1,510 @@
+/* Copyright (C) 2008 Sun Microsystems, Inc
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "mysql_priv.h"
+#include "sp_head.h"
+#include "sp_pcontext.h"
+#include "sp_rcontext.h"
+#include "sql_signal.h"
+
+/*
+ The parser accepts any error code (desired)
+ The runtime internally supports any error code (desired)
+ The client server protocol is limited to 16 bits error codes (restriction)
+ Enforcing the 65535 limit in the runtime until the protocol can change.
+*/
+#define MAX_MYSQL_ERRNO UINT_MAX16
+
+const LEX_STRING Diag_condition_item_names[]=
+{
+ { C_STRING_WITH_LEN("CLASS_ORIGIN") },
+ { C_STRING_WITH_LEN("SUBCLASS_ORIGIN") },
+ { C_STRING_WITH_LEN("CONSTRAINT_CATALOG") },
+ { C_STRING_WITH_LEN("CONSTRAINT_SCHEMA") },
+ { C_STRING_WITH_LEN("CONSTRAINT_NAME") },
+ { C_STRING_WITH_LEN("CATALOG_NAME") },
+ { C_STRING_WITH_LEN("SCHEMA_NAME") },
+ { C_STRING_WITH_LEN("TABLE_NAME") },
+ { C_STRING_WITH_LEN("COLUMN_NAME") },
+ { C_STRING_WITH_LEN("CURSOR_NAME") },
+ { C_STRING_WITH_LEN("MESSAGE_TEXT") },
+ { C_STRING_WITH_LEN("MYSQL_ERRNO") },
+
+ { C_STRING_WITH_LEN("CONDITION_IDENTIFIER") },
+ { C_STRING_WITH_LEN("CONDITION_NUMBER") },
+ { C_STRING_WITH_LEN("CONNECTION_NAME") },
+ { C_STRING_WITH_LEN("MESSAGE_LENGTH") },
+ { C_STRING_WITH_LEN("MESSAGE_OCTET_LENGTH") },
+ { C_STRING_WITH_LEN("PARAMETER_MODE") },
+ { C_STRING_WITH_LEN("PARAMETER_NAME") },
+ { C_STRING_WITH_LEN("PARAMETER_ORDINAL_POSITION") },
+ { C_STRING_WITH_LEN("RETURNED_SQLSTATE") },
+ { C_STRING_WITH_LEN("ROUTINE_CATALOG") },
+ { C_STRING_WITH_LEN("ROUTINE_NAME") },
+ { C_STRING_WITH_LEN("ROUTINE_SCHEMA") },
+ { C_STRING_WITH_LEN("SERVER_NAME") },
+ { C_STRING_WITH_LEN("SPECIFIC_NAME") },
+ { C_STRING_WITH_LEN("TRIGGER_CATALOG") },
+ { C_STRING_WITH_LEN("TRIGGER_NAME") },
+ { C_STRING_WITH_LEN("TRIGGER_SCHEMA") }
+};
+
+const LEX_STRING Diag_statement_item_names[]=
+{
+ { C_STRING_WITH_LEN("NUMBER") },
+ { C_STRING_WITH_LEN("MORE") },
+ { C_STRING_WITH_LEN("COMMAND_FUNCTION") },
+ { C_STRING_WITH_LEN("COMMAND_FUNCTION_CODE") },
+ { C_STRING_WITH_LEN("DYNAMIC_FUNCTION") },
+ { C_STRING_WITH_LEN("DYNAMIC_FUNCTION_CODE") },
+ { C_STRING_WITH_LEN("ROW_COUNT") },
+ { C_STRING_WITH_LEN("TRANSACTIONS_COMMITTED") },
+ { C_STRING_WITH_LEN("TRANSACTIONS_ROLLED_BACK") },
+ { C_STRING_WITH_LEN("TRANSACTION_ACTIVE") }
+};
+
+Set_signal_information::Set_signal_information()
+{
+ clear();
+}
+
+Set_signal_information::Set_signal_information(
+ const Set_signal_information& set)
+{
+ memcpy(m_item, set.m_item, sizeof(m_item));
+}
+
+void Set_signal_information::clear()
+{
+ memset(m_item, 0, sizeof(m_item));
+}
+
+void Signal_common::assign_defaults(MYSQL_ERROR *cond,
+ bool set_level_code,
+ MYSQL_ERROR::enum_warning_level level,
+ int sqlcode)
+{
+ if (set_level_code)
+ {
+ cond->m_level= level;
+ cond->m_sql_errno= sqlcode;
+ }
+ if (! cond->get_message_text())
+ cond->set_builtin_message_text(ER(sqlcode));
+}
+
+void Signal_common::eval_defaults(THD *thd, MYSQL_ERROR *cond)
+{
+ DBUG_ASSERT(cond);
+
+ const char* sqlstate;
+ bool set_defaults= (m_cond != 0);
+
+ if (set_defaults)
+ {
+ /*
+ SIGNAL is restricted in sql_yacc.yy to only signal SQLSTATE conditions.
+ */
+ DBUG_ASSERT(m_cond->type == sp_cond_type::state);
+ sqlstate= m_cond->sqlstate;
+ cond->set_sqlstate(sqlstate);
+ }
+ else
+ sqlstate= cond->get_sqlstate();
+
+ DBUG_ASSERT(sqlstate);
+ /* SQLSTATE class "00": illegal, rejected in the parser. */
+ DBUG_ASSERT((sqlstate[0] != '0') || (sqlstate[1] != '0'));
+
+ if ((sqlstate[0] == '0') && (sqlstate[1] == '1'))
+ {
+ /* SQLSTATE class "01": warning. */
+ assign_defaults(cond, set_defaults,
+ MYSQL_ERROR::WARN_LEVEL_WARN, ER_SIGNAL_WARN);
+ }
+ else if ((sqlstate[0] == '0') && (sqlstate[1] == '2'))
+ {
+ /* SQLSTATE class "02": not found. */
+ assign_defaults(cond, set_defaults,
+ MYSQL_ERROR::WARN_LEVEL_ERROR, ER_SIGNAL_NOT_FOUND);
+ }
+ else
+ {
+ /* other SQLSTATE classes : error. */
+ assign_defaults(cond, set_defaults,
+ MYSQL_ERROR::WARN_LEVEL_ERROR, ER_SIGNAL_EXCEPTION);
+ }
+}
+
+static bool assign_fixed_string(MEM_ROOT *mem_root,
+ CHARSET_INFO *dst_cs,
+ size_t max_char,
+ String *dst,
+ const String* src)
+{
+ bool truncated;
+ size_t numchars;
+ CHARSET_INFO *src_cs;
+ const char* src_str;
+ const char* src_end;
+ size_t src_len;
+ size_t to_copy;
+ char* dst_str;
+ size_t dst_len;
+ size_t dst_copied;
+ uint32 dummy_offset;
+
+ src_str= src->ptr();
+ if (src_str == NULL)
+ {
+ dst->set((const char*) NULL, 0, dst_cs);
+ return false;
+ }
+
+ src_cs= src->charset();
+ src_len= src->length();
+ src_end= src_str + src_len;
+ numchars= src_cs->cset->numchars(src_cs, src_str, src_end);
+
+ if (numchars <= max_char)
+ {
+ to_copy= src->length();
+ truncated= false;
+ }
+ else
+ {
+ numchars= max_char;
+ to_copy= dst_cs->cset->charpos(dst_cs, src_str, src_end, numchars);
+ truncated= true;
+ }
+
+ if (String::needs_conversion(to_copy, src_cs, dst_cs, & dummy_offset))
+ {
+ dst_len= numchars * dst_cs->mbmaxlen;
+ dst_str= (char*) alloc_root(mem_root, dst_len + 1);
+ if (dst_str)
+ {
+ const char* well_formed_error_pos;
+ const char* cannot_convert_error_pos;
+ const char* from_end_pos;
+
+ dst_copied= well_formed_copy_nchars(dst_cs, dst_str, dst_len,
+ src_cs, src_str, src_len,
+ numchars,
+ & well_formed_error_pos,
+ & cannot_convert_error_pos,
+ & from_end_pos);
+ DBUG_ASSERT(dst_copied <= dst_len);
+ dst_len= dst_copied; /* In case the copy truncated the data */
+ dst_str[dst_copied]= '\0';
+ }
+ }
+ else
+ {
+ dst_len= to_copy;
+ dst_str= (char*) alloc_root(mem_root, dst_len + 1);
+ if (dst_str)
+ {
+ memcpy(dst_str, src_str, to_copy);
+ dst_str[to_copy]= '\0';
+ }
+ }
+ dst->set(dst_str, dst_len, dst_cs);
+
+ return truncated;
+}
+
+static int assign_condition_item(MEM_ROOT *mem_root, const char* name, THD *thd,
+ Item *set, String *ci)
+{
+ char str_buff[(64+1)*4]; /* Room for a null terminated UTF8 String 64 */
+ String str_value(str_buff, sizeof(str_buff), & my_charset_utf8_bin);
+ String *str;
+ bool truncated;
+
+ DBUG_ENTER("assign_condition_item");
+
+ if (set->is_null())
+ {
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR, name, "NULL");
+ DBUG_RETURN(1);
+ }
+
+ str= set->val_str(& str_value);
+ truncated= assign_fixed_string(mem_root, & my_charset_utf8_bin, 64, ci, str);
+ if (truncated)
+ {
+ if (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES |
+ MODE_STRICT_ALL_TABLES))
+ {
+ thd->raise_error_printf(ER_COND_ITEM_TOO_LONG, name);
+ DBUG_RETURN(1);
+ }
+
+ thd->raise_warning_printf(WARN_COND_ITEM_TRUNCATED, name);
+ }
+
+ DBUG_RETURN(0);
+}
+
+
+int Signal_common::eval_signal_informations(THD *thd, MYSQL_ERROR *cond)
+{
+ struct cond_item_map
+ {
+ enum enum_diag_condition_item_name m_item;
+ String MYSQL_ERROR::*m_member;
+ };
+
+ static cond_item_map map[]=
+ {
+ { DIAG_CLASS_ORIGIN, & MYSQL_ERROR::m_class_origin },
+ { DIAG_SUBCLASS_ORIGIN, & MYSQL_ERROR::m_subclass_origin },
+ { DIAG_CONSTRAINT_CATALOG, & MYSQL_ERROR::m_constraint_catalog },
+ { DIAG_CONSTRAINT_SCHEMA, & MYSQL_ERROR::m_constraint_schema },
+ { DIAG_CONSTRAINT_NAME, & MYSQL_ERROR::m_constraint_name },
+ { DIAG_CATALOG_NAME, & MYSQL_ERROR::m_catalog_name },
+ { DIAG_SCHEMA_NAME, & MYSQL_ERROR::m_schema_name },
+ { DIAG_TABLE_NAME, & MYSQL_ERROR::m_table_name },
+ { DIAG_COLUMN_NAME, & MYSQL_ERROR::m_column_name },
+ { DIAG_CURSOR_NAME, & MYSQL_ERROR::m_cursor_name }
+ };
+
+ Item *set;
+ String str_value;
+ String *str;
+ int i;
+ uint j;
+ int result= 1;
+ enum enum_diag_condition_item_name item_enum;
+ String *member;
+ const LEX_STRING *name;
+
+ DBUG_ENTER("Signal_common::eval_signal_informations");
+
+ for (i= FIRST_DIAG_SET_PROPERTY;
+ i <= LAST_DIAG_SET_PROPERTY;
+ i++)
+ {
+ set= m_set_signal_information.m_item[i];
+ if (set)
+ {
+ if (! set->fixed)
+ {
+ if (set->fix_fields(thd, & set))
+ goto end;
+ m_set_signal_information.m_item[i]= set;
+ }
+ }
+ }
+
+ /*
+ Generically assign all the UTF8 String 64 condition items
+ described in the map.
+ */
+ for (j= 0; j < array_elements(map); j++)
+ {
+ item_enum= map[j].m_item;
+ set= m_set_signal_information.m_item[item_enum];
+ if (set != NULL)
+ {
+ member= & (cond->* map[j].m_member);
+ name= & Diag_condition_item_names[item_enum];
+ if (assign_condition_item(cond->m_mem_root, name->str, thd, set, member))
+ goto end;
+ }
+ }
+
+ /*
+ Assign the remaining attributes.
+ */
+
+ set= m_set_signal_information.m_item[DIAG_MESSAGE_TEXT];
+ if (set != NULL)
+ {
+ if (set->is_null())
+ {
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR,
+ "MESSAGE_TEXT", "NULL");
+ goto end;
+ }
+ /*
+ Enforce that SET MESSAGE_TEXT = <value> evaluates the value
+ as VARCHAR(128) CHARACTER SET UTF8.
+ */
+ bool truncated;
+ String utf8_text;
+ str= set->val_str(& str_value);
+ truncated= assign_fixed_string(thd->mem_root, & my_charset_utf8_bin, 128,
+ & utf8_text, str);
+ if (truncated)
+ {
+ if (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES |
+ MODE_STRICT_ALL_TABLES))
+ {
+ thd->raise_error_printf(ER_COND_ITEM_TOO_LONG,
+ "MESSAGE_TEXT");
+ goto end;
+ }
+
+ thd->raise_warning_printf(WARN_COND_ITEM_TRUNCATED,
+ "MESSAGE_TEXT");
+ }
+
+ /*
+ See the comments
+ "Design notes about MYSQL_ERROR::m_message_text."
+ in file sql_error.cc
+ */
+ String converted_text;
+ converted_text.set_charset(error_message_charset_info);
+ converted_text.append(utf8_text.ptr(), utf8_text.length(),
+ utf8_text.charset());
+ cond->set_builtin_message_text(converted_text.c_ptr_safe());
+ }
+
+ set= m_set_signal_information.m_item[DIAG_MYSQL_ERRNO];
+ if (set != NULL)
+ {
+ if (set->is_null())
+ {
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR,
+ "MYSQL_ERRNO", "NULL");
+ goto end;
+ }
+ longlong code= set->val_int();
+ if ((code <= 0) || (code > MAX_MYSQL_ERRNO))
+ {
+ str= set->val_str(& str_value);
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR,
+ "MYSQL_ERRNO", str->c_ptr_safe());
+ goto end;
+ }
+ cond->m_sql_errno= (int) code;
+ }
+
+ /*
+ The various item->val_xxx() methods don't return an error code,
+ but flag thd in case of failure.
+ */
+ if (! thd->is_error())
+ result= 0;
+
+end:
+ for (i= FIRST_DIAG_SET_PROPERTY;
+ i <= LAST_DIAG_SET_PROPERTY;
+ i++)
+ {
+ set= m_set_signal_information.m_item[i];
+ if (set)
+ {
+ if (set->fixed)
+ set->cleanup();
+ }
+ }
+
+ DBUG_RETURN(result);
+}
+
+bool Signal_common::raise_condition(THD *thd, MYSQL_ERROR *cond)
+{
+ bool result= TRUE;
+
+ DBUG_ENTER("Signal_common::raise_condition");
+
+ DBUG_ASSERT(m_lex->query_tables == NULL);
+
+ eval_defaults(thd, cond);
+ if (eval_signal_informations(thd, cond))
+ DBUG_RETURN(result);
+
+ /* SIGNAL should not signal WARN_LEVEL_NOTE */
+ DBUG_ASSERT((cond->m_level == MYSQL_ERROR::WARN_LEVEL_WARN) ||
+ (cond->m_level == MYSQL_ERROR::WARN_LEVEL_ERROR));
+
+ MYSQL_ERROR *raised= NULL;
+ raised= thd->raise_condition(cond->get_sql_errno(),
+ cond->get_sqlstate(),
+ cond->get_level(),
+ cond->get_message_text());
+ if (raised)
+ raised->copy_opt_attributes(cond);
+
+ if (cond->m_level == MYSQL_ERROR::WARN_LEVEL_WARN)
+ {
+ my_ok(thd);
+ result= FALSE;
+ }
+
+ DBUG_RETURN(result);
+}
+
+bool Signal_statement::execute(THD *thd)
+{
+ bool result= TRUE;
+ MYSQL_ERROR cond(thd->mem_root);
+
+ DBUG_ENTER("Signal_statement::execute");
+
+ thd->stmt_da->reset_diagnostics_area();
+ thd->row_count_func= 0;
+ thd->warning_info->clear_warning_info(thd->query_id);
+
+ result= raise_condition(thd, &cond);
+
+ DBUG_RETURN(result);
+}
+
+
+bool Resignal_statement::execute(THD *thd)
+{
+ MYSQL_ERROR *signaled;
+ int result= TRUE;
+
+ DBUG_ENTER("Resignal_statement::execute");
+
+ thd->warning_info->m_warn_id= thd->query_id;
+
+ if (! thd->spcont || ! (signaled= thd->spcont->raised_condition()))
+ {
+ thd->raise_error(ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER);
+ DBUG_RETURN(result);
+ }
+
+ if (m_cond == NULL)
+ {
+ /* RESIGNAL without signal_value */
+ result= raise_condition(thd, signaled);
+ DBUG_RETURN(result);
+ }
+
+ /* RESIGNAL with signal_value */
+
+ /* Make room for 2 conditions */
+ thd->warning_info->reserve_space(thd, 2);
+
+ MYSQL_ERROR *raised= NULL;
+ raised= thd->raise_condition_no_handler(signaled->get_sql_errno(),
+ signaled->get_sqlstate(),
+ signaled->get_level(),
+ signaled->get_message_text());
+ if (raised)
+ raised->copy_opt_attributes(signaled);
+
+ result= raise_condition(thd, signaled);
+
+ DBUG_RETURN(result);
+}
+
diff --git a/sql/sql_signal.h b/sql/sql_signal.h
new file mode 100644
index 00000000000..c9c1517f4ad
--- /dev/null
+++ b/sql/sql_signal.h
@@ -0,0 +1,152 @@
+/* Copyright (C) 2008 Sun Microsystems, Inc
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef SQL_SIGNAL_H
+#define SQL_SIGNAL_H
+
+/**
+ Signal_common represents the common properties of the SIGNAL and RESIGNAL
+ statements.
+*/
+class Signal_common : public Sql_statement
+{
+protected:
+ /**
+ Constructor.
+ @param lex the LEX structure for this statement.
+ @param cond the condition signaled if any, or NULL.
+ @param set collection of signal condition item assignments.
+ */
+ Signal_common(LEX *lex,
+ const sp_cond_type_t *cond,
+ const Set_signal_information& set)
+ : Sql_statement(lex),
+ m_cond(cond),
+ m_set_signal_information(set)
+ {}
+
+ virtual ~Signal_common()
+ {}
+
+ /**
+ Assign the condition items 'MYSQL_ERRNO', 'level' and 'MESSAGE_TEXT'
+ default values of a condition.
+ @param cond the condition to update.
+ @param set_level_code true if 'level' and 'MYSQL_ERRNO' needs to be overwritten
+ @param level the level to assign
+ @param sqlcode the sql code to assign
+ */
+ static void assign_defaults(MYSQL_ERROR *cond,
+ bool set_level_code,
+ MYSQL_ERROR::enum_warning_level level,
+ int sqlcode);
+
+ /**
+ Evaluate the condition items 'SQLSTATE', 'MYSQL_ERRNO', 'level' and 'MESSAGE_TEXT'
+ default values for this statement.
+ @param thd the current thread.
+ @param cond the condition to update.
+ */
+ void eval_defaults(THD *thd, MYSQL_ERROR *cond);
+
+ /**
+ Evaluate each signal condition items for this statement.
+ @param thd the current thread.
+ @param cond the condition to update.
+ @return 0 on success.
+ */
+ int eval_signal_informations(THD *thd, MYSQL_ERROR *cond);
+
+ /**
+ Raise a SQL condition.
+ @param thd the current thread.
+ @param cond the condition to raise.
+ @return false on success.
+ */
+ bool raise_condition(THD *thd, MYSQL_ERROR *cond);
+
+ /**
+ The condition to signal or resignal.
+ This member is optional and can be NULL (RESIGNAL).
+ */
+ const sp_cond_type_t *m_cond;
+
+ /**
+ Collection of 'SET item = value' assignments in the
+ SIGNAL/RESIGNAL statement.
+ */
+ Set_signal_information m_set_signal_information;
+};
+
+/**
+ Signal_statement represents a SIGNAL statement.
+*/
+class Signal_statement : public Signal_common
+{
+public:
+ /**
+ Constructor, used to represent a SIGNAL statement.
+ @param lex the LEX structure for this statement.
+ @param cond the SQL condition to signal (required).
+ @param set the collection of signal informations to signal.
+ */
+ Signal_statement(LEX *lex,
+ const sp_cond_type_t *cond,
+ const Set_signal_information& set)
+ : Signal_common(lex, cond, set)
+ {}
+
+ virtual ~Signal_statement()
+ {}
+
+ /**
+ Execute a SIGNAL statement at runtime.
+ @param thd the current thread.
+ @return false on success.
+ */
+ virtual bool execute(THD *thd);
+};
+
+/**
+ Resignal_statement represents a RESIGNAL statement.
+*/
+class Resignal_statement : public Signal_common
+{
+public:
+ /**
+ Constructor, used to represent a RESIGNAL statement.
+ @param lex the LEX structure for this statement.
+ @param cond the SQL condition to resignal (optional, may be NULL).
+ @param set the collection of signal informations to resignal.
+ */
+ Resignal_statement(LEX *lex,
+ const sp_cond_type_t *cond,
+ const Set_signal_information& set)
+ : Signal_common(lex, cond, set)
+ {}
+
+ virtual ~Resignal_statement()
+ {}
+
+ /**
+ Execute a RESIGNAL statement at runtime.
+ @param thd the current thread.
+ @return 0 on success.
+ */
+ virtual bool execute(THD *thd);
+};
+
+#endif
+
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 1e9322f7f5b..102b3ef0a11 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -1,3 +1,6 @@
+#ifndef SQL_SORT_INCLUDED
+#define SQL_SORT_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -87,3 +90,5 @@ int merge_buffers(SORTPARAM *param,IO_CACHE *from_file,
BUFFPEK *lastbuff,BUFFPEK *Fb,
BUFFPEK *Tb,int flag);
void reuse_freed_buff(QUEUE *queue, BUFFPEK *reuse, uint key_length);
+
+#endif /* SQL_SORT_INCLUDED */
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 7c9793b273b..593450cacd5 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -794,10 +794,11 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
*/
-uint32
-copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
- const char *from, uint32 from_length, CHARSET_INFO *from_cs,
- uint *errors)
+static uint32
+copy_and_convert_extended(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs,
+ uint *errors)
{
int cnvres;
my_wc_t wc;
@@ -849,6 +850,65 @@ outp:
}
+/*
+ Optimized for quick copying of ASCII characters in the range 0x00..0x7F.
+*/
+uint32
+copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length, CHARSET_INFO *from_cs,
+ uint *errors)
+{
+ /*
+ If any of the character sets is not ASCII compatible,
+ immediately switch to slow mb_wc->wc_mb method.
+ */
+ if ((to_cs->state | from_cs->state) & MY_CS_NONASCII)
+ return copy_and_convert_extended(to, to_length, to_cs,
+ from, from_length, from_cs, errors);
+
+ uint32 length= min(to_length, from_length), length2= length;
+
+#if defined(__i386__)
+ /*
+ Special loop for i386, it allows to refer to a
+ non-aligned memory block as UINT32, which makes
+ it possible to copy four bytes at once. This
+ gives about 10% performance improvement comparing
+ to byte-by-byte loop.
+ */
+ for ( ; length >= 4; length-= 4, from+= 4, to+= 4)
+ {
+ if ((*(uint32*)from) & 0x80808080)
+ break;
+ *((uint32*) to)= *((const uint32*) from);
+ }
+#endif
+
+ for (; ; *to++= *from++, length--)
+ {
+ if (!length)
+ {
+ *errors= 0;
+ return length2;
+ }
+ if (*((unsigned char*) from) > 0x7F) /* A non-ASCII character */
+ {
+ uint32 copied_length= length2 - length;
+ to_length-= copied_length;
+ from_length-= copied_length;
+ return copied_length + copy_and_convert_extended(to, to_length,
+ to_cs,
+ from, from_length,
+ from_cs,
+ errors);
+ }
+ }
+
+ DBUG_ASSERT(FALSE); // Should never get to here
+ return 0; // Make compiler happy
+}
+
+
/**
Copy string with HEX-encoding of "bad" characters.
diff --git a/sql/sql_string.h b/sql/sql_string.h
index d62908e5d66..75dc1163eec 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -1,3 +1,6 @@
+#ifndef SQL_STRING_INCLUDED
+#define SQL_STRING_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -120,6 +123,11 @@ public:
(void) realloc(str_length);
return Ptr;
}
+ LEX_STRING lex_string() const
+ {
+ LEX_STRING lex_string = { (char*) ptr(), length() };
+ return lex_string;
+ }
void set(String &str,uint32 offset,uint32 arg_length)
{
@@ -389,3 +397,5 @@ static inline bool check_if_only_end_space(CHARSET_INFO *cs, char *str,
{
return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;
}
+
+#endif /* SQL_STRING_INCLUDED */
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 869ae42c98c..b648a9b933e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1585,7 +1585,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
{
if (!(part_syntax_buf= generate_partition_syntax(part_info,
&syntax_len,
- TRUE, TRUE)))
+ TRUE, TRUE,
+ lpt->create_info,
+ lpt->alter_info)))
{
DBUG_RETURN(TRUE);
}
@@ -1677,7 +1679,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
char *tmp_part_syntax_str;
if (!(part_syntax_buf= generate_partition_syntax(part_info,
&syntax_len,
- TRUE, TRUE)))
+ TRUE, TRUE,
+ lpt->create_info,
+ lpt->alter_info)))
{
error= 1;
goto err;
@@ -2056,6 +2060,12 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
DBUG_PRINT("table", ("table: 0x%lx s: 0x%lx", (long) table->table,
table->table ? (long) table->table->s : (long) -1));
+
+ DBUG_EXECUTE_IF("bug43138",
+ my_printf_error(ER_BAD_TABLE_ERROR,
+ ER(ER_BAD_TABLE_ERROR), MYF(0),
+ table->table_name););
+
}
/*
It's safe to unlock LOCK_open: we have an exclusive lock
@@ -2269,17 +2279,19 @@ bool check_duplicates_in_interval(const char *set_or_name,
tmp.count--;
if (find_type2(&tmp, (const char*)*cur_value, *cur_length, cs))
{
+ THD *thd= current_thd;
+ ErrConvString err(*cur_value, *cur_length, cs);
if ((current_thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_error(ER_DUPLICATED_VALUE_IN_TYPE, MYF(0),
- name,*cur_value,set_or_name);
+ name, err.ptr(), set_or_name);
return 1;
}
- push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_DUPLICATED_VALUE_IN_TYPE,
- ER(ER_DUPLICATED_VALUE_IN_TYPE),
- name,*cur_value,set_or_name);
+ push_warning_printf(thd,MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_DUPLICATED_VALUE_IN_TYPE,
+ ER(ER_DUPLICATED_VALUE_IN_TYPE),
+ name, err.ptr(), set_or_name);
(*dup_val_count)++;
}
}
@@ -2496,6 +2508,39 @@ int prepare_create_field(Create_field *sql_field,
DBUG_RETURN(0);
}
+
+/*
+ Get character set from field object generated by parser using
+ default values when not set.
+
+ SYNOPSIS
+ get_sql_field_charset()
+ sql_field The sql_field object
+ create_info Info generated by parser
+
+ RETURN VALUES
+ cs Character set
+*/
+
+CHARSET_INFO* get_sql_field_charset(Create_field *sql_field,
+ HA_CREATE_INFO *create_info)
+{
+ CHARSET_INFO *cs= sql_field->charset;
+
+ if (!cs)
+ cs= create_info->default_table_charset;
+ /*
+ table_charset is set only in ALTER TABLE t1 CONVERT TO CHARACTER SET csname
+ if we want change character set for all varchar/char columns.
+ But the table charset must not affect the BLOB fields, so don't
+ allow to change my_charset_bin to somethig else.
+ */
+ if (create_info->table_charset && cs != &my_charset_bin)
+ cs= create_info->table_charset;
+ return cs;
+}
+
+
/*
Preparation for table creation
@@ -2559,18 +2604,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
executing a prepared statement for the second time.
*/
sql_field->length= sql_field->char_length;
- if (!sql_field->charset)
- sql_field->charset= create_info->default_table_charset;
- /*
- table_charset is set in ALTER TABLE if we want change character set
- for all varchar/char columns.
- But the table charset must not affect the BLOB fields, so don't
- allow to change my_charset_bin to somethig else.
- */
- if (create_info->table_charset && sql_field->charset != &my_charset_bin)
- sql_field->charset= create_info->table_charset;
-
- save_cs= sql_field->charset;
+ save_cs= sql_field->charset= get_sql_field_charset(sql_field,
+ create_info);
if ((sql_field->flags & BINCMP_FLAG) &&
!(sql_field->charset= get_charset_by_csname(sql_field->charset->csname,
MY_CS_BINSORT,MYF(0))))
@@ -2665,7 +2700,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
interval->type_lengths[i],
comma_buf, comma_length, NULL, 0))
{
- my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", tmp->ptr());
+ ErrConvString err(tmp->ptr(), tmp->length(), cs);
+ my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", err.ptr());
DBUG_RETURN(TRUE);
}
}
@@ -2879,9 +2915,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
while ((key=key_iterator++))
{
- DBUG_PRINT("info", ("key name: '%s' type: %d", key->name ? key->name :
+ DBUG_PRINT("info", ("key name: '%s' type: %d", key->name.str ? key->name.str :
"(none)" , key->type));
- LEX_STRING key_name_str;
if (key->type == Key::FOREIGN_KEY)
{
fk_key_count++;
@@ -2890,7 +2925,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
fk_key->ref_columns.elements != fk_key->columns.elements)
{
my_error(ER_WRONG_FK_DEF, MYF(0),
- (fk_key->name ? fk_key->name : "foreign key without name"),
+ (fk_key->name.str ? fk_key->name.str :
+ "foreign key without name"),
ER(ER_KEY_REF_DO_NOT_MATCH_TABLE_REF));
DBUG_RETURN(TRUE);
}
@@ -2903,12 +2939,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp);
DBUG_RETURN(TRUE);
}
- key_name_str.str= (char*) key->name;
- key_name_str.length= key->name ? strlen(key->name) : 0;
- if (check_string_char_length(&key_name_str, "", NAME_CHAR_LEN,
+ if (check_string_char_length(&key->name, "", NAME_CHAR_LEN,
system_charset_info, 1))
{
- my_error(ER_TOO_LONG_IDENT, MYF(0), key->name);
+ my_error(ER_TOO_LONG_IDENT, MYF(0), key->name.str);
DBUG_RETURN(TRUE);
}
key_iterator2.rewind ();
@@ -2922,7 +2956,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
Then we do not need the generated shorter key.
*/
if ((key2->type != Key::FOREIGN_KEY &&
- key2->name != ignore_key &&
+ key2->name.str != ignore_key &&
!foreign_key_prefix(key, key2)))
{
/* TODO: issue warning message */
@@ -2930,10 +2964,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (!key2->generated ||
(key->generated && key->columns.elements <
key2->columns.elements))
- key->name= ignore_key;
+ key->name.str= ignore_key;
else
{
- key2->name= ignore_key;
+ key2->name.str= ignore_key;
key_parts-= key2->columns.elements;
(*key_count)--;
}
@@ -2941,14 +2975,14 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
}
}
- if (key->name != ignore_key)
+ if (key->name.str != ignore_key)
key_parts+=key->columns.elements;
else
(*key_count)--;
- if (key->name && !tmp_table && (key->type != Key::PRIMARY) &&
- !my_strcasecmp(system_charset_info,key->name,primary_key_name))
+ if (key->name.str && !tmp_table && (key->type != Key::PRIMARY) &&
+ !my_strcasecmp(system_charset_info, key->name.str, primary_key_name))
{
- my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
+ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name.str);
DBUG_RETURN(TRUE);
}
}
@@ -2971,12 +3005,12 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
uint key_length=0;
Key_part_spec *column;
- if (key->name == ignore_key)
+ if (key->name.str == ignore_key)
{
/* ignore redundant keys */
do
key=key_iterator++;
- while (key && key->name == ignore_key);
+ while (key && key->name.str == ignore_key);
if (!key)
break;
}
@@ -3089,22 +3123,22 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
field=0;
while ((sql_field=it++) &&
my_strcasecmp(system_charset_info,
- column->field_name,
+ column->field_name.str,
sql_field->field_name))
field++;
if (!sql_field)
{
- my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name);
+ my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
while ((dup_column= cols2++) != column)
{
if (!my_strcasecmp(system_charset_info,
- column->field_name, dup_column->field_name))
+ column->field_name.str, dup_column->field_name.str))
{
my_printf_error(ER_DUP_FIELDNAME,
ER(ER_DUP_FIELDNAME),MYF(0),
- column->field_name);
+ column->field_name.str);
DBUG_RETURN(TRUE);
}
}
@@ -3118,7 +3152,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->charset->mbminlen > 1 || // ucs2 doesn't work yet
(ft_key_charset && sql_field->charset != ft_key_charset))
{
- my_error(ER_BAD_FT_COLUMN, MYF(0), column->field_name);
+ my_error(ER_BAD_FT_COLUMN, MYF(0), column->field_name.str);
DBUG_RETURN(-1);
}
ft_key_charset=sql_field->charset;
@@ -3146,7 +3180,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
{
if (!(file->ha_table_flags() & HA_CAN_INDEX_BLOBS))
{
- my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name);
+ my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
@@ -3154,7 +3188,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
column->length= 25;
if (!column->length)
{
- my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name);
+ my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
}
@@ -3185,7 +3219,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_info->flags|= HA_NULL_PART_KEY;
if (!(file->ha_table_flags() & HA_NULL_IN_KEY))
{
- my_error(ER_NULL_COLUMN_IN_INDEX, MYF(0), column->field_name);
+ my_error(ER_NULL_COLUMN_IN_INDEX, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
if (key->type == Key::SPATIAL)
@@ -3235,13 +3269,21 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
}
else if (!f_is_geom(sql_field->pack_flag) &&
- (column->length > length ||
- !Field::type_can_have_key_part (sql_field->sql_type) ||
- ((f_is_packed(sql_field->pack_flag) ||
- ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
- (key_info->flags & HA_NOSAME))) &&
- column->length != length)))
- {
+ ((column->length > length &&
+ !Field::type_can_have_key_part (sql_field->sql_type)) ||
+ ((f_is_packed(sql_field->pack_flag) ||
+ ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
+ (key_info->flags & HA_NOSAME))) &&
+ column->length != length)))
+ {
+ /* Catch invalid uses of partial keys.
+ A key is identified as 'partial' if column->length != length.
+ A partial key is invalid if they data type does
+ not allow it, or the field is packed (as in MyISAM),
+ or the storage engine doesn't allow prefixed search and
+ the key is primary key.
+ */
+
my_message(ER_WRONG_SUB_KEY, ER(ER_WRONG_SUB_KEY), MYF(0));
DBUG_RETURN(TRUE);
}
@@ -3250,7 +3292,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
else if (length == 0)
{
- my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name);
+ my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
@@ -3308,7 +3350,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_name=primary_key_name;
primary_key=1;
}
- else if (!(key_name = key->name))
+ else if (!(key_name= key->name.str))
key_name=make_unique_key_name(sql_field->field_name,
*key_info_buffer, key_info);
if (check_if_keyname_exists(key_name, *key_info_buffer, key_info))
@@ -3619,6 +3661,9 @@ bool mysql_create_table_no_lock(THD *thd,
}
if (check_engine(thd, table_name, create_info))
DBUG_RETURN(TRUE);
+
+ set_table_default_charset(thd, create_info, (char*) db);
+
db_options= create_info->table_options;
if (create_info->row_type == ROW_TYPE_DYNAMIC)
db_options|=HA_OPTION_PACK_RECORD;
@@ -3712,7 +3757,7 @@ bool mysql_create_table_no_lock(THD *thd,
ha_resolve_storage_engine_name(part_info->default_engine_type),
ha_resolve_storage_engine_name(create_info->db_type)));
if (part_info->check_partition_info(thd, &engine_type, file,
- create_info, TRUE))
+ create_info, FALSE))
goto err;
part_info->default_engine_type= engine_type;
@@ -3722,7 +3767,9 @@ bool mysql_create_table_no_lock(THD *thd,
*/
if (!(part_syntax_buf= generate_partition_syntax(part_info,
&syntax_len,
- TRUE, TRUE)))
+ TRUE, TRUE,
+ create_info,
+ alter_info)))
goto err;
part_info->part_info_string= part_syntax_buf;
part_info->part_info_len= syntax_len;
@@ -3748,9 +3795,9 @@ bool mysql_create_table_no_lock(THD *thd,
creates a proper .par file. The current part_info object is
only used to create the frm-file and .par-file.
*/
- if (part_info->use_default_no_partitions &&
- part_info->no_parts &&
- (int)part_info->no_parts !=
+ if (part_info->use_default_num_partitions &&
+ part_info->num_parts &&
+ (int)part_info->num_parts !=
file->get_default_no_partitions(create_info))
{
uint i;
@@ -3761,13 +3808,13 @@ bool mysql_create_table_no_lock(THD *thd,
(part_it++)->part_state= PART_TO_BE_DROPPED;
}
else if (part_info->is_sub_partitioned() &&
- part_info->use_default_no_subpartitions &&
- part_info->no_subparts &&
- (int)part_info->no_subparts !=
+ part_info->use_default_num_subpartitions &&
+ part_info->num_subparts &&
+ (int)part_info->num_subparts !=
file->get_default_no_partitions(create_info))
{
DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
- part_info->no_subparts= file->get_default_no_partitions(create_info);
+ part_info->num_subparts= file->get_default_no_partitions(create_info);
}
}
else if (create_info->db_type != engine_type)
@@ -3789,8 +3836,6 @@ bool mysql_create_table_no_lock(THD *thd,
}
#endif
- set_table_default_charset(thd, create_info, (char*) db);
-
if (mysql_prepare_create_table(thd, create_info, alter_info,
internal_tmp_table,
&db_options, file,
@@ -3846,7 +3891,7 @@ bool mysql_create_table_no_lock(THD *thd,
Then she could create the table. This case is pretty obscure and
therefore we don't introduce a new error message only for it.
*/
- if (get_cached_table_share(db, alias))
+ if (get_cached_table_share(db, table_name))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
goto unlock_and_end;
@@ -3980,7 +4025,7 @@ bool mysql_create_table(THD *thd, const char *db, const char *table_name,
/* Wait for any database locks */
pthread_mutex_lock(&LOCK_lock_db);
while (!thd->killed &&
- hash_search(&lock_db_cache,(uchar*) db, strlen(db)))
+ my_hash_search(&lock_db_cache,(uchar*) db, strlen(db)))
{
wait_for_condition(thd, &LOCK_lock_db, &COND_refresh);
pthread_mutex_lock(&LOCK_lock_db);
@@ -4520,7 +4565,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
item->maybe_null = 1;
field_list.push_back(item = new Item_empty_string("Msg_text", 255));
item->maybe_null = 1;
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -4569,6 +4614,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
/*
Set up which partitions that should be processed
if ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION ..
+ CACHE INDEX/LOAD INDEX for specified partitions
*/
Alter_info *alter_info= &lex->alter_info;
@@ -4579,11 +4625,11 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
}
- uint no_parts_found;
- uint no_parts_opt= alter_info->partition_names.elements;
- no_parts_found= set_part_state(alter_info, table->table->part_info,
- PART_CHANGED);
- if (no_parts_found != no_parts_opt &&
+ uint num_parts_found;
+ uint num_parts_opt= alter_info->partition_names.elements;
+ num_parts_found= set_part_state(alter_info, table->table->part_info,
+ PART_ADMIN);
+ if (num_parts_found != num_parts_opt &&
(!(alter_info->flags & ALTER_ALL_PARTITION)))
{
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
@@ -4640,17 +4686,17 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
if (!table->table)
{
DBUG_PRINT("admin", ("open table failed"));
- if (!thd->warn_list.elements)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ if (thd->warning_info->is_empty())
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE));
/* if it was a view will check md5 sum */
if (table->view &&
view_checksum(thd, table) == HA_ADMIN_WRONG_CHECKSUM)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM));
- if (thd->main_da.is_error() &&
- (thd->main_da.sql_errno() == ER_NO_SUCH_TABLE ||
- thd->main_da.sql_errno() == ER_FILE_NOT_FOUND))
+ if (thd->stmt_da->is_error() &&
+ (thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE ||
+ thd->stmt_da->sql_errno() == ER_FILE_NOT_FOUND))
/* A missing table is just issued as a failed command */
result_code= HA_ADMIN_FAILED;
else
@@ -4692,7 +4738,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->table=0; // For query cache
if (protocol->write())
goto err;
- thd->main_da.reset_diagnostics_area();
+ thd->stmt_da->reset_diagnostics_area();
continue;
/* purecov: end */
}
@@ -4752,8 +4798,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
we will store the error message in a result set row
and then clear.
*/
- if (thd->main_da.is_ok())
- thd->main_da.reset_diagnostics_area();
+ if (thd->stmt_da->is_ok())
+ thd->stmt_da->reset_diagnostics_area();
goto send_result;
}
}
@@ -4767,21 +4813,21 @@ send_result:
lex->cleanup_after_one_table_open();
thd->clear_error(); // these errors shouldn't get client
{
- List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
while ((err= it++))
{
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store((char*) operator_name, system_charset_info);
- protocol->store(warning_level_names[err->level].str,
- warning_level_names[err->level].length,
+ protocol->store(warning_level_names[err->get_level()].str,
+ warning_level_names[err->get_level()].length,
system_charset_info);
- protocol->store(err->msg, system_charset_info);
+ protocol->store(err->get_message_text(), system_charset_info);
if (protocol->write())
goto err;
}
- mysql_reset_errors(thd, true);
+ thd->warning_info->clear_warning_info(thd->query_id);
}
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
@@ -4876,8 +4922,8 @@ send_result_message:
we will store the error message in a result set row
and then clear.
*/
- if (thd->main_da.is_ok())
- thd->main_da.reset_diagnostics_area();
+ if (thd->stmt_da->is_ok())
+ thd->stmt_da->reset_diagnostics_area();
ha_autocommit_or_rollback(thd, 0);
close_thread_tables(thd);
if (!result_code) // recreation went ok
@@ -4895,7 +4941,7 @@ send_result_message:
DBUG_ASSERT(thd->is_error());
if (thd->is_error())
{
- const char *err_msg= thd->main_da.message();
+ const char *err_msg= thd->stmt_da->message();
if (!thd->vio_ok())
{
sql_print_error("%s", err_msg);
@@ -5426,7 +5472,7 @@ binlog:
*/
if (!table->view)
{
- IF_DBUG(int result=)
+ int result __attribute__((unused))=
store_create_info(thd, table, &query,
create_info, FALSE /* show_database */);
@@ -6245,6 +6291,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
key_part_length /= key_part->field->charset()->mbmaxlen;
key_parts.push_back(new Key_part_spec(cfield->field_name,
+ strlen(cfield->field_name),
key_part_length));
}
if (key_parts.elements)
@@ -6274,7 +6321,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
else
key_type= Key::MULTIPLE;
- key= new Key(key_type, key_name,
+ key= new Key(key_type, key_name, strlen(key_name),
&key_create_info,
test(key_info->flags & HA_GENERATED_KEY),
key_parts);
@@ -6287,10 +6334,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
{
if (key->type != Key::FOREIGN_KEY)
new_key_list.push_back(key);
- if (key->name &&
- !my_strcasecmp(system_charset_info,key->name,primary_key_name))
+ if (key->name.str &&
+ !my_strcasecmp(system_charset_info, key->name.str, primary_key_name))
{
- my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
+ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name.str);
goto err;
}
}
@@ -7489,7 +7536,7 @@ view_err:
end_temporary:
my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
(ulong) (copied + deleted), (ulong) deleted,
- (ulong) thd->cuted_fields);
+ (ulong) thd->warning_info->statement_warn_count());
my_ok(thd, copied + deleted, 0L, tmp_name);
thd->some_tables_deleted=0;
DBUG_RETURN(FALSE);
@@ -7513,7 +7560,8 @@ err:
the table to be altered isn't empty.
Report error here.
*/
- if (alter_info->error_if_not_empty && thd->row_count)
+ if (alter_info->error_if_not_empty &&
+ thd->warning_info->current_row_for_warning())
{
const char *f_val= 0;
enum enum_mysql_timestamp_type t_type= MYSQL_TIMESTAMP_DATE;
@@ -7534,7 +7582,7 @@ err:
}
bool save_abort_on_warning= thd->abort_on_warning;
thd->abort_on_warning= TRUE;
- make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
f_val, strlength(f_val), t_type,
alter_info->datetime_field->field_name);
thd->abort_on_warning= save_abort_on_warning;
@@ -7681,7 +7729,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE);
if (ignore)
to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
- thd->row_count= 0;
+ thd->warning_info->reset_current_row_for_warning();
restore_record(to, s->default_values); // Create empty record
while (!(error=info.read_record(&info)))
{
@@ -7691,7 +7739,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
error= 1;
break;
}
- thd->row_count++;
/* Return error if source table isn't empty. */
if (error_if_not_empty)
{
@@ -7741,6 +7788,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
}
else
found_count++;
+ thd->warning_info->inc_current_row_for_warning();
}
end_read_record(&info);
free_io_cache(from);
@@ -7830,7 +7878,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
field_list.push_back(item= new Item_int("Checksum", (longlong) 1,
MY_INT64_NUM_DECIMAL_DIGITS));
item->maybe_null= 1;
- if (protocol->send_fields(&field_list,
+ if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index fcc442a8f9a..ef81c7d847e 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -31,7 +31,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
{
hton= ha_default_handlerton(thd);
if (ts_info->storage_engine != 0)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_resolve_storage_engine_name(hton),
@@ -60,7 +60,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
}
else
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ha_resolve_storage_engine_name(hton),
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index eeb9a21b6f5..6c0cb08cc79 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -85,7 +85,7 @@ void print_cached_tables(void)
for (idx=unused=0 ; idx < open_cache.records ; idx++)
{
- TABLE *entry=(TABLE*) hash_element(&open_cache,idx);
+ TABLE *entry=(TABLE*) my_hash_element(&open_cache,idx);
printf("%-14.14s %-32s%6ld%8ld%6d %s\n",
entry->s->db.str, entry->s->table_name.str, entry->s->version,
entry->in_use ? entry->in_use->thread_id : 0L,
@@ -113,7 +113,7 @@ void print_cached_tables(void)
if (count != unused)
printf("Unused_links (%d) doesn't match open_cache: %d\n", count,unused);
printf("\nCurrent refresh version: %ld\n",refresh_version);
- if (hash_check(&open_cache))
+ if (my_hash_check(&open_cache))
printf("Error: File hash table is corrupted\n");
fflush(stdout);
VOID(pthread_mutex_unlock(&LOCK_open));
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index a251a533622..61da4617610 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -422,7 +422,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
TABLE_LIST **save_query_tables_own_last= thd->lex->query_tables_own_last;
thd->lex->query_tables_own_last= 0;
- err_status= check_table_access(thd, TRIGGER_ACL, tables, 1, FALSE);
+ err_status= check_table_access(thd, TRIGGER_ACL, tables, FALSE, 1, FALSE);
thd->lex->query_tables_own_last= save_query_tables_own_last;
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index f6754a75284..b411acf2ac5 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -1,3 +1,6 @@
+#ifndef SQL_TRIGGER_INCLUDED
+#define SQL_TRIGGER_INCLUDED
+
/* Copyright (C) 2004-2005 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -174,3 +177,4 @@ bool load_table_name_for_trigger(THD *thd,
const LEX_STRING *trn_path,
LEX_STRING *tbl_name);
+#endif /* SQL_TRIGGER_INCLUDED */
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index c6b41b59a3f..a1a0d9633b7 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -124,10 +124,10 @@ void udf_init()
init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0);
THD *new_thd = new THD;
if (!new_thd ||
- hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))
+ my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))
{
sql_print_error("Can't allocate memory for udf structures");
- hash_free(&udf_hash);
+ my_hash_free(&udf_hash);
free_root(&mem,MYF(0));
delete new_thd;
DBUG_VOID_RETURN;
@@ -239,20 +239,20 @@ void udf_free()
DBUG_ENTER("udf_free");
for (uint idx=0 ; idx < udf_hash.records ; idx++)
{
- udf_func *udf=(udf_func*) hash_element(&udf_hash,idx);
+ udf_func *udf=(udf_func*) my_hash_element(&udf_hash,idx);
if (udf->dlhandle) // Not closed before
{
/* Mark all versions using the same handler as closed */
for (uint j=idx+1 ; j < udf_hash.records ; j++)
{
- udf_func *tmp=(udf_func*) hash_element(&udf_hash,j);
+ udf_func *tmp=(udf_func*) my_hash_element(&udf_hash,j);
if (udf->dlhandle == tmp->dlhandle)
tmp->dlhandle=0; // Already closed
}
dlclose(udf->dlhandle);
}
}
- hash_free(&udf_hash);
+ my_hash_free(&udf_hash);
free_root(&mem,MYF(0));
if (initialized)
{
@@ -268,7 +268,7 @@ static void del_udf(udf_func *udf)
DBUG_ENTER("del_udf");
if (!--udf->usage_count)
{
- hash_delete(&udf_hash,(uchar*) udf);
+ my_hash_delete(&udf_hash,(uchar*) udf);
using_udf_functions=udf_hash.records != 0;
}
else
@@ -282,7 +282,7 @@ static void del_udf(udf_func *udf)
uint name_length=udf->name.length;
udf->name.str=(char*) "*";
udf->name.length=1;
- hash_update(&udf_hash,(uchar*) udf,(uchar*) name,name_length);
+ my_hash_update(&udf_hash,(uchar*) udf,(uchar*) name,name_length);
}
DBUG_VOID_RETURN;
}
@@ -302,7 +302,7 @@ void free_udf(udf_func *udf)
We come here when someone has deleted the udf function
while another thread still was using the udf
*/
- hash_delete(&udf_hash,(uchar*) udf);
+ my_hash_delete(&udf_hash,(uchar*) udf);
using_udf_functions=udf_hash.records != 0;
if (!find_udf_dl(udf->dl))
dlclose(udf->dlhandle);
@@ -328,8 +328,8 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
else
rw_rdlock(&THR_LOCK_udf); /* Called during parsing */
- if ((udf=(udf_func*) hash_search(&udf_hash,(uchar*) name,
- length ? length : (uint) strlen(name))))
+ if ((udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) name,
+ length ? length : (uint) strlen(name))))
{
if (!udf->dlhandle)
udf=0; // Could not be opened
@@ -351,7 +351,7 @@ static void *find_udf_dl(const char *dl)
*/
for (uint idx=0 ; idx < udf_hash.records ; idx++)
{
- udf_func *udf=(udf_func*) hash_element(&udf_hash,idx);
+ udf_func *udf=(udf_func*) my_hash_element(&udf_hash,idx);
if (!strcmp(dl, udf->dl) && udf->dlhandle != NULL)
DBUG_RETURN(udf->dlhandle);
}
@@ -441,7 +441,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
thd->clear_current_stmt_binlog_row_based();
rw_wrlock(&THR_LOCK_udf);
- if ((hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length)))
+ if ((my_hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length)))
{
my_error(ER_UDF_EXISTS, MYF(0), udf->name.str);
goto err;
@@ -544,8 +544,8 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
thd->clear_current_stmt_binlog_row_based();
rw_wrlock(&THR_LOCK_udf);
- if (!(udf=(udf_func*) hash_search(&udf_hash,(uchar*) udf_name->str,
- (uint) udf_name->length)))
+ if (!(udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) udf_name->str,
+ (uint) udf_name->length)))
{
my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), udf_name->str);
goto err;
diff --git a/sql/sql_udf.h b/sql/sql_udf.h
index 4b8b492698e..95cb167869e 100644
--- a/sql/sql_udf.h
+++ b/sql/sql_udf.h
@@ -1,3 +1,6 @@
+#ifndef SQL_UDF_INCLUDED
+#define SQL_UDF_INCLUDED
+
/* Copyright (C) 2000-2001, 2003-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -140,3 +143,4 @@ void free_udf(udf_func *udf);
int mysql_create_function(THD *thd,udf_func *udf);
int mysql_drop_function(THD *thd,const LEX_STRING *name);
#endif
+#endif /* SQL_UDF_INCLUDED */
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 819214afa31..e7b4eb22e78 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -725,7 +725,7 @@ int mysql_update(THD *thd,
}
else
table->file->unlock_row();
- thd->row_count++;
+ thd->warning_info->inc_current_row_for_warning();
if (thd->is_error())
{
error= 1;
@@ -831,8 +831,9 @@ int mysql_update(THD *thd,
if (error < 0)
{
char buff[STRING_BUFFER_USUAL_SIZE];
- my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), (ulong) found, (ulong) updated,
- (ulong) thd->cuted_fields);
+ my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), (ulong) found,
+ (ulong) updated,
+ (ulong) thd->warning_info->statement_warn_count());
thd->row_count_func=
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
my_ok(thd, (ulong) thd->row_count_func, id, buff);
@@ -921,7 +922,6 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{
update_non_unique_table_error(table_list, "UPDATE", duplicate);
- my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
DBUG_RETURN(TRUE);
}
}
@@ -1076,7 +1076,7 @@ reopen_tables:
if (check_access(thd, want_privilege,
tl->db, &tl->grant.privilege, 0, 0,
test(tl->schema_table)) ||
- check_grant(thd, want_privilege, tl, 0, 1, 0))
+ check_grant(thd, want_privilege, tl, FALSE, 1, FALSE))
DBUG_RETURN(TRUE);
}
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index ae3af0640a3..9abbadb8c6b 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -269,11 +269,11 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
*/
if ((check_access(thd, CREATE_VIEW_ACL, view->db, &view->grant.privilege,
0, 0, is_schema_db(view->db)) ||
- check_grant(thd, CREATE_VIEW_ACL, view, 0, 1, 0)) ||
+ check_grant(thd, CREATE_VIEW_ACL, view, FALSE, 1, FALSE)) ||
(mode != VIEW_CREATE_NEW &&
(check_access(thd, DROP_ACL, view->db, &view->grant.privilege,
0, 0, is_schema_db(view->db)) ||
- check_grant(thd, DROP_ACL, view, 0, 1, 0))))
+ check_grant(thd, DROP_ACL, view, FALSE, 1, FALSE))))
goto err;
for (sl= select_lex; sl; sl= sl->next_select())
@@ -323,7 +323,7 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
{
if (check_access(thd, SELECT_ACL, tbl->db,
&tbl->grant.privilege, 0, 0, test(tbl->schema_table)) ||
- check_grant(thd, SELECT_ACL, tbl, 0, 1, 0))
+ check_grant(thd, SELECT_ACL, tbl, FALSE, 1, FALSE))
goto err;
}
}
@@ -1233,8 +1233,9 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
if (!table->prelocking_placeholder &&
(old_lex->sql_command == SQLCOM_SELECT && old_lex->describe))
{
- if (check_table_access(thd, SELECT_ACL, view_tables, UINT_MAX, TRUE) &&
- check_table_access(thd, SHOW_VIEW_ACL, table, UINT_MAX, TRUE))
+ if (check_table_access(thd, SELECT_ACL, view_tables, FALSE,
+ UINT_MAX, TRUE) &&
+ check_table_access(thd, SHOW_VIEW_ACL, table, FALSE, UINT_MAX, TRUE))
{
my_message(ER_VIEW_NO_EXPLAIN, ER(ER_VIEW_NO_EXPLAIN), MYF(0));
goto err;
@@ -1244,7 +1245,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
(old_lex->sql_command == SQLCOM_SHOW_CREATE) &&
!table->belong_to_view)
{
- if (check_table_access(thd, SHOW_VIEW_ACL, table, UINT_MAX, FALSE))
+ if (check_table_access(thd, SHOW_VIEW_ACL, table, FALSE, UINT_MAX, FALSE))
goto err;
}
diff --git a/sql/sql_view.h b/sql/sql_view.h
index e08c2168e14..3de51c3264e 100644
--- a/sql/sql_view.h
+++ b/sql/sql_view.h
@@ -1,3 +1,6 @@
+#ifndef SQL_VIEW_INCLUDED
+#define SQL_VIEW_INCLUDED
+
/* -*- C++ -*- */
/* Copyright (C) 2004 MySQL AB
@@ -42,3 +45,4 @@ bool mysql_rename_view(THD *thd, const char *new_db, const char *new_name,
#define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)
+#endif /* SQL_VIEW_INCLUDED */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 72b8aa32e30..e0b319b562b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,6 +43,7 @@
#include "sp_pcontext.h"
#include "sp_rcontext.h"
#include "sp.h"
+#include "sql_signal.h"
#include "event_parse_data.h"
#include <myisam.h>
#include <myisammrg.h>
@@ -55,8 +56,6 @@
int yylex(void *yylval, void *yythd);
-const LEX_STRING null_lex_str= {0,0};
-
#define yyoverflow(A,B,C,D,E,F) \
{ \
ulong val= *(F); \
@@ -131,10 +130,13 @@ void my_parse_error(const char *s)
Lex_input_stream *lip= & thd->m_parser_state->m_lip;
const char *yytext= lip->get_tok_start();
+ if (!yytext)
+ yytext= "";
+
/* Push an error into the error stack */
+ ErrConvString err(yytext, thd->variables.character_set_client);
my_printf_error(ER_PARSE_ERROR, ER(ER_PARSE_ERROR), MYF(0), s,
- (yytext ? yytext : ""),
- lip->yylineno);
+ err.ptr(), lip->yylineno);
}
/**
@@ -635,10 +637,12 @@ Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal,
struct sp_cond_type *spcondtype;
struct { int vars, conds, hndlrs, curs; } spblock;
sp_name *spname;
- struct st_lex *lex;
+ LEX *lex;
sp_head *sphead;
struct p_elem_val *p_elem_value;
enum index_hint_type index_hint;
+ enum enum_filetype filetype;
+ Diag_condition_item_name diag_condition_item_name;
}
%{
@@ -720,6 +724,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token CASCADED /* SQL-2003-R */
%token CASE_SYM /* SQL-2003-R */
%token CAST_SYM /* SQL-2003-R */
+%token CATALOG_NAME_SYM /* SQL-2003-N */
%token CHAIN_SYM /* SQL-2003-N */
%token CHANGE
%token CHANGED
@@ -728,6 +733,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token CHECKSUM_SYM
%token CHECK_SYM /* SQL-2003-R */
%token CIPHER_SYM
+%token CLASS_ORIGIN_SYM /* SQL-2003-N */
%token CLIENT_SYM
%token CLOSE_SYM /* SQL-2003-R */
%token COALESCE /* SQL-2003-N */
@@ -736,6 +742,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token COLLATION_SYM /* SQL-2003-N */
%token COLUMNS
%token COLUMN_SYM /* SQL-2003-R */
+%token COLUMN_NAME_SYM /* SQL-2003-N */
%token COMMENT_SYM
%token COMMITTED_SYM /* SQL-2003-N */
%token COMMIT_SYM /* SQL-2003-R */
@@ -743,10 +750,13 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token COMPLETION_SYM
%token COMPRESSED_SYM
%token CONCURRENT
-%token CONDITION_SYM /* SQL-2003-N */
+%token CONDITION_SYM /* SQL-2003-R, SQL-2008-R */
%token CONNECTION_SYM
%token CONSISTENT_SYM
%token CONSTRAINT /* SQL-2003-R */
+%token CONSTRAINT_CATALOG_SYM /* SQL-2003-N */
+%token CONSTRAINT_NAME_SYM /* SQL-2003-N */
+%token CONSTRAINT_SCHEMA_SYM /* SQL-2003-N */
%token CONTAINS_SYM /* SQL-2003-N */
%token CONTEXT_SYM
%token CONTINUE_SYM /* SQL-2003-R */
@@ -760,6 +770,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token CURDATE /* MYSQL-FUNC */
%token CURRENT_USER /* SQL-2003-R */
%token CURSOR_SYM /* SQL-2003-R */
+%token CURSOR_NAME_SYM /* SQL-2003-N */
%token CURTIME /* MYSQL-FUNC */
%token DATABASE
%token DATABASES
@@ -872,6 +883,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token IDENT_QUOTED
%token IF
%token IGNORE_SYM
+%token IGNORE_SERVER_IDS_SYM
%token IMPORT
%token INDEXES
%token INDEX_SYM
@@ -946,6 +958,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token MASTER_SSL_VERIFY_SERVER_CERT_SYM
%token MASTER_SYM
%token MASTER_USER_SYM
+%token MASTER_HEARTBEAT_PERIOD_SYM
%token MATCH /* SQL-2003-R */
%token MAX_CONNECTIONS_PER_HOUR
%token MAX_QUERIES_PER_HOUR
@@ -961,6 +974,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token MEDIUM_SYM
%token MEMORY_SYM
%token MERGE_SYM /* SQL-2003-R */
+%token MESSAGE_TEXT_SYM /* SQL-2003-N */
%token MICROSECOND_SYM /* MYSQL-FUNC */
%token MIGRATE_SYM
%token MINUTE_MICROSECOND_SYM
@@ -977,6 +991,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token MULTIPOINT
%token MULTIPOLYGON
%token MUTEX_SYM
+%token MYSQL_ERRNO_SYM
%token NAMES_SYM /* SQL-2003-N */
%token NAME_SYM /* SQL-2003-N */
%token NATIONAL_SYM /* SQL-2003-R */
@@ -1062,6 +1077,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token REDUNDANT_SYM
%token REFERENCES /* SQL-2003-R */
%token REGEXP
+%token RELAYLOG_SYM
%token RELAY_LOG_FILE_SYM
%token RELAY_LOG_POS_SYM
%token RELAY_THREAD
@@ -1077,6 +1093,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token REPLICATION
%token REQUIRE_SYM
%token RESET_SYM
+%token RESIGNAL_SYM /* SQL-2003-R */
%token RESOURCES
%token RESTORE_SYM
%token RESTRICT
@@ -1094,6 +1111,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token RTREE_SYM
%token SAVEPOINT_SYM /* SQL-2003-R */
%token SCHEDULE_SYM
+%token SCHEMA_NAME_SYM /* SQL-2003-N */
%token SECOND_MICROSECOND_SYM
%token SECOND_SYM /* SQL-2003-R */
%token SECURITY_SYM /* SQL-2003-N */
@@ -1112,6 +1130,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token SHIFT_RIGHT /* OPERATOR */
%token SHOW
%token SHUTDOWN
+%token SIGNAL_SYM /* SQL-2003-R */
%token SIGNED_SYM
%token SIMPLE_SYM /* SQL-2003-N */
%token SLAVE
@@ -1145,6 +1164,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token STORAGE_SYM
%token STRAIGHT_JOIN
%token STRING_SYM
+%token SUBCLASS_ORIGIN_SYM /* SQL-2003-N */
%token SUBDATE_SYM
%token SUBJECT_SYM
%token SUBPARTITIONS_SYM
@@ -1161,6 +1181,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token TABLE_REF_PRIORITY
%token TABLE_SYM /* SQL-2003-R */
%token TABLE_CHECKSUM_SYM
+%token TABLE_NAME_SYM /* SQL-2003-N */
%token TEMPORARY /* SQL-2003-N */
%token TEMPTABLE_SYM
%token TERMINATED
@@ -1232,6 +1253,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token WRITE_SYM /* SQL-2003-N */
%token X509_SYM
%token XA_SYM
+%token XML_SYM
%token XOR
%token YEAR_MONTH_SYM
%token YEAR_SYM /* SQL-2003-R */
@@ -1263,6 +1285,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
NCHAR_STRING opt_component key_cache_name
sp_opt_label BIN_NUM label_ident TEXT_STRING_filesystem ident_or_empty
+ opt_constraint constraint opt_ident
%type <lex_str_ptr>
opt_table_alias
@@ -1271,8 +1294,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
table_ident table_ident_nodb references xid
%type <simple_string>
- remember_name remember_end opt_ident opt_db text_or_password
- opt_constraint constraint
+ remember_name remember_end opt_db text_or_password
%type <string>
text_string opt_gconcat_separator
@@ -1295,9 +1317,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <ulonglong_number>
ulonglong_num real_ulonglong_num size_number
-%type <p_elem_value>
- part_bit_expr
-
%type <lock_type>
replace_lock_option opt_low_priority insert_lock_option load_data_lock
@@ -1318,6 +1337,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
function_call_nonkeyword
function_call_generic
function_call_conflict
+ signal_allowed_expr
%type <item_num>
NUM_literal
@@ -1393,7 +1413,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
slave master_def master_defs master_file_def slave_until_opts
repair restore backup analyze check start checksum
field_list field_list_item field_spec kill column_def key_def
- keycache_list assign_to_keycache preload_list preload_keys
+ keycache_list keycache_list_or_parts assign_to_keycache
+ assign_to_keycache_parts
+ preload_list preload_list_or_parts preload_keys preload_keys_parts
select_item_list select_item values_list no_braces
opt_limit_clause delete_limit_clause fields opt_values values
procedure_list procedure_list2 procedure_item
@@ -1422,7 +1444,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
prepare prepare_src execute deallocate
statement sp_suid
sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa
- load_data opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
+ opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
view_replace_or_algorithm view_replace
view_algorithm view_or_trigger_or_sp_or_event
definer_tail no_definer_tail
@@ -1430,6 +1452,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
view_check_option trigger_tail sp_tail sf_tail udf_tail event_tail
install uninstall partition_entry binlog_base64_event
init_key_options key_options key_opts key_opt key_using_alg
+ part_column_list
server_def server_options_list server_option
definer_opt no_definer definer
END_OF_INPUT
@@ -1445,12 +1468,16 @@ END_OF_INPUT
%type <NONE> case_stmt_specification simple_case_stmt searched_case_stmt
%type <num> sp_decl_idents sp_opt_inout sp_handler_type sp_hcond_list
-%type <spcondtype> sp_cond sp_hcond
+%type <spcondtype> sp_cond sp_hcond sqlstate signal_value opt_signal_value
%type <spblock> sp_decls sp_decl
%type <lex> sp_cursor_stmt
%type <spname> sp_name
%type <index_hint> index_hint_type
%type <num> index_hint_clause
+%type <filetype> data_or_xml
+
+%type <NONE> signal_stmt resignal_stmt
+%type <diag_condition_item_name> signal_condition_information_item_name
%type <NONE>
'-' '+' '*' '/' '%' '(' ')'
@@ -1497,7 +1524,7 @@ query:
Lex_input_stream *lip = YYLIP;
if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) &&
- ! lip->stmt_prepare_mode &&
+ lip->multi_statements &&
! lip->eof())
{
/*
@@ -1572,12 +1599,14 @@ statement:
| repair
| replace
| reset
+ | resignal_stmt
| restore
| revoke
| rollback
| savepoint
| select
| set
+ | signal_stmt
| show
| slave
| start
@@ -1690,6 +1719,12 @@ change:
LEX *lex = Lex;
lex->sql_command = SQLCOM_CHANGE_MASTER;
bzero((char*) &lex->mi, sizeof(lex->mi));
+ /*
+ resetting flags that can left from the previous CHANGE MASTER
+ */
+ lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_UNCHANGED;
+ my_init_dynamic_array(&Lex->mi.repl_ignore_server_ids,
+ sizeof(::server_id), 16, 16);
}
master_defs
{}
@@ -1724,7 +1759,7 @@ master_def:
| MASTER_SSL_SYM EQ ulong_num
{
Lex->mi.ssl= $3 ?
- LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE;
+ LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE;
}
| MASTER_SSL_CA_SYM EQ TEXT_STRING_sys
{
@@ -1749,11 +1784,69 @@ master_def:
| MASTER_SSL_VERIFY_SERVER_CERT_SYM EQ ulong_num
{
Lex->mi.ssl_verify_server_cert= $3 ?
- LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE;
+ LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE;
}
- | master_file_def
+
+ | MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
+ {
+ Lex->mi.heartbeat_period= (float) $3->val_real();
+ if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
+ Lex->mi.heartbeat_period < 0.0)
+ {
+ const char format[]= "%d seconds";
+ char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
+ my_sprintf(buf, (buf, format, SLAVE_MAX_HEARTBEAT_PERIOD));
+ my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
+ MYF(0),
+ " is negative or exceeds the maximum ",
+ buf);
+ MYSQL_YYABORT;
+ }
+ if (Lex->mi.heartbeat_period > slave_net_timeout)
+ {
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
+ " exceeds the value of `slave_net_timeout' sec.",
+ " A sensible value for the period should be"
+ " less than the timeout.");
+ }
+ if (Lex->mi.heartbeat_period < 0.001)
+ {
+ if (Lex->mi.heartbeat_period != 0.0)
+ {
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
+ " is less than 1 msec.",
+ " The period is reset to zero which means"
+ " no heartbeats will be sending");
+ Lex->mi.heartbeat_period= 0.0;
+ }
+ Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;
+ }
+ Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
+ }
+ | IGNORE_SERVER_IDS_SYM EQ '(' ignore_server_id_list ')'
+ {
+ Lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
+ }
+ |
+ master_file_def
;
+ignore_server_id_list:
+ /* Empty */
+ | ignore_server_id
+ | ignore_server_id_list ',' ignore_server_id
+ ;
+
+ignore_server_id:
+ ulong_num
+ {
+ insert_dynamic(&Lex->mi.repl_ignore_server_ids, (uchar*) &($1));
+ }
+
master_file_def:
MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys
{
@@ -1846,7 +1939,7 @@ create:
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
}
- key= new Key($2, $4.str, &lex->key_create_info, 0,
+ key= new Key($2, $4, &lex->key_create_info, 0,
lex->col_list);
if (key == NULL)
MYSQL_YYABORT;
@@ -2472,12 +2565,12 @@ sp_decl:
LEX *lex= Lex;
sp_pcontext *spc= lex->spcont;
- if (spc->find_cond(&$2, TRUE))
- {
- my_error(ER_SP_DUP_COND, MYF(0), $2.str);
- MYSQL_YYABORT;
- }
- if(YYTHD->lex->spcont->push_cond(&$2, $5))
+ if (spc->find_cond(&$2, TRUE))
+ {
+ my_error(ER_SP_DUP_COND, MYF(0), $2.str);
+ MYSQL_YYABORT;
+ }
+ if(YYTHD->lex->spcont->push_cond(&$2, $5))
MYSQL_YYABORT;
$$.vars= $$.hndlrs= $$.curs= 0;
$$.conds= 1;
@@ -2492,9 +2585,9 @@ sp_decl:
sp_pcontext *ctx= lex->spcont;
sp_instr_hpush_jump *i=
new sp_instr_hpush_jump(sp->instructions(), ctx, $2,
- ctx->current_var_count());
+ ctx->current_var_count());
if (i == NULL ||
- sp->add_instr(i) ||
+ sp->add_instr(i) ||
sp->push_backpatch(i, ctx->push_label((char *)"", 0)))
MYSQL_YYABORT;
}
@@ -2511,15 +2604,15 @@ sp_decl:
i= new sp_instr_hreturn(sp->instructions(), ctx,
ctx->current_var_count());
if (i == NULL ||
- sp->add_instr(i))
+ sp->add_instr(i))
MYSQL_YYABORT;
}
else
{ /* EXIT or UNDO handler, just jump to the end of the block */
i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
if (i == NULL ||
- sp->add_instr(i) ||
- sp->push_backpatch(i, lex->spcont->last_label())) /* Block end */
+ sp->add_instr(i) ||
+ sp->push_backpatch(i, lex->spcont->last_label())) /* Block end */
MYSQL_YYABORT;
}
lex->sphead->backpatch(hlab);
@@ -2546,9 +2639,9 @@ sp_decl:
}
i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count());
- if (i == NULL ||
+ if (i == NULL ||
sp->add_instr(i) ||
- ctx->push_cursor(&$2))
+ ctx->push_cursor(&$2))
MYSQL_YYABORT;
$$.vars= $$.conds= $$.hndlrs= 0;
$$.curs= 1;
@@ -2617,13 +2710,22 @@ sp_hcond_element:
sp_cond:
ulong_num
{ /* mysql errno */
+ if ($1 == 0)
+ {
+ my_error(ER_WRONG_VALUE, MYF(0), "CONDITION", "0");
+ MYSQL_YYABORT;
+ }
$$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
if ($$ == NULL)
MYSQL_YYABORT;
$$->type= sp_cond_type_t::number;
$$->mysqlerr= $1;
}
- | SQLSTATE_SYM opt_value TEXT_STRING_literal
+ | sqlstate
+ ;
+
+sqlstate:
+ SQLSTATE_SYM opt_value TEXT_STRING_literal
{ /* SQLSTATE */
if (!sp_cond_check(&$3))
{
@@ -2634,8 +2736,8 @@ sp_cond:
if ($$ == NULL)
MYSQL_YYABORT;
$$->type= sp_cond_type_t::state;
- memcpy($$->sqlstate, $3.str, 5);
- $$->sqlstate[5]= '\0';
+ memcpy($$->sqlstate, $3.str, SQLSTATE_LENGTH);
+ $$->sqlstate[SQLSTATE_LENGTH]= '\0';
}
;
@@ -2681,6 +2783,160 @@ sp_hcond:
}
;
+signal_stmt:
+ SIGNAL_SYM signal_value opt_set_signal_information
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Yacc_state *state= & thd->m_parser_state->m_yacc;
+
+ lex->sql_command= SQLCOM_SIGNAL;
+ lex->m_stmt= new (thd->mem_root) Signal_statement(lex, $2,
+ state->m_set_signal_info);
+ if (lex->m_stmt == NULL)
+ MYSQL_YYABORT;
+ }
+ ;
+
+signal_value:
+ ident
+ {
+ LEX *lex= Lex;
+ sp_cond_type_t *cond;
+ if (lex->spcont == NULL)
+ {
+ /* SIGNAL foo cannot be used outside of stored programs */
+ my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ cond= lex->spcont->find_cond(&$1);
+ if (cond == NULL)
+ {
+ my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ if (cond->type != sp_cond_type_t::state)
+ {
+ my_error(ER_SIGNAL_BAD_CONDITION_TYPE, MYF(0));
+ MYSQL_YYABORT;
+ }
+ $$= cond;
+ }
+ | sqlstate
+ { $$= $1; }
+ ;
+
+opt_signal_value:
+ /* empty */
+ { $$= NULL; }
+ | signal_value
+ { $$= $1; }
+ ;
+
+opt_set_signal_information:
+ /* empty */
+ {
+ YYTHD->m_parser_state->m_yacc.m_set_signal_info.clear();
+ }
+ | SET signal_information_item_list
+ ;
+
+signal_information_item_list:
+ signal_condition_information_item_name EQ signal_allowed_expr
+ {
+ Set_signal_information *info;
+ info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info;
+ int index= (int) $1;
+ info->clear();
+ info->m_item[index]= $3;
+ }
+ | signal_information_item_list ','
+ signal_condition_information_item_name EQ signal_allowed_expr
+ {
+ Set_signal_information *info;
+ info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info;
+ int index= (int) $3;
+ if (info->m_item[index] != NULL)
+ {
+ my_error(ER_DUP_SIGNAL_SET, MYF(0),
+ Diag_condition_item_names[index].str);
+ MYSQL_YYABORT;
+ }
+ info->m_item[index]= $5;
+ }
+ ;
+
+/*
+ Only a limited subset of <expr> are allowed in SIGNAL/RESIGNAL.
+*/
+signal_allowed_expr:
+ literal
+ { $$= $1; }
+ | variable
+ {
+ if ($1->type() == Item::FUNC_ITEM)
+ {
+ Item_func *item= (Item_func*) $1;
+ if (item->functype() == Item_func::SUSERVAR_FUNC)
+ {
+ /*
+ Don't allow the following syntax:
+ SIGNAL/RESIGNAL ...
+ SET <signal condition item name> = @foo := expr
+ */
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ }
+ $$= $1;
+ }
+ | simple_ident
+ { $$= $1; }
+ ;
+
+/* conditions that can be set in signal / resignal */
+signal_condition_information_item_name:
+ CLASS_ORIGIN_SYM
+ { $$= DIAG_CLASS_ORIGIN; }
+ | SUBCLASS_ORIGIN_SYM
+ { $$= DIAG_SUBCLASS_ORIGIN; }
+ | CONSTRAINT_CATALOG_SYM
+ { $$= DIAG_CONSTRAINT_CATALOG; }
+ | CONSTRAINT_SCHEMA_SYM
+ { $$= DIAG_CONSTRAINT_SCHEMA; }
+ | CONSTRAINT_NAME_SYM
+ { $$= DIAG_CONSTRAINT_NAME; }
+ | CATALOG_NAME_SYM
+ { $$= DIAG_CATALOG_NAME; }
+ | SCHEMA_NAME_SYM
+ { $$= DIAG_SCHEMA_NAME; }
+ | TABLE_NAME_SYM
+ { $$= DIAG_TABLE_NAME; }
+ | COLUMN_NAME_SYM
+ { $$= DIAG_COLUMN_NAME; }
+ | CURSOR_NAME_SYM
+ { $$= DIAG_CURSOR_NAME; }
+ | MESSAGE_TEXT_SYM
+ { $$= DIAG_MESSAGE_TEXT; }
+ | MYSQL_ERRNO_SYM
+ { $$= DIAG_MYSQL_ERRNO; }
+ ;
+
+resignal_stmt:
+ RESIGNAL_SYM opt_signal_value opt_set_signal_information
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Yacc_state *state= & thd->m_parser_state->m_yacc;
+
+ lex->sql_command= SQLCOM_RESIGNAL;
+ lex->m_stmt= new (thd->mem_root) Resignal_statement(lex, $2,
+ state->m_set_signal_info);
+ if (lex->m_stmt == NULL)
+ MYSQL_YYABORT;
+ }
+ ;
+
sp_decl_idents:
ident
{
@@ -2818,7 +3074,7 @@ sp_proc_stmt_return:
i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
sp->m_return_field_def.sql_type, lex);
if (i == NULL ||
- sp->add_instr(i))
+ sp->add_instr(i))
MYSQL_YYABORT;
sp->m_flags|= sp_head::HAS_RETURN;
}
@@ -3059,7 +3315,7 @@ sp_if:
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
$2, lex);
if (i == NULL ||
- sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
sp->add_cont_backpatch(i) ||
sp->add_instr(i))
MYSQL_YYABORT;
@@ -3348,7 +3604,7 @@ sp_unlabeled_control:
if (i == NULL ||
lex->sphead->add_instr(i))
MYSQL_YYABORT;
- }
+ }
| WHILE_SYM
{ Lex->sphead->reset_lex(YYTHD); }
expr DO_SYM
@@ -3359,7 +3615,7 @@ sp_unlabeled_control:
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$3, lex);
if (i == NULL ||
- /* Jumping forward */
+ /* Jumping forward */
sp->push_backpatch(i, lex->spcont->last_label()) ||
sp->new_cont_backpatch(i) ||
sp->add_instr(i))
@@ -3892,17 +4148,9 @@ opt_partitioning:
;
partitioning:
- PARTITION_SYM
+ PARTITION_SYM have_partitioning
{
-#ifdef WITH_PARTITION_STORAGE_ENGINE
LEX *lex= Lex;
- LEX_STRING partition_name={C_STRING_WITH_LEN("partition")};
- if (!plugin_is_ready(&partition_name, MYSQL_STORAGE_ENGINE_PLUGIN))
- {
- my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
- "--skip-partition");
- MYSQL_YYABORT;
- }
lex->part_info= new partition_info();
if (!lex->part_info)
{
@@ -3913,14 +4161,27 @@ partitioning:
{
lex->alter_info.flags|= ALTER_PARTITION;
}
+ }
+ partition
+ ;
+
+have_partitioning:
+ /* empty */
+ {
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ LEX_STRING partition_name={C_STRING_WITH_LEN("partition")};
+ if (!plugin_is_ready(&partition_name, MYSQL_STORAGE_ENGINE_PLUGIN))
+ {
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-partition");
+ MYSQL_YYABORT;
+ }
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
- "partitioning", "--with-partition");
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-partition");
MYSQL_YYABORT;
#endif
-
}
- partition
;
partition_entry:
@@ -3941,25 +4202,28 @@ partition_entry:
;
partition:
- BY part_type_def opt_no_parts opt_sub_part part_defs
+ BY part_type_def opt_num_parts opt_sub_part part_defs
;
part_type_def:
opt_linear KEY_SYM '(' part_field_list ')'
{
- LEX *lex= Lex;
- lex->part_info->list_of_part_fields= TRUE;
- lex->part_info->part_type= HASH_PARTITION;
+ partition_info *part_info= Lex->part_info;
+ part_info->list_of_part_fields= TRUE;
+ part_info->column_list= FALSE;
+ part_info->part_type= HASH_PARTITION;
}
| opt_linear HASH_SYM
{ Lex->part_info->part_type= HASH_PARTITION; }
part_func {}
- | RANGE_SYM
+ | RANGE_SYM part_func
{ Lex->part_info->part_type= RANGE_PARTITION; }
- part_func {}
- | LIST_SYM
+ | RANGE_SYM part_column_list
+ { Lex->part_info->part_type= RANGE_PARTITION; }
+ | LIST_SYM part_func
+ { Lex->part_info->part_type= LIST_PARTITION; }
+ | LIST_SYM part_column_list
{ Lex->part_info->part_type= LIST_PARTITION; }
- part_func {}
;
opt_linear:
@@ -3981,59 +4245,66 @@ part_field_item_list:
part_field_item:
ident
{
- if (Lex->part_info->part_field_list.push_back($1.str))
+ partition_info *part_info= Lex->part_info;
+ part_info->num_columns++;
+ if (part_info->part_field_list.push_back($1.str))
{
mem_alloc_error(1);
MYSQL_YYABORT;
}
+ if (part_info->num_columns > MAX_REF_PARTS)
+ {
+ my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0),
+ "list of partition fields");
+ MYSQL_YYABORT;
+ }
+ }
+ ;
+
+part_column_list:
+ COLUMNS '(' part_field_list ')'
+ {
+ partition_info *part_info= Lex->part_info;
+ part_info->column_list= TRUE;
+ part_info->list_of_part_fields= TRUE;
}
;
+
part_func:
'(' remember_name part_func_expr remember_end ')'
{
- LEX *lex= Lex;
- uint expr_len= (uint)($4 - $2) - 1;
- lex->part_info->list_of_part_fields= FALSE;
- lex->part_info->part_expr= $3;
- char *func_string= (char*) sql_memdup($2+1, expr_len);
- if (func_string == NULL)
- MYSQL_YYABORT;
- lex->part_info->part_func_string= func_string;
- lex->part_info->part_func_len= expr_len;
+ partition_info *part_info= Lex->part_info;
+ if (part_info->set_part_expr($2+1, $3, $4, FALSE))
+ { MYSQL_YYABORT; }
+ part_info->num_columns= 1;
+ part_info->column_list= FALSE;
}
;
sub_part_func:
'(' remember_name part_func_expr remember_end ')'
{
- LEX *lex= Lex;
- uint expr_len= (uint)($4 - $2) - 1;
- lex->part_info->list_of_subpart_fields= FALSE;
- lex->part_info->subpart_expr= $3;
- char *func_string= (char*) sql_memdup($2+1, expr_len);
- if (func_string == NULL)
- MYSQL_YYABORT;
- lex->part_info->subpart_func_string= func_string;
- lex->part_info->subpart_func_len= expr_len;
+ if (Lex->part_info->set_part_expr($2+1, $3, $4, TRUE))
+ { MYSQL_YYABORT; }
}
;
-opt_no_parts:
+opt_num_parts:
/* empty */ {}
| PARTITIONS_SYM real_ulong_num
{
- uint no_parts= $2;
- LEX *lex= Lex;
- if (no_parts == 0)
+ uint num_parts= $2;
+ partition_info *part_info= Lex->part_info;
+ if (num_parts == 0)
{
my_error(ER_NO_PARTS_ERROR, MYF(0), "partitions");
MYSQL_YYABORT;
}
- lex->part_info->no_parts= no_parts;
- lex->part_info->use_default_no_partitions= FALSE;
+ part_info->num_parts= num_parts;
+ part_info->use_default_num_partitions= FALSE;
}
;
@@ -4041,15 +4312,15 @@ opt_sub_part:
/* empty */ {}
| SUBPARTITION_SYM BY opt_linear HASH_SYM sub_part_func
{ Lex->part_info->subpart_type= HASH_PARTITION; }
- opt_no_subparts {}
+ opt_num_subparts {}
| SUBPARTITION_SYM BY opt_linear KEY_SYM
'(' sub_part_field_list ')'
{
- LEX *lex= Lex;
- lex->part_info->subpart_type= HASH_PARTITION;
- lex->part_info->list_of_subpart_fields= TRUE;
+ partition_info *part_info= Lex->part_info;
+ part_info->subpart_type= HASH_PARTITION;
+ part_info->list_of_subpart_fields= TRUE;
}
- opt_no_subparts {}
+ opt_num_subparts {}
;
sub_part_field_list:
@@ -4060,11 +4331,18 @@ sub_part_field_list:
sub_part_field_item:
ident
{
- if (Lex->part_info->subpart_field_list.push_back($1.str))
+ partition_info *part_info= Lex->part_info;
+ if (part_info->subpart_field_list.push_back($1.str))
{
mem_alloc_error(1);
MYSQL_YYABORT;
}
+ if (part_info->subpart_field_list.elements > MAX_REF_PARTS)
+ {
+ my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0),
+ "list of subpartition fields");
+ MYSQL_YYABORT;
+ }
}
;
@@ -4084,33 +4362,46 @@ part_func_expr:
}
;
-opt_no_subparts:
+opt_num_subparts:
/* empty */ {}
| SUBPARTITIONS_SYM real_ulong_num
{
- uint no_parts= $2;
+ uint num_parts= $2;
LEX *lex= Lex;
- if (no_parts == 0)
+ if (num_parts == 0)
{
my_error(ER_NO_PARTS_ERROR, MYF(0), "subpartitions");
MYSQL_YYABORT;
}
- lex->part_info->no_subparts= no_parts;
- lex->part_info->use_default_no_subpartitions= FALSE;
+ lex->part_info->num_subparts= num_parts;
+ lex->part_info->use_default_num_subpartitions= FALSE;
}
;
part_defs:
/* empty */
- {}
+ {
+ partition_info *part_info= Lex->part_info;
+ if (part_info->part_type == RANGE_PARTITION)
+ {
+ my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0),
+ "RANGE");
+ MYSQL_YYABORT;
+ }
+ else if (part_info->part_type == LIST_PARTITION)
+ {
+ my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0),
+ "LIST");
+ MYSQL_YYABORT;
+ }
+ }
| '(' part_def_list ')'
{
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
+ partition_info *part_info= Lex->part_info;
uint count_curr_parts= part_info->partitions.elements;
- if (part_info->no_parts != 0)
+ if (part_info->num_parts != 0)
{
- if (part_info->no_parts !=
+ if (part_info->num_parts !=
count_curr_parts)
{
my_parse_error(ER(ER_PARTITION_WRONG_NO_PART_ERROR));
@@ -4119,7 +4410,7 @@ part_defs:
}
else if (count_curr_parts > 0)
{
- part_info->no_parts= count_curr_parts;
+ part_info->num_parts= count_curr_parts;
}
part_info->count_curr_subparts= 0;
}
@@ -4133,8 +4424,7 @@ part_def_list:
part_definition:
PARTITION_SYM
{
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
+ partition_info *part_info= Lex->part_info;
partition_element *p_elem= new partition_element();
if (!p_elem || part_info->partitions.push_back(p_elem))
@@ -4146,7 +4436,7 @@ part_definition:
part_info->curr_part_elem= p_elem;
part_info->current_partition= p_elem;
part_info->use_default_partitions= FALSE;
- part_info->use_default_no_partitions= FALSE;
+ part_info->use_default_num_partitions= FALSE;
}
part_name
opt_part_values
@@ -4158,8 +4448,7 @@ part_definition:
part_name:
ident
{
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
+ partition_info *part_info= Lex->part_info;
partition_element *p_elem= part_info->curr_part_elem;
p_elem->partition_name= $1.str;
}
@@ -4169,15 +4458,16 @@ opt_part_values:
/* empty */
{
LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
if (! lex->is_partition_management())
{
- if (lex->part_info->part_type == RANGE_PARTITION)
+ if (part_info->part_type == RANGE_PARTITION)
{
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
"RANGE", "LESS THAN");
MYSQL_YYABORT;
}
- if (lex->part_info->part_type == LIST_PARTITION)
+ if (part_info->part_type == LIST_PARTITION)
{
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
"LIST", "IN");
@@ -4185,14 +4475,15 @@ opt_part_values:
}
}
else
- lex->part_info->part_type= HASH_PARTITION;
+ part_info->part_type= HASH_PARTITION;
}
- | VALUES LESS_SYM THAN_SYM part_func_max
+ | VALUES LESS_SYM THAN_SYM
{
LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
if (! lex->is_partition_management())
{
- if (Lex->part_info->part_type != RANGE_PARTITION)
+ if (part_info->part_type != RANGE_PARTITION)
{
my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
"RANGE", "LESS THAN");
@@ -4200,153 +4491,183 @@ opt_part_values:
}
}
else
- lex->part_info->part_type= RANGE_PARTITION;
+ part_info->part_type= RANGE_PARTITION;
}
- | VALUES IN_SYM '(' part_list_func ')'
+ part_func_max {}
+ | VALUES IN_SYM
{
LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
if (! lex->is_partition_management())
{
- if (Lex->part_info->part_type != LIST_PARTITION)
+ if (part_info->part_type != LIST_PARTITION)
{
my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
- "LIST", "IN");
+ "LIST", "IN");
MYSQL_YYABORT;
}
}
else
- lex->part_info->part_type= LIST_PARTITION;
+ part_info->part_type= LIST_PARTITION;
}
+ part_values_in {}
;
part_func_max:
- max_value_sym
+ MAX_VALUE_SYM
{
- LEX *lex= Lex;
- if (lex->part_info->defined_max_value)
+ partition_info *part_info= Lex->part_info;
+
+ if (part_info->num_columns &&
+ part_info->num_columns != 1U)
{
- my_parse_error(ER(ER_PARTITION_MAXVALUE_ERROR));
+ part_info->print_debug("Kilroy II", NULL);
+ my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
MYSQL_YYABORT;
}
- lex->part_info->defined_max_value= TRUE;
- lex->part_info->curr_part_elem->max_value= TRUE;
- lex->part_info->curr_part_elem->range_value= LONGLONG_MAX;
- }
- | part_range_func
- {
- if (Lex->part_info->defined_max_value)
+ else
+ part_info->num_columns= 1U;
+ if (part_info->init_column_part())
{
- my_parse_error(ER(ER_PARTITION_MAXVALUE_ERROR));
MYSQL_YYABORT;
}
- if (Lex->part_info->curr_part_elem->has_null_value)
+ if (part_info->add_max_value())
{
- my_parse_error(ER(ER_NULL_IN_VALUES_LESS_THAN));
MYSQL_YYABORT;
}
}
+ | part_value_item {}
;
-max_value_sym:
- MAX_VALUE_SYM
- | '(' MAX_VALUE_SYM ')'
- ;
-
-part_range_func:
- '(' part_bit_expr ')'
+part_values_in:
+ part_value_item
+ {
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ part_info->print_debug("part_values_in: part_value_item", NULL);
+
+ if (part_info->num_columns != 1U)
+ {
+ if (!lex->is_partition_management() ||
+ part_info->num_columns == 0 ||
+ part_info->num_columns > MAX_REF_PARTS)
+ {
+ part_info->print_debug("Kilroy III", NULL);
+ my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
+ MYSQL_YYABORT;
+ }
+ /*
+ Reorganize the current large array into a list of small
+ arrays with one entry in each array. This can happen
+ in the first partition of an ALTER TABLE statement where
+ we ADD or REORGANIZE partitions. Also can only happen
+ for LIST partitions.
+ */
+ if (part_info->reorganize_into_single_field_col_val())
+ {
+ MYSQL_YYABORT;
+ }
+ }
+ }
+ | '(' part_value_list ')'
{
partition_info *part_info= Lex->part_info;
- if (!($2->unsigned_flag))
- part_info->curr_part_elem->signed_flag= TRUE;
- part_info->curr_part_elem->range_value= $2->value;
+ if (part_info->num_columns < 2U)
+ {
+ my_parse_error(ER(ER_ROW_SINGLE_PARTITION_FIELD_ERROR));
+ MYSQL_YYABORT;
+ }
}
;
-part_list_func:
- part_list_item {}
- | part_list_func ',' part_list_item {}
+part_value_list:
+ part_value_item {}
+ | part_value_list ',' part_value_item {}
;
-part_list_item:
- part_bit_expr
+part_value_item:
+ '('
{
- part_elem_value *value_ptr= $1;
partition_info *part_info= Lex->part_info;
- if (!value_ptr->unsigned_flag)
- part_info->curr_part_elem->signed_flag= TRUE;
- if (!value_ptr->null_value &&
- part_info->curr_part_elem->
- list_val_list.push_back(value_ptr))
+ part_info->print_debug("( part_value_item", NULL);
+ /* Initialisation code needed for each list of value expressions */
+ if (!(part_info->part_type == LIST_PARTITION &&
+ part_info->num_columns == 1U) &&
+ part_info->init_column_part())
{
- mem_alloc_error(sizeof(part_elem_value));
MYSQL_YYABORT;
}
}
- ;
-
-part_bit_expr:
- bit_expr
+ part_value_item_list {}
+ ')'
{
- Item *part_expr= $1;
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Name_resolution_context *context= &lex->current_select->context;
- TABLE_LIST *save_list= context->table_list;
- const char *save_where= thd->where;
-
- context->table_list= 0;
- thd->where= "partition function";
-
- part_elem_value *value_ptr=
- (part_elem_value*)sql_alloc(sizeof(part_elem_value));
- if (!value_ptr)
+ LEX *lex= Lex;
+ partition_info *part_info= Lex->part_info;
+ part_info->print_debug(") part_value_item", NULL);
+ if (part_info->num_columns == 0)
+ part_info->num_columns= part_info->curr_list_object;
+ if (part_info->num_columns != part_info->curr_list_object)
{
- mem_alloc_error(sizeof(part_elem_value));
+ /*
+ All value items lists must be of equal length, in some cases
+ which is covered by the above if-statement we don't know yet
+ how many columns is in the partition so the assignment above
+ ensures that we only report errors when we know we have an
+ error.
+ */
+ part_info->print_debug("Kilroy I", NULL);
+ my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
MYSQL_YYABORT;
}
- if (part_expr->walk(&Item::check_partition_func_processor, 0,
- NULL))
+ part_info->curr_list_object= 0;
+ }
+ ;
+
+part_value_item_list:
+ part_value_expr_item {}
+ | part_value_item_list ',' part_value_expr_item {}
+ ;
+
+part_value_expr_item:
+ MAX_VALUE_SYM
+ {
+ partition_info *part_info= Lex->part_info;
+ part_column_list_val *col_val;
+ if (part_info->part_type == LIST_PARTITION)
{
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ my_parse_error(ER(ER_MAXVALUE_IN_VALUES_IN));
MYSQL_YYABORT;
}
- if (part_expr->fix_fields(YYTHD, (Item**)0) ||
- ((context->table_list= save_list), FALSE) ||
- (!part_expr->const_item()) ||
- (!lex->safe_to_cache_query))
+ if (part_info->add_max_value())
{
- my_error(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR, MYF(0));
MYSQL_YYABORT;
}
- thd->where= save_where;
- value_ptr->value= part_expr->val_int();
- value_ptr->unsigned_flag= TRUE;
- if (!part_expr->unsigned_flag &&
- value_ptr->value < 0)
- value_ptr->unsigned_flag= FALSE;
- if ((value_ptr->null_value= part_expr->null_value))
+ }
+ | bit_expr
+ {
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ Item *part_expr= $1;
+
+ if (!lex->safe_to_cache_query)
{
- if (Lex->part_info->curr_part_elem->has_null_value)
- {
- my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
- MYSQL_YYABORT;
- }
- Lex->part_info->curr_part_elem->has_null_value= TRUE;
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ MYSQL_YYABORT;
}
- else if (part_expr->result_type() != INT_RESULT)
+ if (part_info->add_column_list_value(YYTHD, part_expr))
{
- my_parse_error(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR));
MYSQL_YYABORT;
}
- $$= value_ptr;
}
;
+
opt_sub_partition:
/* empty */
{
- if (Lex->part_info->no_subparts != 0 &&
- !Lex->part_info->use_default_subpartitions)
+ partition_info *part_info= Lex->part_info;
+ if (part_info->num_subparts != 0 &&
+ !part_info->use_default_subpartitions)
{
/*
We come here when we have defined subpartitions on the first
@@ -4358,11 +4679,10 @@ opt_sub_partition:
}
| '(' sub_part_list ')'
{
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
- if (part_info->no_subparts != 0)
+ partition_info *part_info= Lex->part_info;
+ if (part_info->num_subparts != 0)
{
- if (part_info->no_subparts !=
+ if (part_info->num_subparts !=
part_info->count_curr_subparts)
{
my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
@@ -4376,7 +4696,7 @@ opt_sub_partition:
my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
MYSQL_YYABORT;
}
- part_info->no_subparts= part_info->count_curr_subparts;
+ part_info->num_subparts= part_info->count_curr_subparts;
}
part_info->count_curr_subparts= 0;
}
@@ -4390,8 +4710,7 @@ sub_part_list:
sub_part_definition:
SUBPARTITION_SYM
{
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
+ partition_info *part_info= Lex->part_info;
partition_element *curr_part= part_info->current_partition;
partition_element *sub_p_elem= new partition_element(curr_part);
if (part_info->use_default_subpartitions &&
@@ -4419,7 +4738,7 @@ sub_part_definition:
}
part_info->curr_part_elem= sub_p_elem;
part_info->use_default_subpartitions= FALSE;
- part_info->use_default_no_subpartitions= FALSE;
+ part_info->use_default_num_subpartitions= FALSE;
part_info->count_curr_subparts++;
}
sub_name opt_part_options {}
@@ -4445,9 +4764,9 @@ opt_part_option:
{ Lex->part_info->curr_part_elem->tablespace_name= $3.str; }
| opt_storage ENGINE_SYM opt_equal storage_engines
{
- LEX *lex= Lex;
- lex->part_info->curr_part_elem->engine_type= $4;
- lex->part_info->default_engine_type= $4;
+ partition_info *part_info= Lex->part_info;
+ part_info->curr_part_elem->engine_type= $4;
+ part_info->default_engine_type= $4;
}
| NODEGROUP_SYM opt_equal real_ulong_num
{ Lex->part_info->curr_part_elem->nodegroup_id= (uint16) $3; }
@@ -4825,8 +5144,7 @@ key_def:
'(' key_list ')' key_options
{
LEX *lex=Lex;
- const char *key_name= $3 ? $3 : $1;
- Key *key= new Key($2, key_name, &lex->key_create_info, 0,
+ Key *key= new Key($2, $3.str ? $3 : $1, &lex->key_create_info, 0,
lex->col_list);
if (key == NULL)
MYSQL_YYABORT;
@@ -4836,9 +5154,7 @@ key_def:
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
{
LEX *lex=Lex;
- const char *key_name= $1 ? $1 : $4;
- const char *fkey_name = $4 ? $4 : key_name;
- Key *key= new Foreign_key(fkey_name, lex->col_list,
+ Key *key= new Foreign_key($4.str ? $4 : $1, lex->col_list,
$8,
lex->ref_list,
lex->fk_delete_opt,
@@ -4847,7 +5163,7 @@ key_def:
if (key == NULL)
MYSQL_YYABORT;
lex->alter_info.key_list.push_back(key);
- key= new Key(Key::MULTIPLE, key_name,
+ key= new Key(Key::MULTIPLE, $1.str ? $1 : $4,
&default_key_create_info, 1,
lex->col_list);
if (key == NULL)
@@ -4877,7 +5193,7 @@ check_constraint:
;
opt_constraint:
- /* empty */ { $$=(char*) 0; }
+ /* empty */ { $$= null_lex_str; }
| constraint { $$= $1; }
;
@@ -5168,6 +5484,7 @@ field_length:
opt_field_length:
/* empty */ { Lex->length=(char*) 0; /* use default length */ }
| field_length { }
+ ;
opt_precision:
/* empty */ {}
@@ -5381,14 +5698,14 @@ opt_ref_list:
ref_list:
ref_list ',' ident
{
- Key_part_spec *key= new Key_part_spec($3.str);
+ Key_part_spec *key= new Key_part_spec($3, 0);
if (key == NULL)
MYSQL_YYABORT;
Lex->ref_list.push_back(key);
}
| ident
{
- Key_part_spec *key= new Key_part_spec($1.str);
+ Key_part_spec *key= new Key_part_spec($1, 0);
if (key == NULL)
MYSQL_YYABORT;
Lex->ref_list.push_back(key);
@@ -5535,7 +5852,7 @@ key_list:
key_part:
ident
{
- $$= new Key_part_spec($1.str);
+ $$= new Key_part_spec($1, 0);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -5546,15 +5863,15 @@ key_part:
{
my_error(ER_KEY_PART_0, MYF(0), $1.str);
}
- $$= new Key_part_spec($1.str,(uint) key_part_len);
+ $$= new Key_part_spec($1, (uint) key_part_len);
if ($$ == NULL)
MYSQL_YYABORT;
}
;
opt_ident:
- /* empty */ { $$=(char*) 0; /* Default length */ }
- | field_ident { $$=$1.str; }
+ /* empty */ { $$= null_lex_str; }
+ | field_ident { $$= $1; }
;
opt_component:
@@ -5582,7 +5899,6 @@ alter:
if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
TL_OPTION_UPDATING))
MYSQL_YYABORT;
- lex->alter_info.reset();
lex->col_list.empty();
lex->select_lex.init_order();
lex->select_lex.db=
@@ -5816,7 +6132,7 @@ alter_commands:
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_OPTIMIZE;
+ lex->sql_command= SQLCOM_OPTIMIZE;
lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
@@ -5826,7 +6142,7 @@ alter_commands:
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_ANALYZE;
+ lex->sql_command= SQLCOM_ANALYZE;
lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
@@ -5834,7 +6150,7 @@ alter_commands:
| CHECK_SYM PARTITION_SYM all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_CHECK;
+ lex->sql_command= SQLCOM_CHECK;
lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->check_opt.init();
}
@@ -5843,7 +6159,7 @@ alter_commands:
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_REPAIR;
+ lex->sql_command= SQLCOM_REPAIR;
lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
@@ -5854,7 +6170,14 @@ alter_commands:
LEX *lex= Lex;
lex->alter_info.flags|= ALTER_COALESCE_PARTITION;
lex->no_write_to_binlog= $3;
- lex->alter_info.no_parts= $4;
+ lex->alter_info.num_parts= $4;
+ }
+ | TRUNCATE_SYM PARTITION_SYM all_or_alt_part_name_list
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_TRUNCATE;
+ lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
+ lex->check_opt.init();
}
| reorg_partition_rule
;
@@ -5896,12 +6219,11 @@ add_part_extra:
| '(' part_def_list ')'
{
LEX *lex= Lex;
- lex->part_info->no_parts= lex->part_info->partitions.elements;
+ lex->part_info->num_parts= lex->part_info->partitions.elements;
}
| PARTITIONS_SYM real_ulong_num
{
- LEX *lex= Lex;
- lex->part_info->no_parts= $2;
+ Lex->part_info->num_parts= $2;
}
;
@@ -5931,8 +6253,8 @@ reorg_parts_rule:
}
INTO '(' part_def_list ')'
{
- LEX *lex= Lex;
- lex->part_info->no_parts= lex->part_info->partitions.elements;
+ partition_info *part_info= Lex->part_info;
+ part_info->num_parts= part_info->partitions.elements;
}
;
@@ -6441,14 +6763,23 @@ table_to_table:
;
keycache:
- CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name
+ CACHE_SYM INDEX_SYM
+ {
+ Lex->alter_info.reset();
+ }
+ keycache_list_or_parts IN_SYM key_cache_name
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE;
- lex->ident= $5;
+ lex->ident= $6;
}
;
+keycache_list_or_parts:
+ keycache_list
+ | assign_to_keycache_parts
+ ;
+
keycache_list:
assign_to_keycache
| keycache_list ',' assign_to_keycache
@@ -6463,6 +6794,15 @@ assign_to_keycache:
}
;
+assign_to_keycache_parts:
+ table_ident adm_partition cache_keys_spec
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, NULL, 0, TL_READ,
+ Select->pop_index_hints()))
+ MYSQL_YYABORT;
+ }
+ ;
+
key_cache_name:
ident { $$= $1; }
| DEFAULT { $$ = default_key_cache_base; }
@@ -6473,11 +6813,17 @@ preload:
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_PRELOAD_KEYS;
+ lex->alter_info.reset();
}
- preload_list
+ preload_list_or_parts
{}
;
+preload_list_or_parts:
+ preload_keys_parts
+ | preload_list
+ ;
+
preload_list:
preload_keys
| preload_list ',' preload_keys
@@ -6492,6 +6838,23 @@ preload_keys:
}
;
+preload_keys_parts:
+ table_ident adm_partition cache_keys_spec opt_ignore_leaves
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, NULL, $4, TL_READ,
+ Select->pop_index_hints()))
+ MYSQL_YYABORT;
+ }
+ ;
+
+adm_partition:
+ PARTITION_SYM have_partitioning
+ {
+ Lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
+ }
+ '(' all_or_alt_part_name_list ')'
+ ;
+
cache_keys_spec:
{
Lex->select_lex.alloc_index_hints(YYTHD);
@@ -6555,7 +6918,7 @@ select_paren:
sel->olap != UNSPECIFIED_OLAP_TYPE &&
sel->master_unit()->fake_select_lex)
{
- my_error(ER_WRONG_USAGE, MYF(0),
+ my_error(ER_WRONG_USAGE, MYF(0),
"CUBE/ROLLUP", "ORDER BY");
MYSQL_YYABORT;
}
@@ -8088,13 +8451,13 @@ udf_expr:
sum_expr:
AVG_SYM '(' in_sum_expr ')'
{
- $$= new (YYTHD->mem_root) Item_sum_avg($3);
+ $$= new (YYTHD->mem_root) Item_sum_avg($3, FALSE);
if ($$ == NULL)
MYSQL_YYABORT;
}
| AVG_SYM '(' DISTINCT in_sum_expr ')'
{
- $$= new (YYTHD->mem_root) Item_sum_avg_distinct($4);
+ $$= new (YYTHD->mem_root) Item_sum_avg($4, TRUE);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -8137,7 +8500,7 @@ sum_expr:
{ Select->in_sum_expr--; }
')'
{
- $$= new (YYTHD->mem_root) Item_sum_count_distinct(* $5);
+ $$= new (YYTHD->mem_root) Item_sum_count(* $5);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -8196,13 +8559,13 @@ sum_expr:
}
| SUM_SYM '(' in_sum_expr ')'
{
- $$= new (YYTHD->mem_root) Item_sum_sum($3);
+ $$= new (YYTHD->mem_root) Item_sum_sum($3, FALSE);
if ($$ == NULL)
MYSQL_YYABORT;
}
| SUM_SYM '(' DISTINCT in_sum_expr ')'
{
- $$= new (YYTHD->mem_root) Item_sum_sum_distinct($4);
+ $$= new (YYTHD->mem_root) Item_sum_sum($4, TRUE);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -8864,24 +9227,25 @@ interval:
;
interval_time_stamp:
- interval_time_st {}
- | FRAC_SECOND_SYM {
- $$=INTERVAL_MICROSECOND;
- /*
- FRAC_SECOND was mistakenly implemented with
- a wrong resolution. According to the ODBC
- standard it should be nanoseconds, not
- microseconds. Changing it to nanoseconds
- in MySQL would mean making TIMESTAMPDIFF
- and TIMESTAMPADD to return DECIMAL, since
- the return value would be too big for BIGINT
- Hence we just deprecate the incorrect
- implementation without changing its
- resolution.
- */
- WARN_DEPRECATED(yythd, "6.2", "FRAC_SECOND", "MICROSECOND");
- }
- ;
+ interval_time_st {}
+ | FRAC_SECOND_SYM
+ {
+ $$=INTERVAL_MICROSECOND;
+ /*
+ FRAC_SECOND was mistakenly implemented with
+ a wrong resolution. According to the ODBC
+ standard it should be nanoseconds, not
+ microseconds. Changing it to nanoseconds
+ in MySQL would mean making TIMESTAMPDIFF
+ and TIMESTAMPADD to return DECIMAL, since
+ the return value would be too big for BIGINT
+ Hence we just deprecate the incorrect
+ implementation without changing its
+ resolution.
+ */
+ WARN_DEPRECATED(yythd, "6.2", "FRAC_SECOND", "MICROSECOND");
+ }
+ ;
interval_time_st:
DAY_SYM { $$=INTERVAL_DAY; }
@@ -9917,6 +10281,7 @@ truncate:
{
LEX* lex= Lex;
lex->sql_command= SQLCOM_TRUNCATE;
+ lex->alter_info.reset();
lex->select_lex.options= 0;
lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE_UNSPECIFIED;
lex->select_lex.init_order();
@@ -10104,6 +10469,11 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
} opt_limit_clause_init
+ | RELAYLOG_SYM EVENTS_SYM binlog_in binlog_from
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SHOW_RELAYLOG_EVENTS;
+ } opt_limit_clause_init
| keys_or_index from_or_in table_ident opt_db where_clause
{
LEX *lex= Lex;
@@ -10113,11 +10483,6 @@ show_param:
if (prepare_schema_table(YYTHD, lex, $3, SCH_STATISTICS))
MYSQL_YYABORT;
}
- | COLUMN_SYM TYPES_SYM
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES;
- }
| TABLE_SYM TYPES_SYM
{
LEX *lex=Lex;
@@ -10305,23 +10670,13 @@ show_param:
}
| PROCEDURE CODE_SYM sp_name
{
-#ifdef DBUG_OFF
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
-#else
Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
Lex->spname= $3;
-#endif
}
| FUNCTION_SYM CODE_SYM sp_name
{
-#ifdef DBUG_OFF
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
-#else
Lex->sql_command= SQLCOM_SHOW_FUNC_CODE;
Lex->spname= $3;
-#endif
}
| CREATE EVENT_SYM sp_name
{
@@ -10572,51 +10927,33 @@ use:
/* import, export of files */
load:
- LOAD DATA_SYM
+ LOAD data_or_xml
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
if (lex->sphead)
{
- my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
+ my_error(ER_SP_BADSTATEMENT, MYF(0),
+ $2 == FILETYPE_CSV ? "LOAD DATA" : "LOAD XML");
MYSQL_YYABORT;
}
}
- load_data
- {}
- | LOAD TABLE_SYM table_ident FROM MASTER_SYM
- {
- LEX *lex=Lex;
- WARN_DEPRECATED(yythd, "6.0", "LOAD TABLE FROM MASTER",
- "MySQL Administrator (mysqldump, mysql)");
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD TABLE");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
- if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- }
- ;
-
-load_data:
load_data_lock opt_local INFILE TEXT_STRING_filesystem
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_LOAD;
- lex->lock_option= $1;
- lex->local_file= $2;
+ lex->lock_option= $4;
+ lex->local_file= $5;
lex->duplicates= DUP_ERROR;
lex->ignore= 0;
- if (!(lex->exchange= new sql_exchange($4.str, 0)))
+ if (!(lex->exchange= new sql_exchange($7.str, 0, $2)))
MYSQL_YYABORT;
}
opt_duplicate INTO TABLE_SYM table_ident
{
LEX *lex=Lex;
- if (!Select->add_table_to_list(YYTHD, $9, NULL, TL_OPTION_UPDATING,
+ if (!Select->add_table_to_list(YYTHD, $12, NULL, TL_OPTION_UPDATING,
lex->lock_option))
MYSQL_YYABORT;
lex->field_list.empty();
@@ -10624,12 +10961,35 @@ load_data:
lex->value_list.empty();
}
opt_load_data_charset
- { Lex->exchange->cs= $11; }
+ { Lex->exchange->cs= $14; }
+ opt_xml_rows_identified_by
opt_field_term opt_line_term opt_ignore_lines opt_field_or_var_spec
opt_load_data_set_spec
{}
- | FROM MASTER_SYM
+ | LOAD TABLE_SYM table_ident FROM MASTER_SYM
+ {
+ LEX *lex=Lex;
+ WARN_DEPRECATED(yythd, "6.0", "LOAD TABLE FROM MASTER",
+ "MySQL Administrator (mysqldump, mysql)");
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD TABLE");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
+ if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
+ MYSQL_YYABORT;
+ }
+ | LOAD DATA_SYM FROM MASTER_SYM
{
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
+ MYSQL_YYABORT;
+ }
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
WARN_DEPRECATED(yythd, "6.0", "LOAD DATA FROM MASTER",
"mysqldump or future "
@@ -10637,6 +10997,11 @@ load_data:
}
;
+data_or_xml:
+ DATA_SYM { $$= FILETYPE_CSV; }
+ | XML_SYM { $$= FILETYPE_XML; }
+ ;
+
opt_local:
/* empty */ { $$=0;}
| LOCAL_SYM { $$=1;}
@@ -10723,15 +11088,26 @@ line_term:
}
;
+opt_xml_rows_identified_by:
+ /* empty */ { }
+ | ROWS_SYM IDENTIFIED_SYM BY text_string
+ { Lex->exchange->line_term = $4; };
+
opt_ignore_lines:
/* empty */
- | IGNORE_SYM NUM LINES
+ | IGNORE_SYM NUM lines_or_rows
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->skip_lines= atol($2.str);
}
;
+lines_or_rows:
+ LINES { }
+
+ | ROWS_SYM { }
+ ;
+
opt_field_or_var_spec:
/* empty */ {}
| '(' fields_or_vars ')' {}
@@ -11360,8 +11736,9 @@ IDENT_sys:
$1.length, &dummy_error);
if (wlen < $1.length)
{
+ ErrConvString err($1.str, $1.length, &my_charset_bin);
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
- cs->csname, $1.str + wlen);
+ cs->csname, err.ptr());
MYSQL_YYABORT;
}
$$= $1;
@@ -11576,13 +11953,16 @@ keyword_sp:
| BOOLEAN_SYM {}
| BTREE_SYM {}
| CASCADED {}
+ | CATALOG_NAME_SYM {}
| CHAIN_SYM {}
| CHANGED {}
| CIPHER_SYM {}
| CLIENT_SYM {}
+ | CLASS_ORIGIN_SYM {}
| COALESCE {}
| CODE_SYM {}
| COLLATION_SYM {}
+ | COLUMN_NAME_SYM {}
| COLUMNS {}
| COMMITTED_SYM {}
| COMPACT_SYM {}
@@ -11591,10 +11971,14 @@ keyword_sp:
| CONCURRENT {}
| CONNECTION_SYM {}
| CONSISTENT_SYM {}
+ | CONSTRAINT_CATALOG_SYM {}
+ | CONSTRAINT_SCHEMA_SYM {}
+ | CONSTRAINT_NAME_SYM {}
| CONTEXT_SYM {}
| CONTRIBUTORS_SYM {}
| CPU_SYM {}
| CUBE_SYM {}
+ | CURSOR_NAME_SYM {}
| DATA_SYM {}
| DATAFILE_SYM {}
| DATETIME {}
@@ -11682,10 +12066,10 @@ keyword_sp:
| MAX_SIZE_SYM {}
| MAX_UPDATES_PER_HOUR {}
| MAX_USER_CONNECTIONS_SYM {}
- | MAX_VALUE_SYM {}
| MEDIUM_SYM {}
| MEMORY_SYM {}
| MERGE_SYM {}
+ | MESSAGE_TEXT_SYM {}
| MICROSECOND_SYM {}
| MIGRATE_SYM {}
| MINUTE_SYM {}
@@ -11697,6 +12081,7 @@ keyword_sp:
| MULTIPOINT {}
| MULTIPOLYGON {}
| MUTEX_SYM {}
+ | MYSQL_ERRNO_SYM {}
| NAME_SYM {}
| NAMES_SYM {}
| NATIONAL_SYM {}
@@ -11739,6 +12124,7 @@ keyword_sp:
| REDO_BUFFER_SIZE_SYM {}
| REDOFILE_SYM {}
| REDUNDANT_SYM {}
+ | RELAYLOG_SYM {}
| RELAY_LOG_FILE_SYM {}
| RELAY_LOG_POS_SYM {}
| RELAY_THREAD {}
@@ -11756,6 +12142,7 @@ keyword_sp:
| ROW_SYM {}
| RTREE_SYM {}
| SCHEDULE_SYM {}
+ | SCHEMA_NAME_SYM {}
| SECOND_SYM {}
| SERIAL_SYM {}
| SERIALIZABLE_SYM {}
@@ -11774,6 +12161,7 @@ keyword_sp:
| STATUS_SYM {}
| STORAGE_SYM {}
| STRING_SYM {}
+ | SUBCLASS_ORIGIN_SYM {}
| SUBDATE_SYM {}
| SUBJECT_SYM {}
| SUBPARTITION_SYM {}
@@ -11782,6 +12170,7 @@ keyword_sp:
| SUSPEND_SYM {}
| SWAPS_SYM {}
| SWITCHES_SYM {}
+ | TABLE_NAME_SYM {}
| TABLES {}
| TABLE_CHECKSUM_SYM {}
| TABLESPACE {}
@@ -11815,6 +12204,7 @@ keyword_sp:
| WEEK_SYM {}
| WORK_SYM {}
| X509_SYM {}
+ | XML_SYM {}
| YEAR_SYM {}
;
@@ -12562,6 +12952,7 @@ object_privilege:
| CREATE USER { Lex->grant |= CREATE_USER_ACL; }
| EVENT_SYM { Lex->grant |= EVENT_ACL;}
| TRIGGER_SYM { Lex->grant |= TRIGGER_ACL; }
+ | CREATE TABLESPACE { Lex->grant |= CREATE_TABLESPACE_ACL; }
;
opt_and:
diff --git a/sql/structs.h b/sql/structs.h
index 2546d241059..33b7148c4b3 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -1,3 +1,6 @@
+#ifndef STRUCTS_INCLUDED
+#define STRUCTS_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -16,8 +19,9 @@
/* The old structures from unireg */
-struct st_table;
+struct TABLE;
class Field;
+class THD;
typedef struct st_date_time_format {
uchar positions[8];
@@ -97,7 +101,7 @@ typedef struct st_key {
union {
int bdb_return_if_eq;
} handler;
- struct st_table *table;
+ TABLE *table;
} KEY;
@@ -115,36 +119,6 @@ typedef struct st_reginfo { /* Extra info about reg */
} REGINFO;
-class SQL_SELECT;
-class THD;
-class handler;
-struct st_join_table;
-
-void rr_unlock_row(st_join_table *tab);
-
-struct READ_RECORD { /* Parameter to read_record */
- typedef int (*Read_func)(READ_RECORD*);
- typedef void (*Unlock_row_func)(st_join_table *);
- struct st_table *table; /* Head-form */
- handler *file;
- struct st_table **forms; /* head and ref forms */
-
- Read_func read_record;
- Unlock_row_func unlock_row;
- THD *thd;
- SQL_SELECT *select;
- uint cache_records;
- uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
- uint index;
- uchar *ref_pos; /* pointer to form->refpos */
- uchar *record;
- uchar *rec_buf; /* to read field values after filesort */
- uchar *cache,*cache_pos,*cache_end,*read_positions;
- IO_CACHE *io_cache;
- bool print_error, ignore_not_found_rows;
-};
-
-
/*
Originally MySQL used MYSQL_TIME structure inside server only, but since
4.1 it's exported to user in the new client API. Define aliases for
@@ -386,3 +360,5 @@ public:
Discrete_interval* get_tail() const { return tail; };
Discrete_interval* get_current() const { return current; };
};
+
+#endif /* STRUCTS_INCLUDED */
diff --git a/sql/table.cc b/sql/table.cc
index 0ca81294458..a1a422028d4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -423,7 +423,7 @@ void free_table_share(TABLE_SHARE *share)
pthread_mutex_destroy(&share->mutex);
pthread_cond_destroy(&share->cond);
}
- hash_free(&share->name_hash);
+ my_hash_free(&share->name_hash);
plugin_unlock(NULL, share->db_plugin);
share->db_plugin= NULL;
@@ -725,7 +725,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
share->avg_row_length= uint4korr(head+34);
share->row_type= (row_type) head[40];
- share->table_charset= get_charset((uint) head[38],MYF(0));
+ share->table_charset= get_charset((((uint) head[41]) << 8) +
+ (uint) head[38],MYF(0));
share->null_field_first= 1;
}
if (!share->table_charset)
@@ -1147,10 +1148,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
use_hash= share->fields >= MAX_FIELDS_BEFORE_HASH;
if (use_hash)
- use_hash= !hash_init(&share->name_hash,
- system_charset_info,
- share->fields,0,0,
- (hash_get_key) get_field_name,0,0);
+ use_hash= !my_hash_init(&share->name_hash,
+ system_charset_info,
+ share->fields,0,0,
+ (my_hash_get_key) get_field_name,0,0);
for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++)
{
@@ -1184,12 +1185,13 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
}
else
{
- if (!strpos[14])
+ uint csid= strpos[14] + (((uint) strpos[11]) << 8);
+ if (!csid)
charset= &my_charset_bin;
- else if (!(charset=get_charset((uint) strpos[14], MYF(0))))
+ else if (!(charset= get_charset(csid, MYF(0))))
{
error= 5; // Unknown or unavailable charset
- errarg= (int) strpos[14];
+ errarg= (int) csid;
goto err;
}
}
@@ -1262,7 +1264,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
"Please do \"ALTER TABLE '%s' FORCE\" to fix it!",
share->fieldnames.type_names[i], share->table_name.str,
share->table_name.str);
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CRASHED_ON_USAGE,
"Found incompatible DECIMAL field '%s' in %s; "
"Please do \"ALTER TABLE '%s' FORCE\" to fix it!",
@@ -1472,7 +1474,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
"Please do \"ALTER TABLE '%s' FORCE \" to fix it!",
share->table_name.str,
share->table_name.str);
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CRASHED_ON_USAGE,
"Found wrong key definition in %s; "
"Please do \"ALTER TABLE '%s' FORCE\" to fix "
@@ -1597,7 +1599,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete handler_file;
#ifndef DBUG_OFF
if (use_hash)
- (void) hash_check(&share->name_hash);
+ (void) my_hash_check(&share->name_hash);
#endif
DBUG_RETURN (0);
@@ -1608,7 +1610,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
x_free((uchar*) disk_buff);
delete crypted;
delete handler_file;
- hash_free(&share->name_hash);
+ my_hash_free(&share->name_hash);
+ if (share->ha_data_destroy)
+ share->ha_data_destroy(share->ha_data);
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);
@@ -2465,8 +2469,7 @@ File create_frm(THD *thd, const char *name, const char *db,
if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0)
{
- uint key_length, tmp_key_length;
- uint tmp;
+ uint key_length, tmp_key_length, tmp, csid;
bzero((char*) fileinfo,64);
/* header */
fileinfo[0]=(uchar) 254;
@@ -2506,8 +2509,9 @@ File create_frm(THD *thd, const char *name, const char *db,
fileinfo[32]=0; // No filename anymore
fileinfo[33]=5; // Mark for 5.0 frm file
int4store(fileinfo+34,create_info->avg_row_length);
- fileinfo[38]= (create_info->default_table_charset ?
- create_info->default_table_charset->number : 0);
+ csid= (create_info->default_table_charset ?
+ create_info->default_table_charset->number : 0);
+ fileinfo[38]= (uchar) csid;
/*
In future versions, we will store in fileinfo[39] the values of the
TRANSACTIONAL and PAGE_CHECKSUM clauses of CREATE TABLE.
@@ -2515,7 +2519,7 @@ File create_frm(THD *thd, const char *name, const char *db,
fileinfo[39]= 0;
fileinfo[40]= (uchar) create_info->row_type;
/* Next few bytes where for RAID support */
- fileinfo[41]= 0;
+ fileinfo[41]= (uchar) (csid >> 8);
fileinfo[42]= 0;
fileinfo[43]= 0;
fileinfo[44]= 0;
@@ -2947,7 +2951,7 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
Create Item_field for each column in the table.
SYNPOSIS
- st_table::fill_item_list()
+ TABLE::fill_item_list()
item_list a pointer to an empty list used to store items
DESCRIPTION
@@ -2960,7 +2964,7 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
1 out of memory
*/
-bool st_table::fill_item_list(List<Item> *item_list) const
+bool TABLE::fill_item_list(List<Item> *item_list) const
{
/*
All Item_field's created using a direct pointer to a field
@@ -2980,7 +2984,7 @@ bool st_table::fill_item_list(List<Item> *item_list) const
Fields of this table.
SYNPOSIS
- st_table::fill_item_list()
+ TABLE::fill_item_list()
item_list a non-empty list with Item_fields
DESCRIPTION
@@ -2990,7 +2994,7 @@ bool st_table::fill_item_list(List<Item> *item_list) const
is the same as the number of columns in the table.
*/
-void st_table::reset_item_list(List<Item> *item_list) const
+void TABLE::reset_item_list(List<Item> *item_list) const
{
List_iterator_fast<Item> it(*item_list);
for (Field **ptr= field; *ptr; ptr++)
@@ -3374,20 +3378,20 @@ void TABLE_LIST::hide_view_error(THD *thd)
/* Hide "Unknown column" or "Unknown function" error */
DBUG_ASSERT(thd->is_error());
- if (thd->main_da.sql_errno() == ER_BAD_FIELD_ERROR ||
- thd->main_da.sql_errno() == ER_SP_DOES_NOT_EXIST ||
- thd->main_da.sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
- thd->main_da.sql_errno() == ER_PROCACCESS_DENIED_ERROR ||
- thd->main_da.sql_errno() == ER_COLUMNACCESS_DENIED_ERROR ||
- thd->main_da.sql_errno() == ER_TABLEACCESS_DENIED_ERROR ||
- thd->main_da.sql_errno() == ER_TABLE_NOT_LOCKED ||
- thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)
+ if (thd->stmt_da->sql_errno() == ER_BAD_FIELD_ERROR ||
+ thd->stmt_da->sql_errno() == ER_SP_DOES_NOT_EXIST ||
+ thd->stmt_da->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION ||
+ thd->stmt_da->sql_errno() == ER_PROCACCESS_DENIED_ERROR ||
+ thd->stmt_da->sql_errno() == ER_COLUMNACCESS_DENIED_ERROR ||
+ thd->stmt_da->sql_errno() == ER_TABLEACCESS_DENIED_ERROR ||
+ thd->stmt_da->sql_errno() == ER_TABLE_NOT_LOCKED ||
+ thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE)
{
TABLE_LIST *top= top_table();
thd->clear_error();
my_error(ER_VIEW_INVALID, MYF(0), top->view_db.str, top->view_name.str);
}
- else if (thd->main_da.sql_errno() == ER_NO_DEFAULT_FOR_FIELD)
+ else if (thd->stmt_da->sql_errno() == ER_NO_DEFAULT_FOR_FIELD)
{
TABLE_LIST *top= top_table();
thd->clear_error();
@@ -3465,7 +3469,7 @@ int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
TABLE_LIST *main_view= top_table();
if (ignore_failure)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_VIEW_CHECK_FAILED, ER(ER_VIEW_CHECK_FAILED),
main_view->view_db.str, main_view->view_name.str);
return(VIEW_CHECK_SKIP);
@@ -3932,14 +3936,14 @@ const char *Natural_join_column::db_name()
return table_ref->view_db.str;
/*
- Test that TABLE_LIST::db is the same as st_table_share::db to
+ Test that TABLE_LIST::db is the same as TABLE_SHARE::db to
ensure consistency. An exception are I_S schema tables, which
are inconsistent in this respect.
*/
DBUG_ASSERT(!strcmp(table_ref->db,
table_ref->table->s->db.str) ||
(table_ref->schema_table &&
- table_ref->table->s->db.str[0] == 0));
+ is_schema_db(table_ref->table->s->db.str)));
return table_ref->db;
}
@@ -4151,13 +4155,13 @@ const char *Field_iterator_table_ref::get_db_name()
return natural_join_it.column_ref()->db_name();
/*
- Test that TABLE_LIST::db is the same as st_table_share::db to
+ Test that TABLE_LIST::db is the same as TABLE_SHARE::db to
ensure consistency. An exception are I_S schema tables, which
are inconsistent in this respect.
*/
DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) ||
(table_ref->schema_table &&
- table_ref->table->s->db.str[0] == 0));
+ is_schema_db(table_ref->table->s->db.str)));
return table_ref->db;
}
@@ -4327,7 +4331,7 @@ Field_iterator_table_ref::get_natural_column_ref()
/* Reset all columns bitmaps */
-void st_table::clear_column_bitmaps()
+void TABLE::clear_column_bitmaps()
{
/*
Reset column read/write usage. It's identical to:
@@ -4348,9 +4352,9 @@ void st_table::clear_column_bitmaps()
key fields.
*/
-void st_table::prepare_for_position()
+void TABLE::prepare_for_position()
{
- DBUG_ENTER("st_table::prepare_for_position");
+ DBUG_ENTER("TABLE::prepare_for_position");
if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
s->primary_key < MAX_KEY)
@@ -4369,14 +4373,14 @@ void st_table::prepare_for_position()
NOTE:
This changes the bitmap to use the tmp bitmap
After this, you can't access any other columns in the table until
- bitmaps are reset, for example with st_table::clear_column_bitmaps()
- or st_table::restore_column_maps_after_mark_index()
+ bitmaps are reset, for example with TABLE::clear_column_bitmaps()
+ or TABLE::restore_column_maps_after_mark_index()
*/
-void st_table::mark_columns_used_by_index(uint index)
+void TABLE::mark_columns_used_by_index(uint index)
{
MY_BITMAP *bitmap= &tmp_set;
- DBUG_ENTER("st_table::mark_columns_used_by_index");
+ DBUG_ENTER("TABLE::mark_columns_used_by_index");
(void) file->extra(HA_EXTRA_KEYREAD);
bitmap_clear_all(bitmap);
@@ -4397,9 +4401,9 @@ void st_table::mark_columns_used_by_index(uint index)
when calling mark_columns_used_by_index
*/
-void st_table::restore_column_maps_after_mark_index()
+void TABLE::restore_column_maps_after_mark_index()
{
- DBUG_ENTER("st_table::restore_column_maps_after_mark_index");
+ DBUG_ENTER("TABLE::restore_column_maps_after_mark_index");
key_read= 0;
(void) file->extra(HA_EXTRA_NO_KEYREAD);
@@ -4413,7 +4417,7 @@ void st_table::restore_column_maps_after_mark_index()
mark columns used by key, but don't reset other fields
*/
-void st_table::mark_columns_used_by_index_no_reset(uint index,
+void TABLE::mark_columns_used_by_index_no_reset(uint index,
MY_BITMAP *bitmap)
{
KEY_PART_INFO *key_part= key_info[index].key_part;
@@ -4432,7 +4436,7 @@ void st_table::mark_columns_used_by_index_no_reset(uint index,
always set and sometimes read.
*/
-void st_table::mark_auto_increment_column()
+void TABLE::mark_auto_increment_column()
{
DBUG_ASSERT(found_next_number_field);
/*
@@ -4465,7 +4469,7 @@ void st_table::mark_auto_increment_column()
retrieve the row again.
*/
-void st_table::mark_columns_needed_for_delete()
+void TABLE::mark_columns_needed_for_delete()
{
if (triggers)
triggers->mark_fields_used(TRG_EVENT_DELETE);
@@ -4515,7 +4519,7 @@ void st_table::mark_columns_needed_for_delete()
retrieve the row again.
*/
-void st_table::mark_columns_needed_for_update()
+void TABLE::mark_columns_needed_for_update()
{
DBUG_ENTER("mark_columns_needed_for_update");
if (triggers)
@@ -4558,7 +4562,7 @@ void st_table::mark_columns_needed_for_update()
as changed.
*/
-void st_table::mark_columns_needed_for_insert()
+void TABLE::mark_columns_needed_for_insert()
{
if (triggers)
{
@@ -4588,7 +4592,7 @@ void st_table::mark_columns_needed_for_insert()
TABLEs. Each of these TABLEs is called a part of a MERGE table.
*/
-bool st_table::is_children_attached(void)
+bool TABLE::is_children_attached(void)
{
return((child_l && children_attached) ||
(parent && parent->children_attached));
@@ -4652,9 +4656,9 @@ Item_subselect *TABLE_LIST::containing_subselect()
DESCRIPTION
The parser collects the index hints for each table in a "tagged list"
(TABLE_LIST::index_hints). Using the information in this tagged list
- this function sets the members st_table::keys_in_use_for_query,
+ this function sets the members st_table::keys_in_use_for_query,
st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
- st_table::force_index, st_table::force_index_order,
+ st_table::force_index, st_table::force_index_order,
st_table::force_index_group and st_table::covering_keys.
Current implementation of the runtime does not allow mixing FORCE INDEX
diff --git a/sql/table.h b/sql/table.h
index eae261cc97d..6723dfc40dd 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,3 +1,6 @@
+#ifndef TABLE_INCLUDED
+#define TABLE_INCLUDED
+
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -320,9 +323,9 @@ public:
instance of table share per one table in the database.
*/
-typedef struct st_table_share
+struct TABLE_SHARE
{
- st_table_share() {} /* Remove gcc warning */
+ TABLE_SHARE() {} /* Remove gcc warning */
/** Category of this table. */
TABLE_CATEGORY table_category;
@@ -335,11 +338,7 @@ typedef struct st_table_share
TYPELIB *intervals; /* pointer to interval info */
pthread_mutex_t mutex; /* For locking the share */
pthread_cond_t cond; /* To signal that share is ready */
- struct st_table_share *next, /* Link to unused shares */
- **prev;
-#ifdef NOT_YET
- struct st_table *open_tables; /* link to open tables */
-#endif
+ TABLE_SHARE *next, **prev; /* Link to unused shares */
/* The following is copied to each TABLE on OPEN */
Field **field;
@@ -465,6 +464,7 @@ typedef struct st_table_share
/** place to store storage engine specific data */
void *ha_data;
+ void (*ha_data_destroy)(void *); /* An optional destructor for ha_data */
/*
@@ -634,7 +634,7 @@ typedef struct st_table_share
return (tmp_table == SYSTEM_TMP_TABLE || is_view) ? 0 : table_map_id;
}
-} TABLE_SHARE;
+};
extern ulong refresh_version;
@@ -647,19 +647,16 @@ enum index_hint_type
INDEX_HINT_FORCE
};
-struct st_table {
- st_table() {} /* Remove gcc warning */
+struct TABLE
+{
+ TABLE() {} /* Remove gcc warning */
TABLE_SHARE *s;
handler *file;
-#ifdef NOT_YET
- struct st_table *used_next, **used_prev; /* Link to used tables */
- struct st_table *open_next, **open_prev; /* Link to open tables */
-#endif
- struct st_table *next, *prev;
+ TABLE *next, *prev;
/* For the below MERGE related members see top comment in ha_myisammrg.cc */
- struct st_table *parent; /* Set in MERGE child. Ptr to parent */
+ TABLE *parent; /* Set in MERGE child. Ptr to parent */
TABLE_LIST *child_l; /* Set in MERGE parent. List of children */
TABLE_LIST **child_last_l; /* Set in MERGE parent. End of list */
@@ -1053,7 +1050,6 @@ typedef struct st_schema_table
/** The threshold size a blob field buffer before it is freed */
#define MAX_TDC_BLOB_SIZE 65536
-struct st_lex;
class select_union;
class TMP_TABLE_PARAM;
@@ -1131,6 +1127,7 @@ public:
(TABLE_LIST::join_using_fields != NULL)
*/
+struct LEX;
class Index_hint;
struct TABLE_LIST
{
@@ -1251,7 +1248,7 @@ struct TABLE_LIST
TMP_TABLE_PARAM *schema_table_param;
/* link to select_lex where this table was used */
st_select_lex *select_lex;
- st_lex *view; /* link on VIEW lex for merging */
+ LEX *view; /* link on VIEW lex for merging */
Field_translator *field_translation; /* array of VIEW fields */
/* pointer to element after last one in translation table above */
Field_translator *field_translation_end;
@@ -1410,6 +1407,8 @@ struct TABLE_LIST
the parsed tree is created.
*/
uint8 trg_event_map;
+ /* TRUE <=> this table is a const one and was optimized away. */
+ bool optimized_away;
uint i_s_requested_object;
bool has_db_lookup_value;
@@ -1466,9 +1465,9 @@ struct TABLE_LIST
Item_subselect *containing_subselect();
/*
- Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
- st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
- st_table::force_index and st_table::covering_keys.
+ Compiles the tagged hints list and fills up TABLE::keys_in_use_for_query,
+ TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by,
+ TABLE::force_index and TABLE::covering_keys.
*/
bool process_index_hints(TABLE *table);
@@ -1772,3 +1771,4 @@ static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
size_t max_row_length(TABLE *table, const uchar *data);
+#endif /* TABLE_INCLUDED */
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index 0764fe8be33..ed17f7968c0 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -44,9 +44,10 @@ extern "C" {
returned in the error packet.
- SHOW ERROR/SHOW WARNINGS may be empty.
*/
- thd->main_da.set_error_status(thd,
- ER_OUT_OF_RESOURCES,
- ER(ER_OUT_OF_RESOURCES));
+ thd->stmt_da->set_error_status(thd,
+ ER_OUT_OF_RESOURCES,
+ ER(ER_OUT_OF_RESOURCES),
+ NULL);
}
}
}
diff --git a/sql/time.cc b/sql/time.cc
index 8b554beb94b..5f804072eb0 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -748,7 +748,7 @@ void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level leve
cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
type_str, str.c_ptr(), field_name,
- (ulong) thd->row_count);
+ (ulong) thd->warning_info->current_row_for_warning());
else
{
if (time_type > MYSQL_TIMESTAMP_ERROR)
diff --git a/sql/tzfile.h b/sql/tzfile.h
index 1ff82d62329..1c1800ba1ed 100644
--- a/sql/tzfile.h
+++ b/sql/tzfile.h
@@ -1,3 +1,6 @@
+#ifndef TZFILE_INCLUDED
+#define TZFILE_INCLUDED
+
/* Copyright (C) 2004 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -134,3 +137,5 @@ struct tzhead {
*/
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
+
+#endif
diff --git a/sql/tztime.cc b/sql/tztime.cc
index c7a4ad049ec..650678c721b 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1581,17 +1581,17 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
lex_start(thd);
/* Init all memory structures that require explicit destruction */
- if (hash_init(&tz_names, &my_charset_latin1, 20,
- 0, 0, (hash_get_key) my_tz_names_get_key, 0, 0))
+ if (my_hash_init(&tz_names, &my_charset_latin1, 20,
+ 0, 0, (my_hash_get_key) my_tz_names_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
goto end;
}
- if (hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0,
- (hash_get_key)my_offset_tzs_get_key, 0, 0))
+ if (my_hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0,
+ (my_hash_get_key)my_offset_tzs_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
- hash_free(&tz_names);
+ my_hash_free(&tz_names);
goto end;
}
init_alloc_root(&tz_storage, 32 * 1024, 0);
@@ -1645,7 +1645,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
if (open_system_tables_for_read(thd, tz_tables, &open_tables_state_backup))
{
sql_print_warning("Can't open and lock time zone table: %s "
- "trying to live without them", thd->main_da.message());
+ "trying to live without them", thd->stmt_da->message());
/* We will try emulate that everything is ok */
return_val= time_zone_tables_exist= 0;
goto end_with_setting_default_tz;
@@ -1774,8 +1774,8 @@ void my_tz_free()
{
tz_inited= 0;
VOID(pthread_mutex_destroy(&tz_LOCK));
- hash_free(&offset_tzs);
- hash_free(&tz_names);
+ my_hash_free(&offset_tzs);
+ my_hash_free(&tz_names);
free_root(&tz_storage, MYF(0));
}
}
@@ -2267,9 +2267,9 @@ my_tz_find(THD *thd, const String *name)
if (!str_to_offset(name->ptr(), name->length(), &offset))
{
- if (!(result_tz= (Time_zone_offset *)hash_search(&offset_tzs,
- (const uchar *)&offset,
- sizeof(long))))
+ if (!(result_tz= (Time_zone_offset *)my_hash_search(&offset_tzs,
+ (const uchar *)&offset,
+ sizeof(long))))
{
DBUG_PRINT("info", ("Creating new Time_zone_offset object"));
@@ -2285,9 +2285,10 @@ my_tz_find(THD *thd, const String *name)
else
{
result_tz= 0;
- if ((tmp_tzname= (Tz_names_entry *)hash_search(&tz_names,
- (const uchar *)name->ptr(),
- name->length())))
+ if ((tmp_tzname= (Tz_names_entry *)my_hash_search(&tz_names,
+ (const uchar *)
+ name->ptr(),
+ name->length())))
result_tz= tmp_tzname->tz;
else if (time_zone_tables_exist)
{
diff --git a/sql/tztime.h b/sql/tztime.h
index 9bf103519c4..9990e91f17b 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -1,3 +1,6 @@
+#ifndef TZTIME_INCLUDED
+#define TZTIME_INCLUDED
+
/* Copyright (C) 2004 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -79,3 +82,4 @@ static const int MY_TZ_TABLES_COUNT= 4;
#endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */
+#endif /* TZTIME_INCLUDED */
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 82af58ec502..4e3dd82c467 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -139,6 +139,11 @@ typedef long long longlong;
#include <mysql.h>
#include <ctype.h>
+#ifdef _WIN32
+/* inet_aton needs winsock library */
+#pragma comment(lib, "ws2_32")
+#endif
+
#ifdef HAVE_DLOPEN
static pthread_mutex_t LOCK_hostname;
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 60674b8390b..f08c64a3182 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -55,10 +55,12 @@ static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type,
struct Pack_header_error_handler: public Internal_error_handler
{
- virtual bool handle_error(uint sql_errno,
- const char *message,
- MYSQL_ERROR::enum_warning_level level,
- THD *thd);
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
bool is_handled;
Pack_header_error_handler() :is_handled(FALSE) {}
};
@@ -66,11 +68,14 @@ struct Pack_header_error_handler: public Internal_error_handler
bool
Pack_header_error_handler::
-handle_error(uint sql_errno,
- const char * /* message */,
- MYSQL_ERROR::enum_warning_level /* level */,
- THD * /* thd */)
+handle_condition(THD *,
+ uint sql_errno,
+ const char*,
+ MYSQL_ERROR::enum_warning_level,
+ const char*,
+ MYSQL_ERROR ** cond_hdl)
{
+ *cond_hdl= NULL;
is_handled= (sql_errno == ER_TOO_MANY_FIELDS);
return is_handled;
}
@@ -796,20 +801,27 @@ static bool pack_fields(File file, List<Create_field> &create_fields,
recpos= field->offset+1 + (uint) data_offset;
int3store(buff+5,recpos);
int2store(buff+8,field->pack_flag);
- int2store(buff+10,field->unireg_check);
+ DBUG_ASSERT(field->unireg_check < 256);
+ buff[10]= (uchar) field->unireg_check;
buff[12]= (uchar) field->interval_id;
buff[13]= (uchar) field->sql_type;
if (field->sql_type == MYSQL_TYPE_GEOMETRY)
{
+ buff[11]= 0;
buff[14]= (uchar) field->geom_type;
#ifndef HAVE_SPATIAL
DBUG_ASSERT(0); // Should newer happen
#endif
}
else if (field->charset)
+ {
+ buff[11]= (uchar) (field->charset->number >> 8);
buff[14]= (uchar) field->charset->number;
+ }
else
- buff[14]= 0; // Numerical
+ {
+ buff[11]= buff[14]= 0; // Numerical
+ }
int2store(buff+15, field->comment.length);
comment_length+= field->comment.length;
set_if_bigger(int_count,field->interval_id);
diff --git a/sql/unireg.h b/sql/unireg.h
index 3ff7f058e3c..a390b755772 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -1,3 +1,6 @@
+#ifndef UNIREG_INCLUDED
+#define UNIREG_INCLUDED
+
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -16,8 +19,6 @@
/* Extra functions used by unireg library */
-#ifndef _unireg_h
-
#ifndef NO_ALARM_LOOP
#define NO_ALARM_LOOP /* lib5 and popen can't use alarm */
#endif
@@ -39,7 +40,11 @@
#define PLUGINDIR "lib/plugin"
#endif
-#define ER(X) errmesg[(X) - ER_ERROR_FIRST]
+#define CURRENT_THD_ERRMSGS current_thd->variables.lc_messages->errmsgs->errmsgs
+#define DEFAULT_ERRMSGS my_default_lc_messages->errmsgs->errmsgs
+
+#define ER(X) CURRENT_THD_ERRMSGS[(X) - ER_ERROR_FIRST]
+#define ER_DEFAULT(X) DEFAULT_ERRMSGS[(X) - ER_ERROR_FIRST]
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code")
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index 319ed467966..143d684025e 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -1,4 +1,5 @@
# Copyright (C) 2005-2006 MySQL AB
+# Copyright (C) 2009 SUN Microsystems
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -68,14 +69,23 @@ archive_reader_LDFLAGS = @NOINST_LDFLAGS@
EXTRA_DIST = CMakeLists.txt plug.in
if HAVE_DTRACE_DASH_G
+# The object for static and dynamic linking of archive differ
+# For static linkage of archive to mysqld
libarchive_a_LIBADD = probes_mysql.o
libarchive_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
+# For archive as shared library
+ha_archive_la_LIBADD = probes_sh_mysql.o
+ha_archive_la_DEPENDENCIES = probes_sh_mysql.o dtrace_shared_files dtrace_providers
+
+CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files
DTRACEFILES = libarchive_a-ha_archive.o
+DTRACESHAREDFILES = .libs/ha_archive_la-ha_archive.o
DTRACEPROVIDER = probes_mysql.d
dtrace_files:
echo $(DTRACEFILES) > $@
+dtrace_shared_files:
+ echo $(DTRACESHAREDFILES) > $@
dtrace_providers: probes_mysql.d
echo $(DTRACEPROVIDER) > $@
probes_mysql.d:
@@ -83,6 +93,9 @@ probes_mysql.d:
$(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
echo timestamp > dtrace_sources
+probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDFILES)
+ $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
+
probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
$(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
endif
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 2e812ffa6a5..e8d80106a6f 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -172,8 +172,8 @@ int archive_db_init(void *p)
if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST))
goto error;
- if (hash_init(&archive_open_tables, table_alias_charset, 32, 0, 0,
- (hash_get_key) archive_get_key, 0, 0))
+ if (my_hash_init(&archive_open_tables, table_alias_charset, 32, 0, 0,
+ (my_hash_get_key) archive_get_key, 0, 0))
{
VOID(pthread_mutex_destroy(&archive_mutex));
}
@@ -198,7 +198,7 @@ error:
int archive_db_done(void *p)
{
- hash_free(&archive_open_tables);
+ my_hash_free(&archive_open_tables);
VOID(pthread_mutex_destroy(&archive_mutex));
return 0;
@@ -316,9 +316,9 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
pthread_mutex_lock(&archive_mutex);
length=(uint) strlen(table_name);
- if (!(share=(ARCHIVE_SHARE*) hash_search(&archive_open_tables,
- (uchar*) table_name,
- length)))
+ if (!(share=(ARCHIVE_SHARE*) my_hash_search(&archive_open_tables,
+ (uchar*) table_name,
+ length)))
{
char *tmp_name;
azio_stream archive_tmp;
@@ -400,7 +400,7 @@ int ha_archive::free_share()
pthread_mutex_lock(&archive_mutex);
if (!--share->use_count)
{
- hash_delete(&archive_open_tables, (uchar*) share);
+ my_hash_delete(&archive_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->mutex));
/*
diff --git a/storage/blackhole/CMakeLists.txt b/storage/blackhole/CMakeLists.txt
index b762228d7fd..bed282ef21d 100644
--- a/storage/blackhole/CMakeLists.txt
+++ b/storage/blackhole/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(BLACKHOLE_SOURCES ha_blackhole.cc ha_blackhole.h)
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index eaa17a41ac5..27e4c919911 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -319,8 +319,9 @@ static st_blackhole_share *get_share(const char *table_name)
length= (uint) strlen(table_name);
pthread_mutex_lock(&blackhole_mutex);
- if (!(share= (st_blackhole_share*) hash_search(&blackhole_open_tables,
- (uchar*) table_name, length)))
+ if (!(share= (st_blackhole_share*)
+ my_hash_search(&blackhole_open_tables,
+ (uchar*) table_name, length)))
{
if (!(share= (st_blackhole_share*) my_malloc(sizeof(st_blackhole_share) +
length,
@@ -350,7 +351,7 @@ static void free_share(st_blackhole_share *share)
{
pthread_mutex_lock(&blackhole_mutex);
if (!--share->use_count)
- hash_delete(&blackhole_open_tables, (uchar*) share);
+ my_hash_delete(&blackhole_open_tables, (uchar*) share);
pthread_mutex_unlock(&blackhole_mutex);
}
@@ -377,16 +378,16 @@ static int blackhole_init(void *p)
blackhole_hton->flags= HTON_CAN_RECREATE;
VOID(pthread_mutex_init(&blackhole_mutex, MY_MUTEX_INIT_FAST));
- (void) hash_init(&blackhole_open_tables, system_charset_info,32,0,0,
- (hash_get_key) blackhole_get_key,
- (hash_free_key) blackhole_free_key, 0);
+ (void) my_hash_init(&blackhole_open_tables, system_charset_info,32,0,0,
+ (my_hash_get_key) blackhole_get_key,
+ (my_hash_free_key) blackhole_free_key, 0);
return 0;
}
static int blackhole_fini(void *p)
{
- hash_free(&blackhole_open_tables);
+ my_hash_free(&blackhole_open_tables);
pthread_mutex_destroy(&blackhole_mutex);
return 0;
diff --git a/storage/csv/CMakeLists.txt b/storage/csv/CMakeLists.txt
index eb21a9b048c..37760588897 100644
--- a/storage/csv/CMakeLists.txt
+++ b/storage/csv/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 07c4785ab90..9cc0f1e607b 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -111,8 +111,8 @@ static int tina_init_func(void *p)
tina_hton= (handlerton *)p;
VOID(pthread_mutex_init(&tina_mutex,MY_MUTEX_INIT_FAST));
- (void) hash_init(&tina_open_tables,system_charset_info,32,0,0,
- (hash_get_key) tina_get_key,0,0);
+ (void) my_hash_init(&tina_open_tables,system_charset_info,32,0,0,
+ (my_hash_get_key) tina_get_key,0,0);
tina_hton->state= SHOW_OPTION_YES;
tina_hton->db_type= DB_TYPE_CSV_DB;
tina_hton->create= tina_create_handler;
@@ -123,7 +123,7 @@ static int tina_init_func(void *p)
static int tina_done_func(void *p)
{
- hash_free(&tina_open_tables);
+ my_hash_free(&tina_open_tables);
pthread_mutex_destroy(&tina_mutex);
return 0;
@@ -148,9 +148,9 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
If share is not present in the hash, create a new share and
initialize its members.
*/
- if (!(share=(TINA_SHARE*) hash_search(&tina_open_tables,
- (uchar*) table_name,
- length)))
+ if (!(share=(TINA_SHARE*) my_hash_search(&tina_open_tables,
+ (uchar*) table_name,
+ length)))
{
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
&share, sizeof(*share),
@@ -377,7 +377,7 @@ static int free_share(TINA_SHARE *share)
share->tina_write_opened= FALSE;
}
- hash_delete(&tina_open_tables, (uchar*) share);
+ my_hash_delete(&tina_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
my_free((uchar*) share, MYF(0));
@@ -448,6 +448,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin);
chain= chain_buffer;
file_buff= new Transparent_file();
+ init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);;
}
@@ -594,7 +595,7 @@ int ha_tina::find_current_row(uchar *buf)
bool read_all;
DBUG_ENTER("ha_tina::find_current_row");
- free_root(&blobroot, MYF(MY_MARK_BLOCKS_FREE));
+ free_root(&blobroot, MYF(0));
/*
We do not read further then local_saved_data_file_length in order
@@ -1073,8 +1074,6 @@ int ha_tina::rnd_init(bool scan)
records_is_known= 0;
chain_ptr= chain;
- init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);
-
DBUG_RETURN(0);
}
@@ -1192,6 +1191,7 @@ int ha_tina::extra(enum ha_extra_function operation)
DBUG_RETURN(0);
}
+
/*
Set end_pos to the last valid byte of continuous area, closest
to the given "hole", stored in the buffer. "Valid" here means,
@@ -1394,8 +1394,6 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
/* set current position to the beginning of the file */
current_position= next_position= 0;
- init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);
-
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
@@ -1595,8 +1593,6 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
/* set current position to the beginning of the file */
current_position= next_position= 0;
- init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);
-
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
@@ -1604,7 +1600,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
count--;
current_position= next_position;
}
-
+
free_root(&blobroot, MYF(0));
my_free((char*)buf, MYF(0));
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 02e0700a825..a246d1858e5 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -98,6 +98,7 @@ public:
my_free(chain, 0);
if (file_buff)
delete file_buff;
+ free_root(&blobroot, MYF(0));
}
const char *table_type() const { return "CSV"; }
const char *index_type(uint inx) { return "NONE"; }
diff --git a/storage/example/CMakeLists.txt b/storage/example/CMakeLists.txt
index a328da107bd..f0b1343ab9c 100644
--- a/storage/example/CMakeLists.txt
+++ b/storage/example/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(EXAMPLE_SOURCES ha_example.cc)
MYSQL_STORAGE_ENGINE(EXAMPLE)
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index ce269aee59b..1179a338ee2 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -34,7 +34,7 @@ noinst_HEADERS = ha_example.h
EXTRA_LTLIBRARIES = ha_example.la
pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
-ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
+ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
ha_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_SOURCES = ha_example.cc
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 30fc82c82d2..9bc666663c3 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -133,8 +133,8 @@ static int example_init_func(void *p)
example_hton= (handlerton *)p;
VOID(pthread_mutex_init(&example_mutex,MY_MUTEX_INIT_FAST));
- (void) hash_init(&example_open_tables,system_charset_info,32,0,0,
- (hash_get_key) example_get_key,0,0);
+ (void) my_hash_init(&example_open_tables,system_charset_info,32,0,0,
+ (my_hash_get_key) example_get_key,0,0);
example_hton->state= SHOW_OPTION_YES;
example_hton->create= example_create_handler;
@@ -151,7 +151,7 @@ static int example_done_func(void *p)
if (example_open_tables.records)
error= 1;
- hash_free(&example_open_tables);
+ my_hash_free(&example_open_tables);
pthread_mutex_destroy(&example_mutex);
DBUG_RETURN(0);
@@ -175,9 +175,9 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
pthread_mutex_lock(&example_mutex);
length=(uint) strlen(table_name);
- if (!(share=(EXAMPLE_SHARE*) hash_search(&example_open_tables,
- (uchar*) table_name,
- length)))
+ if (!(share=(EXAMPLE_SHARE*) my_hash_search(&example_open_tables,
+ (uchar*) table_name,
+ length)))
{
if (!(share=(EXAMPLE_SHARE *)
my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
@@ -222,7 +222,7 @@ static int free_share(EXAMPLE_SHARE *share)
pthread_mutex_lock(&example_mutex);
if (!--share->use_count)
{
- hash_delete(&example_open_tables, (uchar*) share);
+ my_hash_delete(&example_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
my_free(share, MYF(0));
@@ -921,6 +921,24 @@ static struct st_mysql_sys_var* example_system_variables[]= {
NULL
};
+// this is an example of SHOW_FUNC and of my_snprintf() service
+static int show_func_example(MYSQL_THD thd, struct st_mysql_show_var *var,
+ char *buf)
+{
+ var->type= SHOW_CHAR;
+ var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
+ my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
+ "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension
+ srv_enum_var, srv_ulong_var, "really");
+ return 0;
+}
+
+static struct st_mysql_show_var func_status[]=
+{
+ {"example_func_example", (char *)show_func_example, SHOW_FUNC},
+ {0,0,SHOW_UNDEF}
+};
+
mysql_declare_plugin(example)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -932,7 +950,7 @@ mysql_declare_plugin(example)
example_init_func, /* Plugin Init */
example_done_func, /* Plugin Deinit */
0x0001 /* 0.1 */,
- NULL, /* status variables */
+ func_status, /* status variables */
example_system_variables, /* system variables */
NULL /* config options */
}
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index a3fa42d7d05..05be8b27a8b 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -459,8 +459,8 @@ int federated_db_init(void *p)
if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST))
goto error;
- if (!hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0,
- (hash_get_key) federated_get_key, 0, 0))
+ if (!my_hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0,
+ (my_hash_get_key) federated_get_key, 0, 0))
{
DBUG_RETURN(FALSE);
}
@@ -483,7 +483,7 @@ error:
int federated_done(void *p)
{
- hash_free(&federated_open_tables);
+ my_hash_free(&federated_open_tables);
VOID(pthread_mutex_destroy(&federated_mutex));
return 0;
@@ -1495,10 +1495,10 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
goto error;
/* TODO: change tmp_share.scheme to LEX_STRING object */
- if (!(share= (FEDERATED_SHARE *) hash_search(&federated_open_tables,
- (uchar*) tmp_share.share_key,
- tmp_share.
- share_key_length)))
+ if (!(share= (FEDERATED_SHARE *) my_hash_search(&federated_open_tables,
+ (uchar*) tmp_share.share_key,
+ tmp_share.
+ share_key_length)))
{
query.set_charset(system_charset_info);
query.append(STRING_WITH_LEN("SELECT "));
@@ -1560,7 +1560,7 @@ static int free_share(FEDERATED_SHARE *share)
pthread_mutex_lock(&federated_mutex);
if (!--share->use_count)
{
- hash_delete(&federated_open_tables, (uchar*) share);
+ my_hash_delete(&federated_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->mutex));
free_root(&mem_root, MYF(0));
@@ -2892,7 +2892,7 @@ int ha_federated::info(uint flag)
}
if (flag & HA_STATUS_AUTO)
- stats.auto_increment_value= mysql->last_used_con->insert_id;
+ stats.auto_increment_value= mysql->insert_id;
mysql_free_result(result);
diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt
index c2d2cd1290f..4a0fa22c8f1 100755
--- a/storage/heap/CMakeLists.txt
+++ b/storage/heap/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 1c0aa177fba..1c3a86fb2b3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1138,7 +1138,29 @@ innobase_mysql_tmpfile(void)
will be passed to fdopen(), it will be closed by invoking
fclose(), which in turn will invoke close() instead of
my_close(). */
+
+#ifdef _WIN32
+ /* Note that on Windows, the integer returned by mysql_tmpfile
+ has no relation to C runtime file descriptor. Here, we need
+ to call my_get_osfhandle to get the HANDLE and then convert it
+ to C runtime filedescriptor. */
+ {
+ HANDLE hFile = my_get_osfhandle(fd);
+ HANDLE hDup;
+ BOOL bOK =
+ DuplicateHandle(GetCurrentProcess(), hFile, GetCurrentProcess(),
+ &hDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
+ if(bOK) {
+ fd2 = _open_osfhandle((intptr_t)hDup,0);
+ }
+ else {
+ my_osmaperr(GetLastError());
+ fd2 = -1;
+ }
+ }
+#else
fd2 = dup(fd);
+#endif
if (fd2 < 0) {
DBUG_PRINT("error",("Got error %d on dup",fd2));
my_errno=errno;
@@ -4514,7 +4536,7 @@ calc_row_difference(
upd_t* uvect, /*!< in/out: update vector */
uchar* old_row, /*!< in: old row in MySQL format */
uchar* new_row, /*!< in: new row in MySQL format */
- struct st_table* table, /*!< in: table in MySQL data
+ TABLE* table, /*!< in: table in MySQL data
dictionary */
uchar* upd_buff, /*!< in: buffer to use */
ulint buff_len, /*!< in: buffer length */
diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h
index 985b76f4f50..7f5af6d2e76 100644
--- a/storage/innobase/include/handler0alter.h
+++ b/storage/innobase/include/handler0alter.h
@@ -27,7 +27,7 @@ UNIV_INTERN
void
innobase_rec_to_mysql(
/*==================*/
- TABLE* table, /*!< in/out: MySQL table */
+ struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */
const ulint* offsets); /*!< in: rec_get_offsets(
@@ -39,4 +39,4 @@ UNIV_INTERN
void
innobase_rec_reset(
/*===============*/
- TABLE* table); /*!< in/out: MySQL table */
+ struct TABLE* table); /*!< in/out: MySQL table */
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 62a5efd11f7..fbeb125ce7b 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -191,7 +191,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table); /*!< in/out: MySQL table, for
+ struct TABLE* table); /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
#endif /* row0merge.h */
diff --git a/storage/innobase/include/row0types.h b/storage/innobase/include/row0types.h
index 7920fd75061..1be729206ba 100644
--- a/storage/innobase/include/row0types.h
+++ b/storage/innobase/include/row0types.h
@@ -54,6 +54,6 @@ typedef struct purge_node_struct purge_node_t;
typedef struct row_ext_struct row_ext_t;
/* MySQL data types */
-typedef struct st_table TABLE;
+struct TABLE;
#endif
diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
index 25f041c0885..232211e5ce7 100644
--- a/storage/innobase/row/row0merge.c
+++ b/storage/innobase/row/row0merge.c
@@ -408,7 +408,7 @@ row_merge_buf_add(
/** Structure for reporting duplicate records. */
struct row_merge_dup_struct {
const dict_index_t* index; /*!< index being sorted */
- TABLE* table; /*!< MySQL table object */
+ struct TABLE* table; /*!< MySQL table object */
ulint n_dup; /*!< number of duplicates */
};
@@ -1100,7 +1100,7 @@ ulint
row_merge_read_clustered_index(
/*===========================*/
trx_t* trx, /*!< in: transaction */
- TABLE* table, /*!< in/out: MySQL table object,
+ struct TABLE* table, /*!< in/out: MySQL table object,
for reporting erroneous records */
const dict_table_t* old_table,/*!< in: table where rows are
read from */
@@ -1388,7 +1388,7 @@ row_merge_blocks(
ulint* foffs1, /*!< in/out: offset of second
source list in the file */
merge_file_t* of, /*!< in/out: output file */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -1570,7 +1570,7 @@ row_merge(
ulint* half, /*!< in/out: half the file */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -1678,7 +1678,7 @@ row_merge_sort(
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -2458,7 +2458,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt
index c05e0046e64..829d89a798a 100755
--- a/storage/myisam/CMakeLists.txt
+++ b/storage/myisam/CMakeLists.txt
@@ -15,8 +15,6 @@
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc
@@ -34,16 +32,16 @@ MYSQL_STORAGE_ENGINE(MYISAM)
IF(NOT SOURCE_SUBLIBS)
ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
- TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32)
+ TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys dbug strings zlib)
ADD_EXECUTABLE(myisamchk myisamchk.c)
- TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32)
+ TARGET_LINK_LIBRARIES(myisamchk myisam mysys dbug strings zlib)
ADD_EXECUTABLE(myisamlog myisamlog.c)
- TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32)
+ TARGET_LINK_LIBRARIES(myisamlog myisam mysys dbug strings zlib)
ADD_EXECUTABLE(myisampack myisampack.c)
- TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32)
+ TARGET_LINK_LIBRARIES(myisampack myisam mysys dbug strings zlib)
SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj")
diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c
index 1b6c7458fd7..16cbfa1dada 100644
--- a/storage/myisam/ft_static.c
+++ b/storage/myisam/ft_static.c
@@ -30,8 +30,8 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
0, /* Bit pos */
HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */
HA_FT_MAXBYTELEN, /* length */
- HA_KEYTYPE_VARTEXT2, /* type */
63, /* language (will be overwritten) */
+ HA_KEYTYPE_VARTEXT2, /* type */
0, /* null_bit */
2, 0, 0 /* bit_start, bit_end, bit_length */
},
@@ -41,7 +41,7 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
be packed in any way, otherwise w_search() won't be able to
update key entry 'in vivo'
*/
- 0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0
+ 0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 63, HA_FT_WTYPE, 0, 0, 0, 0
}
};
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 696b9ff93df..79f1ea0e4e5 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -66,9 +66,12 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
{
DBUG_ENTER("mi_dynmap_file");
- if (size > (my_off_t) (~((size_t) 0)))
+ if (size == 0 || size > (my_off_t) (~((size_t) 0)))
{
- DBUG_PRINT("warning", ("File is too large for mmap"));
+ if (size)
+ DBUG_PRINT("warning", ("File is too large for mmap"));
+ else
+ DBUG_PRINT("warning", ("Do not mmap zero-length"));
DBUG_RETURN(1);
}
/*
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index 6a4c21160f4..8a5866ae763 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -236,7 +236,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
break; /* Impossible */
}
}
-#ifdef __WIN__
+#ifdef _WIN32
else
{
/*
@@ -455,11 +455,11 @@ int _mi_writeinfo(register MI_INFO *info, uint operation)
share->state.update_count= info->last_loop= ++info->this_loop;
if ((error=mi_state_info_write(share->kfile, &share->state, 1)))
olderror=my_errno;
-#ifdef __WIN__
+#ifdef _WIN32
if (myisam_flush)
{
- _commit(share->kfile);
- _commit(info->dfile);
+ my_sync(share->kfile,0);
+ my_sync(info->dfile,0);
}
#endif
}
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index e18146f2357..9117d76de24 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -1130,10 +1130,10 @@ int mi_keyseg_write(File file, const HA_KEYSEG *keyseg)
ulong pos;
*ptr++= keyseg->type;
- *ptr++= keyseg->language;
+ *ptr++= keyseg->language & 0xFF; /* Collation ID, low byte */
*ptr++= keyseg->null_bit;
*ptr++= keyseg->bit_start;
- *ptr++= keyseg->bit_end;
+ *ptr++= keyseg->language >> 8; /* Collation ID, high byte */
*ptr++= keyseg->bit_length;
mi_int2store(ptr,keyseg->flag); ptr+=2;
mi_int2store(ptr,keyseg->length); ptr+=2;
@@ -1152,12 +1152,13 @@ uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg)
keyseg->language = *ptr++;
keyseg->null_bit = *ptr++;
keyseg->bit_start = *ptr++;
- keyseg->bit_end = *ptr++;
+ keyseg->language += ((uint16) (*ptr++)) << 8;
keyseg->bit_length = *ptr++;
keyseg->flag = mi_uint2korr(ptr); ptr +=2;
keyseg->length = mi_uint2korr(ptr); ptr +=2;
keyseg->start = mi_uint4korr(ptr); ptr +=4;
keyseg->null_pos = mi_uint4korr(ptr); ptr +=4;
+ keyseg->bit_end= 0;
keyseg->charset=0; /* Will be filled in later */
if (keyseg->null_bit)
/* We adjust bit_pos if null_bit is last in the byte */
diff --git a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt
index 60cfffc67ff..c545d04a780 100755
--- a/storage/myisammrg/CMakeLists.txt
+++ b/storage/myisammrg/CMakeLists.txt
@@ -12,8 +12,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index addec5bb58a..471e2243aac 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -153,7 +153,7 @@ extern "C" void myrg_print_wrong_table(const char *table_name)
buf[db.length]= '.';
memcpy(buf + db.length + 1, name.str, name.length);
buf[db.length + name.length + 1]= 0;
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ADMIN_WRONG_MRG_TABLE, ER(ER_ADMIN_WRONG_MRG_TABLE),
buf);
}
diff --git a/storage/mysql_storage_engine.cmake b/storage/mysql_storage_engine.cmake
index af8c3a85cd1..b920f16452b 100644
--- a/storage/mysql_storage_engine.cmake
+++ b/storage/mysql_storage_engine.cmake
@@ -34,7 +34,7 @@ IF(NOT SOURCE_SUBLIBS)
#The dll is linked to the mysqld executable
SET(dyn_libname ha_${libname})
ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES})
- TARGET_LINK_LIBRARIES (${dyn_libname} mysqld)
+ TARGET_LINK_LIBRARIES (${dyn_libname} mysqlservices mysqld)
IF(${engine}_LIBS)
TARGET_LINK_LIBRARIES(${dyn_libname} ${${engine}_LIBS})
ENDIF(${engine}_LIBS)
diff --git a/storage/ndb/test/run-test/setup.cpp b/storage/ndb/test/run-test/setup.cpp
index cbb7a34f171..60f8285888c 100644
--- a/storage/ndb/test/run-test/setup.cpp
+++ b/storage/ndb/test/run-test/setup.cpp
@@ -105,6 +105,8 @@ setup_config(atrt_config& config)
*/
for (j = 0; j<(size_t)argc; j++)
{
+ if (tmp[j] == args_separator) /* skip arguments separator */
+ continue;
for (k = 0; proc_args[k].name; k++)
{
if (!strncmp(tmp[j], proc_args[k].name, strlen(proc_args[k].name)))
@@ -369,6 +371,12 @@ load_options(int argc, char** argv, int type, atrt_options& opts)
{
for (size_t i = 0; i<(size_t)argc; i++)
{
+ /**
+ * Skip the separator for arguments from config file and command
+ * line
+ */
+ if (argv[i] == args_separator)
+ continue;
for (size_t j = 0; f_options[j].name; j++)
{
const char * name = f_options[j].name;
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 3d9de566670..294a129fc1b 100755
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 7e742050aa8..73ade93f6e1 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -23,7 +23,7 @@
#define ROW16_LEN 8
#define MAX_BUF 64*1024
-static CHARSET_INFO all_charsets[256];
+static CHARSET_INFO all_charsets[512];
void
@@ -63,7 +63,9 @@ print_array16(FILE *f, const char *set, const char *name, uint16 *a, int n)
static int get_charset_number(const char *charset_name)
{
CHARSET_INFO *cs;
- for (cs= all_charsets; cs < all_charsets+255; ++cs)
+ for (cs= all_charsets;
+ cs < all_charsets + array_elements(all_charsets);
+ cs++)
{
if ( cs->name && !strcmp(cs->name, charset_name))
return cs->number;
@@ -184,11 +186,12 @@ void dispcset(FILE *f,CHARSET_INFO *cs)
{
fprintf(f,"{\n");
fprintf(f," %d,%d,%d,\n",cs->number,0,0);
- fprintf(f," MY_CS_COMPILED%s%s%s%s,\n",
+ fprintf(f," MY_CS_COMPILED%s%s%s%s%s,\n",
cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "",
cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "",
is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "",
- my_charset_is_8bit_pure_ascii(cs) ? "|MY_CS_PUREASCII" : "");
+ my_charset_is_8bit_pure_ascii(cs) ? "|MY_CS_PUREASCII" : "",
+ !my_charset_is_ascii_compatible(cs) ? "|MY_CS_NONASCII": "");
if (cs->name)
{
@@ -287,7 +290,9 @@ main(int argc, char **argv __attribute__((unused)))
sprintf(filename,"%s/%s",argv[1],"Index.xml");
my_read_charset_file(filename);
- for (cs=all_charsets; cs < all_charsets+256; cs++)
+ for (cs= all_charsets;
+ cs < all_charsets + array_elements(all_charsets);
+ cs++)
{
if (cs->number && !(cs->state & MY_CS_COMPILED))
{
@@ -312,7 +317,9 @@ main(int argc, char **argv __attribute__((unused)))
fprintf(f,"#include <m_ctype.h>\n\n");
- for (cs=all_charsets; cs < all_charsets+256; cs++)
+ for (cs= all_charsets;
+ cs < all_charsets + array_elements(all_charsets);
+ cs++)
{
if (simple_cs_is_full(cs))
{
@@ -329,7 +336,9 @@ main(int argc, char **argv __attribute__((unused)))
}
fprintf(f,"CHARSET_INFO compiled_charsets[] = {\n");
- for (cs=all_charsets; cs < all_charsets+256; cs++)
+ for (cs= all_charsets;
+ cs < all_charsets + array_elements(all_charsets);
+ cs++)
{
if (simple_cs_is_full(cs))
{
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 75244e40435..ba12f3f4267 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -6,7 +6,7 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
-/* Copyright (C) 2000-2007 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -6804,7 +6804,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_swe7
{
10,0,0,
- MY_CS_COMPILED|MY_CS_PRIMARY,
+ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_NONASCII,
"swe7", /* cset name */
"swe7_swedish_ci", /* coll name */
"", /* comment */
@@ -8454,7 +8454,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_swe7
{
82,0,0,
- MY_CS_COMPILED|MY_CS_BINSORT,
+ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII,
"swe7", /* cset name */
"swe7_bin", /* coll name */
"", /* comment */
@@ -8550,72 +8550,6 @@ CHARSET_INFO compiled_charsets[] = {
}
,
#endif
-#ifdef HAVE_CHARSET_geostd8
-{
- 92,0,0,
- MY_CS_COMPILED|MY_CS_PRIMARY,
- "geostd8", /* cset name */
- "geostd8_general_ci", /* coll name */
- "", /* comment */
- NULL, /* tailoring */
- ctype_geostd8_general_ci, /* ctype */
- to_lower_geostd8_general_ci, /* lower */
- to_upper_geostd8_general_ci, /* upper */
- sort_order_geostd8_general_ci, /* sort_order */
- NULL, /* contractions */
- NULL, /* sort_order_big*/
- to_uni_geostd8_general_ci, /* to_uni */
- NULL, /* from_uni */
- my_unicase_default, /* caseinfo */
- NULL, /* state map */
- NULL, /* ident map */
- 1, /* strxfrm_multiply*/
- 1, /* caseup_multiply*/
- 1, /* casedn_multiply*/
- 1, /* mbminlen */
- 1, /* mbmaxlen */
- 0, /* min_sort_char */
- 255, /* max_sort_char */
- ' ', /* pad_char */
- 0, /* escape_with_backslash_is_dangerous */
- &my_charset_8bit_handler,
- &my_collation_8bit_simple_ci_handler,
-}
-,
-#endif
-#ifdef HAVE_CHARSET_geostd8
-{
- 93,0,0,
- MY_CS_COMPILED|MY_CS_BINSORT,
- "geostd8", /* cset name */
- "geostd8_bin", /* coll name */
- "", /* comment */
- NULL, /* tailoring */
- ctype_geostd8_bin, /* ctype */
- to_lower_geostd8_bin, /* lower */
- to_upper_geostd8_bin, /* upper */
- NULL, /* sort_order */
- NULL, /* contractions */
- NULL, /* sort_order_big*/
- to_uni_geostd8_bin, /* to_uni */
- NULL, /* from_uni */
- my_unicase_default, /* caseinfo */
- NULL, /* state map */
- NULL, /* ident map */
- 1, /* strxfrm_multiply*/
- 1, /* caseup_multiply*/
- 1, /* casedn_multiply*/
- 1, /* mbminlen */
- 1, /* mbmaxlen */
- 0, /* min_sort_char */
- 255, /* max_sort_char */
- ' ', /* pad_char */
- 0, /* escape_with_backslash_is_dangerous */
- &my_charset_8bit_handler,
- &my_collation_8bit_bin_handler,
-}
-,
-#endif
#ifdef HAVE_CHARSET_latin1
{
94,0,0,
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index ac426e0d7b5..60280efe087 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4672,7 +4672,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_sjis_japanese_ci=
{
13,0,0, /* number */
- MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
+ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_NONASCII, /* state */
"sjis", /* cs name */
"sjis_japanese_ci", /* name */
"", /* comment */
@@ -4704,7 +4704,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
CHARSET_INFO my_charset_sjis_bin=
{
88,0,0, /* number */
- MY_CS_COMPILED|MY_CS_BINSORT, /* state */
+ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, /* state */
"sjis", /* cs name */
"sjis_bin", /* name */
"", /* comment */
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 6ae0cc3a293..541eb7afeb9 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6712,6 +6712,34 @@ static const char hungarian[]=
"&O < \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150"
"&U < \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170";
+/*
+ SCCII Part 1 : Collation Sequence (SLS1134)
+ 2006/11/24
+ Harshula Jayasuriya <harshula at gmail dot com>
+ Language Technology Research Lab, University of Colombo / ICTA
+*/
+#if 0
+static const char sinhala[]=
+ "& \\u0D96 < \\u0D82 < \\u0D83"
+ "& \\u0DA5 < \\u0DA4"
+ "& \\u0DD8 < \\u0DF2 < \\u0DDF < \\u0DF3"
+ "& \\u0DDE < \\u0DCA";
+#else
+static const char sinhala[]=
+ "& \\u0D96 < \\u0D82 < \\u0D83 < \\u0D9A < \\u0D9B < \\u0D9C < \\u0D9D"
+ "< \\u0D9E < \\u0D9F < \\u0DA0 < \\u0DA1 < \\u0DA2 < \\u0DA3"
+ "< \\u0DA5 < \\u0DA4 < \\u0DA6"
+ "< \\u0DA7 < \\u0DA8 < \\u0DA9 < \\u0DAA < \\u0DAB < \\u0DAC"
+ "< \\u0DAD < \\u0DAE < \\u0DAF < \\u0DB0 < \\u0DB1"
+ "< \\u0DB3 < \\u0DB4 < \\u0DB5 < \\u0DB6 < \\u0DB7 < \\u0DB8"
+ "< \\u0DB9 < \\u0DBA < \\u0DBB < \\u0DBD < \\u0DC0 < \\u0DC1"
+ "< \\u0DC2 < \\u0DC3 < \\u0DC4 < \\u0DC5 < \\u0DC6"
+ "< \\u0DCF"
+ "< \\u0DD0 < \\u0DD1 < \\u0DD2 < \\u0DD3 < \\u0DD4 < \\u0DD6"
+ "< \\u0DD8 < \\u0DF2 < \\u0DDF < \\u0DF3 < \\u0DD9 < \\u0DDA"
+ "< \\u0DDB < \\u0DDC < \\u0DDD < \\u0DDE < \\u0DCA";
+#endif
+
/*
Unicode Collation Algorithm:
@@ -8090,7 +8118,7 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
CHARSET_INFO my_charset_ucs2_unicode_ci=
{
128,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_unicode_ci", /* name */
"", /* comment */
@@ -8122,7 +8150,7 @@ CHARSET_INFO my_charset_ucs2_unicode_ci=
CHARSET_INFO my_charset_ucs2_icelandic_uca_ci=
{
129,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_icelandic_ci",/* name */
"", /* comment */
@@ -8154,7 +8182,7 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci=
CHARSET_INFO my_charset_ucs2_latvian_uca_ci=
{
130,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_latvian_ci", /* name */
"", /* comment */
@@ -8186,7 +8214,7 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci=
CHARSET_INFO my_charset_ucs2_romanian_uca_ci=
{
131,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_romanian_ci", /* name */
"", /* comment */
@@ -8218,7 +8246,7 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci=
CHARSET_INFO my_charset_ucs2_slovenian_uca_ci=
{
132,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_slovenian_ci",/* name */
"", /* comment */
@@ -8250,7 +8278,7 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci=
CHARSET_INFO my_charset_ucs2_polish_uca_ci=
{
133,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_polish_ci", /* name */
"", /* comment */
@@ -8282,7 +8310,7 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci=
CHARSET_INFO my_charset_ucs2_estonian_uca_ci=
{
134,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_estonian_ci", /* name */
"", /* comment */
@@ -8314,7 +8342,7 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci=
CHARSET_INFO my_charset_ucs2_spanish_uca_ci=
{
135,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_spanish_ci", /* name */
"", /* comment */
@@ -8346,7 +8374,7 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci=
CHARSET_INFO my_charset_ucs2_swedish_uca_ci=
{
136,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_swedish_ci", /* name */
"", /* comment */
@@ -8378,7 +8406,7 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci=
CHARSET_INFO my_charset_ucs2_turkish_uca_ci=
{
137,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_turkish_ci", /* name */
"", /* comment */
@@ -8410,7 +8438,7 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci=
CHARSET_INFO my_charset_ucs2_czech_uca_ci=
{
138,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_czech_ci", /* name */
"", /* comment */
@@ -8443,7 +8471,7 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci=
CHARSET_INFO my_charset_ucs2_danish_uca_ci=
{
139,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_danish_ci", /* name */
"", /* comment */
@@ -8475,7 +8503,7 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci=
CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci=
{
140,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_lithuanian_ci",/* name */
"", /* comment */
@@ -8507,7 +8535,7 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci=
CHARSET_INFO my_charset_ucs2_slovak_uca_ci=
{
141,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_slovak_ci", /* name */
"", /* comment */
@@ -8539,7 +8567,7 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci=
CHARSET_INFO my_charset_ucs2_spanish2_uca_ci=
{
142,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_spanish2_ci", /* name */
"", /* comment */
@@ -8572,7 +8600,7 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci=
CHARSET_INFO my_charset_ucs2_roman_uca_ci=
{
143,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_roman_ci", /* name */
"", /* comment */
@@ -8605,7 +8633,7 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci=
CHARSET_INFO my_charset_ucs2_persian_uca_ci=
{
144,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_persian_ci", /* name */
"", /* comment */
@@ -8638,7 +8666,7 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci=
CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
{
145,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_esperanto_ci",/* name */
"", /* comment */
@@ -8671,7 +8699,7 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
CHARSET_INFO my_charset_ucs2_hungarian_uca_ci=
{
146,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_hungarian_ci",/* name */
"", /* comment */
@@ -8701,6 +8729,39 @@ CHARSET_INFO my_charset_ucs2_hungarian_uca_ci=
};
+CHARSET_INFO my_charset_ucs2_sinhala_uca_ci=
+{
+ 147,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "ucs2", /* csname */
+ "ucs2_sinhala_ci", /* name */
+ "", /* comment */
+ sinhala, /* tailoring */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 2, /* mbminlen */
+ 2, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_ucs2_handler,
+ &my_collation_ucs2_uca_handler
+};
+
+
#endif
@@ -8751,7 +8812,7 @@ extern MY_CHARSET_HANDLER my_charset_utf8_handler;
CHARSET_INFO my_charset_utf8_unicode_ci=
{
192,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_unicode_ci", /* name */
"", /* comment */
@@ -8784,7 +8845,7 @@ CHARSET_INFO my_charset_utf8_unicode_ci=
CHARSET_INFO my_charset_utf8_icelandic_uca_ci=
{
193,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_icelandic_ci",/* name */
"", /* comment */
@@ -8816,7 +8877,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci=
CHARSET_INFO my_charset_utf8_latvian_uca_ci=
{
194,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_latvian_ci", /* name */
"", /* comment */
@@ -8848,7 +8909,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci=
CHARSET_INFO my_charset_utf8_romanian_uca_ci=
{
195,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_romanian_ci", /* name */
"", /* comment */
@@ -8880,7 +8941,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci=
CHARSET_INFO my_charset_utf8_slovenian_uca_ci=
{
196,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_slovenian_ci",/* name */
"", /* comment */
@@ -8912,7 +8973,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci=
CHARSET_INFO my_charset_utf8_polish_uca_ci=
{
197,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_polish_ci", /* name */
"", /* comment */
@@ -8944,7 +9005,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci=
CHARSET_INFO my_charset_utf8_estonian_uca_ci=
{
198,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_estonian_ci", /* name */
"", /* comment */
@@ -8976,7 +9037,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci=
CHARSET_INFO my_charset_utf8_spanish_uca_ci=
{
199,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_spanish_ci", /* name */
"", /* comment */
@@ -9008,7 +9069,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci=
CHARSET_INFO my_charset_utf8_swedish_uca_ci=
{
200,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_swedish_ci", /* name */
"", /* comment */
@@ -9040,7 +9101,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci=
CHARSET_INFO my_charset_utf8_turkish_uca_ci=
{
201,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_turkish_ci", /* name */
"", /* comment */
@@ -9072,7 +9133,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci=
CHARSET_INFO my_charset_utf8_czech_uca_ci=
{
202,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_czech_ci", /* name */
"", /* comment */
@@ -9105,7 +9166,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci=
CHARSET_INFO my_charset_utf8_danish_uca_ci=
{
203,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_danish_ci", /* name */
"", /* comment */
@@ -9137,7 +9198,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci=
CHARSET_INFO my_charset_utf8_lithuanian_uca_ci=
{
204,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_lithuanian_ci",/* name */
"", /* comment */
@@ -9169,7 +9230,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci=
CHARSET_INFO my_charset_utf8_slovak_uca_ci=
{
205,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_slovak_ci", /* name */
"", /* comment */
@@ -9201,7 +9262,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci=
CHARSET_INFO my_charset_utf8_spanish2_uca_ci=
{
206,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_spanish2_ci", /* name */
"", /* comment */
@@ -9233,7 +9294,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci=
CHARSET_INFO my_charset_utf8_roman_uca_ci=
{
207,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_roman_ci", /* name */
"", /* comment */
@@ -9265,7 +9326,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci=
CHARSET_INFO my_charset_utf8_persian_uca_ci=
{
208,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_persian_ci", /* name */
"", /* comment */
@@ -9297,7 +9358,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci=
CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
{
209,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_esperanto_ci",/* name */
"", /* comment */
@@ -9329,7 +9390,7 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
CHARSET_INFO my_charset_utf8_hungarian_uca_ci=
{
210,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"utf8", /* cs name */
"utf8_hungarian_ci",/* name */
"", /* comment */
@@ -9358,6 +9419,38 @@ CHARSET_INFO my_charset_utf8_hungarian_uca_ci=
&my_collation_any_uca_handler
};
+CHARSET_INFO my_charset_utf8_sinhala_uca_ci=
+{
+ 211,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "utf8", /* cs name */
+ "utf8_sinhala_ci", /* name */
+ "", /* comment */
+ sinhala, /* tailoring */
+ ctype_utf8, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 3, /* mbminlen */
+ 3, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf8_handler,
+ &my_collation_any_uca_handler
+};
+
#endif /* HAVE_CHARSET_utf8 */
#endif /* HAVE_UCA_COLLATIONS */
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index a1c691a462b..f030c08523c 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1712,7 +1712,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler=
CHARSET_INFO my_charset_ucs2_general_ci=
{
35,0,0, /* number */
- MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_general_ci", /* name */
"", /* comment */
@@ -1744,7 +1744,7 @@ CHARSET_INFO my_charset_ucs2_general_ci=
CHARSET_INFO my_charset_ucs2_bin=
{
90,0,0, /* number */
- MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE,
+ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII,
"ucs2", /* cs name */
"ucs2_bin", /* name */
"", /* comment */
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index ae942b59caa..91f633e45ce 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4200,7 +4200,7 @@ static MY_CHARSET_HANDLER my_charset_filename_handler=
CHARSET_INFO my_charset_filename=
{
17,0,0, /* number */
- MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN,
+ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN|MY_CS_NONASCII,
"filename", /* cs name */
"filename", /* name */
"", /* comment */
diff --git a/strings/ctype.c b/strings/ctype.c
index 17ad1256e74..75d76aceea3 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -405,3 +405,23 @@ my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs)
}
return 1;
}
+
+
+/*
+ Shared function between conf_to_src and mysys.
+ Check if a 8bit character set is compatible with
+ ascii on the range 0x00..0x7F.
+*/
+my_bool
+my_charset_is_ascii_compatible(CHARSET_INFO *cs)
+{
+ uint i;
+ if (!cs->tab_to_uni)
+ return 1;
+ for (i= 0; i < 128; i++)
+ {
+ if (cs->tab_to_uni[i] != i)
+ return 0;
+ }
+ return 1;
+}
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 920022aae91..ad8e7c8c776 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -18,61 +18,530 @@
#include <stdarg.h>
#include <m_ctype.h>
-/*
- Limited snprintf() implementations
- SYNOPSIS
- my_vsnprintf()
- to Store result here
- n Store up to n-1 characters, followed by an end 0
- fmt printf format
- ap Arguments
-
- IMPLEMENTION:
- Supports following formats:
- %#[l]d
- %#[l]u
- %#[l]x
- %#.#b Local format; note first # is ignored and second is REQUIRED
- %#.#s Note first # is ignored
+#define MAX_ARGS 32 /* max positional args count*/
+#define MAX_PRINT_INFO 32 /* max print position count */
+
+#define LENGTH_ARG 1
+#define WIDTH_ARG 2
+#define PREZERO_ARG 4
+#define ESCAPED_ARG 8
+
+typedef struct pos_arg_info ARGS_INFO;
+typedef struct print_info PRINT_INFO;
+
+struct pos_arg_info
+{
+ char arg_type; /* argument type */
+ uint have_longlong; /* used from integer values */
+ char *str_arg; /* string value of the arg */
+ longlong longlong_arg; /* integer value of the arg */
+ double double_arg; /* double value of the arg */
+};
+
+
+struct print_info
+{
+ char arg_type; /* argument type */
+ size_t arg_idx; /* index of the positional arg */
+ size_t length; /* print width or arg index */
+ size_t width; /* print width or arg index */
+ uint flags;
+ const char *begin; /**/
+ const char *end; /**/
+};
+
+
+/**
+ Calculates print length or index of positional argument
+
+ @param fmt processed string
+ @param length print length or index of positional argument
+ @param pre_zero returns flags with PREZERO_ARG set if necessary
+
+ @retval
+ string position right after length digits
+*/
+
+static const char *get_length(const char *fmt, size_t *length, uint *pre_zero)
+{
+ for (; my_isdigit(&my_charset_latin1, *fmt); fmt++)
+ {
+ *length= *length * 10 + (uint)(*fmt - '0');
+ if (!*length)
+ *pre_zero|= PREZERO_ARG; /* first digit was 0 */
+ }
+ return fmt;
+}
+
+
+/**
+ Calculates print width or index of positional argument
+
+ @param fmt processed string
+ @param width print width or index of positional argument
+
+ @retval
+ string position right after width digits
+*/
+
+static const char *get_width(const char *fmt, size_t *width)
+{
+ for (; my_isdigit(&my_charset_latin1, *fmt); fmt++)
+ {
+ *width= *width * 10 + (uint)(*fmt - '0');
+ }
+ return fmt;
+}
+
+/**
+ Calculates print width or index of positional argument
+
+ @param fmt processed string
+ @param have_longlong TRUE if longlong is required
+
+ @retval
+ string position right after modifier symbol
+*/
+
+static const char *check_longlong(const char *fmt, uint *have_longlong)
+{
+ *have_longlong= 0;
+ if (*fmt == 'l')
+ {
+ fmt++;
+ if (*fmt != 'l')
+ *have_longlong= (sizeof(long) == sizeof(longlong));
+ else
+ {
+ fmt++;
+ *have_longlong= 1;
+ }
+ }
+ else if (*fmt == 'z')
+ {
+ fmt++;
+ *have_longlong= (sizeof(size_t) == sizeof(longlong));
+ }
+ return fmt;
+}
+
+
+/**
+ Returns escaped string
+
+ @param cs string charset
+ @param to buffer where escaped string will be placed
+ @param end end of buffer
+ @param par string to escape
+ @param par_len string length
+ @param quote_char character for quoting
+
+ @retval
+ position in buffer which points on the end of escaped string
+*/
+
+static char *backtick_string(CHARSET_INFO *cs, char *to, char *end,
+ char *par, size_t par_len, char quote_char)
+{
+ uint char_len;
+ char *start= to;
+ char *par_end= par + par_len;
+ size_t buff_length= (size_t) (end - to);
+
+ if (buff_length <= par_len)
+ goto err;
+ *start++= quote_char;
+
+ for ( ; par < par_end; par+= char_len)
+ {
+ uchar c= *(uchar *) par;
+ if (!(char_len= my_mbcharlen(cs, c)))
+ char_len= 1;
+ if (char_len == 1 && c == (uchar) quote_char )
+ {
+ if (start + 1 >= end)
+ goto err;
+ *start++= quote_char;
+ }
+ if (start + char_len >= end)
+ goto err;
+ start= strnmov(start, par, char_len);
+ }
- RETURN
+ if (start + 1 >= end)
+ goto err;
+ *start++= quote_char;
+ return start;
+
+err:
+ *to='\0';
+ return to;
+}
+
+
+/**
+ Prints string argument
+*/
+
+static char *process_str_arg(CHARSET_INFO *cs, char *to, char *end,
+ size_t width, char *par, uint print_type)
+{
+ int well_formed_error;
+ size_t plen, left_len= (size_t) (end - to) + 1;
+ if (!par)
+ par = (char*) "(null)";
+
+ plen= strnlen(par, width);
+ if (left_len <= plen)
+ plen = left_len - 1;
+ plen= cs->cset->well_formed_len(cs, par, par + plen,
+ width, &well_formed_error);
+ if (print_type & ESCAPED_ARG)
+ to= backtick_string(cs, to, end, par, plen, '`');
+ else
+ to= strnmov(to,par,plen);
+ return to;
+}
+
+
+/**
+ Prints binary argument
+*/
+
+static char *process_bin_arg(char *to, char *end, size_t width, char *par)
+{
+ DBUG_ASSERT(to <= end);
+ if (to + width + 1 > end)
+ width= end - to - 1; /* sign doesn't matter */
+ memmove(to, par, width);
+ to+= width;
+ return to;
+}
+
+
+/**
+ Prints integer argument
+*/
+
+static char *process_int_arg(char *to, char *end, size_t length,
+ longlong par, char arg_type, uint print_type)
+{
+ size_t res_length, to_length;
+ char *store_start= to, *store_end;
+ char buff[32];
+
+ if ((to_length= (size_t) (end-to)) < 16 || length)
+ store_start= buff;
+
+ if (arg_type == 'd')
+ store_end= int10_to_str(par, store_start, -10);
+ else if (arg_type == 'u')
+ store_end= int10_to_str(par, store_start, 10);
+ else if (arg_type == 'p')
+ {
+ store_start[0]= '0';
+ store_start[1]= 'x';
+ store_end= int2str(par, store_start + 2, 16, 0);
+ }
+ else
+ {
+ DBUG_ASSERT(arg_type == 'X' || arg_type =='x');
+ store_end= int2str(par, store_start, 16, (arg_type == 'X'));
+ }
+
+ if ((res_length= (size_t) (store_end - store_start)) > to_length)
+ return to; /* num doesn't fit in output */
+ /* If %#d syntax was used, we have to pre-zero/pre-space the string */
+ if (store_start == buff)
+ {
+ length= min(length, to_length);
+ if (res_length < length)
+ {
+ size_t diff= (length- res_length);
+ bfill(to, diff, (print_type & PREZERO_ARG) ? '0' : ' ');
+ if (arg_type == 'p' && print_type & PREZERO_ARG)
+ {
+ if (diff > 1)
+ to[1]= 'x';
+ else
+ store_start[0]= 'x';
+ store_start[1]= '0';
+ }
+ to+= diff;
+ }
+ bmove(to, store_start, res_length);
+ }
+ to+= res_length;
+ return to;
+}
+
+
+/**
+ Procesed positional arguments.
+
+ @param cs string charset
+ @param to buffer where processed string will be place
+ @param end end of buffer
+ @param par format string
+ @param arg_index arg index of the first occurrence of positional arg
+ @param ap list of parameters
+
+ @retval
+ end of buffer where processed string is placed
+*/
+
+static char *process_args(CHARSET_INFO *cs, char *to, char *end,
+ const char* fmt, size_t arg_index, va_list ap)
+{
+ ARGS_INFO args_arr[MAX_ARGS];
+ PRINT_INFO print_arr[MAX_PRINT_INFO];
+ uint idx= 0, arg_count= arg_index;
+
+start:
+ /* Here we are at the beginning of positional argument, right after $ */
+ arg_index--;
+ print_arr[idx].flags= 0;
+ if (*fmt == '`')
+ {
+ print_arr[idx].flags|= ESCAPED_ARG;
+ fmt++;
+ }
+ if (*fmt == '-')
+ fmt++;
+ print_arr[idx].length= print_arr[idx].width= 0;
+ /* Get print length */
+ if (*fmt == '*')
+ {
+ fmt++;
+ fmt= get_length(fmt, &print_arr[idx].length, &print_arr[idx].flags);
+ print_arr[idx].length--;
+ DBUG_ASSERT(*fmt == '$' && print_arr[idx].length < MAX_ARGS);
+ args_arr[print_arr[idx].length].arg_type= 'd';
+ print_arr[idx].flags|= LENGTH_ARG;
+ arg_count= max(arg_count, print_arr[idx].length + 1);
+ fmt++;
+ }
+ else
+ fmt= get_length(fmt, &print_arr[idx].length, &print_arr[idx].flags);
+
+ if (*fmt == '.')
+ {
+ fmt++;
+ /* Get print width */
+ if (*fmt == '*')
+ {
+ fmt++;
+ fmt= get_width(fmt, &print_arr[idx].width);
+ print_arr[idx].width--;
+ DBUG_ASSERT(*fmt == '$' && print_arr[idx].width < MAX_ARGS);
+ args_arr[print_arr[idx].width].arg_type= 'd';
+ print_arr[idx].flags|= WIDTH_ARG;
+ arg_count= max(arg_count, print_arr[idx].width + 1);
+ fmt++;
+ }
+ else
+ fmt= get_width(fmt, &print_arr[idx].width);
+ }
+ else
+ print_arr[idx].width= SIZE_T_MAX;
+
+ fmt= check_longlong(fmt, &args_arr[arg_index].have_longlong);
+ if (*fmt == 'p')
+ args_arr[arg_index].have_longlong= (sizeof(void *) == sizeof(longlong));
+ args_arr[arg_index].arg_type= print_arr[idx].arg_type= *fmt;
+
+ print_arr[idx].arg_idx= arg_index;
+ print_arr[idx].begin= ++fmt;
+
+ while (*fmt && *fmt != '%')
+ fmt++;
+
+ if (!*fmt) /* End of format string */
+ {
+ uint i;
+ print_arr[idx].end= fmt;
+ /* Obtain parameters from the list */
+ for (i= 0 ; i < arg_count; i++)
+ {
+ switch (args_arr[i].arg_type) {
+ case 's':
+ case 'b':
+ args_arr[i].str_arg= va_arg(ap, char *);
+ break;
+ case 'f':
+ case 'g':
+ args_arr[i].double_arg= va_arg(ap, double);
+ break;
+ case 'd':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'p':
+ if (args_arr[i].have_longlong)
+ args_arr[i].longlong_arg= va_arg(ap,longlong);
+ else if (args_arr[i].arg_type == 'd')
+ args_arr[i].longlong_arg= va_arg(ap, int);
+ else
+ args_arr[i].longlong_arg= va_arg(ap, uint);
+ break;
+ case 'c':
+ args_arr[i].longlong_arg= va_arg(ap, int);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ }
+ }
+ /* Print result string */
+ for (i= 0; i <= idx; i++)
+ {
+ uint width= 0, length= 0;
+ switch (print_arr[i].arg_type) {
+ case 's':
+ {
+ char *par= args_arr[print_arr[i].arg_idx].str_arg;
+ width= (print_arr[i].flags & WIDTH_ARG) ?
+ args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
+ to= process_str_arg(cs, to, end, width, par, print_arr[i].flags);
+ break;
+ }
+ case 'b':
+ {
+ char *par = args_arr[print_arr[i].arg_idx].str_arg;
+ width= (print_arr[i].flags & WIDTH_ARG) ?
+ args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
+ to= process_bin_arg(to, end, width, par);
+ break;
+ }
+ case 'c':
+ {
+ if (to == end)
+ break;
+ *to++= (char) args_arr[print_arr[i].arg_idx].longlong_arg;
+ break;
+ }
+ case 'd':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'p':
+ {
+ /* Integer parameter */
+ longlong larg;
+ length= (print_arr[i].flags & LENGTH_ARG) ?
+ args_arr[print_arr[i].length].longlong_arg : print_arr[i].length;
+
+ if (args_arr[print_arr[i].arg_idx].have_longlong)
+ larg = args_arr[print_arr[i].arg_idx].longlong_arg;
+ else if (print_arr[i].arg_type == 'd')
+ larg = (int) args_arr[print_arr[i].arg_idx].longlong_arg;
+ else
+ larg= (uint) args_arr[print_arr[i].arg_idx].longlong_arg;
+
+ to= process_int_arg(to, end, length, larg, print_arr[i].arg_type,
+ print_arr[i].flags);
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (to == end)
+ break;
+
+ length= min(end - to , print_arr[i].end - print_arr[i].begin);
+ if (to + length < end)
+ length++;
+ to= strnmov(to, print_arr[i].begin, length);
+ }
+ DBUG_ASSERT(to <= end);
+ *to='\0'; /* End of errmessage */
+ return to;
+ }
+ else
+ {
+ /* Process next positional argument*/
+ DBUG_ASSERT(*fmt == '%');
+ print_arr[idx].end= fmt - 1;
+ idx++;
+ fmt++;
+ arg_index= 0;
+ fmt= get_width(fmt, &arg_index);
+ DBUG_ASSERT(*fmt == '$');
+ fmt++;
+ arg_count= max(arg_count, arg_index);
+ goto start;
+ }
+ DBUG_ASSERT(0);
+ return 0;
+}
+
+
+
+/**
+ Produces output string according to a format string
+
+ See the detailed documentation around my_snprintf_service_st
+
+ @param cs string charset
+ @param to buffer where processed string will be place
+ @param n size of buffer
+ @param par format string
+ @param ap list of parameters
+
+ @retval
length of result string
*/
-size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
+size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
+ const char* fmt, va_list ap)
{
char *start=to, *end=to+n-1;
size_t length, width;
- uint pre_zero, have_long;
+ uint print_type, have_longlong;
for (; *fmt ; fmt++)
{
if (*fmt != '%')
{
- if (to == end) /* End of buffer */
+ if (to == end) /* End of buffer */
break;
- *to++= *fmt; /* Copy ordinary char */
+ *to++= *fmt; /* Copy ordinary char */
continue;
}
fmt++; /* skip '%' */
- /* Read max fill size (only used with %d and %u) */
- if (*fmt == '-')
- fmt++;
+
length= width= 0;
- pre_zero= have_long= 0;
- if (*fmt == '*')
+ print_type= 0;
+
+ /* Read max fill size (only used with %d and %u) */
+ if (my_isdigit(&my_charset_latin1, *fmt))
{
- fmt++;
- length= va_arg(ap, int);
+ fmt= get_length(fmt, &length, &print_type);
+ if (*fmt == '$')
+ {
+ to= process_args(cs, to, end, (fmt+1), length, ap);
+ return (size_t) (to - start);
+ }
}
else
- for (; my_isdigit(&my_charset_latin1, *fmt); fmt++)
+ {
+ if (*fmt == '`')
+ {
+ print_type|= ESCAPED_ARG;
+ fmt++;
+ }
+ if (*fmt == '-')
+ fmt++;
+ if (*fmt == '*')
{
- length= length * 10 + (uint)(*fmt - '0');
- if (!length)
- pre_zero= 1; /* first digit was 0 */
+ fmt++;
+ length= va_arg(ap, int);
}
+ else
+ fmt= get_length(fmt, &length, &print_type);
+ }
+
if (*fmt == '.')
{
fmt++;
@@ -82,75 +551,41 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
width= va_arg(ap, int);
}
else
- for (; my_isdigit(&my_charset_latin1, *fmt); fmt++)
- width= width * 10 + (uint)(*fmt - '0');
+ fmt= get_width(fmt, &width);
}
else
- width= ~0;
- if (*fmt == 'l')
- {
- fmt++;
- have_long= 1;
- }
+ width= SIZE_T_MAX;
+
+ fmt= check_longlong(fmt, &have_longlong);
+
if (*fmt == 's') /* String parameter */
{
- reg2 char *par = va_arg(ap, char *);
- size_t plen,left_len = (size_t) (end - to) + 1;
- if (!par) par = (char*)"(null)";
- plen= (uint) strnlen(par, width);
- if (left_len <= plen)
- plen = left_len - 1;
- to=strnmov(to,par,plen);
+ reg2 char *par= va_arg(ap, char *);
+ to= process_str_arg(cs, to, end, width, par, print_type);
continue;
}
else if (*fmt == 'b') /* Buffer parameter */
{
char *par = va_arg(ap, char *);
- DBUG_ASSERT(to <= end);
- if (to + abs(width) + 1 > end)
- width= (uint) (end - to - 1); /* sign doesn't matter */
- memmove(to, par, abs(width));
- to+= width;
+ to= process_bin_arg(to, end, width, par);
continue;
}
- else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */
+ else if (*fmt == 'd' || *fmt == 'u' || *fmt == 'x' || *fmt == 'X' ||
+ *fmt == 'p')
{
- register long larg;
- size_t res_length, to_length;
- char *store_start= to, *store_end;
- char buff[32];
-
- if ((to_length= (size_t) (end-to)) < 16 || length)
- store_start= buff;
- if (have_long)
- larg = va_arg(ap, long);
- else
- if (*fmt == 'd')
- larg = va_arg(ap, int);
- else
- larg= (long) (uint) va_arg(ap, int);
- if (*fmt == 'd')
- store_end= int10_to_str(larg, store_start, -10);
+ /* Integer parameter */
+ longlong larg;
+ if (*fmt == 'p')
+ have_longlong= (sizeof(void *) == sizeof(longlong));
+
+ if (have_longlong)
+ larg = va_arg(ap,longlong);
+ else if (*fmt == 'd')
+ larg = va_arg(ap, int);
else
- if (*fmt== 'u')
- store_end= int10_to_str(larg, store_start, 10);
- else
- store_end= int2str(larg, store_start, 16, 0);
- if ((res_length= (size_t) (store_end - store_start)) > to_length)
- break; /* num doesn't fit in output */
- /* If %#d syntax was used, we have to pre-zero/pre-space the string */
- if (store_start == buff)
- {
- length= min(length, to_length);
- if (res_length < length)
- {
- size_t diff= (length- res_length);
- bfill(to, diff, pre_zero ? '0' : ' ');
- to+= diff;
- }
- bmove(to, store_start, res_length);
- }
- to+= res_length;
+ larg= va_arg(ap, uint);
+
+ to= process_int_arg(to, end, length, larg, *fmt, print_type);
continue;
}
else if (*fmt == 'c') /* Character parameter */
@@ -174,6 +609,19 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
}
+/*
+ Limited snprintf() implementations
+
+ exported to plugins as a service, see the detailed documentation
+ around my_snprintf_service_st
+*/
+
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
+{
+ return my_vsnprintf_ex(&my_charset_latin1, to, n, fmt, ap);
+}
+
+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
{
size_t result;
@@ -184,42 +632,3 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
return result;
}
-#ifdef MAIN
-#define OVERRUN_SENTRY 250
-static void my_printf(const char * fmt, ...)
-{
- char buf[33];
- int n;
- va_list ar;
- va_start(ar, fmt);
- buf[sizeof(buf)-1]=OVERRUN_SENTRY;
- n = my_vsnprintf(buf, sizeof(buf)-1,fmt, ar);
- printf(buf);
- printf("n=%d, strlen=%d\n", n, strlen(buf));
- if ((uchar) buf[sizeof(buf)-1] != OVERRUN_SENTRY)
- {
- fprintf(stderr, "Buffer overrun\n");
- abort();
- }
- va_end(ar);
-}
-
-
-int main()
-{
-
- my_printf("Hello\n");
- my_printf("Hello int, %d\n", 1);
- my_printf("Hello string '%s'\n", "I am a string");
- my_printf("Hello hack hack hack hack hack hack hack %d\n", 1);
- my_printf("Hello %d hack %d\n", 1, 4);
- my_printf("Hello %d hack hack hack hack hack %d\n", 1, 4);
- my_printf("Hello '%s' hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n", "hack");
- my_printf("Hello hhhhhhhhhhhhhh %d sssssssssssssss\n", 1);
- my_printf("Hello %u\n", 1);
- my_printf("Hex: %lx '%6lx'\n", 32, 65);
- my_printf("conn %ld to: '%-.64s' user: '%-.32s' host:\
- `%-.64s' (%-.64s)", 1, 0,0,0,0);
- return 0;
-}
-#endif
diff --git a/strings/strings-not-used.h b/strings/strings-not-used.h
index 3efaa8ab6eb..8311545f22f 100644
--- a/strings/strings-not-used.h
+++ b/strings/strings-not-used.h
@@ -1,3 +1,6 @@
+#ifndef STRINGS_NOT_USED_INCLUDED
+#define STRINGS_NOT_USED_INCLUDED
+
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -35,3 +38,4 @@
#define _AlphabetSize 256
#endif /* NullS */
+#endif /* STRINGS_NOT_USED_INCLUDED */
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 87198fc9cf5..ccf4d8ff51d 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -53,13 +53,14 @@ datadir=
# Negative numbers mean to wait indefinitely
service_startup_timeout=900
+# Lock directory for RedHat / SuSE.
+lockdir='/var/lock/subsys'
+lock_file_path="$lockdir/mysql"
+
# The following variables are only set for letting mysql.server find things.
# Set some defaults
-pid_file=
-server_pid_file=
-use_mysqld_safe=1
-user=@MYSQLD_USER@
+mysqld_pid_file_path=
if test -z "$basedir"
then
basedir=@prefix@
@@ -101,11 +102,14 @@ else
}
fi
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
+PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH
mode=$1 # start or stop
-shift
+
+[ $# -ge 1 ] && shift
+
+
other_args="$*" # uncommon, but needed when called from an RPM upgrade action
# Expected: "--skip-networking --skip-grant-tables"
# They are not checked here, intentionally, as it is the resposibility
@@ -131,59 +135,50 @@ parse_server_arguments() {
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
datadir_set=1
;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --use-mysqld_safe) use_mysqld_safe=1;;
- --use-manager) use_mysqld_safe=0;;
- esac
- done
-}
-
-parse_manager_arguments() {
- for arg do
- case "$arg" in
- --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}
wait_for_pid () {
- verb="$1"
- manager_pid="$2" # process ID of the program operating on the pid-file
+ verb="$1" # created | removed
+ pid="$2" # process ID of the program operating on the pid-file
+ pid_file_path="$3" # path to the PID file.
+
i=0
avoid_race_condition="by checking again"
+
while test $i -ne $service_startup_timeout ; do
case "$verb" in
'created')
# wait for a PID-file to pop into existence.
- test -s $pid_file && i='' && break
+ test -s "$pid_file_path" && i='' && break
;;
'removed')
# wait for this PID-file to disappear
- test ! -s $pid_file && i='' && break
+ test ! -s "$pid_file_path" && i='' && break
;;
*)
- echo "wait_for_pid () usage: wait_for_pid created|removed manager_pid"
+ echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
exit 1
;;
esac
- # if manager isn't running, then pid-file will never be updated
- if test -n "$manager_pid"; then
- if kill -0 "$manager_pid" 2>/dev/null; then
- : # the manager still runs
+ # if server isn't running, then pid-file will never be updated
+ if test -n "$pid"; then
+ if kill -0 "$pid" 2>/dev/null; then
+ : # the server still runs
else
- # The manager may have exited between the last pid-file check and now.
+ # The server may have exited between the last pid-file check and now.
if test -n "$avoid_race_condition"; then
avoid_race_condition=""
continue # Check again.
fi
# there's nothing that will affect the file.
- log_failure_msg "Manager of pid-file quit without updating file."
+ log_failure_msg "The server quit without updating PID file ($pid_file_path)."
return 1 # not waiting any more.
fi
fi
@@ -191,6 +186,7 @@ wait_for_pid () {
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
+
done
if test -z "$i" ; then
@@ -259,28 +255,16 @@ fi
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
-# Look for the pidfile
-parse_manager_arguments `$print_defaults $extra_args manager`
-
#
# Set pid file if not given
#
-if test -z "$pid_file"
-then
- pid_file=$datadir/mysqlmanager-`@HOSTNAME@`.pid
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$datadir/$pid_file" ;;
- esac
-fi
-if test -z "$server_pid_file"
+if test -z "$mysqld_pid_file_path"
then
- server_pid_file=$datadir/`@HOSTNAME@`.pid
+ mysqld_pid_file_path=$datadir/`@HOSTNAME@`.pid
else
- case "$server_pid_file" in
+ case "$mysqld_pid_file_path" in
/* ) ;;
- * ) server_pid_file="$datadir/$server_pid_file" ;;
+ * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
esac
fi
@@ -291,53 +275,23 @@ case "$mode" in
# Safeguard (relative paths, core dumps..)
cd $basedir
- manager=$bindir/mysqlmanager
- if test -x $libexecdir/mysqlmanager
- then
- manager=$libexecdir/mysqlmanager
- elif test -x $sbindir/mysqlmanager
- then
- manager=$sbindir/mysqlmanager
- fi
-
echo $echo_n "Starting MySQL"
- if test -x $manager -a "$use_mysqld_safe" = "0"
- then
- if test -n "$other_args"
- then
- log_failure_msg "MySQL manager does not support options '$other_args'"
- exit 1
- fi
- # Give extra arguments to mysqld with the my.cnf file. This script may
- # be overwritten at next upgrade.
- "$manager" \
- --mysqld-safe-compatible \
- --user="$user" \
- --pid-file="$pid_file" >/dev/null 2>&1 &
- wait_for_pid created $!; return_value=$?
-
- # Make lock for RedHat / SuSE
- if test -w /var/lock/subsys
- then
- touch /var/lock/subsys/mysqlmanager
- fi
- exit $return_value
- elif test -x $bindir/mysqld_safe
+ if test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- pid_file=$server_pid_file
- $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
- wait_for_pid created $!; return_value=$?
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
+ wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
- if test -w /var/lock/subsys
+ if test -w "$lockdir"
then
- touch /var/lock/subsys/mysql
+ touch "$lock_file_path"
fi
+
exit $return_value
else
- log_failure_msg "Couldn't find MySQL manager ($manager) or server ($bindir/mysqld_safe)"
+ log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
fi
;;
@@ -345,39 +299,29 @@ case "$mode" in
# Stop daemon. We use a signal here to avoid having to know the
# root password.
- # The RedHat / SuSE lock directory to remove
- lock_dir=/var/lock/subsys/mysqlmanager
-
- # If the manager pid_file doesn't exist, try the server's
- if test ! -s "$pid_file"
+ if test -s "$mysqld_pid_file_path"
then
- pid_file=$server_pid_file
- lock_dir=/var/lock/subsys/mysql
- fi
+ mysqld_pid=`cat "$mysqld_pid_file_path"`
- if test -s "$pid_file"
- then
- mysqlmanager_pid=`cat $pid_file`
-
- if (kill -0 $mysqlmanager_pid 2>/dev/null)
+ if (kill -9 $mysqld_pid 2>/dev/null)
then
echo $echo_n "Shutting down MySQL"
- kill $mysqlmanager_pid
- # mysqlmanager should remove the pid_file when it exits, so wait for it.
- wait_for_pid removed "$mysqlmanager_pid"; return_value=$?
+ kill $mysqld_pid
+ # mysqld should remove the pid file when it exits, so wait for it.
+ wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
else
- log_failure_msg "MySQL manager or server process #$mysqlmanager_pid is not running!"
- rm $pid_file
+ log_failure_msg "MySQL server process #$mysqld_pid is not running!"
+ rm "$mysqld_pid_file_path"
fi
-
- # delete lock for RedHat / SuSE
- if test -f $lock_dir
+
+ # Delete lock for RedHat / SuSE
+ if test -f "$lock_file_path"
then
- rm -f $lock_dir
+ rm -f "$lock_file_path"
fi
exit $return_value
else
- log_failure_msg "MySQL manager or server PID file could not be found!"
+ log_failure_msg "MySQL server PID file could not be found!"
fi
;;
@@ -393,10 +337,10 @@ case "$mode" in
;;
'reload'|'force-reload')
- if test -s "$server_pid_file" ; then
- read mysqld_pid < $server_pid_file
+ if test -s "$mysqld_pid_file_path" ; then
+ read mysqld_pid < "$mysqld_pid_file_path"
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
- touch $server_pid_file
+ touch "$mysqld_pid_file_path"
else
log_failure_msg "MySQL PID file could not be found!"
exit 1
@@ -404,8 +348,8 @@ case "$mode" in
;;
'status')
# First, check to see if pid file exists
- if test -s "$server_pid_file" ; then
- read mysqld_pid < $server_pid_file
+ if test -s "$mysqld_pid_file_path" ; then
+ read mysqld_pid < "$mysqld_pid_file_path"
if kill -0 $mysqld_pid 2>/dev/null ; then
log_success_msg "MySQL running ($mysqld_pid)"
exit 0
@@ -417,13 +361,8 @@ case "$mode" in
# Try to find appropriate mysqld process
mysqld_pid=`pidof $libexecdir/mysqld`
if test -z $mysqld_pid ; then
- if test "$use_mysqld_safe" = "0" ; then
- lockfile=/var/lock/subsys/mysqlmanager
- else
- lockfile=/var/lock/subsys/mysql
- fi
- if test -f $lockfile ; then
- log_failure_msg "MySQL is not running, but lock exists"
+ if test -f "$lock_file_path" ; then
+ log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
exit 2
fi
log_failure_msg "MySQL is not running"
@@ -436,7 +375,8 @@ case "$mode" in
;;
*)
# usage
- echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
+ basename=`basename "$0"`
+ echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
exit 1
;;
esac
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 3c80304330b..239611c0b53 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -472,8 +472,8 @@ rm -fr $RBR%{_datadir}/sql-bench
# will appreciate that, as all services usually offer this.
ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
-# Touch the place where the my.cnf config file might be located
-# Just to make sure it's in the file list and marked as a config file
+# Touch the place where the my.cnf config file might be located.
+# Just to make sure it's in the file list and marked as a config file.
touch $RBR%{_sysconfdir}/my.cnf
%pre server
@@ -878,6 +878,10 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
+
+- "mysqlmanager" got removed from version 5.4, all references deleted.
+
* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2093fc0da36..0ee8769cd23 100755
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -13,15 +13,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# About "mysqlclient_notls", see note in "client/CMakeLists.txt"
-
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS("-DMYSQL_CLIENT")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_EXECUTABLE(mysql_client_test mysql_client_test.c ../mysys/my_memmem.c)
-TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient)
ADD_EXECUTABLE(bug25714 bug25714.c)
-TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(bug25714 mysqlclient)
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index f65e549fd96..cfe401c75f3 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -703,6 +703,29 @@ int my_stmt_result(const char *buff)
return row_count;
}
+/* Print the total number of warnings and the warnings themselves. */
+
+void my_process_warnings(MYSQL *conn, unsigned expected_warning_count)
+{
+ MYSQL_RES *result;
+ int rc;
+
+ if (!opt_silent)
+ fprintf(stdout, "\n total warnings: %u (expected: %u)\n",
+ mysql_warning_count(conn), expected_warning_count);
+
+ DIE_UNLESS(mysql_warning_count(mysql) == expected_warning_count);
+
+ rc= mysql_query(conn, "SHOW WARNINGS");
+ DIE_UNLESS(rc == 0);
+
+ result= mysql_store_result(conn);
+ mytest(result);
+
+ rc= my_process_result_set(result);
+ mysql_free_result(result);
+}
+
/* Utility function to verify a particular column data */
@@ -1516,6 +1539,568 @@ static void test_prepare_simple()
myquery(rc);
}
+/************************************************************************/
+
+#define FILE_PATH_SIZE 4096
+
+char mct_log_file_path[FILE_PATH_SIZE];
+FILE *mct_log_file= NULL;
+
+void mct_start_logging(const char *test_case_name)
+{
+ const char *tmp_dir= getenv("MYSQL_TMP_DIR");
+
+ if (!tmp_dir)
+ {
+ printf("Warning: MYSQL_TMP_DIR is not set. Logging is disabled.\n");
+ return;
+ }
+
+ if (mct_log_file)
+ {
+ printf("Warning: can not start logging for test case '%s' "
+ "because log is already open\n",
+ (const char *) test_case_name);
+ return;
+ }
+
+ /*
+ Path is: <tmp_dir>/<test_case_name>.out.log
+ 10 is length of '/' + '.out.log' + \0
+ */
+
+ if (strlen(tmp_dir) + strlen(test_case_name) + 10 > FILE_PATH_SIZE)
+ {
+ printf("Warning: MYSQL_TMP_DIR is too long. Logging is disabled.\n");
+ return;
+ }
+
+ my_snprintf(mct_log_file_path, FILE_PATH_SIZE,
+ "%s/%s.out.log",
+ (const char *) tmp_dir,
+ (const char *) test_case_name);
+
+ mct_log_file= my_fopen(mct_log_file_path, O_WRONLY | O_BINARY, MYF(MY_WME));
+
+ if (!mct_log_file)
+ {
+ printf("Warning: can not open log file (%s): %s. Logging is disabled.\n",
+ (const char *) mct_log_file_path,
+ (const char *) strerror(errno));
+ return;
+ }
+}
+
+void mct_log(const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ vprintf(format, args);
+ va_end(args);
+
+ if (mct_log_file)
+ {
+ va_list args;
+ va_start(args, format);
+ vfprintf(mct_log_file, format, args);
+ va_end(args);
+ }
+}
+
+void mct_close_log()
+{
+ if (!mct_log_file)
+ return;
+
+ my_fclose(mct_log_file, MYF(0));
+ mct_log_file= NULL;
+}
+
+#define WL4435_NUM_PARAMS 10
+#define WL4435_STRING_SIZE 30
+
+static void test_wl4435()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ char query[MAX_TEST_QUERY_LENGTH];
+
+ char str_data[20][WL4435_STRING_SIZE];
+ double dbl_data[20];
+ char dec_data[20][WL4435_STRING_SIZE];
+ int int_data[20];
+ ulong str_length= WL4435_STRING_SIZE;
+ my_bool is_null;
+ MYSQL_BIND ps_params[WL4435_NUM_PARAMS];
+
+ int exec_counter;
+
+ myheader("test_wl4435");
+ mct_start_logging("test_wl4435");
+
+ rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p2");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t2");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE t1(a1 INT, a2 CHAR(32), "
+ " a3 DOUBLE(4, 2), a4 DECIMAL(3, 1))");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE t2(b0 INT, b1 INT, b2 CHAR(32), "
+ " b3 DOUBLE(4, 2), b4 DECIMAL(3, 1))");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES"
+ "(1, '11', 12.34, 56.7), "
+ "(2, '12', 56.78, 90.1), "
+ "(3, '13', 23.45, 67.8)");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "INSERT INTO t2 VALUES"
+ "(100, 10, '110', 70.70, 10.1), "
+ "(200, 20, '120', 80.80, 20.2), "
+ "(300, 30, '130', 90.90, 30.3)");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "CREATE PROCEDURE p1("
+ " IN v0 INT, "
+ " OUT v_str_1 CHAR(32), "
+ " OUT v_dbl_1 DOUBLE(4, 2), "
+ " OUT v_dec_1 DECIMAL(6, 3), "
+ " OUT v_int_1 INT, "
+ " IN v1 INT, "
+ " INOUT v_str_2 CHAR(64), "
+ " INOUT v_dbl_2 DOUBLE(5, 3), "
+ " INOUT v_dec_2 DECIMAL(7, 4), "
+ " INOUT v_int_2 INT)"
+ "BEGIN "
+ " SET v0 = -1; "
+ " SET v1 = -1; "
+ " SET v_str_1 = 'test_1'; "
+ " SET v_dbl_1 = 12.34; "
+ " SET v_dec_1 = 567.891; "
+ " SET v_int_1 = 2345; "
+ " SET v_str_2 = 'test_2'; "
+ " SET v_dbl_2 = 67.891; "
+ " SET v_dec_2 = 234.6789; "
+ " SET v_int_2 = 6789; "
+ " SELECT * FROM t1; "
+ " SELECT * FROM t2; "
+ "END");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "CREATE PROCEDURE p2("
+ " IN i1 VARCHAR(255) CHARACTER SET koi8r, "
+ " OUT o1 VARCHAR(255) CHARACTER SET cp1251, "
+ " OUT o2 VARBINARY(255)) "
+ "BEGIN "
+ " SET o1 = i1; "
+ " SET o2 = i1; "
+ "END");
+ myquery(rc);
+
+ strmov(query, "CALL p1(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ /* Init PS-parameters. */
+
+ bzero((char *) ps_params, sizeof (ps_params));
+
+ /* - v0 -- INT */
+
+ ps_params[0].buffer_type= MYSQL_TYPE_LONG;
+ ps_params[0].buffer= (char *) &int_data[0];
+ ps_params[0].length= 0;
+ ps_params[0].is_null= 0;
+
+ /* - v_str_1 -- CHAR(32) */
+
+ ps_params[1].buffer_type= MYSQL_TYPE_STRING;
+ ps_params[1].buffer= (char *) str_data[0];
+ ps_params[1].buffer_length= WL4435_STRING_SIZE;
+ ps_params[1].length= &str_length;
+ ps_params[1].is_null= 0;
+
+ /* - v_dbl_1 -- DOUBLE */
+
+ ps_params[2].buffer_type= MYSQL_TYPE_DOUBLE;
+ ps_params[2].buffer= (char *) &dbl_data[0];
+ ps_params[2].length= 0;
+ ps_params[2].is_null= 0;
+
+ /* - v_dec_1 -- DECIMAL */
+
+ ps_params[3].buffer_type= MYSQL_TYPE_NEWDECIMAL;
+ ps_params[3].buffer= (char *) dec_data[0];
+ ps_params[3].buffer_length= WL4435_STRING_SIZE;
+ ps_params[3].length= 0;
+ ps_params[3].is_null= 0;
+
+ /* - v_int_1 -- INT */
+
+ ps_params[4].buffer_type= MYSQL_TYPE_LONG;
+ ps_params[4].buffer= (char *) &int_data[0];
+ ps_params[4].length= 0;
+ ps_params[4].is_null= 0;
+
+ /* - v1 -- INT */
+
+ ps_params[5].buffer_type= MYSQL_TYPE_LONG;
+ ps_params[5].buffer= (char *) &int_data[0];
+ ps_params[5].length= 0;
+ ps_params[5].is_null= 0;
+
+ /* - v_str_2 -- CHAR(32) */
+
+ ps_params[6].buffer_type= MYSQL_TYPE_STRING;
+ ps_params[6].buffer= (char *) str_data[0];
+ ps_params[6].buffer_length= WL4435_STRING_SIZE;
+ ps_params[6].length= &str_length;
+ ps_params[6].is_null= 0;
+
+ /* - v_dbl_2 -- DOUBLE */
+
+ ps_params[7].buffer_type= MYSQL_TYPE_DOUBLE;
+ ps_params[7].buffer= (char *) &dbl_data[0];
+ ps_params[7].length= 0;
+ ps_params[7].is_null= 0;
+
+ /* - v_dec_2 -- DECIMAL */
+
+ ps_params[8].buffer_type= MYSQL_TYPE_DECIMAL;
+ ps_params[8].buffer= (char *) dec_data[0];
+ ps_params[8].buffer_length= WL4435_STRING_SIZE;
+ ps_params[8].length= 0;
+ ps_params[8].is_null= 0;
+
+ /* - v_int_2 -- INT */
+
+ ps_params[9].buffer_type= MYSQL_TYPE_LONG;
+ ps_params[9].buffer= (char *) &int_data[0];
+ ps_params[9].length= 0;
+ ps_params[9].is_null= 0;
+
+ /* Bind parameters. */
+
+ rc= mysql_stmt_bind_param(stmt, ps_params);
+
+ /* Execute! */
+
+ for (exec_counter= 0; exec_counter < 3; ++exec_counter)
+ {
+ int i;
+ int num_fields;
+ MYSQL_BIND *rs_bind;
+
+ mct_log("\nexec_counter: %d\n", (int) exec_counter);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ while (1)
+ {
+ MYSQL_FIELD *fields;
+
+ MYSQL_RES *rs_metadata= mysql_stmt_result_metadata(stmt);
+
+ num_fields= mysql_stmt_field_count(stmt);
+ fields= mysql_fetch_fields(rs_metadata);
+
+ rs_bind= (MYSQL_BIND *) malloc(sizeof (MYSQL_BIND) * num_fields);
+ bzero(rs_bind, sizeof (MYSQL_BIND) * num_fields);
+
+ mct_log("num_fields: %d\n", (int) num_fields);
+
+ for (i = 0; i < num_fields; ++i)
+ {
+ mct_log(" - %d: name: '%s'/'%s'; table: '%s'/'%s'; "
+ "db: '%s'; catalog: '%s'; length: %d; max_length: %d; "
+ "type: %d; decimals: %d\n",
+ (int) i,
+ (const char *) fields[i].name,
+ (const char *) fields[i].org_name,
+ (const char *) fields[i].table,
+ (const char *) fields[i].org_table,
+ (const char *) fields[i].db,
+ (const char *) fields[i].catalog,
+ (int) fields[i].length,
+ (int) fields[i].max_length,
+ (int) fields[i].type,
+ (int) fields[i].decimals);
+
+ rs_bind[i].buffer_type= fields[i].type;
+ rs_bind[i].is_null= &is_null;
+
+ switch (fields[i].type)
+ {
+ case MYSQL_TYPE_LONG:
+ rs_bind[i].buffer= (char *) &(int_data[i]);
+ rs_bind[i].buffer_length= sizeof (int_data);
+ break;
+
+ case MYSQL_TYPE_STRING:
+ rs_bind[i].buffer= (char *) str_data[i];
+ rs_bind[i].buffer_length= WL4435_STRING_SIZE;
+ rs_bind[i].length= &str_length;
+ break;
+
+ case MYSQL_TYPE_DOUBLE:
+ rs_bind[i].buffer= (char *) &dbl_data[i];
+ rs_bind[i].buffer_length= sizeof (dbl_data);
+ break;
+
+ case MYSQL_TYPE_NEWDECIMAL:
+ rs_bind[i].buffer= (char *) dec_data[i];
+ rs_bind[i].buffer_length= WL4435_STRING_SIZE;
+ rs_bind[i].length= &str_length;
+ break;
+
+ default:
+ fprintf(stderr, "ERROR: unexpected type: %d.\n", fields[i].type);
+ exit(1);
+ }
+ }
+
+ rc= mysql_stmt_bind_result(stmt, rs_bind);
+ check_execute(stmt, rc);
+
+ mct_log("Data:\n");
+
+ while (1)
+ {
+ int rc= mysql_stmt_fetch(stmt);
+
+ if (rc == 1 || rc == MYSQL_NO_DATA)
+ break;
+
+ mct_log(" ");
+
+ for (i = 0; i < num_fields; ++i)
+ {
+ switch (rs_bind[i].buffer_type)
+ {
+ case MYSQL_TYPE_LONG:
+ mct_log(" int: %ld;",
+ (long) *((int *) rs_bind[i].buffer));
+ break;
+
+ case MYSQL_TYPE_STRING:
+ mct_log(" str: '%s';",
+ (char *) rs_bind[i].buffer);
+ break;
+
+ case MYSQL_TYPE_DOUBLE:
+ mct_log(" dbl: %lf;",
+ (double) *((double *) rs_bind[i].buffer));
+ break;
+
+ case MYSQL_TYPE_NEWDECIMAL:
+ mct_log(" dec: '%s';",
+ (char *) rs_bind[i].buffer);
+ break;
+
+ default:
+ printf(" unexpected type (%d)\n",
+ rs_bind[i].buffer_type);
+ }
+ }
+ mct_log("\n");
+ }
+
+ mct_log("EOF\n");
+
+ rc= mysql_stmt_next_result(stmt);
+ mct_log("mysql_stmt_next_result(): %d; field_count: %d\n",
+ (int) rc, (int) mysql->field_count);
+
+ free(rs_bind);
+ mysql_free_result(rs_metadata);
+
+ if (rc > 0)
+ {
+ printf("Error: %s (errno: %d)\n",
+ mysql_stmt_error(stmt), mysql_stmt_errno(stmt));
+ DIE(rc > 0);
+ }
+
+ if (rc)
+ break;
+
+ if (!mysql->field_count)
+ {
+ /* This is the last OK-packet. No more resultsets. */
+ break;
+ }
+ }
+
+ }
+
+ mysql_stmt_close(stmt);
+
+ mct_close_log();
+
+ rc= mysql_commit(mysql);
+ myquery(rc);
+
+ /* i18n part of test case. */
+
+ {
+ const char *str_koi8r= "\xee\xd5\x2c\x20\xda\xc1\x20\xd2\xd9\xc2\xc1\xcc\xcb\xd5";
+ const char *str_cp1251= "\xcd\xf3\x2c\x20\xe7\xe0\x20\xf0\xfb\xe1\xe0\xeb\xea\xf3";
+ char o1_buffer[255];
+ ulong o1_length;
+ char o2_buffer[255];
+ ulong o2_length;
+
+ MYSQL_BIND rs_bind[2];
+
+ strmov(query, "CALL p2(?, ?, ?)");
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ /* Init PS-parameters. */
+
+ bzero((char *) ps_params, sizeof (ps_params));
+
+ ps_params[0].buffer_type= MYSQL_TYPE_STRING;
+ ps_params[0].buffer= (char *) str_koi8r;
+ ps_params[0].buffer_length= strlen(str_koi8r);
+
+ ps_params[1].buffer_type= MYSQL_TYPE_STRING;
+ ps_params[1].buffer= o1_buffer;
+ ps_params[1].buffer_length= 0;
+
+ ps_params[2].buffer_type= MYSQL_TYPE_STRING;
+ ps_params[2].buffer= o2_buffer;
+ ps_params[2].buffer_length= 0;
+
+ /* Bind parameters. */
+
+ rc= mysql_stmt_bind_param(stmt, ps_params);
+ check_execute(stmt, rc);
+
+ /* Prevent converting to character_set_results. */
+
+ rc= mysql_query(mysql, "SET NAMES binary");
+ myquery(rc);
+
+ /* Execute statement. */
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ /* Bind result. */
+
+ bzero(rs_bind, sizeof (rs_bind));
+
+ rs_bind[0].buffer_type= MYSQL_TYPE_STRING;
+ rs_bind[0].buffer= o1_buffer;
+ rs_bind[0].buffer_length= sizeof (o1_buffer);
+ rs_bind[0].length= &o1_length;
+
+ rs_bind[1].buffer_type= MYSQL_TYPE_BLOB;
+ rs_bind[1].buffer= o2_buffer;
+ rs_bind[1].buffer_length= sizeof (o2_buffer);
+ rs_bind[1].length= &o2_length;
+
+ rc= mysql_stmt_bind_result(stmt, rs_bind);
+ check_execute(stmt, rc);
+
+ /* Fetch result. */
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+
+ /* Check result. */
+
+ DIE_UNLESS(o1_length == strlen(str_cp1251));
+ DIE_UNLESS(o2_length == strlen(str_koi8r));
+ DIE_UNLESS(!memcmp(o1_buffer, str_cp1251, o1_length));
+ DIE_UNLESS(!memcmp(o2_buffer, str_koi8r, o2_length));
+
+ rc= mysql_stmt_fetch(stmt);
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ rc= mysql_stmt_next_result(stmt);
+ DIE_UNLESS(rc == 0 && mysql->field_count == 0);
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_commit(mysql);
+ myquery(rc);
+ }
+}
+
+static void test_wl4435_2()
+{
+ MYSQL_STMT *stmt;
+ int i;
+ int rc;
+ char query[MAX_TEST_QUERY_LENGTH];
+
+ myheader("test_wl4435_2");
+ mct_start_logging("test_wl4435_2");
+
+ /*
+ Do a few iterations so that we catch any problem with incorrect
+ handling/flushing prepared statement results.
+ */
+
+ for (i= 0; i < 10; ++i)
+ {
+ /*
+ Prepare a procedure. That can be moved out of the loop, but it was
+ left in the loop for the sake of having as many statements as
+ possible.
+ */
+
+ rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "CREATE PROCEDURE p1()"
+ "BEGIN "
+ " SELECT 1; "
+ " SELECT 2, 3 UNION SELECT 4, 5; "
+ " SELECT 6, 7, 8; "
+ "END");
+ myquery(rc);
+
+ /* Invoke a procedure, that returns several result sets. */
+
+ strmov(query, "CALL p1()");
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ /* Execute! */
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ /* Flush all the results. */
+
+ mysql_stmt_close(stmt);
+
+ /* Clean up. */
+ rc= mysql_commit(mysql);
+ myquery(rc);
+
+ rc= mysql_query(mysql, "DROP PROCEDURE p1");
+ myquery(rc);
+ }
+}
+
/* Test simple prepare field results */
@@ -7773,26 +8358,26 @@ static void test_explain_bug()
verify_prepare_field(result, 0, "Field", "COLUMN_NAME",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 64, 0);
+ 0, 0, "information_schema", 64, 0);
verify_prepare_field(result, 1, "Type", "COLUMN_TYPE", MYSQL_TYPE_BLOB,
- 0, 0, "", 0, 0);
+ 0, 0, "information_schema", 0, 0);
verify_prepare_field(result, 2, "Null", "IS_NULLABLE",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 3, 0);
+ 0, 0, "information_schema", 3, 0);
verify_prepare_field(result, 3, "Key", "COLUMN_KEY",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 3, 0);
+ 0, 0, "information_schema", 3, 0);
if ( mysql_get_server_version(mysql) >= 50027 )
{
/* The patch for bug#23037 changes column type of DEAULT to blob */
verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT",
- MYSQL_TYPE_BLOB, 0, 0, "", 0, 0);
+ MYSQL_TYPE_BLOB, 0, 0, "information_schema", 0, 0);
}
else
{
@@ -7801,14 +8386,14 @@ static void test_explain_bug()
MYSQL_TYPE_BLOB :
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "",
+ 0, 0, "information_schema",
mysql_get_server_version(mysql) >= 50027 ? 0 :64, 0);
}
verify_prepare_field(result, 5, "Extra", "EXTRA",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 27, 0);
+ 0, 0, "information_schema", 27, 0);
mysql_free_result(result);
mysql_stmt_close(stmt);
@@ -12501,7 +13086,7 @@ static void test_datetime_ranges()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- DIE_UNLESS(mysql_warning_count(mysql) != 6);
+ my_process_warnings(mysql, 12);
verify_col_data("t1", "year", "0000-00-00 00:00:00");
verify_col_data("t1", "month", "0000-00-00 00:00:00");
@@ -12532,7 +13117,7 @@ static void test_datetime_ranges()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- DIE_UNLESS(mysql_warning_count(mysql) != 3);
+ my_process_warnings(mysql, 6);
verify_col_data("t1", "year", "0000-00-00 00:00:00");
verify_col_data("t1", "month", "0000-00-00 00:00:00");
@@ -12571,7 +13156,7 @@ static void test_datetime_ranges()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- DIE_UNLESS(mysql_warning_count(mysql) == 2);
+ my_process_warnings(mysql, 2);
verify_col_data("t1", "day_ovfl", "838:59:59");
verify_col_data("t1", "day", "828:30:30");
@@ -14476,9 +15061,8 @@ static void test_bug12001()
/* Create connection that supports multi statements */
if (!mysql_real_connect(mysql_local, opt_host, opt_user,
- opt_password, current_db, opt_port,
- opt_unix_socket, CLIENT_MULTI_STATEMENTS |
- CLIENT_MULTI_RESULTS))
+ opt_password, current_db, opt_port,
+ opt_unix_socket, CLIENT_MULTI_STATEMENTS))
{
fprintf(stdout, "\n mysql_real_connect() failed");
exit(1);
@@ -15846,7 +16430,7 @@ static void test_bug15752()
if (! mysql_real_connect(&mysql_local, opt_host, opt_user,
opt_password, current_db, opt_port,
opt_unix_socket,
- CLIENT_MULTI_STATEMENTS|CLIENT_MULTI_RESULTS))
+ CLIENT_MULTI_STATEMENTS))
{
printf("Unable connect to MySQL server: %s\n", mysql_error(&mysql_local));
DIE_UNLESS(0);
@@ -17434,6 +18018,7 @@ static void test_bug28386()
DBUG_VOID_RETURN;
}
+
static void test_wl4166_1()
{
MYSQL_STMT *stmt;
@@ -17645,6 +18230,167 @@ static void test_wl4166_2()
}
+
+/**
+ Test how warnings generated during assignment of parameters
+ are (currently not) preserve in case of reprepare.
+*/
+
+static void test_wl4166_3()
+{
+ int rc;
+ MYSQL_STMT *stmt;
+ MYSQL_BIND my_bind[1];
+ MYSQL_TIME tm[1];
+
+ myheader("test_wl4166_3");
+
+ rc= mysql_query(mysql, "drop table if exists t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "create table t1 (year datetime)");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql, "insert into t1 (year) values (?)");
+ check_stmt(stmt);
+ verify_param_count(stmt, 1);
+
+ bzero((char*) my_bind, sizeof(my_bind));
+ my_bind[0].buffer_type= MYSQL_TYPE_DATETIME;
+ my_bind[0].buffer= &tm[0];
+
+ rc= mysql_stmt_bind_param(stmt, my_bind);
+ check_execute(stmt, rc);
+
+ tm[0].year= 10000;
+ tm[0].month= 1; tm[0].day= 1;
+ tm[0].hour= 1; tm[0].minute= 1; tm[0].second= 1;
+ tm[0].second_part= 0; tm[0].neg= 0;
+
+ /* Cause a statement reprepare */
+ rc= mysql_query(mysql, "alter table t1 add column c int");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ /*
+ Sic: only one warning, instead of two. The warning
+ about data truncation when assigning a parameter is lost.
+ This is a bug.
+ */
+ my_process_warnings(mysql, 1);
+
+ verify_col_data("t1", "year", "0000-00-00 00:00:00");
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+}
+
+
+/**
+ Test that long data parameters, as well as parameters
+ that were originally in a different character set, are
+ preserved in case of reprepare.
+*/
+
+static void test_wl4166_4()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ const char *stmt_text;
+ MYSQL_BIND bind_array[2];
+
+ /* Represented as numbers to keep UTF8 tools from clobbering them. */
+ const char *koi8= "\xee\xd5\x2c\x20\xda\xc1\x20\xd2\xd9\xc2\xc1\xcc\xcb\xd5";
+ const char *cp1251= "\xcd\xf3\x2c\x20\xe7\xe0\x20\xf0\xfb\xe1\xe0\xeb\xea\xf3";
+ char buf1[16], buf2[16];
+ ulong buf1_len, buf2_len;
+
+ myheader("test_wl4166_4");
+
+ rc= mysql_query(mysql, "drop table if exists t1");
+ myquery(rc);
+
+ /*
+ Create table with binary columns, set session character set to cp1251,
+ client character set to koi8, and make sure that there is conversion
+ on insert and no conversion on select
+ */
+ rc= mysql_query(mysql,
+ "create table t1 (c1 varbinary(255), c2 varbinary(255))");
+ myquery(rc);
+ rc= mysql_query(mysql, "set character_set_client=koi8r, "
+ "character_set_connection=cp1251, "
+ "character_set_results=koi8r");
+ myquery(rc);
+
+ bzero((char*) bind_array, sizeof(bind_array));
+
+ bind_array[0].buffer_type= MYSQL_TYPE_STRING;
+
+ bind_array[1].buffer_type= MYSQL_TYPE_STRING;
+ bind_array[1].buffer= (void *) koi8;
+ bind_array[1].buffer_length= strlen(koi8);
+
+ stmt= mysql_stmt_init(mysql);
+ check_stmt(stmt);
+
+ stmt_text= "insert into t1 (c1, c2) values (?, ?)";
+
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ mysql_stmt_bind_param(stmt, bind_array);
+
+ mysql_stmt_send_long_data(stmt, 0, koi8, strlen(koi8));
+
+ /* Cause a reprepare at statement execute */
+ rc= mysql_query(mysql, "alter table t1 add column d int");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ stmt_text= "select c1, c2 from t1";
+
+ /* c1 and c2 are binary so no conversion will be done on select */
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ bind_array[0].buffer= buf1;
+ bind_array[0].buffer_length= sizeof(buf1);
+ bind_array[0].length= &buf1_len;
+
+ bind_array[1].buffer= buf2;
+ bind_array[1].buffer_length= sizeof(buf2);
+ bind_array[1].length= &buf2_len;
+
+ mysql_stmt_bind_result(stmt, bind_array);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+
+ DIE_UNLESS(buf1_len == strlen(cp1251));
+ DIE_UNLESS(buf2_len == strlen(cp1251));
+ DIE_UNLESS(!memcmp(buf1, cp1251, buf1_len));
+ DIE_UNLESS(!memcmp(buf2, cp1251, buf1_len));
+
+ rc= mysql_stmt_fetch(stmt);
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "set names default");
+ myquery(rc);
+}
+
/**
Bug#38486 Crash when using cursor protocol
*/
@@ -17675,6 +18421,49 @@ static void test_bug38486(void)
DBUG_VOID_RETURN;
}
+
+/**
+ Bug# 33831 mysql_real_connect() should fail if
+ given an already connected MYSQL handle.
+*/
+
+static void test_bug33831(void)
+{
+ MYSQL *l_mysql;
+ my_bool error;
+
+ DBUG_ENTER("test_bug33831");
+
+ error= 0;
+
+ if (!(l_mysql= mysql_client_init(NULL)))
+ {
+ myerror("mysql_client_init() failed");
+ DIE_UNLESS(0);
+ }
+ if (!(mysql_real_connect(l_mysql, opt_host, opt_user,
+ opt_password, current_db, opt_port,
+ opt_unix_socket, 0)))
+ {
+ myerror("connection failed");
+ DIE_UNLESS(0);
+ }
+
+ if (mysql_real_connect(l_mysql, opt_host, opt_user,
+ opt_password, current_db, opt_port,
+ opt_unix_socket, 0))
+ {
+ myerror("connection should have failed");
+ DIE_UNLESS(0);
+ }
+
+
+ mysql_close(l_mysql);
+
+ DBUG_VOID_RETURN;
+}
+
+
static void test_bug40365(void)
{
uint rc, i;
@@ -18363,7 +19152,12 @@ static struct my_tests_st my_tests[]= {
{ "test_bug28386", test_bug28386 },
{ "test_wl4166_1", test_wl4166_1 },
{ "test_wl4166_2", test_wl4166_2 },
+ { "test_wl4166_3", test_wl4166_3 },
+ { "test_wl4166_4", test_wl4166_4 },
+ { "test_wl4435", test_wl4435 },
+ { "test_wl4435_2", test_wl4435_2 },
{ "test_bug38486", test_bug38486 },
+ { "test_bug33831", test_bug33831 },
{ "test_bug40365", test_bug40365 },
{ "test_bug43560", test_bug43560 },
#ifdef HAVE_QUERY_CACHE
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
index f0ffc7a6720..56c65d71396 100644
--- a/unittest/mysys/Makefile.am
+++ b/unittest/mysys/Makefile.am
@@ -21,7 +21,7 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
-noinst_PROGRAMS = bitmap-t base64-t
+noinst_PROGRAMS = bitmap-t base64-t my_vsnprintf-t
if NEED_THREAD
# my_atomic-t is used to check thread functions, so it is safe to
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c
new file mode 100644
index 00000000000..f3a6b5700da
--- /dev/null
+++ b/unittest/mysys/my_vsnprintf-t.c
@@ -0,0 +1,155 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <my_global.h>
+#include <m_string.h>
+#include <tap.h>
+
+char buf[1024]; /* let's hope that's enough */
+
+void test1(const char *res, const char *fmt, ...)
+{
+ va_list args;
+ size_t len;
+ va_start(args,fmt);
+ len= my_vsnprintf(buf, sizeof(buf)-1, fmt, args);
+ va_end(args);
+ ok(strlen(res) == len && strcmp(buf, res) == 0, "\"%s\"", buf);
+}
+
+int main(void)
+{
+ plan(47);
+
+ test1("Constant string",
+ "Constant string");
+
+ test1("Format specifier s works",
+ "Format specifier s %s", "works");
+ test1("Format specifier b works (mysql extension)",
+ "Format specifier b %.5b (mysql extension)", "works!!!");
+ test1("Format specifier c !",
+ "Format specifier c %c", '!');
+ test1("Format specifier d 1",
+ "Format specifier d %d", 1);
+ test1("Format specifier u 2",
+ "Format specifier u %u", 2);
+ test1("Format specifier x a",
+ "Format specifier x %x", 10);
+ test1("Format specifier X B",
+ "Format specifier X %X", 11);
+ test1("Format specifier p 0x5",
+ "Format specifier p %p", 5);
+
+ test1("Flag '-' is ignored < 1>",
+ "Flag '-' is ignored <%-4d>", 1);
+ test1("Flag '0' works <0006>",
+ "Flag '0' works <%04d>", 6);
+
+ test1("Width is ignored for strings <x> <y>",
+ "Width is ignored for strings <%04s> <%5s>", "x", "y");
+
+ test1("Precision works for strings <abcde>",
+ "Precision works for strings <%.5s>", "abcdef!");
+
+ test1("Flag '`' (backtick) works: `abcd` `op``q` (mysql extension)",
+ "Flag '`' (backtick) works: %`s %`.4s (mysql extension)",
+ "abcd", "op`qrst");
+
+ test1("Length modifiers work: 1 * -1 * 2 * 3",
+ "Length modifiers work: %d * %ld * %lld * %zd", 1, -1L, 2LL, (size_t)3);
+
+ test1("(null) pointer is fine",
+ "%s pointer is fine", NULL);
+
+ test1("Positional arguments work: on the dark side they are",
+ "Positional arguments work: %3$s %1$s %2$s",
+ "they", "are", "on the dark side");
+
+ test1("Asterisk '*' as a width works: < 4>",
+ "Asterisk '*' as a width works: <%*d>", 5, 4);
+
+ test1("Asterisk '*' as a precision works: <qwerty>",
+ "Asterisk '*' as a precision works: <%.*s>", 6, "qwertyuiop");
+
+ test1("Positional arguments for a width: < 4>",
+ "Positional arguments for a width: <%1$*2$d>", 4, 5);
+
+ test1("Positional arguments for a precision: <qwerty>",
+ "Positional arguments for a precision: <%1$.*2$s>", "qwertyuiop", 6);
+
+ test1("Positional arguments and a width: <0000ab>",
+ "Positional arguments and a width: <%1$06x>", 0xab);
+
+ test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>",
+ "Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd);
+
+#if MYSQL_VERSION_ID > 60000
+#error %f/%g tests go here
+#endif
+
+ test1("Hello",
+ "Hello");
+ test1("Hello int, 1",
+ "Hello int, %d", 1);
+ test1("Hello int, -1",
+ "Hello int, %d", -1);
+ test1("Hello string 'I am a string'",
+ "Hello string '%s'", "I am a string");
+ test1("Hello hack hack hack hack hack hack hack 1",
+ "Hello hack hack hack hack hack hack hack %d", 1);
+ test1("Hello 1 hack 4",
+ "Hello %d hack %d", 1, 4);
+ test1("Hello 1 hack hack hack hack hack 4",
+ "Hello %d hack hack hack hack hack %d", 1, 4);
+ test1("Hello 'hack' hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+ "Hello '%s' hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", "hack");
+ test1("Hello hhhhhhhhhhhhhh 1 sssssssssssssss",
+ "Hello hhhhhhhhhhhhhh %d sssssssssssssss", 1);
+ test1("Hello 1",
+ "Hello %u", 1);
+ test1("Hello 4294967295",
+ "Hello %u", -1);
+ test1("Hex: 20 ' 41'",
+ "Hex: %lx '%6lx'", 32, 65);
+ test1("conn 1 to: '(null)' user: '(null)' host: '(null)' ((null))",
+ "conn %ld to: '%-.64s' user: '%-.32s' host: '%-.64s' (%-.64s)",
+ 1L, NULL, NULL, NULL, NULL);
+ test1("Hello string `I am a string`",
+ "Hello string %`s", "I am a string");
+ test1("Hello TEST",
+ "Hello %05s", "TEST");
+ test1("My `Q` test",
+ "My %1$`-.1s test", "QQQQ");
+ test1("My AAAA test done DDDD",
+ "My %2$s test done %1$s", "DDDD", "AAAA");
+ test1("My DDDD test CCCC, DDD",
+ "My %1$s test %2$s, %1$-.3s", "DDDD", "CCCC");
+ test1("My QQQQ test",
+ "My %1$`-.4b test", "QQQQ");
+ test1("My X test",
+ "My %1$c test", 'X');
+ test1("My <0000000010> test1 < a> test2 < A>",
+ "My <%010d> test1 <%4x> test2 <%4X>", 10, 10, 10);
+ test1("My <0000000010> test1 < a> test2 < a>",
+ "My <%1$010d> test1 <%2$4x> test2 <%2$4x>", 10, 10);
+ test1("My 00010 test",
+ "My %1$*02$d test", 10, 5);
+ test1("My `DDDD` test CCCC, `DDD`",
+ "My %1$`s test %2$s, %1$`-.3s", "DDDD", "CCCC");
+
+ return exit_status();
+}
+
diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt
index 164bcde7c4b..e1bd57d150f 100755
--- a/vio/CMakeLists.txt
+++ b/vio/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DUSE_SYMDIR)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index b662a616eef..21fa80143cd 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -1,3 +1,6 @@
+#ifndef VIO_PRIV_INCLUDED
+#define VIO_PRIV_INCLUDED
+
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -41,3 +44,4 @@ void vio_ssl_delete(Vio *vio);
int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode);
#endif /* HAVE_OPENSSL */
+#endif /* VIO_PRIV_INCLUDED */